@mozaic-ds/chart 0.1.0-beta.3 → 0.1.0-beta.30
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/mozaic-chart.js +4453 -2623
- package/dist/mozaic-chart.umd.cjs +17 -11
- package/dist/style.css +1 -1
- package/package.json +25 -10
- package/src/assets/base.css +1 -1
- package/src/assets/img/bubbles.svg +4 -0
- package/src/components/bar/BarChart.stories.ts +105 -103
- package/src/components/bar/BarChart.vue +257 -131
- package/src/components/bar/index.ts +3 -3
- package/src/components/bubble/BubbleChart.stories.ts +66 -0
- package/src/components/bubble/BubbleChart.vue +363 -0
- package/src/components/bubble/index.ts +8 -0
- package/src/components/doughnut/DoughnutChart.stories.ts +38 -36
- package/src/components/doughnut/DoughnutChart.vue +210 -111
- package/src/components/doughnut/index.ts +3 -3
- package/src/components/index.ts +4 -4
- package/src/components/line/LineChart.stories.ts +52 -27
- package/src/components/line/LineChart.vue +346 -254
- package/src/components/line/index.ts +3 -3
- package/src/components/mixed/MixedBarLineChart.stories.ts +91 -0
- package/src/components/mixed/MixedBarLineChart.vue +413 -0
- package/src/components/mixed/index.ts +8 -0
- package/src/components/radar/RadarChart.stories.ts +102 -102
- package/src/components/radar/RadarChart.vue +204 -165
- package/src/components/radar/index.ts +3 -3
- package/src/main.ts +14 -4
- package/src/plugin.ts +10 -8
- package/src/services/BarChartFunctions.ts +136 -35
- package/src/services/BubbleTooltipService.ts +67 -0
- package/src/services/ChartsCommonLegend.ts +309 -137
- package/src/services/ColorFunctions.ts +1 -1
- package/src/services/DoughnutChartFunctions.ts +132 -55
- package/src/services/FormatUtilities.ts +28 -14
- package/src/services/GenericTooltipService.ts +140 -65
- package/src/services/MixedBarLineFunctions.ts +262 -0
- package/src/services/PatternFunctions.ts +25 -18
- package/src/services/RadarChartFunctions.ts +33 -12
- package/src/services/patterns/ChartDesign.ts +35 -24
- package/src/services/patterns/patternCircles.ts +63 -36
- package/src/services/patterns/patternDashedDiagonals.ts +64 -57
- package/src/services/patterns/patternDiagonals.ts +138 -106
- package/src/services/patterns/patternSquares.ts +86 -80
- package/src/services/patterns/patternVerticalLines.ts +76 -69
- package/src/services/patterns/patternZigzag.ts +92 -85
- package/src/stories/Changelog.mdx +6 -0
- package/src/stories/Contributing.mdx +101 -0
- package/src/stories/GettingStarted.mdx +92 -0
- package/src/stories/SupportAndOnboarding.mdx +44 -0
- package/src/types/AxisDefinition.ts +4 -0
- package/src/types/BarData.ts +1 -0
- package/src/types/Chart.ts +9 -7
- package/src/types/DoughnutData.ts +8 -0
- package/src/types/GenericData.ts +10 -10
- package/src/types/LineChart.ts +4 -4
- package/src/types/MixedBarLineData.ts +7 -0
- package/src/types/RadarData.ts +33 -29
- package/src/types/TooltipChartType.ts +7 -6
- package/src/vite-env.d.ts +3 -3
- package/src/App.vue +0 -80
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Lu=Object.defineProperty;var Tu=(G,x,rt)=>x in G?Lu(G,x,{enumerable:!0,configurable:!0,writable:!0,value:rt}):G[x]=rt;var k=(G,x,rt)=>(Tu(G,typeof x!="symbol"?x+"":x,rt),rt);(function(G,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],x):(G=typeof globalThis<"u"?globalThis:G||self,x(G.MozaicChart={},G.Vue))})(this,function(G,x){var It;"use strict";/*!
|
|
2
2
|
* @kurkle/color v0.3.2
|
|
3
3
|
* https://github.com/kurkle/color#readme
|
|
4
4
|
* (c) 2023 Jukka Kurkela
|
|
5
5
|
* Released under the MIT License
|
|
6
|
-
*/function
|
|
7
|
-
* Chart.js v4.
|
|
6
|
+
*/function rt(i){return i+.5|0}const Mt=(i,t,e)=>Math.max(Math.min(i,e),t);function he(i){return Mt(rt(i*2.55),0,255)}function Pt(i){return Mt(rt(i*255),0,255)}function bt(i){return Mt(rt(i/2.55)/100,0,1)}function Tn(i){return Mt(rt(i*100),0,100)}const ot={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},Oi=[..."0123456789ABCDEF"],pa=i=>Oi[i&15],ma=i=>Oi[(i&240)>>4]+Oi[i&15],He=i=>(i&240)>>4===(i&15),ba=i=>He(i.r)&&He(i.g)&&He(i.b)&&He(i.a);function ya(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&ot[i[1]]*17,g:255&ot[i[2]]*17,b:255&ot[i[3]]*17,a:t===5?ot[i[4]]*17:255}:(t===7||t===9)&&(e={r:ot[i[1]]<<4|ot[i[2]],g:ot[i[3]]<<4|ot[i[4]],b:ot[i[5]]<<4|ot[i[6]],a:t===9?ot[i[7]]<<4|ot[i[8]]:255})),e}const xa=(i,t)=>i<255?t(i):"";function _a(i){var t=ba(i)?pa:ma;return i?"#"+t(i.r)+t(i.g)+t(i.b)+xa(i.a,t):void 0}const va=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function On(i,t,e){const n=t*Math.min(e,1-e),s=(o,a=(o+i/30)%12)=>e-n*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function Sa(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function wa(i,t,e){const n=On(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function ka(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function Ii(i){const e=i.r/255,n=i.g/255,s=i.b/255,o=Math.max(e,n,s),a=Math.min(e,n,s),r=(o+a)/2;let l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=ka(e,n,s,h,o),l=l*60+.5),[l|0,c||0,r]}function Fi(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(Pt)}function Ri(i,t,e){return Fi(On,i,t,e)}function Ca(i,t,e){return Fi(wa,i,t,e)}function Ma(i,t,e){return Fi(Sa,i,t,e)}function In(i){return(i%360+360)%360}function Pa(i){const t=va.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?he(+t[5]):Pt(+t[5]));const s=In(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?n=Ca(s,o,a):t[1]==="hsv"?n=Ma(s,o,a):n=Ri(s,o,a),{r:n[0],g:n[1],b:n[2],a:e}}function Aa(i,t){var e=Ii(i);e[0]=In(e[0]+t),e=Ri(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Da(i){if(!i)return;const t=Ii(i),e=t[0],n=Tn(t[1]),s=Tn(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${bt(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const Fn={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"},Rn={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 La(){const i={},t=Object.keys(Rn),e=Object.keys(Fn);let n,s,o,a,r;for(n=0;n<t.length;n++){for(a=r=t[n],s=0;s<e.length;s++)o=e[s],r=r.replace(o,Fn[o]);o=parseInt(Rn[a],16),i[r]=[o>>16&255,o>>8&255,o&255]}return i}let Ne;function Ta(i){Ne||(Ne=La(),Ne.transparent=[0,0,0,0]);const t=Ne[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Oa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ia(i){const t=Oa.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const a=+t[7];e=t[8]?he(a):Mt(a*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?he(n):Mt(n,0,255)),s=255&(t[4]?he(s):Mt(s,0,255)),o=255&(t[6]?he(o):Mt(o,0,255)),{r:n,g:s,b:o,a:e}}}function Fa(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${bt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ei=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,$t=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Ra(i,t,e){const n=$t(bt(i.r)),s=$t(bt(i.g)),o=$t(bt(i.b));return{r:Pt(Ei(n+e*($t(bt(t.r))-n))),g:Pt(Ei(s+e*($t(bt(t.g))-s))),b:Pt(Ei(o+e*($t(bt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function Ve(i,t,e){if(i){let n=Ii(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Ri(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function En(i,t){return i&&Object.assign(t||{},i)}function Bn(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=Pt(i[3]))):(t=En(i,{r:0,g:0,b:0,a:1}),t.a=Pt(t.a)),t}function Ea(i){return i.charAt(0)==="r"?Ia(i):Pa(i)}class de{constructor(t){if(t instanceof de)return t;const e=typeof t;let n;e==="object"?n=Bn(t):e==="string"&&(n=ya(t)||Ta(t)||Ea(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=En(this._rgb);return t&&(t.a=bt(t.a)),t}set rgb(t){this._rgb=Bn(t)}rgbString(){return this._valid?Fa(this._rgb):void 0}hexString(){return this._valid?_a(this._rgb):void 0}hslString(){return this._valid?Da(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=n.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=a*n.a+(1-a)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=Ra(this._rgb,t._rgb,e)),this}clone(){return new de(this.rgb)}alpha(t){return this._rgb.a=Pt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=rt(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 Ve(this._rgb,2,t),this}darken(t){return Ve(this._rgb,2,-t),this}saturate(t){return Ve(this._rgb,1,t),this}desaturate(t){return Ve(this._rgb,1,-t),this}rotate(t){return Aa(this._rgb,t),this}}/*!
|
|
7
|
+
* Chart.js v4.4.0
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2023 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function ft(){}const ca=(()=>{let i=0;return()=>i++})();function F(i){return i===null||typeof i>"u"}function B(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 N(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function et(i,t){return N(i)?i:t}function L(i,t){return typeof i>"u"?t:i}const ha=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,_n=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function E(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function I(i,t,e,n){let s,o,a;if(B(i))if(o=i.length,n)for(s=o-1;s>=0;s--)t.call(e,i[s],s);else for(s=0;s<o;s++)t.call(e,i[s],s);else if(O(i))for(a=Object.keys(i),o=a.length,s=0;s<o;s++)t.call(e,i[a[s]],a[s])}function De(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Te(i){if(B(i))return i.map(Te);if(O(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=Te(i[e[s]]);return t}return i}function vn(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function da(i,t,e,n){if(!vn(i))return;const s=t[i],o=e[i];O(s)&&O(o)?Qt(s,o,n):t[i]=Te(o)}function Qt(i,t,e){const n=B(t)?t:[t],s=n.length;if(!O(i))return i;e=e||{};const o=e.merger||da;let a;for(let r=0;r<s;++r){if(a=n[r],!O(a))continue;const l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],i,a,e)}return i}function Jt(i,t){return Qt(i,t,{merger:ua})}function ua(i,t,e){if(!vn(i))return;const n=t[i],s=e[i];O(n)&&O(s)?Jt(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=Te(s))}const Sn={"":i=>i,x:i=>i.x,y:i=>i.y};function fa(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function ga(i){const t=fa(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function vt(i,t){return(Sn[t]||(Sn[t]=ga(t)))(i)}function Ai(i){return i.charAt(0).toUpperCase()+i.slice(1)}const te=i=>typeof i<"u",St=i=>typeof i=="function",kn=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function pa(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const H=Math.PI,z=2*H,ma=z+H,Le=Number.POSITIVE_INFINITY,ba=H/180,V=H/2,At=H/4,wn=H*2/3,kt=Math.log10,lt=Math.sign;function ee(i,t,e){return Math.abs(i-t)<e}function Mn(i){const t=Math.round(i);i=ee(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(kt(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function ya(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function ie(i){return!isNaN(parseFloat(i))&&isFinite(i)}function xa(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Cn(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ct(i){return i*(H/180)}function Di(i){return i*(180/H)}function Pn(i){if(!N(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function An(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let o=Math.atan2(n,e);return o<-.5*H&&(o+=z),{angle:o,distance:s}}function Ti(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function _a(i,t){return(i-t+ma)%z-H}function it(i){return(i%z+z)%z}function ne(i,t,e,n){const s=it(i),o=it(t),a=it(e),r=it(o-s),l=it(a-s),c=it(s-o),h=it(s-a);return s===o||s===a||n&&o===a||r>l&&c<h}function q(i,t,e){return Math.max(t,Math.min(e,i))}function va(i){return q(i,-32768,32767)}function gt(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function Li(i,t,e){e=e||(a=>i[a]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const Dt=(i,t,e,n)=>Li(i,e,n?s=>{const o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),Sa=(i,t,e)=>Li(i,e,n=>i[n][t]>=e);function ka(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const Dn=["push","pop","shift","splice","unshift"];function wa(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Dn.forEach(e=>{const n="_onData"+Ai(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[n]=="function"&&r[n](...o)}),a}})})}function Tn(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(Dn.forEach(o=>{delete i[o]}),delete i._chartjs)}function Ln(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const On=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Fn(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,On.call(window,()=>{n=!1,i.apply(t,e)}))}}function Ma(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const Oi=i=>i==="start"?"left":i==="end"?"right":"center",G=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Ca=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function Pa(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:a,_parsed:r}=i,l=a.axis,{min:c,max:h,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(s=q(Math.min(Dt(r,l,c).lo,e?n:Dt(t,l,a.getPixelForValue(c)).lo),0,n-1)),u?o=q(Math.max(Dt(r,a.axis,h,!0).hi+1,e?0:Dt(t,l,a.getPixelForValue(h),!0).hi+1),s,n)-s:o=n-s}return{start:s,count:o}}function Aa(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const Oe=i=>i===0||i===1,In=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*z/e)),Rn=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*z/e)+1,se={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*V)+1,easeOutSine:i=>Math.sin(i*V),easeInOutSine:i=>-.5*(Math.cos(H*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=>Oe(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=>Oe(i)?i:In(i,.075,.3),easeOutElastic:i=>Oe(i)?i:Rn(i,.075,.3),easeInOutElastic(i){return Oe(i)?i:i<.5?.5*In(i*2,.1125,.45):.5+.5*Rn(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-se.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?se.easeInBounce(i*2)*.5:se.easeOutBounce(i*2-1)*.5+.5};function Fi(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function En(i){return Fi(i)?i:new Zt(i)}function Ii(i){return Fi(i)?i:new Zt(i).saturate(.5).darken(.1).hexString()}const Da=["x","y","borderWidth","radius","tension"],Ta=["color","borderColor","backgroundColor"];function La(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:Ta},numbers:{type:"number",properties:Da}}),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 Oa(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Bn=new Map;function Fa(i,t){t=t||{};const e=i+JSON.stringify(t);let n=Bn.get(e);return n||(n=new Intl.NumberFormat(i,t),Bn.set(e,n)),n}function Fe(i,t,e){return Fa(t,e).format(i)}const zn={values(i){return B(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Ia(i,e)}const a=kt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Fe(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(kt(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?zn.numeric.call(this,i,t,e):""}};function Ia(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Ie={formatters:zn};function Ra(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(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:Ie.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 Tt=Object.create(null),Ri=Object.create(null);function oe(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function Ei(i,t,e){return typeof t=="string"?Qt(oe(i,t),e):Qt(oe(i,""),t)}class Ea{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=n=>n.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,s)=>Ii(s.backgroundColor),this.hoverBorderColor=(n,s)=>Ii(s.borderColor),this.hoverColor=(n,s)=>Ii(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Ei(this,t,e)}get(t){return oe(this,t)}describe(t,e){return Ei(Ri,t,e)}override(t,e){return Ei(Tt,t,e)}route(t,e,n,s){const o=oe(this,t),a=oe(this,n),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[s];return O(l)?Object.assign({},c,l):L(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var j=new Ea({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[La,Oa,Ra]);function Ba(i){return!i||F(i.size)||F(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Re(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function za(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let a=0;const r=e.length;let l,c,h,d,u;for(l=0;l<r;l++)if(d=e[l],d!=null&&!B(d))a=Re(i,s,o,a,d);else if(B(d))for(c=0,h=d.length;c<h;c++)u=d[c],u!=null&&!B(u)&&(a=Re(i,s,o,a,u));i.restore();const f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return a}function Lt(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function Wn(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function Bi(i,t,e,n){Hn(i,t,e,n,null)}function Hn(i,t,e,n,s){let o,a,r,l,c,h,d,u;const f=t.pointStyle,m=t.rotation,p=t.radius;let g=(m||0)*ba;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(g),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),f){default:s?i.ellipse(e,n,s/2,p,0,0,z):i.arc(e,n,p,0,z),i.closePath();break;case"triangle":h=s?s/2:p,i.moveTo(e+Math.sin(g)*h,n-Math.cos(g)*p),g+=wn,i.lineTo(e+Math.sin(g)*h,n-Math.cos(g)*p),g+=wn,i.lineTo(e+Math.sin(g)*h,n-Math.cos(g)*p),i.closePath();break;case"rectRounded":c=p*.516,l=p-c,a=Math.cos(g+At)*l,d=Math.cos(g+At)*(s?s/2-c:l),r=Math.sin(g+At)*l,u=Math.sin(g+At)*(s?s/2-c:l),i.arc(e-d,n-r,c,g-H,g-V),i.arc(e+u,n-a,c,g-V,g),i.arc(e+d,n+r,c,g,g+V),i.arc(e-u,n+a,c,g+V,g+H),i.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*p,h=s?s/2:l,i.rect(e-h,n-l,2*h,2*l);break}g+=At;case"rectRot":d=Math.cos(g)*(s?s/2:p),a=Math.cos(g)*p,r=Math.sin(g)*p,u=Math.sin(g)*(s?s/2:p),i.moveTo(e-d,n-r),i.lineTo(e+u,n-a),i.lineTo(e+d,n+r),i.lineTo(e-u,n+a),i.closePath();break;case"crossRot":g+=At;case"cross":d=Math.cos(g)*(s?s/2:p),a=Math.cos(g)*p,r=Math.sin(g)*p,u=Math.sin(g)*(s?s/2:p),i.moveTo(e-d,n-r),i.lineTo(e+d,n+r),i.moveTo(e+u,n-a),i.lineTo(e-u,n+a);break;case"star":d=Math.cos(g)*(s?s/2:p),a=Math.cos(g)*p,r=Math.sin(g)*p,u=Math.sin(g)*(s?s/2:p),i.moveTo(e-d,n-r),i.lineTo(e+d,n+r),i.moveTo(e+u,n-a),i.lineTo(e-u,n+a),g+=At,d=Math.cos(g)*(s?s/2:p),a=Math.cos(g)*p,r=Math.sin(g)*p,u=Math.sin(g)*(s?s/2:p),i.moveTo(e-d,n-r),i.lineTo(e+d,n+r),i.moveTo(e+u,n-a),i.lineTo(e-u,n+a);break;case"line":a=s?s/2:Math.cos(g)*p,r=Math.sin(g)*p,i.moveTo(e-a,n-r),i.lineTo(e+a,n+r);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(g)*(s?s/2:p),n+Math.sin(g)*p);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function pt(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 Ee(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function Be(i){i.restore()}function Wa(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function Ha(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function Na(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),F(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 Va(i,t,e,n,s){if(s.strikethrough||s.underline){const o=i.measureText(n),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(a,h),i.lineTo(r,h),i.stroke()}}function ja(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Ot(i,t,e,n,s,o={}){const a=B(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,Na(i,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&ja(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),F(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,n,o.maxWidth)),i.fillText(c,e,n,o.maxWidth),Va(i,e,n,c,o),n+=Number(s.lineHeight);i.restore()}function ae(i,t){const{x:e,y:n,w:s,h:o,radius:a}=t;i.arc(e+a.topLeft,n+a.topLeft,a.topLeft,-V,H,!0),i.lineTo(e,n+o-a.bottomLeft),i.arc(e+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,H,V,!0),i.lineTo(e+s-a.bottomRight,n+o),i.arc(e+s-a.bottomRight,n+o-a.bottomRight,a.bottomRight,V,0,!0),i.lineTo(e+s,n+a.topRight),i.arc(e+s-a.topRight,n+a.topRight,a.topRight,0,-V,!0),i.lineTo(e+a.topLeft,n)}const $a=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ya=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ua(i,t){const e=(""+i).match($a);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 Xa=i=>+i||0;function zi(i,t){const e={},n=O(t),s=n?Object.keys(t):t,o=O(i)?n?a=>L(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of s)e[a]=Xa(o(a));return e}function Nn(i){return zi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Ft(i){return zi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function K(i){const t=Nn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function U(i,t){i=i||{},t=t||j.font;let e=L(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=L(i.style,t.style);n&&!(""+n).match(Ya)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:L(i.family,t.family),lineHeight:Ua(L(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:L(i.weight,t.weight),string:""};return s.string=Ba(s),s}function ze(i,t,e,n){let s=!0,o,a,r;for(o=0,a=i.length;o<a;++o)if(r=i[o],r!==void 0&&(t!==void 0&&typeof r=="function"&&(r=r(t),s=!1),e!==void 0&&B(r)&&(r=r[e%r.length],s=!1),r!==void 0))return n&&!s&&(n.cacheable=!1),r}function qa(i,t,e){const{min:n,max:s}=i,o=_n(t,(s-n)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(n,-Math.abs(o)),max:a(s,o)}}function wt(i,t){return Object.assign(Object.create(i),t)}function Wi(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=Un("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:r=>Wi([r,...i],t,o,n)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return jn(r,l,()=>ir(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return Xn(r).includes(l)},ownKeys(r){return Xn(r)},set(r,l,c){const h=r._storage||(r._storage=s());return r[l]=h[l]=c,delete r._keys,!0}})}function jt(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Vn(i,n),setContext:o=>jt(i,o,e,n),override:o=>jt(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return jn(o,a,()=>Ka(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function Vn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:St(e)?e:()=>e,isIndexable:St(n)?n:()=>n}}const Ga=(i,t)=>i?i+Ai(t):t,Hi=(i,t)=>O(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function jn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const n=e();return i[t]=n,n}function Ka(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=i;let r=n[t];return St(r)&&a.isScriptable(t)&&(r=Za(t,r,i,e)),B(r)&&r.length&&(r=Qa(t,r,i,a.isIndexable)),Hi(t,r)&&(r=jt(r,s,o&&o[t],a)),r}function Za(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=t(o,a||n);return r.delete(i),Hi(i,l)&&(l=Ni(s._scopes,s,i,l)),l}function Qa(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(O(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Ni(c,s,i,h);t.push(jt(d,o,a&&a[i],r))}}return t}function $n(i,t,e){return St(i)?i(t,e):i}const Ja=(i,t)=>i===!0?t:typeof i=="string"?vt(t,i):void 0;function tr(i,t,e,n,s){for(const o of t){const a=Ja(e,o);if(a){i.add(a);const r=$n(a._fallback,e,s);if(typeof r<"u"&&r!==e&&r!==n)return r}else if(a===!1&&typeof n<"u"&&e!==n)return null}return!1}function Ni(i,t,e,n){const s=t._rootScopes,o=$n(t._fallback,e,n),a=[...i,...s],r=new Set;r.add(n);let l=Yn(r,a,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=Yn(r,a,o,l,n),l===null)?!1:Wi(Array.from(r),[""],s,o,()=>er(t,e,n))}function Yn(i,t,e,n,s){for(;e;)e=tr(i,t,e,n,s);return e}function er(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return B(s)&&O(e)?e:s||{}}function ir(i,t,e,n){let s;for(const o of t)if(s=Un(Ga(o,i),e),typeof s<"u")return Hi(i,s)?Ni(e,n,i,s):s}function Un(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function Xn(i){let t=i._keys;return t||(t=i._keys=nr(i._scopes)),t}function nr(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function sr(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,a=new Array(n);let r,l,c,h;for(r=0,l=n;r<l;++r)c=r+e,h=t[c],a[r]={r:s.parse(vt(h,o),c)};return a}const or=Number.EPSILON||1e-14,$t=(i,t)=>t<i.length&&!i[t].skip&&i[t],qn=i=>i==="x"?"y":"x";function ar(i,t,e,n){const s=i.skip?t:i,o=t,a=e.skip?t:e,r=Ti(o,s),l=Ti(a,o);let c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(a.x-s.x),y:o.y-d*(a.y-s.y)},next:{x:o.x+u*(a.x-s.x),y:o.y+u*(a.y-s.y)}}}function rr(i,t,e){const n=i.length;let s,o,a,r,l,c=$t(i,0);for(let h=0;h<n-1;++h)if(l=c,c=$t(i,h+1),!(!l||!c)){if(ee(t[h],0,or)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[h]=s*a*t[h],e[h+1]=o*a*t[h])}}function lr(i,t,e="x"){const n=qn(e),s=i.length;let o,a,r,l=$t(i,0);for(let c=0;c<s;++c){if(a=r,r=l,l=$t(i,c+1),!r)continue;const h=r[e],d=r[n];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${n}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${n}`]=d+o*t[c])}}function cr(i,t="x"){const e=qn(t),n=i.length,s=Array(n).fill(0),o=Array(n);let a,r,l,c=$t(i,0);for(a=0;a<n;++a)if(r=l,l=c,c=$t(i,a+1),!!l){if(c){const h=c[t]-l[t];s[a]=h!==0?(c[e]-l[e])/h:0}o[a]=r?c?lt(s[a-1])!==lt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}rr(i,s,o),lr(i,o,t)}function We(i,t,e){return Math.max(Math.min(i,e),t)}function hr(i,t){let e,n,s,o,a,r=pt(i[0],t);for(e=0,n=i.length;e<n;++e)a=o,o=r,r=e<n-1&&pt(i[e+1],t),o&&(s=i[e],a&&(s.cp1x=We(s.cp1x,t.left,t.right),s.cp1y=We(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=We(s.cp2x,t.left,t.right),s.cp2y=We(s.cp2y,t.top,t.bottom)))}function dr(i,t,e,n,s){let o,a,r,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")cr(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],l=ar(c,r,i[Math.min(o+1,a-(n?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&hr(i,e)}function Gn(){return typeof window<"u"&&typeof document<"u"}function Vi(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function He(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const Ne=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function ur(i,t){return Ne(i).getPropertyValue(t)}const fr=["top","right","bottom","left"];function It(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=fr[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const gr=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function pr(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let a=!1,r,l;if(gr(s,o,i.target))r=s,l=o;else{const c=t.getBoundingClientRect();r=n.clientX-c.left,l=n.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Rt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=Ne(e),o=s.boxSizing==="border-box",a=It(s,"padding"),r=It(s,"border","width"),{x:l,y:c,box:h}=pr(i,e),d=a.left+(h&&r.left),u=a.top+(h&&r.top);let{width:f,height:m}=t;return o&&(f-=a.width+r.width,m-=a.height+r.height),{x:Math.round((l-d)/f*e.width/n),y:Math.round((c-u)/m*e.height/n)}}function mr(i,t,e){let n,s;if(t===void 0||e===void 0){const o=Vi(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=Ne(o),l=It(r,"border","width"),c=It(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,n=He(r.maxWidth,o,"clientWidth"),s=He(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||Le,maxHeight:s||Le}}const Ve=i=>Math.round(i*10)/10;function br(i,t,e,n){const s=Ne(i),o=It(s,"margin"),a=He(s.maxWidth,i,"clientWidth")||Le,r=He(s.maxHeight,i,"clientHeight")||Le,l=mr(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const u=It(s,"border","width"),f=It(s,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Ve(Math.min(c,a,l.maxWidth)),h=Ve(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Ve(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=Ve(Math.floor(h*n))),{width:c,height:h}}function Kn(i,t,e){const n=t||1,s=Math.floor(i.height*n),o=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||a.height!==s||a.width!==o?(i.currentDevicePixelRatio=n,a.height=s,a.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const yr=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function Zn(i,t){const e=ur(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Et(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function xr(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function _r(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=Et(i,s,e),r=Et(s,o,e),l=Et(o,t,e),c=Et(a,r,e),h=Et(r,l,e);return Et(c,h,e)}const vr=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,n){return e-n},leftForLtr(e,n){return e-n}}},Sr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Yt(i,t,e){return i?vr(t,e):Sr()}function Qn(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function Jn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function ts(i){return i==="angle"?{between:ne,compare:_a,normalize:it}:{between:gt,compare:(t,e)=>t-e,normalize:t=>t}}function es({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function kr(i,t,e){const{property:n,start:s,end:o}=e,{between:a,normalize:r}=ts(n),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&a(r(t[c%l][n]),s,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function is(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,a=t.length,{compare:r,between:l,normalize:c}=ts(n),{start:h,end:d,loop:u,style:f}=kr(i,t,e),m=[];let p=!1,g=null,b,y,_;const S=()=>l(s,_,b)&&r(s,_)!==0,x=()=>r(o,b)===0||l(o,_,b),P=()=>p||S(),k=()=>!p||x();for(let w=h,C=h;w<=d;++w)y=t[w%a],!y.skip&&(b=c(y[n]),b!==_&&(p=l(b,s,o),g===null&&P()&&(g=r(b,s)===0?w:C),g!==null&&k()&&(m.push(es({start:g,end:w,loop:u,count:a,style:f})),g=null),C=w,_=b));return g!==null&&m.push(es({start:g,end:d,loop:u,count:a,style:f})),m}function ns(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=is(n[s],i.points,t);o.length&&e.push(...o)}return e}function wr(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Mr(i,t,e,n){const s=i.length,o=[];let a=t,r=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?r.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%s,end:a%s,loop:n}),o}function Cr(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:a,end:r}=wr(e,s,o,n);if(n===!0)return ss(i,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+s:r,c=!!i._fullLoop&&a===0&&r===s-1;return ss(i,Mr(e,a,l,c),e,t)}function ss(i,t,e,n){return!n||!n.setContext||!e?t:Pr(i,t,e,n)}function Pr(i,t,e,n){const s=i._chart.getContext(),o=os(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,l=e.length,c=[];let h=o,d=t[0].start,u=d;function f(m,p,g,b){const y=r?-1:1;if(m!==p){for(m+=l;e[m%l].skip;)m-=y;for(;e[p%l].skip;)p+=y;m%l!==p%l&&(c.push({start:m%l,end:p%l,loop:g,style:b}),h=b,d=p%l)}}for(const m of t){d=r?d:m.start;let p=e[d%l],g;for(u=d+1;u<=m.end;u++){const b=e[u%l];g=os(n.setContext(wt(s,{type:"segment",p0:p,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Ar(g,h)&&f(d,u-1,m.loop,h),p=b,h=g}d<u-1&&f(d,u-1,m.loop,h)}return c}function os(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Ar(i,t){if(!t)return!1;const e=[],n=function(s,o){return Fi(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}/*!
|
|
12
|
-
* Chart.js v4.
|
|
11
|
+
*/function yt(){}const Ba=(()=>{let i=0;return()=>i++})();function I(i){return i===null||typeof i>"u"}function W(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 q(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function ht(i,t){return q(i)?i:t}function T(i,t){return typeof i>"u"?t:i}const za=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,zn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function E(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function R(i,t,e,n){let s,o,a;if(W(i))if(o=i.length,n)for(s=o-1;s>=0;s--)t.call(e,i[s],s);else for(s=0;s<o;s++)t.call(e,i[s],s);else if(O(i))for(a=Object.keys(i),o=a.length,s=0;s<o;s++)t.call(e,i[a[s]],a[s])}function je(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function $e(i){if(W(i))return i.map($e);if(O(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=$e(i[e[s]]);return t}return i}function Wn(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Wa(i,t,e,n){if(!Wn(i))return;const s=t[i],o=e[i];O(s)&&O(o)?dt(s,o,n):t[i]=$e(o)}function dt(i,t,e){const n=W(t)?t:[t],s=n.length;if(!O(i))return i;e=e||{};const o=e.merger||Wa;let a;for(let r=0;r<s;++r){if(a=n[r],!O(a))continue;const l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],i,a,e)}return i}function ue(i,t){return dt(i,t,{merger:Ha})}function Ha(i,t,e){if(!Wn(i))return;const n=t[i],s=e[i];O(n)&&O(s)?ue(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=$e(s))}const Hn={"":i=>i,x:i=>i.x,y:i=>i.y};function Na(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function Va(i){const t=Na(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function At(i,t){return(Hn[t]||(Hn[t]=Va(t)))(i)}function Bi(i){return i.charAt(0).toUpperCase()+i.slice(1)}const fe=i=>typeof i<"u",Dt=i=>typeof i=="function",Nn=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function ja(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const N=Math.PI,H=2*N,$a=H+N,Ue=Number.POSITIVE_INFINITY,Ua=N/180,Y=N/2,Ft=N/4,Vn=N*2/3,zi=Math.log10,ut=Math.sign;function ge(i,t,e){return Math.abs(i-t)<e}function jn(i){const t=Math.round(i);i=ge(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(zi(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Ya(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function pe(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Xa(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Ga(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ft(i){return i*(N/180)}function Wi(i){return i*(180/N)}function $n(i){if(!q(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Un(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let o=Math.atan2(n,e);return o<-.5*N&&(o+=H),{angle:o,distance:s}}function Hi(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function qa(i,t){return(i-t+$a)%H-N}function st(i){return(i%H+H)%H}function me(i,t,e,n){const s=st(i),o=st(t),a=st(e),r=st(o-s),l=st(a-s),c=st(s-o),h=st(s-a);return s===o||s===a||n&&o===a||r>l&&c<h}function Z(i,t,e){return Math.max(t,Math.min(e,i))}function Ka(i){return Z(i,-32768,32767)}function xt(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function Ni(i,t,e){e=e||(a=>i[a]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const Rt=(i,t,e,n)=>Ni(i,e,n?s=>{const o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),Za=(i,t,e)=>Ni(i,e,n=>i[n][t]>=e);function Ja(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const Yn=["push","pop","shift","splice","unshift"];function Qa(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Yn.forEach(e=>{const n="_onData"+Bi(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[n]=="function"&&r[n](...o)}),a}})})}function Xn(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(Yn.forEach(o=>{delete i[o]}),delete i._chartjs)}function Gn(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const qn=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Kn(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,qn.call(window,()=>{n=!1,i.apply(t,e)}))}}function tr(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const Vi=i=>i==="start"?"left":i==="end"?"right":"center",J=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,er=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function ir(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:a,_parsed:r}=i,l=a.axis,{min:c,max:h,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(s=Z(Math.min(Rt(r,l,c).lo,e?n:Rt(t,l,a.getPixelForValue(c)).lo),0,n-1)),u?o=Z(Math.max(Rt(r,a.axis,h,!0).hi+1,e?0:Rt(t,l,a.getPixelForValue(h),!0).hi+1),s,n)-s:o=n-s}return{start:s,count:o}}function nr(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const Ye=i=>i===0||i===1,Zn=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*H/e)),Jn=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*H/e)+1,be={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*Y)+1,easeOutSine:i=>Math.sin(i*Y),easeInOutSine:i=>-.5*(Math.cos(N*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=>Ye(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=>Ye(i)?i:Zn(i,.075,.3),easeOutElastic:i=>Ye(i)?i:Jn(i,.075,.3),easeInOutElastic(i){return Ye(i)?i:i<.5?.5*Zn(i*2,.1125,.45):.5+.5*Jn(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-be.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?be.easeInBounce(i*2)*.5:be.easeOutBounce(i*2-1)*.5+.5};function ji(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Qn(i){return ji(i)?i:new de(i)}function $i(i){return ji(i)?i:new de(i).saturate(.5).darken(.1).hexString()}const sr=["x","y","borderWidth","radius","tension"],or=["color","borderColor","backgroundColor"];function ar(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:or},numbers:{type:"number",properties:sr}}),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 rr(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ts=new Map;function lr(i,t){t=t||{};const e=i+JSON.stringify(t);let n=ts.get(e);return n||(n=new Intl.NumberFormat(i,t),ts.set(e,n)),n}function Ui(i,t,e){return lr(t,e).format(i)}const es={values(i){return W(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=cr(i,e)}const a=zi(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Ui(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(zi(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?es.numeric.call(this,i,t,e):""}};function cr(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Yi={formatters:es};function hr(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:Yi.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 Et=Object.create(null),Xi=Object.create(null);function ye(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function Gi(i,t,e){return typeof t=="string"?dt(ye(i,t),e):dt(ye(i,""),t)}class dr{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=n=>n.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,s)=>$i(s.backgroundColor),this.hoverBorderColor=(n,s)=>$i(s.borderColor),this.hoverColor=(n,s)=>$i(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Gi(this,t,e)}get(t){return ye(this,t)}describe(t,e){return Gi(Xi,t,e)}override(t,e){return Gi(Et,t,e)}route(t,e,n,s){const o=ye(this,t),a=ye(this,n),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[s];return O(l)?Object.assign({},c,l):T(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var U=new dr({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ar,rr,hr]);function ur(i){return!i||I(i.size)||I(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Xe(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function fr(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let a=0;const r=e.length;let l,c,h,d,u;for(l=0;l<r;l++)if(d=e[l],d!=null&&!W(d))a=Xe(i,s,o,a,d);else if(W(d))for(c=0,h=d.length;c<h;c++)u=d[c],u!=null&&!W(u)&&(a=Xe(i,s,o,a,u));i.restore();const f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return a}function Bt(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function is(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function qi(i,t,e,n){ns(i,t,e,n,null)}function ns(i,t,e,n,s){let o,a,r,l,c,h,d,u;const f=t.pointStyle,b=t.rotation,p=t.radius;let m=(b||0)*Ua;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(m),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),f){default:s?i.ellipse(e,n,s/2,p,0,0,H):i.arc(e,n,p,0,H),i.closePath();break;case"triangle":h=s?s/2:p,i.moveTo(e+Math.sin(m)*h,n-Math.cos(m)*p),m+=Vn,i.lineTo(e+Math.sin(m)*h,n-Math.cos(m)*p),m+=Vn,i.lineTo(e+Math.sin(m)*h,n-Math.cos(m)*p),i.closePath();break;case"rectRounded":c=p*.516,l=p-c,a=Math.cos(m+Ft)*l,d=Math.cos(m+Ft)*(s?s/2-c:l),r=Math.sin(m+Ft)*l,u=Math.sin(m+Ft)*(s?s/2-c:l),i.arc(e-d,n-r,c,m-N,m-Y),i.arc(e+u,n-a,c,m-Y,m),i.arc(e+d,n+r,c,m,m+Y),i.arc(e-u,n+a,c,m+Y,m+N),i.closePath();break;case"rect":if(!b){l=Math.SQRT1_2*p,h=s?s/2:l,i.rect(e-h,n-l,2*h,2*l);break}m+=Ft;case"rectRot":d=Math.cos(m)*(s?s/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-d,n-r),i.lineTo(e+u,n-a),i.lineTo(e+d,n+r),i.lineTo(e-u,n+a),i.closePath();break;case"crossRot":m+=Ft;case"cross":d=Math.cos(m)*(s?s/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-d,n-r),i.lineTo(e+d,n+r),i.moveTo(e+u,n-a),i.lineTo(e-u,n+a);break;case"star":d=Math.cos(m)*(s?s/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-d,n-r),i.lineTo(e+d,n+r),i.moveTo(e+u,n-a),i.lineTo(e-u,n+a),m+=Ft,d=Math.cos(m)*(s?s/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-d,n-r),i.lineTo(e+d,n+r),i.moveTo(e+u,n-a),i.lineTo(e-u,n+a);break;case"line":a=s?s/2:Math.cos(m)*p,r=Math.sin(m)*p,i.moveTo(e-a,n-r),i.lineTo(e+a,n+r);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(m)*(s?s/2:p),n+Math.sin(m)*p);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function _t(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function Ge(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function qe(i){i.restore()}function gr(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function pr(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function mr(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),I(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 br(i,t,e,n,s){if(s.strikethrough||s.underline){const o=i.measureText(n),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(a,h),i.lineTo(r,h),i.stroke()}}function yr(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function zt(i,t,e,n,s,o={}){const a=W(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,mr(i,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&yr(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),I(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,n,o.maxWidth)),i.fillText(c,e,n,o.maxWidth),br(i,e,n,c,o),n+=Number(s.lineHeight);i.restore()}function xe(i,t){const{x:e,y:n,w:s,h:o,radius:a}=t;i.arc(e+a.topLeft,n+a.topLeft,a.topLeft,1.5*N,N,!0),i.lineTo(e,n+o-a.bottomLeft),i.arc(e+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,N,Y,!0),i.lineTo(e+s-a.bottomRight,n+o),i.arc(e+s-a.bottomRight,n+o-a.bottomRight,a.bottomRight,Y,0,!0),i.lineTo(e+s,n+a.topRight),i.arc(e+s-a.topRight,n+a.topRight,a.topRight,0,-Y,!0),i.lineTo(e+a.topLeft,n)}const xr=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,_r=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function vr(i,t){const e=(""+i).match(xr);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 Sr=i=>+i||0;function Ki(i,t){const e={},n=O(t),s=n?Object.keys(t):t,o=O(i)?n?a=>T(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of s)e[a]=Sr(o(a));return e}function ss(i){return Ki(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Wt(i){return Ki(i,["topLeft","topRight","bottomLeft","bottomRight"])}function K(i){const t=ss(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function X(i,t){i=i||{},t=t||U.font;let e=T(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=T(i.style,t.style);n&&!(""+n).match(_r)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:T(i.family,t.family),lineHeight:vr(T(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:T(i.weight,t.weight),string:""};return s.string=ur(s),s}function V(i,t,e,n){let s=!0,o,a,r;for(o=0,a=i.length;o<a;++o)if(r=i[o],r!==void 0&&(t!==void 0&&typeof r=="function"&&(r=r(t),s=!1),e!==void 0&&W(r)&&(r=r[e%r.length],s=!1),r!==void 0))return n&&!s&&(n.cacheable=!1),r}function wr(i,t,e){const{min:n,max:s}=i,o=zn(t,(s-n)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(n,-Math.abs(o)),max:a(s,o)}}function Lt(i,t){return Object.assign(Object.create(i),t)}function Zi(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=cs("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:r=>Zi([r,...i],t,o,n)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return as(r,l,()=>Tr(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return hs(r).includes(l)},ownKeys(r){return hs(r)},set(r,l,c){const h=r._storage||(r._storage=s());return r[l]=h[l]=c,delete r._keys,!0}})}function Ut(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:os(i,n),setContext:o=>Ut(i,o,e,n),override:o=>Ut(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return as(o,a,()=>Cr(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function os(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:Dt(e)?e:()=>e,isIndexable:Dt(n)?n:()=>n}}const kr=(i,t)=>i?i+Bi(t):t,Ji=(i,t)=>O(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function as(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const n=e();return i[t]=n,n}function Cr(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=i;let r=n[t];return Dt(r)&&a.isScriptable(t)&&(r=Mr(t,r,i,e)),W(r)&&r.length&&(r=Pr(t,r,i,a.isIndexable)),Ji(t,r)&&(r=Ut(r,s,o&&o[t],a)),r}function Mr(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=t(o,a||n);return r.delete(i),Ji(i,l)&&(l=Qi(s._scopes,s,i,l)),l}function Pr(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(O(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Qi(c,s,i,h);t.push(Ut(d,o,a&&a[i],r))}}return t}function rs(i,t,e){return Dt(i)?i(t,e):i}const Ar=(i,t)=>i===!0?t:typeof i=="string"?At(t,i):void 0;function Dr(i,t,e,n,s){for(const o of t){const a=Ar(e,o);if(a){i.add(a);const r=rs(a._fallback,e,s);if(typeof r<"u"&&r!==e&&r!==n)return r}else if(a===!1&&typeof n<"u"&&e!==n)return null}return!1}function Qi(i,t,e,n){const s=t._rootScopes,o=rs(t._fallback,e,n),a=[...i,...s],r=new Set;r.add(n);let l=ls(r,a,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=ls(r,a,o,l,n),l===null)?!1:Zi(Array.from(r),[""],s,o,()=>Lr(t,e,n))}function ls(i,t,e,n,s){for(;e;)e=Dr(i,t,e,n,s);return e}function Lr(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return W(s)&&O(e)?e:s||{}}function Tr(i,t,e,n){let s;for(const o of t)if(s=cs(kr(o,i),e),typeof s<"u")return Ji(i,s)?Qi(e,n,i,s):s}function cs(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function hs(i){let t=i._keys;return t||(t=i._keys=Or(i._scopes)),t}function Or(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function Ir(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,a=new Array(n);let r,l,c,h;for(r=0,l=n;r<l;++r)c=r+e,h=t[c],a[r]={r:s.parse(At(h,o),c)};return a}const Fr=Number.EPSILON||1e-14,Yt=(i,t)=>t<i.length&&!i[t].skip&&i[t],ds=i=>i==="x"?"y":"x";function Rr(i,t,e,n){const s=i.skip?t:i,o=t,a=e.skip?t:e,r=Hi(o,s),l=Hi(a,o);let c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(a.x-s.x),y:o.y-d*(a.y-s.y)},next:{x:o.x+u*(a.x-s.x),y:o.y+u*(a.y-s.y)}}}function Er(i,t,e){const n=i.length;let s,o,a,r,l,c=Yt(i,0);for(let h=0;h<n-1;++h)if(l=c,c=Yt(i,h+1),!(!l||!c)){if(ge(t[h],0,Fr)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[h]=s*a*t[h],e[h+1]=o*a*t[h])}}function Br(i,t,e="x"){const n=ds(e),s=i.length;let o,a,r,l=Yt(i,0);for(let c=0;c<s;++c){if(a=r,r=l,l=Yt(i,c+1),!r)continue;const h=r[e],d=r[n];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${n}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${n}`]=d+o*t[c])}}function zr(i,t="x"){const e=ds(t),n=i.length,s=Array(n).fill(0),o=Array(n);let a,r,l,c=Yt(i,0);for(a=0;a<n;++a)if(r=l,l=c,c=Yt(i,a+1),!!l){if(c){const h=c[t]-l[t];s[a]=h!==0?(c[e]-l[e])/h:0}o[a]=r?c?ut(s[a-1])!==ut(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}Er(i,s,o),Br(i,o,t)}function Ke(i,t,e){return Math.max(Math.min(i,e),t)}function Wr(i,t){let e,n,s,o,a,r=_t(i[0],t);for(e=0,n=i.length;e<n;++e)a=o,o=r,r=e<n-1&&_t(i[e+1],t),o&&(s=i[e],a&&(s.cp1x=Ke(s.cp1x,t.left,t.right),s.cp1y=Ke(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=Ke(s.cp2x,t.left,t.right),s.cp2y=Ke(s.cp2y,t.top,t.bottom)))}function Hr(i,t,e,n,s){let o,a,r,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")zr(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],l=Rr(c,r,i[Math.min(o+1,a-(n?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&Wr(i,e)}function us(){return typeof window<"u"&&typeof document<"u"}function tn(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ze(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const Je=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Nr(i,t){return Je(i).getPropertyValue(t)}const Vr=["top","right","bottom","left"];function Ht(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Vr[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const jr=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function $r(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let a=!1,r,l;if(jr(s,o,i.target))r=s,l=o;else{const c=t.getBoundingClientRect();r=n.clientX-c.left,l=n.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Nt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=Je(e),o=s.boxSizing==="border-box",a=Ht(s,"padding"),r=Ht(s,"border","width"),{x:l,y:c,box:h}=$r(i,e),d=a.left+(h&&r.left),u=a.top+(h&&r.top);let{width:f,height:b}=t;return o&&(f-=a.width+r.width,b-=a.height+r.height),{x:Math.round((l-d)/f*e.width/n),y:Math.round((c-u)/b*e.height/n)}}function Ur(i,t,e){let n,s;if(t===void 0||e===void 0){const o=tn(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=Je(o),l=Ht(r,"border","width"),c=Ht(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,n=Ze(r.maxWidth,o,"clientWidth"),s=Ze(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||Ue,maxHeight:s||Ue}}const Qe=i=>Math.round(i*10)/10;function Yr(i,t,e,n){const s=Je(i),o=Ht(s,"margin"),a=Ze(s.maxWidth,i,"clientWidth")||Ue,r=Ze(s.maxHeight,i,"clientHeight")||Ue,l=Ur(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const u=Ht(s,"border","width"),f=Ht(s,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Qe(Math.min(c,a,l.maxWidth)),h=Qe(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Qe(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=Qe(Math.floor(h*n))),{width:c,height:h}}function fs(i,t,e){const n=t||1,s=Math.floor(i.height*n),o=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||a.height!==s||a.width!==o?(i.currentDevicePixelRatio=n,a.height=s,a.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Xr=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function gs(i,t){const e=Nr(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Vt(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Gr(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function qr(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=Vt(i,s,e),r=Vt(s,o,e),l=Vt(o,t,e),c=Vt(a,r,e),h=Vt(r,l,e);return Vt(c,h,e)}const Kr=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,n){return e-n},leftForLtr(e,n){return e-n}}},Zr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Xt(i,t,e){return i?Kr(t,e):Zr()}function ps(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function ms(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function bs(i){return i==="angle"?{between:me,compare:qa,normalize:st}:{between:xt,compare:(t,e)=>t-e,normalize:t=>t}}function ys({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function Jr(i,t,e){const{property:n,start:s,end:o}=e,{between:a,normalize:r}=bs(n),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&a(r(t[c%l][n]),s,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function xs(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,a=t.length,{compare:r,between:l,normalize:c}=bs(n),{start:h,end:d,loop:u,style:f}=Jr(i,t,e),b=[];let p=!1,m=null,g,y,_;const S=()=>l(s,_,g)&&r(s,_)!==0,v=()=>r(o,g)===0||l(o,_,g),w=()=>p||S(),M=()=>!p||v();for(let C=h,D=h;C<=d;++C)y=t[C%a],!y.skip&&(g=c(y[n]),g!==_&&(p=l(g,s,o),m===null&&w()&&(m=r(g,s)===0?C:D),m!==null&&M()&&(b.push(ys({start:m,end:C,loop:u,count:a,style:f})),m=null),D=C,_=g));return m!==null&&b.push(ys({start:m,end:d,loop:u,count:a,style:f})),b}function _s(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=xs(n[s],i.points,t);o.length&&e.push(...o)}return e}function Qr(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function tl(i,t,e,n){const s=i.length,o=[];let a=t,r=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?r.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%s,end:a%s,loop:n}),o}function el(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:a,end:r}=Qr(e,s,o,n);if(n===!0)return vs(i,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+s:r,c=!!i._fullLoop&&a===0&&r===s-1;return vs(i,tl(e,a,l,c),e,t)}function vs(i,t,e,n){return!n||!n.setContext||!e?t:il(i,t,e,n)}function il(i,t,e,n){const s=i._chart.getContext(),o=Ss(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,l=e.length,c=[];let h=o,d=t[0].start,u=d;function f(b,p,m,g){const y=r?-1:1;if(b!==p){for(b+=l;e[b%l].skip;)b-=y;for(;e[p%l].skip;)p+=y;b%l!==p%l&&(c.push({start:b%l,end:p%l,loop:m,style:g}),h=g,d=p%l)}}for(const b of t){d=r?d:b.start;let p=e[d%l],m;for(u=d+1;u<=b.end;u++){const g=e[u%l];m=Ss(n.setContext(Lt(s,{type:"segment",p0:p,p1:g,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),nl(m,h)&&f(d,u-1,b.loop,h),p=g,h=m}d<u-1&&f(d,u-1,b.loop,h)}return c}function Ss(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function nl(i,t){if(!t)return!1;const e=[],n=function(s,o){return ji(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}/*!
|
|
12
|
+
* Chart.js v4.4.0
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2023 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class Dr{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const o=e.listeners[s],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(n-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=On.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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((n,s)=>Math.max(n,s._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 n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var mt=new Dr;const as="transparent",Tr={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=En(i||as),s=n.valid&&En(t||as);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Lr{constructor(t,e,n,s){const o=e[n];s=ze([t.to,s,o,t.from]);const a=ze([t.from,o,s]);this._active=!0,this._fn=t.fn||Tr[t.type||typeof a],this._easing=se[t.easing]||se.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=n,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,a=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ze([t.to,e,s,t.from]),this._from=ze([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<n),!this._active){this._target[s]=r,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/n%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}class rs{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!O(t))return;const e=Object.keys(j.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!O(o))return;const a={};for(const r of e)a[r]=o[r];(B(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!n.has(r))&&n.set(r,a)})})}_animateOptions(t,e){const n=e.options,s=Fr(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&Or(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=n.get(c);if(d)if(u&&d.active()){d.update(u,h,r);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new Lr(u,t,c,h),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return mt.add(this._chart,n),!0}}function Or(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Fr(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 ls(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function Ir(i,t,e){if(e===!1)return!1;const n=ls(i,e),s=ls(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function Rr(i){let t,e,n,s;return O(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function cs(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function hs(i,t,e,n={}){const s=i.keys,o=n.mode==="single";let a,r,l,c;if(t!==null){for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(n.all)continue;break}c=i.values[l],N(c)&&(o||t===0||lt(t)===lt(c))&&(t+=c)}return t}}function Er(i){const t=Object.keys(i),e=new Array(t.length);let n,s,o;for(n=0,s=t.length;n<s;++n)o=t[n],e[n]={x:o,y:i[o]};return e}function ds(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Br(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function zr(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Wr(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function us(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function fs(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,c=a.axis,h=Br(o,a,n),d=t.length;let u;for(let f=0;f<d;++f){const m=t[f],{[l]:p,[c]:g}=m,b=m._stacks||(m._stacks={});u=b[c]=Wr(s,h,p),u[r]=g,u._top=us(u,a,!0,n.type),u._bottom=us(u,a,!1,n.type);const y=u._visualValues||(u._visualValues={});y[r]=g}}function ji(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function Hr(i,t){return wt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Nr(i,t,e){return wt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function re(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const $i=i=>i==="reset"||i==="none",gs=(i,t)=>t?i:Object.assign({},i),Vr=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:cs(e,!0),values:null};class Mt{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=ds(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&&re(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(d,u,f,m)=>d==="x"?u:d==="r"?m:f,o=e.xAxisID=L(n.xAxisID,ji(t,"x")),a=e.yAxisID=L(n.yAxisID,ji(t,"y")),r=e.rAxisID=L(n.rAxisID,ji(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),h=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Tn(this._data,this),t._stacked&&re(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(O(e))this._data=Er(e);else if(n!==e){if(n){Tn(n,this);const s=this._cachedMeta;re(s),s._parsed=[]}e&&Object.isExtensible(e)&&wa(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,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=ds(e.vScale,e),e.stack!==n.stack&&(s=!0,re(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&fs(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:a}=n,r=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,d,u;if(this._parsing===!1)n._parsed=s,n._sorted=!0,u=s;else{B(s[t])?u=this.parseArrayData(n,s,t,e):O(s[t])?u=this.parseObjectData(n,s,t,e):u=this.parsePrimitiveData(n,s,t,e);const f=()=>d[r]===null||c&&d[r]<c[r];for(h=0;h<e;++h)n._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);n._sorted=l}a&&fs(this,u)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),h=o===a,d=new Array(s);let u,f,m;for(u=0,f=s;u<f;++u)m=u+n,d[u]={[r]:h||o.parse(c[m],m),[l]:a.parse(e[m],m)};return d}parseArrayData(t,e,n,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,h,d;for(l=0,c=s;l<c;++l)h=l+n,d=e[h],r[l]={x:o.parse(d[0],h),y:a.parse(d[1],h)};return r}parseObjectData(t,e,n,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,d,u,f;for(h=0,d=s;h<d;++h)u=h+n,f=e[u],c[h]={x:o.parse(vt(f,r),u),y:a.parse(vt(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:cs(s,!0),values:e._stacks[t.axis]._visualValues};return hs(r,a,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const o=n[e.axis];let a=o===null?NaN:o;const r=s&&n._stacks[e.axis];s&&r&&(s.values=r,a=hs(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,a=s.length,r=this._getOtherScale(t),l=Vr(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=zr(r);let u,f;function m(){f=s[u];const p=f[r.axis];return!N(f[t.axis])||h>p||d<p}for(u=0;u<a&&!(!m()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=a-1;u>=0;--u)if(!m()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,a;for(s=0,o=e.length;s<o;++s)a=e[s][t.axis],N(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Rr(L(this.options.clip,Ir(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,c=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const d=s[h];d.hidden||(d.active&&c?a.push(d):d.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=Nr(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Hr(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,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",n){const s=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&te(n);if(r)return gs(r,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(j.elements[t]),m=()=>this.getContext(n,s,e),p=c.resolveNamedOptions(u,f,m,d);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(gs(p,l))),p}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,n,e))}const c=new rs(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||$i(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:a}}updateElement(t,e,n,s){$i(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!$i(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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,n=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=n.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,n=!0){const s=this._cachedMeta,o=s.data,a=t+e;let r;const l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&re(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}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 n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}M(Mt,"defaults",{}),M(Mt,"datasetElementType",null),M(Mt,"dataElementType",null);function jr(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let n=[];for(let s=0,o=e.length;s<o;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=Ln(n.sort((s,o)=>s-o))}return i._cache.$bar}function $r(i){const t=i.iScale,e=jr(t,i.type);let n=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(te(r)&&(n=Math.min(n,Math.abs(a-r)||n)),r=a)};for(s=0,o=e.length;s<o;++s)a=t.getPixelForValue(e[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return n}function Yr(i,t,e,n){const s=e.barThickness;let o,a;return F(s)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=s*n,a=1),{chunk:o/n,ratio:a,start:t.pixels[i]-o/2}}function Ur(i,t,e,n){const s=t.pixels,o=s[i];let a=i>0?s[i-1]:null,r=i<s.length-1?s[i+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/n,ratio:e.barPercentage,start:c}}function Xr(i,t,e,n){const s=e.parse(i[0],n),o=e.parse(i[1],n),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}function ps(i,t,e,n){return B(i)?Xr(i,t,e,n):t[e.axis]=e.parse(i,n),t}function ms(i,t,e,n){const s=i.iScale,o=i.vScale,a=s.getLabels(),r=s===o,l=[];let c,h,d,u;for(c=e,h=e+n;c<h;++c)u=t[c],d={},d[s.axis]=r||s.parse(a[c],c),l.push(ps(u,d,o,c));return l}function Yi(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function qr(i,t,e){return i!==0?lt(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Gr(i){let t,e,n,s,o;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:n,reverse:t,top:s,bottom:o}}function Kr(i,t,e,n){let s=t.borderSkipped;const o={};if(!s){i.borderSkipped=o;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:h}=Gr(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=c:(e._bottom||0)===n?s=h:(o[bs(h,a,r,l)]=!0,s=c)),o[bs(s,a,r,l)]=!0,i.borderSkipped=o}function bs(i,t,e,n){return n?(i=Zr(i,t,e),i=ys(i,e,t)):i=ys(i,t,e),i}function Zr(i,t,e){return i===t?e:i===e?t:i}function ys(i,t,e){return i==="start"?t:i==="end"?e:i}function Qr(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class je extends Mt{parsePrimitiveData(t,e,n,s){return ms(t,e,n,s)}parseArrayData(t,e,n,s){return ms(t,e,n,s)}parseObjectData(t,e,n,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,h=a.axis==="x"?r:l,d=[];let u,f,m,p;for(u=n,f=n+s;u<f;++u)p=e[u],m={},m[o.axis]=o.parse(vt(p,c),u),d.push(ps(vt(p,h),m,a,u));return d}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);const o=n._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:s}=e,o=this.getParsed(t),a=o._custom,r=Yi(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,s);for(let f=e;f<e+n;f++){const m=this.getParsed(f),p=o||F(m[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),g=this._calculateBarIndexPixels(f,h),b=(m._stacks||{})[r.axis],y={horizontal:c,base:p.base,enableBorderRadius:!b||Yi(m._custom)||a===b._top||a===b._bottom,x:c?p.head:g.center,y:c?g.center:p.head,height:c?g.size:Math.abs(p.size),width:c?Math.abs(p.size):g.size};u&&(y.options=d||this.resolveDataElementOptions(f,t[f].active?"active":s));const _=y.options||t[f].options;Kr(y,_,b,a),Qr(y,_,h.ratio),this.updateElement(t[f],f,y,s)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=n.options.stacked,a=[],r=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(F(h)||isNaN(h))return!0};for(const l of s)if(!(e!==void 0&&r(l))&&((o===!1||a.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&a.push(l.stack),l.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const s=this._getStacks(t,n),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let o,a;for(o=0,a=e.data.length;o<a;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const r=t.barThickness;return{min:r||$r(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=Yi(c);let d=l[e.axis],u=0,f=n?this.applyStack(e,l,n):d,m,p;f!==d&&(u=f-d,f=d),h&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&<(d)!==lt(c.barEnd)&&(u=0),u+=d);const g=!F(o)&&!h?o:u;let b=e.getPixelForValue(g);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(u+f):m=b,p=m-b,Math.abs(p)<a){p=qr(p,e,r)*a,d===r&&(b-=p/2);const y=e.getPixelForDecimal(0),_=e.getPixelForDecimal(1),S=Math.min(y,_),x=Math.max(y,_);b=Math.max(Math.min(b,x),S),m=b+p,n&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(m)-e.getValueForPixel(b))}if(b===e.getPixelForValue(r)){const y=lt(p)*e.getLineWidthForValue(r)/2;b+=y,p-=y}return{size:p,base:b,head:m,center:m+p/2}}_calculateBarIndexPixels(t,e){const n=e.scale,s=this.options,o=s.skipNull,a=L(s.maxBarThickness,1/0);let r,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?Ur(t,e,s,c):Yr(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=h.start+h.chunk*d+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else r=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&n[o].draw(this._ctx)}}M(je,"id","bar"),M(je,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),M(je,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function Jr(i,t,e){let n=1,s=1,o=0,a=0;if(t<z){const r=i,l=r+t,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(_,S,x)=>ne(_,r,l,!0)?1:Math.max(S,S*e,x,x*e),m=(_,S,x)=>ne(_,r,l,!0)?-1:Math.min(S,S*e,x,x*e),p=f(0,c,d),g=f(V,h,u),b=m(H,c,d),y=m(H+V,h,u);n=(p-b)/2,s=(g-y)/2,o=-(p+b)/2,a=-(g+y)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:a}}class le extends Mt{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 n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(O(n[t])){const{key:l="value"}=this._parsing;o=c=>+vt(n[c],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return ct(this.options.rotation-90)}_getCircumference(){return ct(this.options.circumference)}_getRotationExtents(){let t=z,e=-z;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(n.width,n.height)-a)/2,0),l=Math.min(ha(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:m,offsetY:p}=Jr(d,h,l),g=(n.width-a)/u,b=(n.height-a)/f,y=Math.max(Math.min(g,b)/2,0),_=_n(this.options.radius,y),S=Math.max(_*l,0),x=(_-S)/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=p*_,s.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/z)}updateElements(t,e,n,s){const o=s==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,h=(r.left+r.right)/2,d=(r.top+r.bottom)/2,u=o&&c.animateScale,f=u?0:this.innerRadius,m=u?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(e,s);let b=this._getRotation(),y;for(y=0;y<e;++y)b+=this._circumference(y,o);for(y=e;y<e+n;++y){const _=this._circumference(y,o),S=t[y],x={x:h+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:m,innerRadius:f};g&&(x.options=p||this.resolveDataElementOptions(y,S.active?"active":s)),b+=_,this.updateElement(S,y,x,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?z*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Fe(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){a=n.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(L(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}M(le,"id","doughnut"),M(le,"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"}),M(le,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),M(le,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}});class $e extends Mt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=Pa(e,s,a);this._drawStart=r,this._drawCount=l,Aa(e)&&(r=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},t),this.updateElements(s,r,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s),u=a.axis,f=r.axis,{spanGaps:m,segment:p}=this.options,g=ie(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",y=e+n,_=t.length;let S=e>0&&this.getParsed(e-1);for(let x=0;x<_;++x){const P=t[x],k=b?P:{};if(x<e||x>=y){k.skip=!0;continue}const w=this.getParsed(x),C=F(w[f]),A=k[u]=a.getPixelForValue(w[u],x),D=k[f]=o||C?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,w,l):w[f],x);k.skip=isNaN(A)||isNaN(D)||C,k.stop=x>0&&Math.abs(w[u]-S[u])>g,p&&(k.parsed=w,k.raw=c.data[x]),d&&(k.options=h||this.resolveDataElementOptions(x,P.active?"active":s)),b||this.updateElement(P,x,k,s),S=w}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}M($e,"id","line"),M($e,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),M($e,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ye extends Mt{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return sr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(n.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(n,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=e;r<e+n;r++){const l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":s),h=o.getPointPositionForValue(r,this.getParsed(r).r),d=a?o.xCenter:h.x,u=a?o.yCenter:h.y,f={x:d,y:u,angle:h.angle,skip:isNaN(d)||isNaN(u),options:c};this.updateElement(l,r,f,s)}}}M(Ye,"id","radar"),M(Ye,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),M(Ye,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function Bt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ui{constructor(t){M(this,"options");this.options=t||{}}static override(t){Object.assign(Ui.prototype,t)}init(){}formats(){return Bt()}parse(){return Bt()}format(){return Bt()}add(){return Bt()}diff(){return Bt()}startOf(){return Bt()}endOf(){return Bt()}}var tl={_date:Ui};function el(i,t,e,n){const{controller:s,data:o,_sorted:a}=i,r=s._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const l=r._reversePixels?Sa:Dt;if(n){if(s._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function ce(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:h}=o[r],{lo:d,hi:u}=el(o[r],t,a,s);for(let f=d;f<=u;++f){const m=h[f];m.skip||n(m,c,f)}}}function il(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const o=t?Math.abs(n.x-s.x):0,a=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Xi(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||ce(i,e,t,function(r,l,c){!s&&!pt(r,i.chartArea,0)||r.inRange(t.x,t.y,n)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function nl(i,t,e,n){let s=[];function o(a,r,l){const{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],n),{angle:d}=An(a,{x:t.x,y:t.y});ne(d,c,h)&&s.push({element:a,datasetIndex:r,index:l})}return ce(i,e,t,o),s}function sl(i,t,e,n,s,o){let a=[];const r=il(e);let l=Number.POSITIVE_INFINITY;function c(h,d,u){const f=h.inRange(t.x,t.y,s);if(n&&!f)return;const m=h.getCenterPoint(s);if(!(!!o||i.isPointInArea(m))&&!f)return;const g=r(t,m);g<l?(a=[{element:h,datasetIndex:d,index:u}],l=g):g===l&&a.push({element:h,datasetIndex:d,index:u})}return ce(i,e,t,c),a}function qi(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?nl(i,t,e,s):sl(i,t,e,n,s,o)}function xs(i,t,e,n,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return ce(i,e,t,(l,c,h)=>{l[a](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,s))}),n&&!r?[]:o}var ol={evaluateInteractionItems:ce,modes:{index(i,t,e,n){const s=Rt(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?Xi(i,s,o,n,a):qi(i,s,o,!1,n,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=r[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=Rt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?Xi(i,s,o,n,a):qi(i,s,o,!1,n,a);if(r.length>0){const l=r[0].datasetIndex,c=i.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h})}return r},point(i,t,e,n){const s=Rt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return Xi(i,s,o,n,a)},nearest(i,t,e,n){const s=Rt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return qi(i,s,o,e.intersect,n,a)},x(i,t,e,n){const s=Rt(t,i);return xs(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=Rt(t,i);return xs(i,s,"y",e.intersect,n)}}};const _s=["left","top","right","bottom"];function he(i,t){return i.filter(e=>e.pos===t)}function vs(i,t){return i.filter(e=>_s.indexOf(e.pos)===-1&&e.box.axis===t)}function de(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function al(i){const t=[];let e,n,s,o,a,r;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function rl(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!_s.includes(s))continue;const a=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function ll(i,t){const e=rl(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];const{fullSize:l}=r.box,c=e[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*n:l&&t.availableWidth,r.height=s):(r.width=n,r.height=h?h*s:l&&t.availableHeight)}return e}function cl(i){const t=al(i),e=de(t.filter(c=>c.box.fullSize),!0),n=de(he(t,"left"),!0),s=de(he(t,"right")),o=de(he(t,"top"),!0),a=de(he(t,"bottom")),r=vs(t,"x"),l=vs(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:he(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function Ss(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function ks(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 hl(i,t,e,n){const{pos:s,box:o}=e,a=i.maxPadding;if(!O(s)){e.size&&(i[s]-=e.size);const d=n[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[s]+=e.size}o.getPadding&&ks(a,o.getPadding());const r=Math.max(0,t.outerWidth-Ss(a,i,"left","right")),l=Math.max(0,t.outerHeight-Ss(a,i,"top","bottom")),c=r!==i.w,h=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function dl(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function ul(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return n(i?["left","right"]:["top","bottom"])}function ue(i,t,e,n){const s=[];let o,a,r,l,c,h;for(o=0,a=i.length,c=0;o<a;++o){r=i[o],l=r.box,l.update(r.width||t.w,r.height||t.h,ul(r.horizontal,t));const{same:d,other:u}=hl(t,e,r,n);c|=d&&s.length,h=h||u,l.fullSize||s.push(r)}return c&&ue(s,t,e,n)||h}function Ue(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function ws(i,t,e,n){const s=e.padding;let{x:o,y:a}=t;for(const r of i){const l=r.box,c=n[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){const d=t.w*h,u=c.size||l.height;te(c.start)&&(a=c.start),l.fullSize?Ue(l,s.left,a,e.outerWidth-s.right-s.left,u):Ue(l,t.left+c.placed,a,d,u),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*h,u=c.size||l.width;te(c.start)&&(o=c.start),l.fullSize?Ue(l,o,s.top,u,e.outerHeight-s.bottom-s.top):Ue(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var st={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,n){if(!i)return;const s=K(i.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=cl(i.boxes),l=r.vertical,c=r.horizontal;I(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,g)=>g.box.options&&g.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},s);ks(u,K(n));const f=Object.assign({maxPadding:u,w:o,h:a,x:s.left,y:s.top},s),m=ll(l.concat(c),d);ue(r.fullSize,f,d,m),ue(l,f,d,m),ue(c,f,d,m)&&ue(l,f,d,m),dl(f),ws(r.leftAndTop,f,d,m),f.x+=f.w,f.y+=f.h,ws(r.rightAndBottom,f,d,m),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},I(r.chartArea,p=>{const g=p.box;Object.assign(g,i.chartArea),g.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Ms{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class fl extends Ms{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Xe="$chartjs",gl={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Cs=i=>i===null||i==="";function pl(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Xe]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Cs(s)){const o=Zn(i,"width");o!==void 0&&(i.width=o)}if(Cs(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Zn(i,"height");o!==void 0&&(i.height=o)}return i}const Ps=yr?{passive:!0}:!1;function ml(i,t,e){i.addEventListener(t,e,Ps)}function bl(i,t,e){i.canvas.removeEventListener(t,e,Ps)}function yl(i,t){const e=gl[i.type]||i.type,{x:n,y:s}=Rt(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function qe(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function xl(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||qe(r.addedNodes,n),a=a&&!qe(r.removedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function _l(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||qe(r.removedNodes,n),a=a&&!qe(r.addedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const fe=new Map;let As=0;function Ds(){const i=window.devicePixelRatio;i!==As&&(As=i,fe.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function vl(i,t){fe.size||window.addEventListener("resize",Ds),fe.set(i,t)}function Sl(i){fe.delete(i),fe.size||window.removeEventListener("resize",Ds)}function kl(i,t,e){const n=i.canvas,s=n&&Vi(n);if(!s)return;const o=Fn((r,l)=>{const c=s.clientWidth;e(r,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(s),vl(i,o),a}function Gi(i,t,e){e&&e.disconnect(),t==="resize"&&Sl(i)}function wl(i,t,e){const n=i.canvas,s=Fn(o=>{i.ctx!==null&&e(yl(o,i))},i);return ml(n,t,s),s}class Ml extends Ms{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(pl(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Xe])return!1;const n=e[Xe].initial;["height","width"].forEach(o=>{const a=n[o];F(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Xe],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:xl,detach:_l,resize:kl}[e]||wl;s[e]=a(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:Gi,detach:Gi,resize:Gi}[e]||bl)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return br(t,e,n,s)}isAttached(t){const e=Vi(t);return!!(e&&e.isConnected)}}function Cl(i){return!Gn()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?fl:Ml}class at{constructor(){M(this,"x");M(this,"y");M(this,"active",!1);M(this,"options");M(this,"$animations")}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return ie(this.x)&&ie(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}M(at,"defaults",{}),M(at,"defaultRoutes");function Pl(i,t){const e=i.options.ticks,n=Al(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?Tl(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return Ll(t,c,o,a/s),c;const h=Dl(o,t,s);if(a>0){let d,u;const f=a>1?Math.round((l-r)/(a-1)):null;for(Ge(t,c,h,F(f)?0:r-f,r),d=0,u=a-1;d<u;d++)Ge(t,c,h,o[d],o[d+1]);return Ge(t,c,h,l,F(f)?t.length:l+f),c}return Ge(t,c,h),c}function Al(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function Dl(i,t,e){const n=Ol(i),s=t.length/e;if(!n)return Math.max(s,1);const o=ya(n);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function Tl(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function Ll(i,t,e,n){let s=0,o=e[0],a;for(n=Math.ceil(n),a=0;a<i.length;a++)a===o&&(t.push(i[a]),s++,o=e[s*n])}function Ge(i,t,e,n,s){const o=L(n,0),a=Math.min(L(s,i.length),i.length);let r=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),h=o;h<0;)r++,h=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===h&&(t.push(i[c]),r++,h=Math.round(o+r*e))}function Ol(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const Fl=i=>i==="left"?"right":i==="right"?"left":i,Ts=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Ls=(i,t)=>Math.min(t||i,i);function Os(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function Il(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,a=i._endPixel,r=1e-6;let l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-o,a-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-r||l>a+r)))return l}function Rl(i,t){I(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function ge(i){return i.drawTicks?i.tickLength:0}function Fs(i,t){if(!i.display)return 0;const e=U(i.font,t),n=K(i.padding);return(B(i.text)?i.text.length:1)*e.lineHeight+n.height}function El(i,t){return wt(i,{scale:t,type:"scale"})}function Bl(i,t,e){return wt(i,{tick:e,index:t,type:"tick"})}function zl(i,t,e){let n=Oi(i);return(e&&t!=="right"||!e&&t==="right")&&(n=Fl(n)),n}function Wl(i,t,e,n){const{top:s,left:o,bottom:a,right:r,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,u,f,m;const p=a-s,g=r-o;if(i.isHorizontal()){if(f=G(n,o,r),O(e)){const b=Object.keys(e)[0],y=e[b];m=h[b].getPixelForValue(y)+p-t}else e==="center"?m=(c.bottom+c.top)/2+p-t:m=Ts(i,e,t);u=r-o}else{if(O(e)){const b=Object.keys(e)[0],y=e[b];f=h[b].getPixelForValue(y)-g+t}else e==="center"?f=(c.left+c.right)/2-g+t:f=Ts(i,e,t);m=G(n,a,s),d=e==="left"?-V:V}return{titleX:f,titleY:m,maxWidth:u,rotation:d}}class zt extends at{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:n,_suggestedMax:s}=this;return t=et(t,Number.POSITIVE_INFINITY),e=et(e,Number.NEGATIVE_INFINITY),n=et(n,Number.POSITIVE_INFINITY),s=et(s,Number.NEGATIVE_INFINITY),{min:et(t,n),max:et(e,s),minDefined:N(t),maxDefined:N(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:e,max:n};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),o||(n=Math.max(n,a.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:et(e,et(n,e)),max:et(n,et(e,n))}}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(){E(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=qa(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?Os(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Pl(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,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){E(this.options.afterUpdate,[this])}beforeSetDimensions(){E(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(){E(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),E(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){E(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=E(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){E(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){E(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=Ls(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,l,c;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=q(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/n:f/(n-1),d+6>r&&(r=f/(n-(t.offset?.5:1)),l=this.maxHeight-ge(t.grid)-e.padding-Fs(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),a=Di(Math.min(Math.asin(q((h.highest.height+6)/r,-1,1)),Math.asin(q(l/c,-1,1))-Math.asin(q(u/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){E(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){E(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Fs(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=ge(o)+l):(t.height=this.maxHeight,t.width=ge(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=n.padding*2,m=ct(this.labelRotation),p=Math.cos(m),g=Math.sin(m);if(r){const b=n.mirror?0:g*d.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=n.mirror?0:p*d.width+g*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,g,p)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=s*t.width,f=n*e.height):(u=n*t.height,f=s*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+a)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+a,this.paddingBottom=d+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){E(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,n;for(e=0,n=t.length;e<n;e++)F(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=Os(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Ls(e,n));let c=0,h=0,d,u,f,m,p,g,b,y,_,S,x;for(d=0;d<e;d+=l){if(m=t[d].label,p=this._resolveTickFontOptions(d),s.font=g=p.string,b=o[g]=o[g]||{data:{},gc:[]},y=p.lineHeight,_=S=0,!F(m)&&!B(m))_=Re(s,b.data,b.gc,_,m),S=y;else if(B(m))for(u=0,f=m.length;u<f;++u)x=m[u],!F(x)&&!B(x)&&(_=Re(s,b.data,b.gc,_,x),S+=y);a.push(_),r.push(S),c=Math.max(_,c),h=Math.max(S,h)}Rl(o,e);const P=a.indexOf(c),k=r.indexOf(h),w=C=>({width:a[C]||0,height:r[C]||0});return{first:w(0),last:w(e-1),widest:w(P),highest:w(k),widths:a,heights:r}}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 va(this._alignToPixels?Lt(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 n=e[t];return n.$context||(n.$context=Bl(this.getContext(),t,n))}return this.$context||(this.$context=El(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ct(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*n>r*s?r/n:l/s:l*s<r*n?l/n:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=ge(o),f=[],m=r.setContext(this.getContext()),p=m.display?m.width:0,g=p/2,b=function(W){return Lt(n,W,p)};let y,_,S,x,P,k,w,C,A,D,T,$;if(a==="top")y=b(this.bottom),k=this.bottom-u,C=y-g,D=b(t.top)+g,$=t.bottom;else if(a==="bottom")y=b(this.top),D=t.top,$=b(t.bottom)-g,k=y+g,C=this.top+u;else if(a==="left")y=b(this.right),P=this.right-u,w=y-g,A=b(t.left)+g,T=t.right;else if(a==="right")y=b(this.left),A=t.left,T=b(t.right)-g,P=y+g,w=this.left+u;else if(e==="x"){if(a==="center")y=b((t.top+t.bottom)/2+.5);else if(O(a)){const W=Object.keys(a)[0],Y=a[W];y=b(this.chart.scales[W].getPixelForValue(Y))}D=t.top,$=t.bottom,k=y+g,C=k+u}else if(e==="y"){if(a==="center")y=b((t.left+t.right)/2);else if(O(a)){const W=Object.keys(a)[0],Y=a[W];y=b(this.chart.scales[W].getPixelForValue(Y))}P=y-g,w=P-u,A=t.left,T=t.right}const Q=L(s.ticks.maxTicksLimit,d),R=Math.max(1,Math.ceil(d/Q));for(_=0;_<d;_+=R){const W=this.getContext(_),Y=o.setContext(W),rt=r.setContext(W),Z=Y.lineWidth,qt=Y.color,Si=rt.dash||[],Gt=rt.dashOffset,Se=Y.tickWidth,ke=Y.tickColor,we=Y.tickBorderDash||[],Me=Y.tickBorderDashOffset;S=Il(this,_,l),S!==void 0&&(x=Lt(n,S,Z),c?P=w=A=T=x:k=C=D=$=x,f.push({tx1:P,ty1:k,tx2:w,ty2:C,x1:A,y1:D,x2:T,y2:$,width:Z,color:qt,borderDash:Si,borderDashOffset:Gt,tickWidth:Se,tickColor:ke,tickBorderDash:we,tickBorderDashOffset:Me}))}return this._ticksLength=d,this._borderValue=y,f}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:o}=n,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=ge(n.grid),f=u+h,m=d?-h:f,p=-ct(this.labelRotation),g=[];let b,y,_,S,x,P,k,w,C,A,D,T,$="middle";if(s==="top")P=this.bottom-m,k=this._getXAxisLabelAlignment();else if(s==="bottom")P=this.top+m,k=this._getXAxisLabelAlignment();else if(s==="left"){const R=this._getYAxisLabelAlignment(u);k=R.textAlign,x=R.x}else if(s==="right"){const R=this._getYAxisLabelAlignment(u);k=R.textAlign,x=R.x}else if(e==="x"){if(s==="center")P=(t.top+t.bottom)/2+f;else if(O(s)){const R=Object.keys(s)[0],W=s[R];P=this.chart.scales[R].getPixelForValue(W)+f}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")x=(t.left+t.right)/2-f;else if(O(s)){const R=Object.keys(s)[0],W=s[R];x=this.chart.scales[R].getPixelForValue(W)}k=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?$="top":l==="end"&&($="bottom"));const Q=this._getLabelSizes();for(b=0,y=r.length;b<y;++b){_=r[b],S=_.label;const R=o.setContext(this.getContext(b));w=this.getPixelForTick(b)+o.labelOffset,C=this._resolveTickFontOptions(b),A=C.lineHeight,D=B(S)?S.length:1;const W=D/2,Y=R.color,rt=R.textStrokeColor,Z=R.textStrokeWidth;let qt=k;a?(x=w,k==="inner"&&(b===y-1?qt=this.options.reverse?"left":"right":b===0?qt=this.options.reverse?"right":"left":qt="center"),s==="top"?c==="near"||p!==0?T=-D*A+A/2:c==="center"?T=-Q.highest.height/2-W*A+A:T=-Q.highest.height+A/2:c==="near"||p!==0?T=A/2:c==="center"?T=Q.highest.height/2-W*A:T=Q.highest.height-D*A,d&&(T*=-1),p!==0&&!R.showLabelBackdrop&&(x+=A/2*Math.sin(p))):(P=w,T=(1-D)*A/2);let Si;if(R.showLabelBackdrop){const Gt=K(R.backdropPadding),Se=Q.heights[b],ke=Q.widths[b];let we=T-Gt.top,Me=0-Gt.left;switch($){case"middle":we-=Se/2;break;case"bottom":we-=Se;break}switch(k){case"center":Me-=ke/2;break;case"right":Me-=ke;break}Si={left:Me,top:we,width:ke+Gt.width,height:Se+Gt.height,color:R.backdropColor}}g.push({label:S,font:C,textOffset:T,options:{rotation:p,color:Y,strokeColor:rt,strokeWidth:Z,textAlign:qt,textBaseline:$,translation:[x,P],backdrop:Si}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ct(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,h;return e==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;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:n,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,a=s.length;o<a;++o){const l=s[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),a=n.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,u;this.isHorizontal()?(c=Lt(t,this.left,a)-a/2,h=Lt(t,this.right,r)+r/2,d=u=l):(d=Lt(t,this.top,a)-a/2,u=Lt(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&Ee(n,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,h=a.textOffset;Ot(n,c,0,h,l,r)}s&&Be(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=U(n.font),a=K(n.padding),r=n.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||O(e)?(l+=a.bottom,B(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=Wl(this,l,e,r);Ot(t,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:u,textAlign:zl(r,e,s),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,n=L(t.grid&&t.grid.z,-1),s=L(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==zt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[n]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return U(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ke{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,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 n;Vl(e)&&(n=this.register(e));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Hl(t,a,n),this.override&&j.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in j[s]&&(delete j[s][n],this.override&&delete Tt[n])}}function Hl(i,t,e){const n=Qt(Object.create(null),[e?j.get(e):{},j.get(t),i.defaults]);j.set(t,n),i.defaultRoutes&&Nl(t,i.defaultRoutes),i.descriptors&&j.describe(t,i.descriptors)}function Nl(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");j.route(o,s,l,r)})}function Vl(i){return"id"in i&&"defaults"in i}class jl{constructor(){this.controllers=new Ke(Mt,"datasets",!0),this.elements=new Ke(at,"elements"),this.plugins=new Ke(Object,"plugins"),this.scales=new Ke(zt,"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,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):I(s,a=>{const r=n||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,n){const s=Ai(t);E(n["before"+s],[],n),e[t](n),E(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var ht=new jl;class $l{constructor(){this._init=[]}notify(t,e,n,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,n,s){s=s||{};for(const o of t){const a=o.plugin,r=a[n],l=[e,s,o.options];if(E(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){F(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 n=t&&t.config,s=L(n.options&&n.options.plugins,{}),o=Yl(n);return s===!1&&!e?[]:Xl(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function Yl(i){const t={},e=[],n=Object.keys(ht.plugins.items);for(let o=0;o<n.length;o++)e.push(ht.getPlugin(n[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Ul(i,t){return!t&&i===!1?null:i===!0?{}:i}function Xl(i,{plugins:t,localIds:e},n,s){const o=[],a=i.getContext();for(const r of t){const l=r.id,c=Ul(n[l],s);c!==null&&o.push({plugin:r,options:ql(i.config,{plugin:r,local:e[l]},c,a)})}return o}function ql(i,{plugin:t,local:e},n,s){const o=i.pluginScopeKeys(t),a=i.getOptionScopes(n,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ki(i,t){const e=j.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Gl(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Kl(i,t){return i===t?"_index_":"_value_"}function Is(i){if(i==="x"||i==="y"||i==="r")return i}function Zl(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function Zi(i,...t){if(Is(i))return i;for(const e of t){const n=e.axis||Zl(e.position)||i.length>1&&Is(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Rs(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Ql(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return Rs(i,"x",e[0])||Rs(i,"y",e[0])}return{}}function Jl(i,t){const e=Tt[i.type]||{scales:{}},n=t.scales||{},s=Ki(i.type,t),o=Object.create(null);return Object.keys(n).forEach(a=>{const r=n[a];if(!O(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=Zi(a,r,Ql(a,i),j.scales[r.type]),c=Kl(l,s),h=e.scales||{};o[a]=Jt(Object.create(null),[{axis:l},r,h[l],h[c]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,l=a.indexAxis||Ki(r,t),h=(Tt[r]||{}).scales||{};Object.keys(h).forEach(d=>{const u=Gl(d,l),f=a[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),Jt(o[f],[{axis:u},n[f],h[d]])})}),Object.keys(o).forEach(a=>{const r=o[a];Jt(r,[j.scales[r.type],j.scale])}),o}function Es(i){const t=i.options||(i.options={});t.plugins=L(t.plugins,{}),t.scales=Jl(i,t)}function Bs(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function tc(i){return i=i||{},i.data=Bs(i.data),Es(i),i}const zs=new Map,Ws=new Set;function Ze(i,t){let e=zs.get(i);return e||(e=t(),zs.set(i,e),Ws.add(e)),e}const pe=(i,t,e)=>{const n=vt(t,e);n!==void 0&&i.add(n)};class ec{constructor(t){this._config=tc(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=Bs(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(),Es(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ze(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ze(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ze(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return Ze(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,a=this._cachedScopes(t,n),r=a.get(e);if(r)return r;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>pe(l,t,d))),h.forEach(d=>pe(l,s,d)),h.forEach(d=>pe(l,Tt[o]||{},d)),h.forEach(d=>pe(l,j,d)),h.forEach(d=>pe(l,Ri,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ws.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Tt[e]||{},j.datasets[e]||{},{type:e},j,Ri]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Hs(this._resolverCache,t,s);let l=a;if(nc(a,e)){o.$shared=!1,n=St(n)?n():n;const c=this.createResolver(t,n,r);l=jt(a,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=Hs(this._resolverCache,t,n);return O(e)?jt(o,e,void 0,s):o}}function Hs(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:Wi(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},n.set(s,o)),o}const ic=i=>O(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||St(i[e]),!1);function nc(i,t){const{isScriptable:e,isIndexable:n}=Vn(i);for(const s of t){const o=e(s),a=n(s),r=(a||o)&&i[s];if(o&&(St(r)||ic(r))||a&&B(r))return!0}return!1}var sc="4.3.3";const oc=["top","bottom","left","right","chartArea"];function Ns(i,t){return i==="top"||i==="bottom"||oc.indexOf(i)===-1&&t==="x"}function Vs(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function js(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),E(e&&e.onComplete,[i],t)}function ac(i){const t=i.chart,e=t.options.animation;E(e&&e.onProgress,[i],t)}function $s(i){return Gn()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Qe={},Ys=i=>{const t=$s(i);return Object.values(Qe).filter(e=>e.canvas===t).pop()};function rc(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const a=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=a)}}}function lc(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}function cc(i){const{xScale:t,yScale:e}=i;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}let Wt=(Pt=class{static register(...t){ht.add(...t),Us()}static unregister(...t){ht.remove(...t),Us()}constructor(t,e){const n=this.config=new ec(e),s=$s(t),o=Ys(s);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 a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Cl(s)),this.platform.updateConfig(n);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;if(this.id=ca(),this.ctx=r,this.canvas=l,this.width=h,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new $l,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ma(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],Qe[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}mt.listen(this,"complete",js),mt.listen(this,"progress",ac),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return F(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ht}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Kn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Wn(this.canvas,this.ctx),this}stop(){return mt.stop(this),this}resize(t,e){mt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,o),r=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Kn(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),E(n.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};I(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=Zi(a,r),c=l==="r",h=l==="x";return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),I(o,a=>{const r=a.options,l=r.id,c=Zi(l,r),h=L(r.type,a.dtype);(r.position===void 0||Ns(r.position,c)!==Ns(a.dposition))&&(r.position=a.dposition),s[l]=!0;let d=null;if(l in n&&n[l].type===h)d=n[l];else{const u=ht.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(r,t)}),I(s,(a,r)=>{a||delete n[r]}),I(n,a=>{st.configure(this,a,a.options),st.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(Vs("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const o=e[n];let a=this.getDatasetMeta(n);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=r,a.indexAxis=o.indexAxis||Ki(r,this.options),a.order=o.order||0,a.index=n,a.label=""+o.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{const l=ht.getController(r),{datasetElementType:c,dataElementType:h}=j.datasets[r];Object.assign(l,{dataElementType:ht.getElement(h),datasetElementType:c&&ht.getElement(c)}),a.controller=new l(this,n),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){I(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.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 a=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),u=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),s||I(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Vs("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){I(this.scales,t=>{st.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!kn(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const a=n==="_removeElements"?-o:o;rc(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!kn(s,n(o)))return;return Array.from(s).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;st.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],I(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,St(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(mt.has(this)?this.attached&&!mt.running(this)&&mt.start(this):(this.draw(),js({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resize(n,s),this._resizeBeforeDraw=null}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,n=[];let s,o;for(s=0,o=e.length;s<o;++s){const a=e[s];(!t||a.visible)&&n.push(a)}return n}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,n=t._clip,s=!n.disabled,o=cc(t)||this.chartArea,a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&Ee(e,{left:n.left===!1?0:o.left-n.left,right:n.right===!1?this.width:o.right+n.right,top:n.top===!1?0:o.top-n.top,bottom:n.bottom===!1?this.height:o.bottom+n.bottom}),t.controller.draw(),s&&Be(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return pt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=ol.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=wt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);te(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(o,{visible:n}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),mt.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(),Wn(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Qe[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,n=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};I(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),n("resize",o),n("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){I(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},I(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!De(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),a=o(e,t),r=n?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,a=e,r=this._getActiveElements(t,s,n,a),l=pa(t),c=lc(t,this._lastEvent,n,l);n&&(this._lastEvent=null,E(o.onHover,[t,r,this],this),l&&E(o.onClick,[t,r,this],this));const h=!De(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}},M(Pt,"defaults",j),M(Pt,"instances",Qe),M(Pt,"overrides",Tt),M(Pt,"registry",ht),M(Pt,"version",sc),M(Pt,"getChart",Ys),Pt);function Us(){return I(Wt.instances,i=>i._plugins.invalidate())}function hc(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;i.beginPath(),i.arc(o,a,r,n-c,e+c),l>s?(c=s/l,i.arc(o,a,l,e+c,n-c,!0)):i.arc(o,a,s,e+V,n-V),i.closePath(),i.clip()}function dc(i){return zi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function uc(i,t,e,n){const s=dc(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,n*t/2),r=l=>{const c=(e-Math.min(o,l))*n/2;return q(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:q(s.innerStart,0,a),innerEnd:q(s.innerEnd,0,a)}}function Ut(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Je(i,t,e,n,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+n+e-c,0),u=h>0?h+n+e+c:0;let f=0;const m=s-l;if(n){const R=h>0?h-n:0,W=d>0?d-n:0,Y=(R+W)/2,rt=Y!==0?m*Y/(Y+n):m;f=(m-rt)/2}const p=Math.max(.001,m*d-e/H)/d,g=(m-p)/2,b=l+g+f,y=s-g-f,{outerStart:_,outerEnd:S,innerStart:x,innerEnd:P}=uc(t,u,d,y-b),k=d-_,w=d-S,C=b+_/k,A=y-S/w,D=u+x,T=u+P,$=b+x/D,Q=y-P/T;if(i.beginPath(),o){const R=(C+A)/2;if(i.arc(a,r,d,C,R),i.arc(a,r,d,R,A),S>0){const Z=Ut(w,A,a,r);i.arc(Z.x,Z.y,S,A,y+V)}const W=Ut(T,y,a,r);if(i.lineTo(W.x,W.y),P>0){const Z=Ut(T,Q,a,r);i.arc(Z.x,Z.y,P,y+V,Q+Math.PI)}const Y=(y-P/u+(b+x/u))/2;if(i.arc(a,r,u,y-P/u,Y,!0),i.arc(a,r,u,Y,b+x/u,!0),x>0){const Z=Ut(D,$,a,r);i.arc(Z.x,Z.y,x,$+Math.PI,b-V)}const rt=Ut(k,b,a,r);if(i.lineTo(rt.x,rt.y),_>0){const Z=Ut(k,C,a,r);i.arc(Z.x,Z.y,_,b-V,C)}}else{i.moveTo(a,r);const R=Math.cos(C)*d+a,W=Math.sin(C)*d+r;i.lineTo(R,W);const Y=Math.cos(A)*d+a,rt=Math.sin(A)*d+r;i.lineTo(Y,rt)}i.closePath()}function fc(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){Je(i,t,e,n,l,s);for(let c=0;c<o;++c)i.fill();isNaN(r)||(l=a+(r%z||z))}return Je(i,t,e,n,l,s),i.fill(),l}function gc(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u}=l,f=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=u,f?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let m=t.endAngle;if(o){Je(i,t,e,n,m,s);for(let p=0;p<o;++p)i.stroke();isNaN(r)||(m=a+(r%z||z))}f&&hc(i,t,m),o||(Je(i,t,e,n,m,s),i.stroke())}class me extends at{constructor(e){super();M(this,"circumference");M(this,"endAngle");M(this,"fullCircles");M(this,"innerRadius");M(this,"outerRadius");M(this,"pixelMargin");M(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,n,s){const o=this.getProps(["x","y"],s),{angle:a,distance:r}=An(o,{x:e,y:n}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,p=L(u,c-l)>=z||ne(a,l,c),g=gt(r,h+f,d+f);return p&&g}getCenterPoint(e){const{x:n,y:s,startAngle:o,endAngle:a,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,d=(o+a)/2,u=(r+l+h+c)/2;return{x:n+Math.cos(d)*u,y:s+Math.sin(d)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:s}=this,o=(n.offset||0)/4,a=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>z?Math.floor(s/z):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(H,s||0)),h=o*c;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,fc(e,this,h,a,r),gc(e,this,h,a,r),e.restore()}}M(me,"id","arc"),M(me,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),M(me,"defaultRoutes",{backgroundColor:"backgroundColor"}),M(me,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Xs(i,t,e=t){i.lineCap=L(e.borderCapStyle,t.borderCapStyle),i.setLineDash(L(e.borderDash,t.borderDash)),i.lineDashOffset=L(e.borderDashOffset,t.borderDashOffset),i.lineJoin=L(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=L(e.borderWidth,t.borderWidth),i.strokeStyle=L(e.borderColor,t.borderColor)}function pc(i,t,e){i.lineTo(e.x,e.y)}function mc(i){return i.stepped?Wa:i.tension||i.cubicInterpolationMode==="monotone"?Ha:pc}function qs(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function bc(i,t,e,n){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=qs(s,e,n),h=mc(o);let{move:d=!0,reverse:u}=n||{},f,m,p;for(f=0;f<=c;++f)m=s[(r+(u?c-f:f))%a],!m.skip&&(d?(i.moveTo(m.x,m.y),d=!1):h(i,p,m,u,o.stepped),p=m);return l&&(m=s[(r+(u?c:0))%a],h(i,p,m,u,o.stepped)),!!l}function yc(i,t,e,n){const s=t.points,{count:o,start:a,ilen:r}=qs(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,d=0,u,f,m,p,g,b;const y=S=>(a+(c?r-S:S))%o,_=()=>{p!==g&&(i.lineTo(h,g),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(f=s[y(0)],i.moveTo(f.x,f.y)),u=0;u<=r;++u){if(f=s[y(u)],f.skip)continue;const S=f.x,x=f.y,P=S|0;P===m?(x<p?p=x:x>g&&(g=x),h=(d*h+S)/++d):(_(),i.lineTo(S,x),m=P,d=0,p=g=x),b=x}_()}function Qi(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?yc:bc}function xc(i){return i.stepped?xr:i.tension||i.cubicInterpolationMode==="monotone"?_r:Et}function _c(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),Xs(i,t.options),i.stroke(s)}function vc(i,t,e,n){const{segments:s,options:o}=t,a=Qi(t);for(const r of s)Xs(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const Sc=typeof Path2D=="function";function kc(i,t,e,n){Sc&&!t.options.segment?_c(i,t,e,n):vc(i,t,e,n)}class bt extends at{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;dr(this._points,n,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Cr(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,a=ns(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=xc(n);let c,h;for(c=0,h=a.length;c<h;++c){const{start:d,end:u}=a[c],f=o[d],m=o[u];if(f===m){r.push(f);continue}const p=Math.abs((s-f[e])/(m[e]-f[e])),g=l(f,m,p,n.stepped);g[e]=t[e],r.push(g)}return r.length===1?r[0]:r}pathSegment(t,e,n){return Qi(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=Qi(this);let a=this._loop;e=e||0,n=n||this.points.length-e;for(const r of s)a&=o(t,this,r,{start:e,end:e+n-1});return!!a}draw(t,e,n,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),kc(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}M(bt,"id","line"),M(bt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),M(bt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),M(bt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Gs(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class be extends at{constructor(e){super();M(this,"parsed");M(this,"skip");M(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,n,s){const o=this.options,{x:a,y:r}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(n-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,n){return Gs(this,e,"x",n)}inYRange(e,n){return Gs(this,e,"y",n)}getCenterPoint(e){const{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}size(e){e=e||this.options||{};let n=e.radius||0;n=Math.max(n,n&&e.hoverRadius||0);const s=n&&e.borderWidth||0;return(n+s)*2}draw(e,n){const s=this.options;this.skip||s.radius<.1||!pt(this,n,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Bi(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}M(be,"id","point"),M(be,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),M(be,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ks(i,t){const{x:e,y:n,base:s,width:o,height:a}=i.getProps(["x","y","base","width","height"],t);let r,l,c,h,d;return i.horizontal?(d=a/2,r=Math.min(e,s),l=Math.max(e,s),c=n-d,h=n+d):(d=o/2,r=e-d,l=e+d,c=Math.min(n,s),h=Math.max(n,s)),{left:r,top:c,right:l,bottom:h}}function Ct(i,t,e,n){return i?0:q(t,e,n)}function wc(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,o=Nn(n);return{t:Ct(s.top,o.top,0,e),r:Ct(s.right,o.right,0,t),b:Ct(s.bottom,o.bottom,0,e),l:Ct(s.left,o.left,0,t)}}function Mc(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,o=Ft(s),a=Math.min(t,e),r=i.borderSkipped,l=n||O(s);return{topLeft:Ct(!l||r.top||r.left,o.topLeft,0,a),topRight:Ct(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Ct(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Ct(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Cc(i){const t=Ks(i),e=t.right-t.left,n=t.bottom-t.top,s=wc(i,e/2,n/2),o=Mc(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Ji(i,t,e,n){const s=t===null,o=e===null,r=i&&!(s&&o)&&Ks(i,n);return r&&(s||gt(t,r.left,r.right))&&(o||gt(e,r.top,r.bottom))}function Pc(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Ac(i,t){i.rect(t.x,t.y,t.w,t.h)}function tn(i,t,e={}){const n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-n,a=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+o,h:i.h+a,radius:i.radius}}class ti extends at{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:n,backgroundColor:s}}=this,{inner:o,outer:a}=Cc(this),r=Pc(a.radius)?ae:Ac;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,tn(a,e,o)),t.clip(),r(t,tn(o,-e,a)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),r(t,tn(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return Ji(this,t,e,n)}inXRange(t,e){return Ji(this,t,null,e)}inYRange(t,e){return Ji(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}M(ti,"id","bar"),M(ti,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),M(ti,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Dc(i,t,e){const n=i.segments,s=i.points,o=t.points,a=[];for(const r of n){let{start:l,end:c}=r;c=nn(l,c,s);const h=en(e,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:h,start:s[l],end:s[c]});continue}const d=ns(t,h);for(const u of d){const f=en(e,o[u.start],o[u.end],u.loop),m=is(r,s,f);for(const p of m)a.push({source:p,target:u,start:{[e]:Zs(h,f,"start",Math.max)},end:{[e]:Zs(h,f,"end",Math.min)}})}}return a}function en(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=it(s),o=it(o)),{property:i,start:s,end:o}}function Tc(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=nn(a,r,s);const l=s[a],c=s[r];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function nn(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function Zs(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function Qs(i,t){let e=[],n=!1;return B(i)?(n=!0,e=i):e=Tc(i,t),e.length?new bt({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function Js(i){return i&&i.fill!==!1}function Lc(i,t,e){let s=i[t].fill;const o=[t];let a;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!N(s))return s;if(a=i[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function Oc(i,t,e){const n=Ec(i);if(O(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return N(s)&&Math.floor(s)===s?Fc(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Fc(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function Ic(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:O(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Rc(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:O(i)?n=i.value:n=t.getBaseValue(),n}function Ec(i){const t=i.options,e=t.fill;let n=L(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Bc(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,a=n.points,r=zc(t,e);r.push(Qs({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)Wc(s,a[h],r)}return new bt({points:s,options:{}})}function zc(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Wc(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=Hc(o,t,"x");if(!(!l||a&&r)){if(a)n.unshift(l);else if(i.push(l),!r)break}}i.push(...n)}function Hc(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],o=i.segments,a=i.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],d=a[h.start][e],u=a[h.end][e];if(gt(s,d,u)){r=s===d,l=s===u;break}}return{first:r,last:l,point:n}}class to{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:o,radius:a}=this;return e=e||{start:0,end:z},t.arc(s,o,a,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}}function Nc(i){const{chart:t,fill:e,line:n}=i;if(N(e))return Vc(t,e);if(e==="stack")return Bc(i);if(e==="shape")return!0;const s=jc(i);return s instanceof to?s:Qs(s,n)}function Vc(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function jc(i){return(i.scale||{}).getPointPositionForValue?Yc(i):$c(i)}function $c(i){const{scale:t={},fill:e}=i,n=Ic(e,t);if(N(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function Yc(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,a=Rc(e,t,o),r=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,o);return new to({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function sn(i,t,e){const n=Nc(t),{line:s,scale:o,axis:a}=t,r=s.options,l=r.fill,c=r.backgroundColor,{above:h=c,below:d=c}=l||{};n&&s.points.length&&(Ee(i,e),Uc(i,{line:s,target:n,above:h,below:d,area:e,scale:o,axis:a}),Be(i))}function Uc(i,t){const{line:e,target:n,above:s,below:o,area:a,scale:r}=t,l=e._loop?"angle":t.axis;i.save(),l==="x"&&o!==s&&(eo(i,n,a.top),io(i,{line:e,target:n,color:s,scale:r,property:l}),i.restore(),i.save(),eo(i,n,a.bottom)),io(i,{line:e,target:n,color:o,scale:r,property:l}),i.restore()}function eo(i,t,e){const{segments:n,points:s}=t;let o=!0,a=!1;i.beginPath();for(const r of n){const{start:l,end:c}=r,h=s[l],d=s[nn(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(d.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function io(i,t){const{line:e,target:n,property:s,color:o,scale:a}=t,r=Dc(e,n,s);for(const{source:l,target:c,start:h,end:d}of r){const{style:{backgroundColor:u=o}={}}=l,f=n!==!0;i.save(),i.fillStyle=u,Xc(i,a,f&&en(s,h,d)),i.beginPath();const m=!!e.pathSegment(i,l);let p;if(f){m?i.closePath():no(i,n,d,s);const g=!!n.pathSegment(i,c,{move:m,reverse:!0});p=m&&g,p||no(i,n,h,s)}i.closePath(),i.fill(p?"evenodd":"nonzero"),i.restore()}}function Xc(i,t,e){const{top:n,bottom:s}=t.chart.chartArea,{property:o,start:a,end:r}=e||{};o==="x"&&(i.beginPath(),i.rect(a,n,r-a,s-n),i.clip())}function no(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var qc={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<n;++a)o=i.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof bt&&(l={visible:i.isDatasetVisible(a),index:a,fill:Oc(r,a,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<n;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=Lc(s,a,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),n&&r.fill&&sn(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;Js(o)&&sn(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!Js(n)||e.drawTime!=="beforeDatasetDraw"||sn(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const so=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},Gc=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class oo extends at{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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=E(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,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 n=t.labels,s=U(n.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=so(n,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+r;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((m,p)=>{const g=n+e/2+o.measureText(m.text).width;(p===0||c[c.length-1]+g+2*r>a)&&(d+=h,c[c.length-(p>0?0:1)]=0,f+=h,u++),l[p]={left:0,top:f,row:u,width:g,height:s},c[c.length-1]+=g+r}),d}_fitCols(t,e,n,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-t;let d=r,u=0,f=0,m=0,p=0;return this.legendItems.forEach((g,b)=>{const{itemWidth:y,itemHeight:_}=Kc(n,e,o,g,s);b>0&&f+_+2*r>h&&(d+=u+r,c.push({width:u,height:f}),m+=u+r,p++,u=f=0),l[b]={left:m,top:f,col:p,width:y,height:_},u=Math.max(u,y),f+=_+r}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,a=Yt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=G(n,this.left+s,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=G(n,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=G(n,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=G(n,this.top+t+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ee(t,this),this._draw(),Be(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:a}=t,r=j.color,l=Yt(t.rtl,this.left,this.width),c=U(a.font),{padding:h}=a,d=c.size,u=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:p,itemHeight:g}=so(a,d),b=function(P,k,w){if(isNaN(m)||m<=0||isNaN(p)||p<0)return;s.save();const C=L(w.lineWidth,1);if(s.fillStyle=L(w.fillStyle,r),s.lineCap=L(w.lineCap,"butt"),s.lineDashOffset=L(w.lineDashOffset,0),s.lineJoin=L(w.lineJoin,"miter"),s.lineWidth=C,s.strokeStyle=L(w.strokeStyle,r),s.setLineDash(L(w.lineDash,[])),a.usePointStyle){const A={radius:p*Math.SQRT2/2,pointStyle:w.pointStyle,rotation:w.rotation,borderWidth:C},D=l.xPlus(P,m/2),T=k+u;Hn(s,A,D,T,a.pointStyleWidth&&m)}else{const A=k+Math.max((d-p)/2,0),D=l.leftForLtr(P,m),T=Ft(w.borderRadius);s.beginPath(),Object.values(T).some($=>$!==0)?ae(s,{x:D,y:A,w:m,h:p,radius:T}):s.rect(D,A,m,p),s.fill(),C!==0&&s.stroke()}s.restore()},y=function(P,k,w){Ot(s,w.text,P,k+g/2,c,{strikethrough:w.hidden,textAlign:l.textAlign(w.textAlign)})},_=this.isHorizontal(),S=this._computeTitleHeight();_?f={x:G(o,this.left+h,this.right-n[0]),y:this.top+h+S,line:0}:f={x:this.left+h,y:G(o,this.top+S+h,this.bottom-e[0].height),line:0},Qn(this.ctx,t.textDirection);const x=g+h;this.legendItems.forEach((P,k)=>{s.strokeStyle=P.fontColor,s.fillStyle=P.fontColor;const w=s.measureText(P.text).width,C=l.textAlign(P.textAlign||(P.textAlign=a.textAlign)),A=m+u+w;let D=f.x,T=f.y;l.setWidth(this.width),_?k>0&&D+A+h>this.right&&(T=f.y+=x,f.line++,D=f.x=G(o,this.left+h,this.right-n[f.line])):k>0&&T+x>this.bottom&&(D=f.x=D+e[f.line].width+h,f.line++,T=f.y=G(o,this.top+S+h,this.bottom-e[f.line].height));const $=l.x(D);if(b($,T,P),D=Ca(C,D+m+u,_?D+A:this.right,t.rtl),y(l.x(D),T,P),_)f.x+=A+h;else if(typeof P.text!="string"){const Q=c.lineHeight;f.y+=ao(P,Q)+h}else f.y+=x}),Jn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=U(e.font),s=K(e.padding);if(!e.display)return;const o=Yt(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=n.size/2,c=s.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=G(t.align,d,this.right-u);else{const m=this.columnSizes.reduce((p,g)=>Math.max(p,g.height),0);h=c+G(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const f=G(r,d,d+u);a.textAlign=o.textAlign(Oi(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=n.string,Ot(a,e.text,f,h,n)}_computeTitleHeight(){const t=this.options.title,e=U(t.font),n=K(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(gt(t,this.left,this.right)&>(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],gt(t,s.left,s.left+s.width)&>(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!Jc(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Gc(s,n);s&&!o&&E(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&E(e.onHover,[t,n,this],this)}else n&&E(e.onClick,[t,n,this],this)}}function Kc(i,t,e,n,s){const o=Zc(n,i,t,e),a=Qc(s,n,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Zc(i,t,e,n){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+n.measureText(s).width}function Qc(i,t,e){let n=i;return typeof t.text!="string"&&(n=ao(t,e)),n}function ao(i,t){const e=i.text?i.text.length:0;return t*e}function Jc(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var ei={id:"legend",_element:oo,start(i,t,e){const n=i.legend=new oo({ctx:i.ctx,options:e,chart:i});st.configure(i,n,e),st.addBox(i,n)},stop(i){st.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;st.configure(i,n,e),n.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 n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),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:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=K(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:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class ro extends at{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 n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=B(n.text)?n.text.length:1;this._padding=K(n.padding);const o=s*U(n.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:n,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,h,d;return this.isHorizontal()?(h=G(r,n,o),d=e+t,c=o-n):(a.position==="left"?(h=n+t,d=G(r,s,e),l=H*-.5):(h=o-t,d=G(r,e,s),l=H*.5),c=s-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=U(e.font),o=n.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);Ot(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:Oi(e.align),textBaseline:"middle",translation:[a,r]})}}function th(i,t){const e=new ro({ctx:i.ctx,options:t,chart:i});st.configure(i,e,t),st.addBox(i,e),i.titleBlock=e}var ii={id:"title",_element:ro,start(i,t,e){th(i,e)},stop(i){const t=i.titleBlock;st.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;st.configure(i,n,e),n.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 ye={average(i){if(!i.length)return!1;let t,e,n=0,s=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const r=a.tooltipPosition();n+=r.x,s+=r.y,++o}}return{x:n/o,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Ti(t,c);h<s&&(s=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function dt(i,t){return t&&(B(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function yt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
16
|
+
*/class sl{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const o=e.listeners[s],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(n-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=qn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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((n,s)=>Math.max(n,s._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 n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var vt=new sl;const ws="transparent",ol={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=Qn(i||ws),s=n.valid&&Qn(t||ws);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class al{constructor(t,e,n,s){const o=e[n];s=V([t.to,s,o,t.from]);const a=V([t.from,o,s]);this._active=!0,this._fn=t.fn||ol[t.type||typeof a],this._easing=be[t.easing]||be.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=n,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,a=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=V([t.to,e,s,t.from]),this._from=V([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<n),!this._active){this._target[s]=r,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/n%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}class ks{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!O(t))return;const e=Object.keys(U.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!O(o))return;const a={};for(const r of e)a[r]=o[r];(W(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!n.has(r))&&n.set(r,a)})})}_animateOptions(t,e){const n=e.options,s=ll(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&rl(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=n.get(c);if(d)if(u&&d.active()){d.update(u,h,r);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new al(u,t,c,h),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return vt.add(this._chart,n),!0}}function rl(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function ll(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 Cs(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function cl(i,t,e){if(e===!1)return!1;const n=Cs(i,e),s=Cs(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function hl(i){let t,e,n,s;return O(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function Ms(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function Ps(i,t,e,n={}){const s=i.keys,o=n.mode==="single";let a,r,l,c;if(t!==null){for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(n.all)continue;break}c=i.values[l],q(c)&&(o||t===0||ut(t)===ut(c))&&(t+=c)}return t}}function dl(i){const t=Object.keys(i),e=new Array(t.length);let n,s,o;for(n=0,s=t.length;n<s;++n)o=t[n],e[n]={x:o,y:i[o]};return e}function As(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function ul(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function fl(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function gl(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function Ds(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Ls(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,c=a.axis,h=ul(o,a,n),d=t.length;let u;for(let f=0;f<d;++f){const b=t[f],{[l]:p,[c]:m}=b,g=b._stacks||(b._stacks={});u=g[c]=gl(s,h,p),u[r]=m,u._top=Ds(u,a,!0,n.type),u._bottom=Ds(u,a,!1,n.type);const y=u._visualValues||(u._visualValues={});y[r]=m}}function en(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function pl(i,t){return Lt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ml(i,t,e){return Lt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function _e(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const nn=i=>i==="reset"||i==="none",Ts=(i,t)=>t?i:Object.assign({},i),bl=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Ms(e,!0),values:null};class St{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=As(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&_e(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(d,u,f,b)=>d==="x"?u:d==="r"?b:f,o=e.xAxisID=T(n.xAxisID,en(t,"x")),a=e.yAxisID=T(n.yAxisID,en(t,"y")),r=e.rAxisID=T(n.rAxisID,en(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),h=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Xn(this._data,this),t._stacked&&_e(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(O(e))this._data=dl(e);else if(n!==e){if(n){Xn(n,this);const s=this._cachedMeta;_e(s),s._parsed=[]}e&&Object.isExtensible(e)&&Qa(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,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=As(e.vScale,e),e.stack!==n.stack&&(s=!0,_e(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&Ls(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:a}=n,r=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,d,u;if(this._parsing===!1)n._parsed=s,n._sorted=!0,u=s;else{W(s[t])?u=this.parseArrayData(n,s,t,e):O(s[t])?u=this.parseObjectData(n,s,t,e):u=this.parsePrimitiveData(n,s,t,e);const f=()=>d[r]===null||c&&d[r]<c[r];for(h=0;h<e;++h)n._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);n._sorted=l}a&&Ls(this,u)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),h=o===a,d=new Array(s);let u,f,b;for(u=0,f=s;u<f;++u)b=u+n,d[u]={[r]:h||o.parse(c[b],b),[l]:a.parse(e[b],b)};return d}parseArrayData(t,e,n,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,h,d;for(l=0,c=s;l<c;++l)h=l+n,d=e[h],r[l]={x:o.parse(d[0],h),y:a.parse(d[1],h)};return r}parseObjectData(t,e,n,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,d,u,f;for(h=0,d=s;h<d;++h)u=h+n,f=e[u],c[h]={x:o.parse(At(f,r),u),y:a.parse(At(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:Ms(s,!0),values:e._stacks[t.axis]._visualValues};return Ps(r,a,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const o=n[e.axis];let a=o===null?NaN:o;const r=s&&n._stacks[e.axis];s&&r&&(s.values=r,a=Ps(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,a=s.length,r=this._getOtherScale(t),l=bl(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=fl(r);let u,f;function b(){f=s[u];const p=f[r.axis];return!q(f[t.axis])||h>p||d<p}for(u=0;u<a&&!(!b()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=a-1;u>=0;--u)if(!b()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,a;for(s=0,o=e.length;s<o;++s)a=e[s][t.axis],q(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=hl(T(this.options.clip,cl(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,c=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const d=s[h];d.hidden||(d.active&&c?a.push(d):d.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=ml(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=pl(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,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",n){const s=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&fe(n);if(r)return Ts(r,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(U.elements[t]),b=()=>this.getContext(n,s,e),p=c.resolveNamedOptions(u,f,b,d);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(Ts(p,l))),p}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,n,e))}const c=new ks(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||nn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:a}}updateElement(t,e,n,s){nn(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!nn(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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,n=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=n.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,n=!0){const s=this._cachedMeta,o=s.data,a=t+e;let r;const l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&_e(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}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 n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}k(St,"defaults",{}),k(St,"datasetElementType",null),k(St,"dataElementType",null);function yl(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let n=[];for(let s=0,o=e.length;s<o;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=Gn(n.sort((s,o)=>s-o))}return i._cache.$bar}function xl(i){const t=i.iScale,e=yl(t,i.type);let n=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(fe(r)&&(n=Math.min(n,Math.abs(a-r)||n)),r=a)};for(s=0,o=e.length;s<o;++s)a=t.getPixelForValue(e[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return n}function _l(i,t,e,n){const s=e.barThickness;let o,a;return I(s)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=s*n,a=1),{chunk:o/n,ratio:a,start:t.pixels[i]-o/2}}function vl(i,t,e,n){const s=t.pixels,o=s[i];let a=i>0?s[i-1]:null,r=i<s.length-1?s[i+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/n,ratio:e.barPercentage,start:c}}function Sl(i,t,e,n){const s=e.parse(i[0],n),o=e.parse(i[1],n),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}function Os(i,t,e,n){return W(i)?Sl(i,t,e,n):t[e.axis]=e.parse(i,n),t}function Is(i,t,e,n){const s=i.iScale,o=i.vScale,a=s.getLabels(),r=s===o,l=[];let c,h,d,u;for(c=e,h=e+n;c<h;++c)u=t[c],d={},d[s.axis]=r||s.parse(a[c],c),l.push(Os(u,d,o,c));return l}function sn(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function wl(i,t,e){return i!==0?ut(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function kl(i){let t,e,n,s,o;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:n,reverse:t,top:s,bottom:o}}function Cl(i,t,e,n){let s=t.borderSkipped;const o={};if(!s){i.borderSkipped=o;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:h}=kl(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=c:(e._bottom||0)===n?s=h:(o[Fs(h,a,r,l)]=!0,s=c)),o[Fs(s,a,r,l)]=!0,i.borderSkipped=o}function Fs(i,t,e,n){return n?(i=Ml(i,t,e),i=Rs(i,e,t)):i=Rs(i,t,e),i}function Ml(i,t,e){return i===t?e:i===e?t:i}function Rs(i,t,e){return i==="start"?t:i==="end"?e:i}function Pl(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class ti extends St{parsePrimitiveData(t,e,n,s){return Is(t,e,n,s)}parseArrayData(t,e,n,s){return Is(t,e,n,s)}parseObjectData(t,e,n,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,h=a.axis==="x"?r:l,d=[];let u,f,b,p;for(u=n,f=n+s;u<f;++u)p=e[u],b={},b[o.axis]=o.parse(At(p,c),u),d.push(Os(At(p,h),b,a,u));return d}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);const o=n._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:s}=e,o=this.getParsed(t),a=o._custom,r=sn(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,s);for(let f=e;f<e+n;f++){const b=this.getParsed(f),p=o||I(b[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,h),g=(b._stacks||{})[r.axis],y={horizontal:c,base:p.base,enableBorderRadius:!g||sn(b._custom)||a===g._top||a===g._bottom,x:c?p.head:m.center,y:c?m.center:p.head,height:c?m.size:Math.abs(p.size),width:c?Math.abs(p.size):m.size};u&&(y.options=d||this.resolveDataElementOptions(f,t[f].active?"active":s));const _=y.options||t[f].options;Cl(y,_,g,a),Pl(y,_,h.ratio),this.updateElement(t[f],f,y,s)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=n.options.stacked,a=[],r=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(I(h)||isNaN(h))return!0};for(const l of s)if(!(e!==void 0&&r(l))&&((o===!1||a.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&a.push(l.stack),l.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const s=this._getStacks(t,n),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let o,a;for(o=0,a=e.data.length;o<a;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const r=t.barThickness;return{min:r||xl(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=sn(c);let d=l[e.axis],u=0,f=n?this.applyStack(e,l,n):d,b,p;f!==d&&(u=f-d,f=d),h&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&ut(d)!==ut(c.barEnd)&&(u=0),u+=d);const m=!I(o)&&!h?o:u;let g=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?b=e.getPixelForValue(u+f):b=g,p=b-g,Math.abs(p)<a){p=wl(p,e,r)*a,d===r&&(g-=p/2);const y=e.getPixelForDecimal(0),_=e.getPixelForDecimal(1),S=Math.min(y,_),v=Math.max(y,_);g=Math.max(Math.min(g,v),S),b=g+p,n&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(b)-e.getValueForPixel(g))}if(g===e.getPixelForValue(r)){const y=ut(p)*e.getLineWidthForValue(r)/2;g+=y,p-=y}return{size:p,base:g,head:b,center:b+p/2}}_calculateBarIndexPixels(t,e){const n=e.scale,s=this.options,o=s.skipNull,a=T(s.maxBarThickness,1/0);let r,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?vl(t,e,s,c):_l(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=h.start+h.chunk*d+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else r=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&n[o].draw(this._ctx)}}k(ti,"id","bar"),k(ti,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),k(ti,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ei extends St{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,s){const o=super.parsePrimitiveData(t,e,n,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+n).radius;return o}parseArrayData(t,e,n,s){const o=super.parseArrayData(t,e,n,s);for(let a=0;a<o.length;a++){const r=e[n+a];o[a]._custom=T(r[2],this.resolveDataElementOptions(a+n).radius)}return o}parseObjectData(t,e,n,s){const o=super.parseObjectData(t,e,n,s);for(let a=0;a<o.length;a++){const r=e[n+a];o[a]._custom=T(r&&r.r&&+r.r,this.resolveDataElementOptions(a+n).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),c=a._custom;return{label:n[t]||"",value:"("+r+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=a.axis,d=r.axis;for(let u=e;u<e+n;u++){const f=t[u],b=!o&&this.getParsed(u),p={},m=p[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(b[h]),g=p[d]=o?r.getBasePixel():r.getPixelForValue(b[d]);p.skip=isNaN(m)||isNaN(g),c&&(p.options=l||this.resolveDataElementOptions(u,f.active?"active":s),o&&(p.options.radius=0)),this.updateElement(f,u,p,s)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=T(n&&n._custom,o),s}}k(ei,"id","bubble"),k(ei,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),k(ei,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Al(i,t,e){let n=1,s=1,o=0,a=0;if(t<H){const r=i,l=r+t,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(_,S,v)=>me(_,r,l,!0)?1:Math.max(S,S*e,v,v*e),b=(_,S,v)=>me(_,r,l,!0)?-1:Math.min(S,S*e,v,v*e),p=f(0,c,d),m=f(Y,h,u),g=b(N,c,d),y=b(N+Y,h,u);n=(p-g)/2,s=(m-y)/2,o=-(p+g)/2,a=-(m+y)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:a}}class ve extends St{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 n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(O(n[t])){const{key:l="value"}=this._parsing;o=c=>+At(n[c],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return ft(this.options.rotation-90)}_getCircumference(){return ft(this.options.circumference)}_getRotationExtents(){let t=H,e=-H;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(n.width,n.height)-a)/2,0),l=Math.min(za(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:b,offsetY:p}=Al(d,h,l),m=(n.width-a)/u,g=(n.height-a)/f,y=Math.max(Math.min(m,g)/2,0),_=zn(this.options.radius,y),S=Math.max(_*l,0),v=(_-S)/this._getVisibleDatasetWeightTotal();this.offsetX=b*_,this.offsetY=p*_,s.total=this.calculateTotal(),this.outerRadius=_-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 n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/H)}updateElements(t,e,n,s){const o=s==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,h=(r.left+r.right)/2,d=(r.top+r.bottom)/2,u=o&&c.animateScale,f=u?0:this.innerRadius,b=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(e,s);let g=this._getRotation(),y;for(y=0;y<e;++y)g+=this._circumference(y,o);for(y=e;y<e+n;++y){const _=this._circumference(y,o),S=t[y],v={x:h+this.offsetX,y:d+this.offsetY,startAngle:g,endAngle:g+_,circumference:_,outerRadius:b,innerRadius:f};m&&(v.options=p||this.resolveDataElementOptions(y,S.active?"active":s)),g+=_,this.updateElement(S,y,v,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?H*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Ui(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){a=n.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(T(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}k(ve,"id","doughnut"),k(ve,"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"}),k(ve,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),k(ve,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}});class ii extends St{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=ir(e,s,a);this._drawStart=r,this._drawCount=l,nr(e)&&(r=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},t),this.updateElements(s,r,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s),u=a.axis,f=r.axis,{spanGaps:b,segment:p}=this.options,m=pe(b)?b:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||o||s==="none",y=e+n,_=t.length;let S=e>0&&this.getParsed(e-1);for(let v=0;v<_;++v){const w=t[v],M=g?w:{};if(v<e||v>=y){M.skip=!0;continue}const C=this.getParsed(v),D=I(C[f]),A=M[u]=a.getPixelForValue(C[u],v),P=M[f]=o||D?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,C,l):C[f],v);M.skip=isNaN(A)||isNaN(P)||D,M.stop=v>0&&Math.abs(C[u]-S[u])>m,p&&(M.parsed=C,M.raw=c.data[v]),d&&(M.options=h||this.resolveDataElementOptions(v,w.active?"active":s)),g||this.updateElement(w,v,M,s),S=C}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}k(ii,"id","line"),k(ii,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),k(ii,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ni extends St{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return Ir.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(n.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(n,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=e;r<e+n;r++){const l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":s),h=o.getPointPositionForValue(r,this.getParsed(r).r),d=a?o.xCenter:h.x,u=a?o.yCenter:h.y,f={x:d,y:u,angle:h.angle,skip:isNaN(d)||isNaN(u),options:c};this.updateElement(l,r,f,s)}}}k(ni,"id","radar"),k(ni,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),k(ni,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function jt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class on{constructor(t){k(this,"options");this.options=t||{}}static override(t){Object.assign(on.prototype,t)}init(){}formats(){return jt()}parse(){return jt()}format(){return jt()}add(){return jt()}diff(){return jt()}startOf(){return jt()}endOf(){return jt()}}var Dl={_date:on};function Ll(i,t,e,n){const{controller:s,data:o,_sorted:a}=i,r=s._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const l=r._reversePixels?Za:Rt;if(n){if(s._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Se(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:h}=o[r],{lo:d,hi:u}=Ll(o[r],t,a,s);for(let f=d;f<=u;++f){const b=h[f];b.skip||n(b,c,f)}}}function Tl(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const o=t?Math.abs(n.x-s.x):0,a=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function an(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||Se(i,e,t,function(r,l,c){!s&&!_t(r,i.chartArea,0)||r.inRange(t.x,t.y,n)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function Ol(i,t,e,n){let s=[];function o(a,r,l){const{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],n),{angle:d}=Un(a,{x:t.x,y:t.y});me(d,c,h)&&s.push({element:a,datasetIndex:r,index:l})}return Se(i,e,t,o),s}function Il(i,t,e,n,s,o){let a=[];const r=Tl(e);let l=Number.POSITIVE_INFINITY;function c(h,d,u){const f=h.inRange(t.x,t.y,s);if(n&&!f)return;const b=h.getCenterPoint(s);if(!(!!o||i.isPointInArea(b))&&!f)return;const m=r(t,b);m<l?(a=[{element:h,datasetIndex:d,index:u}],l=m):m===l&&a.push({element:h,datasetIndex:d,index:u})}return Se(i,e,t,c),a}function rn(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?Ol(i,t,e,s):Il(i,t,e,n,s,o)}function Es(i,t,e,n,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return Se(i,e,t,(l,c,h)=>{l[a](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,s))}),n&&!r?[]:o}var Fl={evaluateInteractionItems:Se,modes:{index(i,t,e,n){const s=Nt(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?an(i,s,o,n,a):rn(i,s,o,!1,n,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=r[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=Nt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?an(i,s,o,n,a):rn(i,s,o,!1,n,a);if(r.length>0){const l=r[0].datasetIndex,c=i.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h})}return r},point(i,t,e,n){const s=Nt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return an(i,s,o,n,a)},nearest(i,t,e,n){const s=Nt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return rn(i,s,o,e.intersect,n,a)},x(i,t,e,n){const s=Nt(t,i);return Es(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=Nt(t,i);return Es(i,s,"y",e.intersect,n)}}};const Bs=["left","top","right","bottom"];function we(i,t){return i.filter(e=>e.pos===t)}function zs(i,t){return i.filter(e=>Bs.indexOf(e.pos)===-1&&e.box.axis===t)}function ke(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Rl(i){const t=[];let e,n,s,o,a,r;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function El(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!Bs.includes(s))continue;const a=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Bl(i,t){const e=El(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];const{fullSize:l}=r.box,c=e[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*n:l&&t.availableWidth,r.height=s):(r.width=n,r.height=h?h*s:l&&t.availableHeight)}return e}function zl(i){const t=Rl(i),e=ke(t.filter(c=>c.box.fullSize),!0),n=ke(we(t,"left"),!0),s=ke(we(t,"right")),o=ke(we(t,"top"),!0),a=ke(we(t,"bottom")),r=zs(t,"x"),l=zs(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:we(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function Ws(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function Hs(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 Wl(i,t,e,n){const{pos:s,box:o}=e,a=i.maxPadding;if(!O(s)){e.size&&(i[s]-=e.size);const d=n[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[s]+=e.size}o.getPadding&&Hs(a,o.getPadding());const r=Math.max(0,t.outerWidth-Ws(a,i,"left","right")),l=Math.max(0,t.outerHeight-Ws(a,i,"top","bottom")),c=r!==i.w,h=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Hl(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Nl(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return n(i?["left","right"]:["top","bottom"])}function Ce(i,t,e,n){const s=[];let o,a,r,l,c,h;for(o=0,a=i.length,c=0;o<a;++o){r=i[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Nl(r.horizontal,t));const{same:d,other:u}=Wl(t,e,r,n);c|=d&&s.length,h=h||u,l.fullSize||s.push(r)}return c&&Ce(s,t,e,n)||h}function si(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function Ns(i,t,e,n){const s=e.padding;let{x:o,y:a}=t;for(const r of i){const l=r.box,c=n[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){const d=t.w*h,u=c.size||l.height;fe(c.start)&&(a=c.start),l.fullSize?si(l,s.left,a,e.outerWidth-s.right-s.left,u):si(l,t.left+c.placed,a,d,u),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*h,u=c.size||l.width;fe(c.start)&&(o=c.start),l.fullSize?si(l,o,s.top,u,e.outerHeight-s.bottom-s.top):si(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var at={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,n){if(!i)return;const s=K(i.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=zl(i.boxes),l=r.vertical,c=r.horizontal;R(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},s);Hs(u,K(n));const f=Object.assign({maxPadding:u,w:o,h:a,x:s.left,y:s.top},s),b=Bl(l.concat(c),d);Ce(r.fullSize,f,d,b),Ce(l,f,d,b),Ce(c,f,d,b)&&Ce(l,f,d,b),Hl(f),Ns(r.leftAndTop,f,d,b),f.x+=f.w,f.y+=f.h,Ns(r.rightAndBottom,f,d,b),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},R(r.chartArea,p=>{const m=p.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Vs{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Vl extends Vs{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const oi="$chartjs",jl={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},js=i=>i===null||i==="";function $l(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[oi]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",js(s)){const o=gs(i,"width");o!==void 0&&(i.width=o)}if(js(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=gs(i,"height");o!==void 0&&(i.height=o)}return i}const $s=Xr?{passive:!0}:!1;function Ul(i,t,e){i.addEventListener(t,e,$s)}function Yl(i,t,e){i.canvas.removeEventListener(t,e,$s)}function Xl(i,t){const e=jl[i.type]||i.type,{x:n,y:s}=Nt(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function ai(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Gl(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||ai(r.addedNodes,n),a=a&&!ai(r.removedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function ql(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||ai(r.removedNodes,n),a=a&&!ai(r.addedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Me=new Map;let Us=0;function Ys(){const i=window.devicePixelRatio;i!==Us&&(Us=i,Me.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Kl(i,t){Me.size||window.addEventListener("resize",Ys),Me.set(i,t)}function Zl(i){Me.delete(i),Me.size||window.removeEventListener("resize",Ys)}function Jl(i,t,e){const n=i.canvas,s=n&&tn(n);if(!s)return;const o=Kn((r,l)=>{const c=s.clientWidth;e(r,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(s),Kl(i,o),a}function ln(i,t,e){e&&e.disconnect(),t==="resize"&&Zl(i)}function Ql(i,t,e){const n=i.canvas,s=Kn(o=>{i.ctx!==null&&e(Xl(o,i))},i);return Ul(n,t,s),s}class tc extends Vs{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?($l(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[oi])return!1;const n=e[oi].initial;["height","width"].forEach(o=>{const a=n[o];I(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[oi],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Gl,detach:ql,resize:Jl}[e]||Ql;s[e]=a(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:ln,detach:ln,resize:ln}[e]||Yl)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Yr(t,e,n,s)}isAttached(t){const e=tn(t);return!!(e&&e.isConnected)}}function ec(i){return!us()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Vl:tc}class lt{constructor(){k(this,"x");k(this,"y");k(this,"active",!1);k(this,"options");k(this,"$animations")}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return pe(this.x)&&pe(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}k(lt,"defaults",{}),k(lt,"defaultRoutes");function ic(i,t){const e=i.options.ticks,n=nc(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?oc(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return ac(t,c,o,a/s),c;const h=sc(o,t,s);if(a>0){let d,u;const f=a>1?Math.round((l-r)/(a-1)):null;for(ri(t,c,h,I(f)?0:r-f,r),d=0,u=a-1;d<u;d++)ri(t,c,h,o[d],o[d+1]);return ri(t,c,h,l,I(f)?t.length:l+f),c}return ri(t,c,h),c}function nc(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function sc(i,t,e){const n=rc(i),s=t.length/e;if(!n)return Math.max(s,1);const o=Ya(n);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function oc(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function ac(i,t,e,n){let s=0,o=e[0],a;for(n=Math.ceil(n),a=0;a<i.length;a++)a===o&&(t.push(i[a]),s++,o=e[s*n])}function ri(i,t,e,n,s){const o=T(n,0),a=Math.min(T(s,i.length),i.length);let r=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),h=o;h<0;)r++,h=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===h&&(t.push(i[c]),r++,h=Math.round(o+r*e))}function rc(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const lc=i=>i==="left"?"right":i==="right"?"left":i,Xs=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Gs=(i,t)=>Math.min(t||i,i);function qs(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function cc(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,a=i._endPixel,r=1e-6;let l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-o,a-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-r||l>a+r)))return l}function hc(i,t){R(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function Pe(i){return i.drawTicks?i.tickLength:0}function Ks(i,t){if(!i.display)return 0;const e=X(i.font,t),n=K(i.padding);return(W(i.text)?i.text.length:1)*e.lineHeight+n.height}function dc(i,t){return Lt(i,{scale:t,type:"scale"})}function uc(i,t,e){return Lt(i,{tick:e,index:t,type:"tick"})}function fc(i,t,e){let n=Vi(i);return(e&&t!=="right"||!e&&t==="right")&&(n=lc(n)),n}function gc(i,t,e,n){const{top:s,left:o,bottom:a,right:r,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,u,f,b;const p=a-s,m=r-o;if(i.isHorizontal()){if(f=J(n,o,r),O(e)){const g=Object.keys(e)[0],y=e[g];b=h[g].getPixelForValue(y)+p-t}else e==="center"?b=(c.bottom+c.top)/2+p-t:b=Xs(i,e,t);u=r-o}else{if(O(e)){const g=Object.keys(e)[0],y=e[g];f=h[g].getPixelForValue(y)-m+t}else e==="center"?f=(c.left+c.right)/2-m+t:f=Xs(i,e,t);b=J(n,a,s),d=e==="left"?-Y:Y}return{titleX:f,titleY:b,maxWidth:u,rotation:d}}class Gt extends lt{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:n,_suggestedMax:s}=this;return t=ht(t,Number.POSITIVE_INFINITY),e=ht(e,Number.NEGATIVE_INFINITY),n=ht(n,Number.POSITIVE_INFINITY),s=ht(s,Number.NEGATIVE_INFINITY),{min:ht(t,n),max:ht(e,s),minDefined:q(t),maxDefined:q(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:e,max:n};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),o||(n=Math.max(n,a.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:ht(e,ht(n,e)),max:ht(n,ht(e,n))}}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(){E(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=wr(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?qs(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=ic(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,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){E(this.options.afterUpdate,[this])}beforeSetDimensions(){E(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(){E(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),E(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){E(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=E(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){E(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){E(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=Gs(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,l,c;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=Z(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/n:f/(n-1),d+6>r&&(r=f/(n-(t.offset?.5:1)),l=this.maxHeight-Pe(t.grid)-e.padding-Ks(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),a=Wi(Math.min(Math.asin(Z((h.highest.height+6)/r,-1,1)),Math.asin(Z(l/c,-1,1))-Math.asin(Z(u/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){E(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){E(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Ks(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=Pe(o)+l):(t.height=this.maxHeight,t.width=Pe(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=n.padding*2,b=ft(this.labelRotation),p=Math.cos(b),m=Math.sin(b);if(r){const g=n.mirror?0:m*d.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+g+f)}else{const g=n.mirror?0:p*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+g+f)}this._calculatePadding(c,h,m,p)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=s*t.width,f=n*e.height):(u=n*t.height,f=s*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+a)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+a,this.paddingBottom=d+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){E(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,n;for(e=0,n=t.length;e<n;e++)I(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=qs(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Gs(e,n));let c=0,h=0,d,u,f,b,p,m,g,y,_,S,v;for(d=0;d<e;d+=l){if(b=t[d].label,p=this._resolveTickFontOptions(d),s.font=m=p.string,g=o[m]=o[m]||{data:{},gc:[]},y=p.lineHeight,_=S=0,!I(b)&&!W(b))_=Xe(s,g.data,g.gc,_,b),S=y;else if(W(b))for(u=0,f=b.length;u<f;++u)v=b[u],!I(v)&&!W(v)&&(_=Xe(s,g.data,g.gc,_,v),S+=y);a.push(_),r.push(S),c=Math.max(_,c),h=Math.max(S,h)}hc(o,e);const w=a.indexOf(c),M=r.indexOf(h),C=D=>({width:a[D]||0,height:r[D]||0});return{first:C(0),last:C(e-1),widest:C(w),highest:C(M),widths:a,heights:r}}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 Ka(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 n=e[t];return n.$context||(n.$context=uc(this.getContext(),t,n))}return this.$context||(this.$context=dc(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ft(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*n>r*s?r/n:l/s:l*s<r*n?l/n:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=Pe(o),f=[],b=r.setContext(this.getContext()),p=b.display?b.width:0,m=p/2,g=function(z){return Bt(n,z,p)};let y,_,S,v,w,M,C,D,A,P,L,B;if(a==="top")y=g(this.bottom),M=this.bottom-u,D=y-m,P=g(t.top)+m,B=t.bottom;else if(a==="bottom")y=g(this.top),P=t.top,B=g(t.bottom)-m,M=y+m,D=this.top+u;else if(a==="left")y=g(this.right),w=this.right-u,C=y-m,A=g(t.left)+m,L=t.right;else if(a==="right")y=g(this.left),A=t.left,L=g(t.right)-m,w=y+m,C=this.left+u;else if(e==="x"){if(a==="center")y=g((t.top+t.bottom)/2+.5);else if(O(a)){const z=Object.keys(a)[0],$=a[z];y=g(this.chart.scales[z].getPixelForValue($))}P=t.top,B=t.bottom,M=y+m,D=M+u}else if(e==="y"){if(a==="center")y=g((t.left+t.right)/2);else if(O(a)){const z=Object.keys(a)[0],$=a[z];y=g(this.chart.scales[z].getPixelForValue($))}w=y-m,C=w-u,A=t.left,L=t.right}const j=T(s.ticks.maxTicksLimit,d),F=Math.max(1,Math.ceil(d/j));for(_=0;_<d;_+=F){const z=this.getContext(_),$=o.setContext(z),ct=r.setContext(z),tt=$.lineWidth,le=$.color,Ti=ct.dash||[],ce=ct.dashOffset,Ee=$.tickWidth,Be=$.tickColor,ze=$.tickBorderDash||[],We=$.tickBorderDashOffset;S=cc(this,_,l),S!==void 0&&(v=Bt(n,S,tt),c?w=C=A=L=v:M=D=P=B=v,f.push({tx1:w,ty1:M,tx2:C,ty2:D,x1:A,y1:P,x2:L,y2:B,width:tt,color:le,borderDash:Ti,borderDashOffset:ce,tickWidth:Ee,tickColor:Be,tickBorderDash:ze,tickBorderDashOffset:We}))}return this._ticksLength=d,this._borderValue=y,f}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:o}=n,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=Pe(n.grid),f=u+h,b=d?-h:f,p=-ft(this.labelRotation),m=[];let g,y,_,S,v,w,M,C,D,A,P,L,B="middle";if(s==="top")w=this.bottom-b,M=this._getXAxisLabelAlignment();else if(s==="bottom")w=this.top+b,M=this._getXAxisLabelAlignment();else if(s==="left"){const F=this._getYAxisLabelAlignment(u);M=F.textAlign,v=F.x}else if(s==="right"){const F=this._getYAxisLabelAlignment(u);M=F.textAlign,v=F.x}else if(e==="x"){if(s==="center")w=(t.top+t.bottom)/2+f;else if(O(s)){const F=Object.keys(s)[0],z=s[F];w=this.chart.scales[F].getPixelForValue(z)+f}M=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")v=(t.left+t.right)/2-f;else if(O(s)){const F=Object.keys(s)[0],z=s[F];v=this.chart.scales[F].getPixelForValue(z)}M=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?B="top":l==="end"&&(B="bottom"));const j=this._getLabelSizes();for(g=0,y=r.length;g<y;++g){_=r[g],S=_.label;const F=o.setContext(this.getContext(g));C=this.getPixelForTick(g)+o.labelOffset,D=this._resolveTickFontOptions(g),A=D.lineHeight,P=W(S)?S.length:1;const z=P/2,$=F.color,ct=F.textStrokeColor,tt=F.textStrokeWidth;let le=M;a?(v=C,M==="inner"&&(g===y-1?le=this.options.reverse?"left":"right":g===0?le=this.options.reverse?"right":"left":le="center"),s==="top"?c==="near"||p!==0?L=-P*A+A/2:c==="center"?L=-j.highest.height/2-z*A+A:L=-j.highest.height+A/2:c==="near"||p!==0?L=A/2:c==="center"?L=j.highest.height/2-z*A:L=j.highest.height-P*A,d&&(L*=-1),p!==0&&!F.showLabelBackdrop&&(v+=A/2*Math.sin(p))):(w=C,L=(1-P)*A/2);let Ti;if(F.showLabelBackdrop){const ce=K(F.backdropPadding),Ee=j.heights[g],Be=j.widths[g];let ze=L-ce.top,We=0-ce.left;switch(B){case"middle":ze-=Ee/2;break;case"bottom":ze-=Ee;break}switch(M){case"center":We-=Be/2;break;case"right":We-=Be;break}Ti={left:We,top:ze,width:Be+ce.width,height:Ee+ce.height,color:F.backdropColor}}m.push({label:S,font:D,textOffset:L,options:{rotation:p,color:$,strokeColor:ct,strokeWidth:tt,textAlign:le,textBaseline:B,translation:[v,w],backdrop:Ti}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ft(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,h;return e==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;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:n,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,a=s.length;o<a;++o){const l=s[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),a=n.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,u;this.isHorizontal()?(c=Bt(t,this.left,a)-a/2,h=Bt(t,this.right,r)+r/2,d=u=l):(d=Bt(t,this.top,a)-a/2,u=Bt(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&Ge(n,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,h=a.textOffset;zt(n,c,0,h,l,r)}s&&qe(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=X(n.font),a=K(n.padding),r=n.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||O(e)?(l+=a.bottom,W(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=gc(this,l,e,r);zt(t,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:u,textAlign:fc(r,e,s),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,n=T(t.grid&&t.grid.z,-1),s=T(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Gt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[n]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return X(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class li{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,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 n;bc(e)&&(n=this.register(e));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,pc(t,a,n),this.override&&U.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in U[s]&&(delete U[s][n],this.override&&delete Et[n])}}function pc(i,t,e){const n=dt(Object.create(null),[e?U.get(e):{},U.get(t),i.defaults]);U.set(t,n),i.defaultRoutes&&mc(t,i.defaultRoutes),i.descriptors&&U.describe(t,i.descriptors)}function mc(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");U.route(o,s,l,r)})}function bc(i){return"id"in i&&"defaults"in i}class yc{constructor(){this.controllers=new li(St,"datasets",!0),this.elements=new li(lt,"elements"),this.plugins=new li(Object,"plugins"),this.scales=new li(Gt,"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,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):R(s,a=>{const r=n||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,n){const s=Bi(t);E(n["before"+s],[],n),e[t](n),E(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var gt=new yc;class xc{constructor(){this._init=[]}notify(t,e,n,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,n,s){s=s||{};for(const o of t){const a=o.plugin,r=a[n],l=[e,s,o.options];if(E(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){I(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,s=T(n.options&&n.options.plugins,{}),o=_c(n);return s===!1&&!e?[]:Sc(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function _c(i){const t={},e=[],n=Object.keys(gt.plugins.items);for(let o=0;o<n.length;o++)e.push(gt.getPlugin(n[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function vc(i,t){return!t&&i===!1?null:i===!0?{}:i}function Sc(i,{plugins:t,localIds:e},n,s){const o=[],a=i.getContext();for(const r of t){const l=r.id,c=vc(n[l],s);c!==null&&o.push({plugin:r,options:wc(i.config,{plugin:r,local:e[l]},c,a)})}return o}function wc(i,{plugin:t,local:e},n,s){const o=i.pluginScopeKeys(t),a=i.getOptionScopes(n,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function cn(i,t){const e=U.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function kc(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Cc(i,t){return i===t?"_index_":"_value_"}function Zs(i){if(i==="x"||i==="y"||i==="r")return i}function Mc(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function hn(i,...t){if(Zs(i))return i;for(const e of t){const n=e.axis||Mc(e.position)||i.length>1&&Zs(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Js(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Pc(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return Js(i,"x",e[0])||Js(i,"y",e[0])}return{}}function Ac(i,t){const e=Et[i.type]||{scales:{}},n=t.scales||{},s=cn(i.type,t),o=Object.create(null);return Object.keys(n).forEach(a=>{const r=n[a];if(!O(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=hn(a,r,Pc(a,i),U.scales[r.type]),c=Cc(l,s),h=e.scales||{};o[a]=ue(Object.create(null),[{axis:l},r,h[l],h[c]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,l=a.indexAxis||cn(r,t),h=(Et[r]||{}).scales||{};Object.keys(h).forEach(d=>{const u=kc(d,l),f=a[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),ue(o[f],[{axis:u},n[f],h[d]])})}),Object.keys(o).forEach(a=>{const r=o[a];ue(r,[U.scales[r.type],U.scale])}),o}function Qs(i){const t=i.options||(i.options={});t.plugins=T(t.plugins,{}),t.scales=Ac(i,t)}function to(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Dc(i){return i=i||{},i.data=to(i.data),Qs(i),i}const eo=new Map,io=new Set;function ci(i,t){let e=eo.get(i);return e||(e=t(),eo.set(i,e),io.add(e)),e}const Ae=(i,t,e)=>{const n=At(t,e);n!==void 0&&i.add(n)};class Lc{constructor(t){this._config=Dc(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=to(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(),Qs(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ci(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ci(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ci(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return ci(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,a=this._cachedScopes(t,n),r=a.get(e);if(r)return r;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Ae(l,t,d))),h.forEach(d=>Ae(l,s,d)),h.forEach(d=>Ae(l,Et[o]||{},d)),h.forEach(d=>Ae(l,U,d)),h.forEach(d=>Ae(l,Xi,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),io.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Et[e]||{},U.datasets[e]||{},{type:e},U,Xi]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=no(this._resolverCache,t,s);let l=a;if(Oc(a,e)){o.$shared=!1,n=Dt(n)?n():n;const c=this.createResolver(t,n,r);l=Ut(a,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=no(this._resolverCache,t,n);return O(e)?Ut(o,e,void 0,s):o}}function no(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:Zi(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},n.set(s,o)),o}const Tc=i=>O(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||Dt(i[e]),!1);function Oc(i,t){const{isScriptable:e,isIndexable:n}=os(i);for(const s of t){const o=e(s),a=n(s),r=(a||o)&&i[s];if(o&&(Dt(r)||Tc(r))||a&&W(r))return!0}return!1}var Ic="4.4.0";const Fc=["top","bottom","left","right","chartArea"];function so(i,t){return i==="top"||i==="bottom"||Fc.indexOf(i)===-1&&t==="x"}function oo(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function ao(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),E(e&&e.onComplete,[i],t)}function Rc(i){const t=i.chart,e=t.options.animation;E(e&&e.onProgress,[i],t)}function ro(i){return us()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const hi={},lo=i=>{const t=ro(i);return Object.values(hi).filter(e=>e.canvas===t).pop()};function Ec(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const a=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=a)}}}function Bc(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}function di(i,t,e){return i.options.clip?i[e]:t[e]}function zc(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:di(e,t,"left"),right:di(e,t,"right"),top:di(n,t,"top"),bottom:di(n,t,"bottom")}:t}let wt=(It=class{static register(...t){gt.add(...t),co()}static unregister(...t){gt.remove(...t),co()}constructor(t,e){const n=this.config=new Lc(e),s=ro(t),o=lo(s);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 a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||ec(s)),this.platform.updateConfig(n);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Ba(),this.ctx=r,this.canvas=l,this.width=h,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new xc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=tr(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],hi[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}vt.listen(this,"complete",ao),vt.listen(this,"progress",Rc),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return I(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return gt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():fs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return is(this.canvas,this.ctx),this}stop(){return vt.stop(this),this}resize(t,e){vt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,o),r=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,fs(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),E(n.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};R(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=hn(a,r),c=l==="r",h=l==="x";return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),R(o,a=>{const r=a.options,l=r.id,c=hn(l,r),h=T(r.type,a.dtype);(r.position===void 0||so(r.position,c)!==so(a.dposition))&&(r.position=a.dposition),s[l]=!0;let d=null;if(l in n&&n[l].type===h)d=n[l];else{const u=gt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(r,t)}),R(s,(a,r)=>{a||delete n[r]}),R(n,a=>{at.configure(this,a,a.options),at.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(oo("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const o=e[n];let a=this.getDatasetMeta(n);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=r,a.indexAxis=o.indexAxis||cn(r,this.options),a.order=o.order||0,a.index=n,a.label=""+o.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{const l=gt.getController(r),{datasetElementType:c,dataElementType:h}=U.datasets[r];Object.assign(l,{dataElementType:gt.getElement(h),datasetElementType:c&>.getElement(c)}),a.controller=new l(this,n),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){R(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 n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.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 a=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),u=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),s||R(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(oo("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){R(this.scales,t=>{at.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Nn(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const a=n==="_removeElements"?-o:o;Ec(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!Nn(s,n(o)))return;return Array.from(s).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;at.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],R(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Dt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(vt.has(this)?this.attached&&!vt.running(this)&&vt.start(this):(this.draw(),ao({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resize(n,s),this._resizeBeforeDraw=null}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,n=[];let s,o;for(s=0,o=e.length;s<o;++s){const a=e[s];(!t||a.visible)&&n.push(a)}return n}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,n=t._clip,s=!n.disabled,o=zc(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&Ge(e,{left:n.left===!1?0:o.left-n.left,right:n.right===!1?this.width:o.right+n.right,top:n.top===!1?0:o.top-n.top,bottom:n.bottom===!1?this.height:o.bottom+n.bottom}),t.controller.draw(),s&&qe(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return _t(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=Fl.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=Lt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);fe(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(o,{visible:n}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),vt.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(),is(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete hi[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,n=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};R(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),n("resize",o),n("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){R(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},R(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!je(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),a=o(e,t),r=n?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,a=e,r=this._getActiveElements(t,s,n,a),l=ja(t),c=Bc(t,this._lastEvent,n,l);n&&(this._lastEvent=null,E(o.onHover,[t,r,this],this),l&&E(o.onClick,[t,r,this],this));const h=!je(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}},k(It,"defaults",U),k(It,"instances",hi),k(It,"overrides",Et),k(It,"registry",gt),k(It,"version",Ic),k(It,"getChart",lo),It);function co(){return R(wt.instances,i=>i._plugins.invalidate())}function Wc(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;i.beginPath(),i.arc(o,a,r,n-c,e+c),l>s?(c=s/l,i.arc(o,a,l,e+c,n-c,!0)):i.arc(o,a,s,e+Y,n-Y),i.closePath(),i.clip()}function Hc(i){return Ki(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Nc(i,t,e,n){const s=Hc(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,n*t/2),r=l=>{const c=(e-Math.min(o,l))*n/2;return Z(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:Z(s.innerStart,0,a),innerEnd:Z(s.innerEnd,0,a)}}function qt(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function ui(i,t,e,n,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+n+e-c,0),u=h>0?h+n+e+c:0;let f=0;const b=s-l;if(n){const F=h>0?h-n:0,z=d>0?d-n:0,$=(F+z)/2,ct=$!==0?b*$/($+n):b;f=(b-ct)/2}const p=Math.max(.001,b*d-e/N)/d,m=(b-p)/2,g=l+m+f,y=s-m-f,{outerStart:_,outerEnd:S,innerStart:v,innerEnd:w}=Nc(t,u,d,y-g),M=d-_,C=d-S,D=g+_/M,A=y-S/C,P=u+v,L=u+w,B=g+v/P,j=y-w/L;if(i.beginPath(),o){const F=(D+A)/2;if(i.arc(a,r,d,D,F),i.arc(a,r,d,F,A),S>0){const tt=qt(C,A,a,r);i.arc(tt.x,tt.y,S,A,y+Y)}const z=qt(L,y,a,r);if(i.lineTo(z.x,z.y),w>0){const tt=qt(L,j,a,r);i.arc(tt.x,tt.y,w,y+Y,j+Math.PI)}const $=(y-w/u+(g+v/u))/2;if(i.arc(a,r,u,y-w/u,$,!0),i.arc(a,r,u,$,g+v/u,!0),v>0){const tt=qt(P,B,a,r);i.arc(tt.x,tt.y,v,B+Math.PI,g-Y)}const ct=qt(M,g,a,r);if(i.lineTo(ct.x,ct.y),_>0){const tt=qt(M,D,a,r);i.arc(tt.x,tt.y,_,g-Y,D)}}else{i.moveTo(a,r);const F=Math.cos(D)*d+a,z=Math.sin(D)*d+r;i.lineTo(F,z);const $=Math.cos(A)*d+a,ct=Math.sin(A)*d+r;i.lineTo($,ct)}i.closePath()}function Vc(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){ui(i,t,e,n,l,s);for(let c=0;c<o;++c)i.fill();isNaN(r)||(l=a+(r%H||H))}return ui(i,t,e,n,l,s),i.fill(),l}function jc(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u}=l,f=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=u,f?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let b=t.endAngle;if(o){ui(i,t,e,n,b,s);for(let p=0;p<o;++p)i.stroke();isNaN(r)||(b=a+(r%H||H))}f&&Wc(i,t,b),o||(ui(i,t,e,n,b,s),i.stroke())}class Kt extends lt{constructor(e){super();k(this,"circumference");k(this,"endAngle");k(this,"fullCircles");k(this,"innerRadius");k(this,"outerRadius");k(this,"pixelMargin");k(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,n,s){const o=this.getProps(["x","y"],s),{angle:a,distance:r}=Un(o,{x:e,y:n}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,p=T(u,c-l)>=H||me(a,l,c),m=xt(r,h+f,d+f);return p&&m}getCenterPoint(e){const{x:n,y:s,startAngle:o,endAngle:a,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,d=(o+a)/2,u=(r+l+h+c)/2;return{x:n+Math.cos(d)*u,y:s+Math.sin(d)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:s}=this,o=(n.offset||0)/4,a=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>H?Math.floor(s/H):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(N,s||0)),h=o*c;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,Vc(e,this,h,a,r),jc(e,this,h,a,r),e.restore()}}k(Kt,"id","arc"),k(Kt,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),k(Kt,"defaultRoutes",{backgroundColor:"backgroundColor"}),k(Kt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function ho(i,t,e=t){i.lineCap=T(e.borderCapStyle,t.borderCapStyle),i.setLineDash(T(e.borderDash,t.borderDash)),i.lineDashOffset=T(e.borderDashOffset,t.borderDashOffset),i.lineJoin=T(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=T(e.borderWidth,t.borderWidth),i.strokeStyle=T(e.borderColor,t.borderColor)}function $c(i,t,e){i.lineTo(e.x,e.y)}function Uc(i){return i.stepped?gr:i.tension||i.cubicInterpolationMode==="monotone"?pr:$c}function uo(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function Yc(i,t,e,n){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=uo(s,e,n),h=Uc(o);let{move:d=!0,reverse:u}=n||{},f,b,p;for(f=0;f<=c;++f)b=s[(r+(u?c-f:f))%a],!b.skip&&(d?(i.moveTo(b.x,b.y),d=!1):h(i,p,b,u,o.stepped),p=b);return l&&(b=s[(r+(u?c:0))%a],h(i,p,b,u,o.stepped)),!!l}function Xc(i,t,e,n){const s=t.points,{count:o,start:a,ilen:r}=uo(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,d=0,u,f,b,p,m,g;const y=S=>(a+(c?r-S:S))%o,_=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,g))};for(l&&(f=s[y(0)],i.moveTo(f.x,f.y)),u=0;u<=r;++u){if(f=s[y(u)],f.skip)continue;const S=f.x,v=f.y,w=S|0;w===b?(v<p?p=v:v>m&&(m=v),h=(d*h+S)/++d):(_(),i.lineTo(S,v),b=w,d=0,p=m=v),g=v}_()}function dn(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Xc:Yc}function Gc(i){return i.stepped?Gr:i.tension||i.cubicInterpolationMode==="monotone"?qr:Vt}function qc(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),ho(i,t.options),i.stroke(s)}function Kc(i,t,e,n){const{segments:s,options:o}=t,a=dn(t);for(const r of s)ho(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const Zc=typeof Path2D=="function";function Jc(i,t,e,n){Zc&&!t.options.segment?qc(i,t,e,n):Kc(i,t,e,n)}class pt extends lt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;Hr(this._points,n,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=el(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,a=_s(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=Gc(n);let c,h;for(c=0,h=a.length;c<h;++c){const{start:d,end:u}=a[c],f=o[d],b=o[u];if(f===b){r.push(f);continue}const p=Math.abs((s-f[e])/(b[e]-f[e])),m=l(f,b,p,n.stepped);m[e]=t[e],r.push(m)}return r.length===1?r[0]:r}pathSegment(t,e,n){return dn(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=dn(this);let a=this._loop;e=e||0,n=n||this.points.length-e;for(const r of s)a&=o(t,this,r,{start:e,end:e+n-1});return!!a}draw(t,e,n,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Jc(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}k(pt,"id","line"),k(pt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),k(pt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),k(pt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function fo(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class Tt extends lt{constructor(e){super();k(this,"parsed");k(this,"skip");k(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,n,s){const o=this.options,{x:a,y:r}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(n-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,n){return fo(this,e,"x",n)}inYRange(e,n){return fo(this,e,"y",n)}getCenterPoint(e){const{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}size(e){e=e||this.options||{};let n=e.radius||0;n=Math.max(n,n&&e.hoverRadius||0);const s=n&&e.borderWidth||0;return(n+s)*2}draw(e,n){const s=this.options;this.skip||s.radius<.1||!_t(this,n,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,qi(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}k(Tt,"id","point"),k(Tt,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),k(Tt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function go(i,t){const{x:e,y:n,base:s,width:o,height:a}=i.getProps(["x","y","base","width","height"],t);let r,l,c,h,d;return i.horizontal?(d=a/2,r=Math.min(e,s),l=Math.max(e,s),c=n-d,h=n+d):(d=o/2,r=e-d,l=e+d,c=Math.min(n,s),h=Math.max(n,s)),{left:r,top:c,right:l,bottom:h}}function Ot(i,t,e,n){return i?0:Z(t,e,n)}function Qc(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,o=ss(n);return{t:Ot(s.top,o.top,0,e),r:Ot(s.right,o.right,0,t),b:Ot(s.bottom,o.bottom,0,e),l:Ot(s.left,o.left,0,t)}}function th(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,o=Wt(s),a=Math.min(t,e),r=i.borderSkipped,l=n||O(s);return{topLeft:Ot(!l||r.top||r.left,o.topLeft,0,a),topRight:Ot(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Ot(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Ot(!l||r.bottom||r.right,o.bottomRight,0,a)}}function eh(i){const t=go(i),e=t.right-t.left,n=t.bottom-t.top,s=Qc(i,e/2,n/2),o=th(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function un(i,t,e,n){const s=t===null,o=e===null,r=i&&!(s&&o)&&go(i,n);return r&&(s||xt(t,r.left,r.right))&&(o||xt(e,r.top,r.bottom))}function ih(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function nh(i,t){i.rect(t.x,t.y,t.w,t.h)}function fn(i,t,e={}){const n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-n,a=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+o,h:i.h+a,radius:i.radius}}class Zt extends lt{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:n,backgroundColor:s}}=this,{inner:o,outer:a}=eh(this),r=ih(a.radius)?xe:nh;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,fn(a,e,o)),t.clip(),r(t,fn(o,-e,a)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),r(t,fn(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return un(this,t,e,n)}inXRange(t,e){return un(this,t,null,e)}inYRange(t,e){return un(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}k(Zt,"id","bar"),k(Zt,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),k(Zt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function sh(i,t,e){const n=i.segments,s=i.points,o=t.points,a=[];for(const r of n){let{start:l,end:c}=r;c=pn(l,c,s);const h=gn(e,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:h,start:s[l],end:s[c]});continue}const d=_s(t,h);for(const u of d){const f=gn(e,o[u.start],o[u.end],u.loop),b=xs(r,s,f);for(const p of b)a.push({source:p,target:u,start:{[e]:po(h,f,"start",Math.max)},end:{[e]:po(h,f,"end",Math.min)}})}}return a}function gn(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=st(s),o=st(o)),{property:i,start:s,end:o}}function oh(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=pn(a,r,s);const l=s[a],c=s[r];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function pn(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function po(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function mo(i,t){let e=[],n=!1;return W(i)?(n=!0,e=i):e=oh(i,t),e.length?new pt({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function bo(i){return i&&i.fill!==!1}function ah(i,t,e){let s=i[t].fill;const o=[t];let a;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!q(s))return s;if(a=i[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function rh(i,t,e){const n=dh(i);if(O(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return q(s)&&Math.floor(s)===s?lh(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function lh(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function ch(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:O(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function hh(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:O(i)?n=i.value:n=t.getBaseValue(),n}function dh(i){const t=i.options,e=t.fill;let n=T(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function uh(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,a=n.points,r=fh(t,e);r.push(mo({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)gh(s,a[h],r)}return new pt({points:s,options:{}})}function fh(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function gh(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=ph(o,t,"x");if(!(!l||a&&r)){if(a)n.unshift(l);else if(i.push(l),!r)break}}i.push(...n)}function ph(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],o=i.segments,a=i.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],d=a[h.start][e],u=a[h.end][e];if(xt(s,d,u)){r=s===d,l=s===u;break}}return{first:r,last:l,point:n}}class yo{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:o,radius:a}=this;return e=e||{start:0,end:H},t.arc(s,o,a,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}}function mh(i){const{chart:t,fill:e,line:n}=i;if(q(e))return bh(t,e);if(e==="stack")return uh(i);if(e==="shape")return!0;const s=yh(i);return s instanceof yo?s:mo(s,n)}function bh(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function yh(i){return(i.scale||{}).getPointPositionForValue?_h(i):xh(i)}function xh(i){const{scale:t={},fill:e}=i,n=ch(e,t);if(q(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function _h(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,a=hh(e,t,o),r=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,o);return new yo({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function mn(i,t,e){const n=mh(t),{line:s,scale:o,axis:a}=t,r=s.options,l=r.fill,c=r.backgroundColor,{above:h=c,below:d=c}=l||{};n&&s.points.length&&(Ge(i,e),vh(i,{line:s,target:n,above:h,below:d,area:e,scale:o,axis:a}),qe(i))}function vh(i,t){const{line:e,target:n,above:s,below:o,area:a,scale:r}=t,l=e._loop?"angle":t.axis;i.save(),l==="x"&&o!==s&&(xo(i,n,a.top),_o(i,{line:e,target:n,color:s,scale:r,property:l}),i.restore(),i.save(),xo(i,n,a.bottom)),_o(i,{line:e,target:n,color:o,scale:r,property:l}),i.restore()}function xo(i,t,e){const{segments:n,points:s}=t;let o=!0,a=!1;i.beginPath();for(const r of n){const{start:l,end:c}=r,h=s[l],d=s[pn(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(d.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function _o(i,t){const{line:e,target:n,property:s,color:o,scale:a}=t,r=sh(e,n,s);for(const{source:l,target:c,start:h,end:d}of r){const{style:{backgroundColor:u=o}={}}=l,f=n!==!0;i.save(),i.fillStyle=u,Sh(i,a,f&&gn(s,h,d)),i.beginPath();const b=!!e.pathSegment(i,l);let p;if(f){b?i.closePath():vo(i,n,d,s);const m=!!n.pathSegment(i,c,{move:b,reverse:!0});p=b&&m,p||vo(i,n,h,s)}i.closePath(),i.fill(p?"evenodd":"nonzero"),i.restore()}}function Sh(i,t,e){const{top:n,bottom:s}=t.chart.chartArea,{property:o,start:a,end:r}=e||{};o==="x"&&(i.beginPath(),i.rect(a,n,r-a,s-n),i.clip())}function vo(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var wh={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<n;++a)o=i.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof pt&&(l={visible:i.isDatasetVisible(a),index:a,fill:rh(r,a,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<n;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=ah(s,a,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),n&&r.fill&&mn(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;bo(o)&&mn(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!bo(n)||e.drawTime!=="beforeDatasetDraw"||mn(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const So=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},kh=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class wo extends lt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=E(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,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 n=t.labels,s=X(n.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=So(n,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+r;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((b,p)=>{const m=n+e/2+o.measureText(b.text).width;(p===0||c[c.length-1]+m+2*r>a)&&(d+=h,c[c.length-(p>0?0:1)]=0,f+=h,u++),l[p]={left:0,top:f,row:u,width:m,height:s},c[c.length-1]+=m+r}),d}_fitCols(t,e,n,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-t;let d=r,u=0,f=0,b=0,p=0;return this.legendItems.forEach((m,g)=>{const{itemWidth:y,itemHeight:_}=Ch(n,e,o,m,s);g>0&&f+_+2*r>h&&(d+=u+r,c.push({width:u,height:f}),b+=u+r,p++,u=f=0),l[g]={left:b,top:f,col:p,width:y,height:_},u=Math.max(u,y),f+=_+r}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,a=Xt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=J(n,this.left+s,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=J(n,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=J(n,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=J(n,this.top+t+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ge(t,this),this._draw(),qe(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:a}=t,r=U.color,l=Xt(t.rtl,this.left,this.width),c=X(a.font),{padding:h}=a,d=c.size,u=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:b,boxHeight:p,itemHeight:m}=So(a,d),g=function(w,M,C){if(isNaN(b)||b<=0||isNaN(p)||p<0)return;s.save();const D=T(C.lineWidth,1);if(s.fillStyle=T(C.fillStyle,r),s.lineCap=T(C.lineCap,"butt"),s.lineDashOffset=T(C.lineDashOffset,0),s.lineJoin=T(C.lineJoin,"miter"),s.lineWidth=D,s.strokeStyle=T(C.strokeStyle,r),s.setLineDash(T(C.lineDash,[])),a.usePointStyle){const A={radius:p*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:D},P=l.xPlus(w,b/2),L=M+u;ns(s,A,P,L,a.pointStyleWidth&&b)}else{const A=M+Math.max((d-p)/2,0),P=l.leftForLtr(w,b),L=Wt(C.borderRadius);s.beginPath(),Object.values(L).some(B=>B!==0)?xe(s,{x:P,y:A,w:b,h:p,radius:L}):s.rect(P,A,b,p),s.fill(),D!==0&&s.stroke()}s.restore()},y=function(w,M,C){zt(s,C.text,w,M+m/2,c,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)})},_=this.isHorizontal(),S=this._computeTitleHeight();_?f={x:J(o,this.left+h,this.right-n[0]),y:this.top+h+S,line:0}:f={x:this.left+h,y:J(o,this.top+S+h,this.bottom-e[0].height),line:0},ps(this.ctx,t.textDirection);const v=m+h;this.legendItems.forEach((w,M)=>{s.strokeStyle=w.fontColor,s.fillStyle=w.fontColor;const C=s.measureText(w.text).width,D=l.textAlign(w.textAlign||(w.textAlign=a.textAlign)),A=b+u+C;let P=f.x,L=f.y;l.setWidth(this.width),_?M>0&&P+A+h>this.right&&(L=f.y+=v,f.line++,P=f.x=J(o,this.left+h,this.right-n[f.line])):M>0&&L+v>this.bottom&&(P=f.x=P+e[f.line].width+h,f.line++,L=f.y=J(o,this.top+S+h,this.bottom-e[f.line].height));const B=l.x(P);if(g(B,L,w),P=er(D,P+b+u,_?P+A:this.right,t.rtl),y(l.x(P),L,w),_)f.x+=A+h;else if(typeof w.text!="string"){const j=c.lineHeight;f.y+=ko(w,j)+h}else f.y+=v}),ms(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=X(e.font),s=K(e.padding);if(!e.display)return;const o=Xt(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=n.size/2,c=s.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=J(t.align,d,this.right-u);else{const b=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+J(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}const f=J(r,d,d+u);a.textAlign=o.textAlign(Vi(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=n.string,zt(a,e.text,f,h,n)}_computeTitleHeight(){const t=this.options.title,e=X(t.font),n=K(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(xt(t,this.left,this.right)&&xt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],xt(t,s.left,s.left+s.width)&&xt(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!Ah(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=kh(s,n);s&&!o&&E(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&E(e.onHover,[t,n,this],this)}else n&&E(e.onClick,[t,n,this],this)}}function Ch(i,t,e,n,s){const o=Mh(n,i,t,e),a=Ph(s,n,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Mh(i,t,e,n){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+n.measureText(s).width}function Ph(i,t,e){let n=i;return typeof t.text!="string"&&(n=ko(t,e)),n}function ko(i,t){const e=i.text?i.text.length:0;return t*e}function Ah(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Jt={id:"legend",_element:wo,start(i,t,e){const n=i.legend=new wo({ctx:i.ctx,options:e,chart:i});at.configure(i,n,e),at.addBox(i,n)},stop(i){at.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;at.configure(i,n,e),n.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 n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),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:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=K(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:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Co extends lt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=W(n.text)?n.text.length:1;this._padding=K(n.padding);const o=s*X(n.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:n,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,h,d;return this.isHorizontal()?(h=J(r,n,o),d=e+t,c=o-n):(a.position==="left"?(h=n+t,d=J(r,s,e),l=N*-.5):(h=o-t,d=J(r,e,s),l=N*.5),c=s-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=X(e.font),o=n.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);zt(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:Vi(e.align),textBaseline:"middle",translation:[a,r]})}}function Dh(i,t){const e=new Co({ctx:i.ctx,options:t,chart:i});at.configure(i,e,t),at.addBox(i,e),i.titleBlock=e}var Qt={id:"title",_element:Co,start(i,t,e){Dh(i,e)},stop(i){const t=i.titleBlock;at.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;at.configure(i,n,e),n.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 De={average(i){if(!i.length)return!1;let t,e,n=0,s=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const r=a.tooltipPosition();n+=r.x,s+=r.y,++o}}return{x:n/o,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Hi(t,c);h<s&&(s=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function mt(i,t){return t&&(W(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function kt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
17
17
|
`)>-1?i.split(`
|
|
18
|
-
`):i}function eh(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:i,label:a,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function lo(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=U(t.bodyFont),c=U(t.titleFont),h=U(t.footerFont),d=o.length,u=s.length,f=n.length,m=K(t.padding);let p=m.height,g=0,b=n.reduce((S,x)=>S+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const S=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;p+=f*S+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const _=function(S){g=Math.max(g,e.measureText(S).width+y)};return e.save(),e.font=c.string,I(i.title,_),e.font=l.string,I(i.beforeBody.concat(i.afterBody),_),y=t.displayColors?a+2+t.boxPadding:0,I(n,S=>{I(S.before,_),I(S.lines,_),I(S.after,_)}),y=0,e.font=h.string,I(i.footer,_),e.restore(),g+=m.width,{width:g,height:p}}function ih(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function nh(i,t,e,n){const{x:s,width:o}=n,a=e.caretSize+e.caretPadding;if(i==="left"&&s+o+a>t.width||i==="right"&&s-o-a<0)return!0}function sh(i,t,e,n){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i;let c="center";return n==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),nh(c,i,t,e)&&(c="center"),c}function co(i,t,e){const n=e.yAlign||t.yAlign||ih(i,e);return{xAlign:e.xAlign||t.xAlign||sh(i,t,e,n),yAlign:n}}function oh(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function ah(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function ho(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Ft(a);let m=oh(t,r);const p=ah(t,l,c);return l==="center"?r==="left"?m+=c:r==="right"&&(m-=c):r==="left"?m-=Math.max(h,u)+s:r==="right"&&(m+=Math.max(d,f)+s),{x:q(m,0,n.width-t.width),y:q(p,0,n.height-t.height)}}function ni(i,t,e){const n=K(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function uo(i){return dt([],yt(i))}function rh(i,t,e){return wt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function fo(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const go={beforeTitle:ft,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:ft,beforeBody:ft,beforeLabel:ft,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 F(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:ft,afterBody:ft,beforeFooter:ft,footer:ft,afterFooter:ft};function J(i,t,e,n){const s=i[t].call(e,n);return typeof s>"u"?go[t].call(e,n):s}class on extends at{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new rs(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=rh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=J(n,"beforeTitle",this,t),o=J(n,"title",this,t),a=J(n,"afterTitle",this,t);let r=[];return r=dt(r,yt(s)),r=dt(r,yt(o)),r=dt(r,yt(a)),r}getBeforeBody(t,e){return uo(J(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return I(t,o=>{const a={before:[],lines:[],after:[]},r=fo(n,o);dt(a.before,yt(J(r,"beforeLabel",this,o))),dt(a.lines,J(r,"label",this,o)),dt(a.after,yt(J(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return uo(J(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=J(n,"beforeFooter",this,t),o=J(n,"footer",this,t),a=J(n,"afterFooter",this,t);let r=[];return r=dt(r,yt(s)),r=dt(r,yt(o)),r=dt(r,yt(a)),r}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;l<c;++l)r.push(eh(this.chart,e[l]));return t.filter&&(r=r.filter((h,d,u)=>t.filter(h,d,u,n))),t.itemSort&&(r=r.sort((h,d)=>t.itemSort(h,d,n))),I(r,h=>{const d=fo(t.callbacks,h);s.push(J(d,"labelColor",this,h)),o.push(J(d,"labelPointStyle",this,h)),a.push(J(d,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=ye[n.position].call(this,s,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);const l=this._size=lo(this,n),c=Object.assign({},r,l),h=co(this.chart,n,c),d=ho(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Ft(r),{x:u,y:f}=t,{width:m,height:p}=e;let g,b,y,_,S,x;return o==="center"?(S=f+p/2,s==="left"?(g=u,b=g-a,_=S+a,x=S-a):(g=u+m,b=g+a,_=S-a,x=S+a),y=g):(s==="left"?b=u+Math.max(l,h)+a:s==="right"?b=u+m-Math.max(c,d)-a:b=this.caretX,o==="top"?(_=f,S=_-a,g=b-a,y=b+a):(_=f+p,S=_+a,g=b+a,y=b-a),x=_),{x1:g,x2:b,x3:y,y1:_,y2:S,y3:x}}drawTitle(t,e,n){const s=this.title,o=s.length;let a,r,l;if(o){const c=Yt(n.rtl,this.x,this.width);for(t.x=ni(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",a=U(n.titleFont),r=n.titleSpacing,e.fillStyle=n.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=n.titleMarginBottom-r)}}_drawColorBox(t,e,n,s,o){const a=this.labelColors[n],r=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,h=U(o.bodyFont),d=ni(this,"left",o),u=s.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,m=e.y+f;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},g=s.leftForLtr(u,c)+c/2,b=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Bi(t,p,g,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Bi(t,p,g,b)}else{t.lineWidth=O(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const p=s.leftForLtr(u,c),g=s.leftForLtr(s.xPlus(u,1),c-2),b=Ft(a.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ae(t,{x:p,y:m,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ae(t,{x:g,y:m+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,m,c,l),t.strokeRect(p,m,c,l),t.fillStyle=a.backgroundColor,t.fillRect(g,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=n,d=U(n.bodyFont);let u=d.lineHeight,f=0;const m=Yt(n.rtl,this.x,this.width),p=function(w){e.fillText(w,m.x(t.x+f),t.y+u/2),t.y+=u+o},g=m.textAlign(a);let b,y,_,S,x,P,k;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=ni(this,g,n),e.fillStyle=n.bodyColor,I(this.beforeBody,p),f=r&&g!=="right"?a==="center"?c/2+h:c+2+h:0,S=0,P=s.length;S<P;++S){for(b=s[S],y=this.labelTextColors[S],e.fillStyle=y,I(b.before,p),_=b.lines,r&&_.length&&(this._drawColorBox(e,t,S,m,n),u=Math.max(d.lineHeight,l)),x=0,k=_.length;x<k;++x)p(_[x]),u=d.lineHeight;I(b.after,p)}f=0,u=d.lineHeight,I(this.afterBody,p),t.y-=o}drawFooter(t,e,n){const s=this.footer,o=s.length;let a,r;if(o){const l=Yt(n.rtl,this.x,this.width);for(t.x=ni(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",a=U(n.footerFont),e.fillStyle=n.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:h}=n,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:m}=Ft(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+d,l),a==="top"&&this.drawCaret(t,e,n,s),e.lineTo(r+c-u,l),e.quadraticCurveTo(r+c,l,r+c,l+u),a==="center"&&o==="right"&&this.drawCaret(t,e,n,s),e.lineTo(r+c,l+h-m),e.quadraticCurveTo(r+c,l+h,r+c-m,l+h),a==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(r+f,l+h),e.quadraticCurveTo(r,l+h,r,l+h-f),a==="center"&&o==="left"&&this.drawCaret(t,e,n,s),e.lineTo(r,l+d),e.quadraticCurveTo(r,l,r+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const a=ye[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=lo(this,t),l=Object.assign({},a,this._size),c=co(e,t,l),h=ho(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const a=K(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),Qn(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Jn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!De(n,s),a=this._positionChanged(s,e);(o||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,n),r=this._positionChanged(a,t),l=e||!De(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e;const a=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,a=ye[o.position].call(this,t,e);return a!==!1&&(n!==a.x||s!==a.y)}}M(on,"positioners",ye);var si={id:"tooltip",_element:on,positioners:ye,afterInit(i,t,e){e&&(i.tooltip=new on({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:go},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 lh=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ch(i,t,e,n){const s=i.indexOf(t);if(s===-1)return lh(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const hh=(i,t)=>i===null?null:q(Math.round(i),0,t);function po(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class oi extends zt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:o}of e)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(F(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:ch(n,t,L(e,t),this._addedLabels),hh(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return po.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}}M(oi,"id","category"),M(oi,"defaults",{ticks:{callback:po}});function dh(i,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,m=h-1,{min:p,max:g}=t,b=!F(a),y=!F(r),_=!F(c),S=(g-p)/(d+1);let x=Mn((g-p)/m/f)*f,P,k,w,C;if(x<1e-14&&!b&&!y)return[{value:p},{value:g}];C=Math.ceil(g/x)-Math.floor(p/x),C>m&&(x=Mn(C*x/m/f)*f),F(l)||(P=Math.pow(10,l),x=Math.ceil(x*P)/P),s==="ticks"?(k=Math.floor(p/x)*x,w=Math.ceil(g/x)*x):(k=p,w=g),b&&y&&o&&xa((r-a)/o,x/1e3)?(C=Math.round(Math.min((r-a)/x,h)),x=(r-a)/C,k=a,w=r):_?(k=b?a:k,w=y?r:w,C=c-1,x=(w-k)/C):(C=(w-k)/x,ee(C,Math.round(C),x/1e3)?C=Math.round(C):C=Math.ceil(C));const A=Math.max(Pn(x),Pn(k));P=Math.pow(10,F(l)?A:l),k=Math.round(k*P)/P,w=Math.round(w*P)/P;let D=0;for(b&&(u&&k!==a?(e.push({value:a}),k<a&&D++,ee(Math.round((k+D*x)*P)/P,a,mo(a,S,i))&&D++):k<a&&D++);D<C;++D){const T=Math.round((k+D*x)*P)/P;if(y&&T>r)break;e.push({value:T})}return y&&u&&w!==r?e.length&&ee(e[e.length-1].value,r,mo(r,S,i))?e[e.length-1].value=r:e.push({value:r}):(!y||w===r)&&e.push({value:w}),e}function mo(i,t,{horizontal:e,minRotation:n}){const s=ct(n),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class ai extends zt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return F(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=e?s:l,r=l=>o=n?o:l;if(t){const l=lt(s),c=lt(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=dh(s,o);return t.bounds==="ticks"&&Cn(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return Fe(t,this.chart.options.locale,this.options.ticks.format)}}class ri extends ai{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=N(t)?t:0,this.max=N(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=ct(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}M(ri,"id","linear"),M(ri,"defaults",{ticks:{callback:Ie.formatters.numeric}});const xe=i=>Math.floor(kt(i)),Ht=(i,t)=>Math.pow(10,xe(i)+t);function bo(i){return i/Math.pow(10,xe(i))===1}function yo(i,t,e){const n=Math.pow(10,e),s=Math.floor(i/n);return Math.ceil(t/n)-s}function uh(i,t){const e=t-i;let n=xe(e);for(;yo(i,t,n)>10;)n++;for(;yo(i,t,n)<10;)n--;return Math.min(n,xe(i))}function fh(i,{min:t,max:e}){t=et(i.min,t);const n=[],s=xe(t);let o=uh(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,h=Math.floor((t-l)/r/10)*r*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=et(i.min,Math.round((l+h+d*Math.pow(10,o))*a)/a);for(;u<e;)n.push({value:u,major:bo(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,a=o>=0?1:a),u=Math.round((l+h+d*Math.pow(10,o))*a)/a;const f=et(i.max,u);return n.push({value:f,major:bo(f),significand:d}),n}class xo extends zt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=ai.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return N(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=N(t)?Math.max(0,t):null,this.max=N(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!N(this._userMin)&&(this.min=t===Ht(this.min,0)?Ht(this.min,-1):Ht(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const o=r=>n=t?n:r,a=r=>s=e?s:r;n===s&&(n<=0?(o(1),a(10)):(o(Ht(n,-1)),a(Ht(s,1)))),n<=0&&o(Ht(s,-1)),s<=0&&a(Ht(n,1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=fh(e,this);return t.bounds==="ticks"&&Cn(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":Fe(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=kt(t),this._valueRange=kt(this.max)-kt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(kt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}M(xo,"id","logarithmic"),M(xo,"defaults",{ticks:{callback:Ie.formatters.logarithmic,major:{enabled:!0}}});function an(i){const t=i.ticks;if(t.display&&i.display){const e=K(t.backdropPadding);return L(t.font&&t.font.size,j.font.size)+e.height}return 0}function gh(i,t,e){return e=B(e)?e:[e],{w:za(i,t.string,e),h:e.length*t.lineHeight}}function _o(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function ph(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?H/o:0;for(let l=0;l<o;l++){const c=a.setContext(i.getPointLabelContext(l));s[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+s[l],r),d=U(c.font),u=gh(i.ctx,d,i._pointLabels[l]);n[l]=u;const f=it(i.getIndexAngle(l)+r),m=Math.round(Di(f)),p=_o(m,h.x,u.w,0,180),g=_o(m,h.y,u.h,90,270);mh(e,t,f,p,g)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=xh(i,n,s)}function mh(i,t,e,n,s){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,l=0;n.start<t.l?(r=(t.l-n.start)/o,i.l=Math.min(i.l,t.l-r)):n.end>t.r&&(r=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,i.b=Math.max(i.b,t.b+l))}function bh(i,t,e){const n=i.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=e,l=i.getPointPosition(t,n+s+a,o),c=Math.round(Di(it(l.angle+V))),h=Sh(l.y,r.h,c),d=_h(c),u=vh(l.x,r.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+r.w,bottom:h+r.h}}function yh(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:o}=i;return!(pt({x:e,y:n},t)||pt({x:e,y:o},t)||pt({x:s,y:n},t)||pt({x:s,y:o},t))}function xh(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:an(o)/2,additionalAngle:a?H/s:0};let c;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const d=bh(i,h,l);n.push(d),r==="auto"&&(d.visible=yh(d,c),d.visible&&(c=d))}return n}function _h(i){return i===0||i===180?"center":i<180?"left":"right"}function vh(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function Sh(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function kh(i,t,e){const{left:n,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!F(r)){const l=Ft(t.borderRadius),c=K(t.backdropPadding);i.fillStyle=r;const h=n-c.left,d=s-c.top,u=o-n+c.width,f=a-s+c.height;Object.values(l).some(m=>m!==0)?(i.beginPath(),ae(i,{x:h,y:d,w:u,h:f,radius:l}),i.fill()):i.fillRect(h,d,u,f)}}function wh(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const o=i._pointLabelItems[s];if(!o.visible)continue;const a=n.setContext(i.getPointLabelContext(s));kh(e,a,o);const r=U(a.font),{x:l,y:c,textAlign:h}=o;Ot(e,i._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function vo(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,z);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<n;a++)o=i.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function Mh(i,t,e,n,s){const o=i.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!n||!r||!l||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash),o.lineDashOffset=s.dashOffset,o.beginPath(),vo(i,e,a,n),o.closePath(),o.stroke(),o.restore())}function Ch(i,t,e){return wt(i,{label:e,index:t,type:"pointLabel"})}class _e extends ai{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=K(an(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=N(t)&&!isNaN(t)?t:0,this.max=N(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/an(this.options))}generateTickLabels(t){ai.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=E(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?ph(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=z/(this._pointLabels.length||1),n=this.options.startAngle||0;return it(t*e+ct(n))}getDistanceFromCenterForValue(t){if(F(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(F(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return Ch(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-V+n;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),vo(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s,border:o}=e,a=this._pointLabels.length;let r,l,c;if(e.pointLabels.display&&wh(this,a),s.display&&this.ticks.forEach((h,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(d),f=s.setContext(u),m=o.setContext(u);Mh(this,f,l,a,m)}}),n.display){for(t.save(),r=a-1;r>=0;r--){const h=n.setContext(this.getPointLabelContext(r)),{color:d,lineWidth:u}=h;!u||!d||(t.lineWidth=u,t.strokeStyle=d,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&!e.reverse)return;const c=n.setContext(this.getContext(l)),h=U(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;const d=K(c.backdropPadding);t.fillRect(-a/2-d.left,-o-h.size/2-d.top,a+d.width,h.size+d.height)}Ot(t,r.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}M(_e,"id","radialLinear"),M(_e,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ie.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),M(_e,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),M(_e,"descriptors",{angleLines:{_fallback:"grid"}});const li={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}},tt=Object.keys(li);function So(i,t){return i-t}function ko(i,t){if(F(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let a=t;return typeof n=="function"&&(a=n(a)),N(a)||(a=typeof n=="string"?e.parse(a,n):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(ie(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function wo(i,t,e,n){const s=tt.length;for(let o=tt.indexOf(i);o<s-1;++o){const a=li[tt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=n)return tt[o]}return tt[s-1]}function Ph(i,t,e,n,s){for(let o=tt.length-1;o>=tt.indexOf(e);o--){const a=tt[o];if(li[a].common&&i._adapter.diff(s,n,a)>=t-1)return a}return tt[e?tt.indexOf(e):0]}function Ah(i){for(let t=tt.indexOf(i)+1,e=tt.length;t<e;++t)if(li[tt[t]].common)return tt[t]}function Mo(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=Li(e,t),o=e[n]>=t?e[n]:e[s];i[o]=!0}}function Dh(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,n))l=e[r],l>=0&&(t[l].major=!0);return t}function Co(i,t,e){const n=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,n.push({value:r,major:!1});return o===0||!e?n:Dh(i,n,s,e)}class ci extends zt{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 n=t.time||(t.time={}),s=this._adapter=new tl._date(t.adapters.date);s.init(e),Jt(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:ko(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=N(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),o=N(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,r=ka(s,o,a);return this._unit=e.unit||(n.autoSkip?wo(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Ph(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Ah(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),Co(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=q(e,0,a),n=q(n,0,a),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,a=o.unit||wo(o.minUnit,e,n,this._getLabelCapacity(e)),r=L(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=ie(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(n,e,a)>1e5*r)throw new Error(e+" and "+n+" are too far apart with stepSize of "+r+" "+a);const m=s.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<n;u=+t.add(u,r,a),f++)Mo(h,u,m);return(u===n||s.bounds==="ticks"||f===1)&&Mo(h,u,m),Object.keys(h).sort(So).map(p=>+p)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,a=e||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,n,s){const o=this.options,a=o.ticks.callback;if(a)return E(a,[t,e,n],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&r[l],d=c&&r[c],u=n[e],f=c&&d&&u&&u.major;return this._adapter.format(t,s||(f?d:h))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=ct(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:n*o+r*a,h:n*a+r*o}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,Co(this,[t],this._majorUnit),s),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(ko(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ln(t.sort(So))}}M(ci,"id","time"),M(ci,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function hi(i,t,e){let n=0,s=i.length-1,o,a,r,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=Dt(i,"pos",t)),{pos:o,time:r}=i[n],{pos:a,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=Dt(i,"time",t)),{time:o,pos:r}=i[n],{time:a,pos:l}=i[s]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class Po extends ci{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=hi(e,this.min),this._tableRange=hi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let a,r,l,c,h;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(a=0,r=s.length;a<r;++a)h=s[a+1],l=s[a-1],c=s[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(e)||n.length===1)&&n.push(e),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(hi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return hi(this._table,n*this._tableRange+this._minPos,!0)}}M(Po,"id","timeseries"),M(Po,"defaults",ci.defaults);const Ao={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Th={type:{type:String,required:!0},...Ao},Lh=v.version[0]==="2"?(i,t)=>Object.assign(i,{attrs:t}):(i,t)=>Object.assign(i,t);function Xt(i){return v.isProxy(i)?v.toRaw(i):i}function Oh(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return v.isProxy(t)?new Proxy(i,{}):i}function Fh(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function Do(i,t){i.labels=t}function To(i,t,e){const n=[];i.datasets=t.map(s=>{const o=i.datasets.find(a=>a[e]===s[e]);return!o||!s.data||n.includes(o)?{...s}:(n.push(o),Object.assign(o,s),o)})}function Ih(i,t){const e={labels:[],datasets:[]};return Do(e,i.labels),To(e,i.datasets,t),e}const Rh=v.defineComponent({props:Th,setup(i,t){let{expose:e}=t;const n=v.ref(null),s=v.shallowRef(null);e({chart:s});const o=()=>{if(!n.value)return;const{type:l,data:c,options:h,plugins:d,datasetIdKey:u}=i,f=Ih(c,u),m=Oh(f,c);s.value=new Wt(n.value,{type:l,data:m,options:{...h},plugins:d})},a=()=>{const l=v.toRaw(s.value);l&&(l.destroy(),s.value=null)},r=l=>{l.update(i.updateMode)};return v.onMounted(o),v.onBeforeUnmount(a),v.watch([()=>i.options,()=>i.data],(l,c)=>{let[h,d]=l,[u,f]=c;const m=v.toRaw(s.value);if(!m)return;let p=!1;if(h){const g=Xt(h),b=Xt(u);g&&g!==b&&(Fh(m,g),p=!0)}if(d){const g=Xt(d.labels),b=Xt(f.labels),y=Xt(d.datasets),_=Xt(f.datasets);g!==b&&(Do(m.config.data,g),p=!0),y&&y!==_&&(To(m.config.data,y,i.datasetIdKey),p=!0)}p&&r(m)},{deep:!0}),()=>v.h("canvas",{ref:n})}});function di(i,t){return Wt.register(t),v.defineComponent({props:Ao,setup(e,n){let{expose:s}=n;const o=v.shallowRef(null),a=r=>{o.value=r==null?void 0:r.chart};return s({chart:o}),()=>v.h(Rh,Lh({ref:a},{type:i,...e}))}})}const Eh=di("bar",je),Bh=di("doughnut",le),zh=di("line",$e),Wh=di("radar",Ye);function rn(){function i(e,n=50,s=50){const o=document.createElement("canvas"),a=o.getContext("2d");return a&&(o.width=n,o.height=s,a.fillStyle=e,a.fillRect(0,0,n,s)),o}function t(e,n){return n?(e+n)%6:e}return{getPatternCanvas:i,getPatternIndexWithShift:t}}function Lo(i,t){const e=parseInt(i.toFixed());return`${new Intl.NumberFormat().format(e)}${t?" "+t:""}`}function Nt(i){return Math.abs(Number(i))>=1e6?new Intl.NumberFormat().format(parseFloat((Number(i)/1e6).toFixed(2)))+" M":Math.abs(Number(i))>=1e3?new Intl.NumberFormat().format(parseFloat((Number(i)/1e3).toFixed(2)))+" K":new Intl.NumberFormat().format(parseFloat(Number(i).toFixed(2)))}function Hh(i,t){return t?(i+t)%6:i}function Nh(i,t){return`${Nt(i.data[t].value)} (${Nt(i.data[t].rate)}%)`}const Vh="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTExLjc0IDEyLjAzaC4wMi0uMDJ6TTEyIDdhMyAzIDAgMDAtMyAzIC43NS43NSAwIDAwMS41IDBBMS41IDEuNSAwIDAxMTIgOC41MWExLjUgMS41IDAgMDEuNjYgMi44NSAyLjQxIDIuNDEgMCAwMC0xLjQxIDIuMTZ2LjI1YS43NS43NSAwIDAwMS41IDB2LS4yNWEuOTEuOTEgMCAwMS41Ny0uODFBMyAzIDAgMDAxMiA3eiIvPjxjaXJjbGUgY3g9IjEyIiBjeT0iMTYuMjQiIHI9Ii43NSIvPjxwYXRoIGQ9Ik0xMiAyYTEwIDEwIDAgMTAxMCAxMEExMCAxMCAwIDAwMTIgMnptMCAxOGE4IDggMCAxMTgtOCA4IDggMCAwMS04IDh6Ii8+PC9zdmc+",{getPatternCanvas:jh}=rn(),$h=14,Oo="6px",ui=18,Fo=6;function Io(i,t,e,n,s,o,a,r){return[{id:"htmlLegend",afterUpdate(l){const h=l.config.type==="doughnut"?"column":"row",d=dn(i,h);for(d.style.margin="1.375rem 1.0625rem";d.firstChild;)d.firstChild.remove();l.options.plugins.legend.labels.generateLabels(l).forEach(f=>{const m=l.config.type==="doughnut",p=m?f.index:f.datasetIndex,g=cn(l,t,p);if(m){const y=p+1===a;g.style.marginTop="12px",y&&(g.style.position="relative")}else g.style.marginRight="12px";g.style.width="max-content",g.style.cursor="pointer";let b;t.value?b=Kh(l,f,t,e,n.value):b=Gh(f,l,e,n.value,s.value,o.value),g.appendChild(b),g.appendChild(ln(f)),m&&a&&Yh(r,a,p)&&g.appendChild(Uh(r,a)),d.appendChild(g)})}}]}function Yh(i,t,e){return i.data.length>t&&e===t-1}function Uh(i,t){const e=document.createElement("div"),n=document.createElement("div"),s=document.createElement("img");e.style.position="absolute",e.style.right="-32px",s.src=Vh,s.style.top="0",s.style.width="1.5rem",s.style.filter="invert(38%) sepia(19%) saturate(18%) hue-rotate(337deg) brightness(97%) contrast(85%)",n.style.position="relative",n.style.display="flex";const o=Xh(i,t);return s.onmouseover=()=>{n.firstElementChild.style.visibility="visible"},e.appendChild(n),n.appendChild(o),n.appendChild(s),e}function Xh(i,t){const e=document.createElement("div");return e.style.visibility="hidden",e.style.position="absolute",e.style.zIndex="10",e.style.width="350px",e.style.bottom="100%",e.style.left="50%",e.style.marginLeft="-150px",e.style.background="#FFFFFF",e.style.boxShadow="0px 1px 5px rgba(0, 0, 0, 0.2)",e.style.borderRadius="0.5rem",e.style.fontSize="14px",e.style.overflow="hidden",qh(i,t,e),e}function qh(i,t,e){const n=t-1;i.data.slice(n).forEach((s,o)=>{const a=n+o,r=document.createElement("div");r.style.display="flex",r.style.justifyContent="space-between",r.style.padding="0.5rem",r.style.border="1px solid #CCCCCC";const l=document.createElement("span");l.appendChild(document.createTextNode(i.labels[a]));const c=document.createElement("span");c.appendChild(document.createTextNode(Nh(i,a))),r.appendChild(l),r.appendChild(c),e.appendChild(r)})}function Gh(i,t,e,n,s,o){const a=t.config.type==="doughnut",r=a?i.index:i.datasetIndex,l=new Image,c=Ro(i,t.config.type),h=o[r](!1,s[r],n),d=jh(h);return l.src=d.toDataURL(),c.style.background=`url(${l.src})`,c.style.backgroundSize="cover",c.style.borderColor=s[r],c.style.borderWidth="2px",c.onmouseover=()=>{a?e.value=r:e.dataSetIndex=r},c.onmouseleave=()=>{a?e.value=null:e.dataSetIndex=null},c}function Kh(i,t,e,n,s){const o=i.config.type==="doughnut",a=o?t.index:t.datasetIndex,r=hn(i,t,s);return i.config.data.labels.every((h,d)=>i.getDataVisibility(d))?(o?(n.value=-1,e.value=!1):n.dataSetIndex=-1,r):(r.onmouseover=()=>{o?n.value=a:n.dataSetIndex=a},r.onmouseleave=()=>{o?n.value=null:n.dataSetIndex=null},r)}function ln(i){const t=document.createElement("p");t.style.color=i.fontColor,t.style.fontSize=`${$h}px`,t.style.margin="0",t.style.padding="0";const e=document.createTextNode(i.text);return t.appendChild(e),t}function Ro(i,t){const e=document.createElement("div");return t!=="doughnut"&&(e.style.background=i.fillStyle,e.style.borderColor=i.strokeStyle,e.style.borderWidth=i.lineWidth+"px"),e.style.borderRadius="5px",e.style.borderStyle="solid",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.width=ui+"px",e.style.marginRight=Oo,e.style.height=ui+"px",e}function Zh(i){const t=document.createElement("div");return t.style.height=Fo+"px",t.style.width=Fo+"px",t.style.background="white",t.style.borderStyle="solid",t.style.borderColor=i.strokeStyle,t.style.borderWidth=i.lineWidth+"px",t}function cn(i,t,e){const n=document.createElement("li");return n.style.alignItems="center",n.style.cursor=t.value?"":"pointer",n.style.display="flex",n.style.flexDirection="row",n.setAttribute("data-test-id",`legend-item-${e}`),n.onclick=()=>{t.value?fi(i,e,t):(zo(i,e,t),i.update())},n}function Qh(i,t,e,n){let s="#fff",o="#666";i&&(s=n?t.fillStyle:t.strokeStyle,o=t.strokeStyle),e.setAttribute("checked",""+i),e.setAttribute("class","mc-checkbox__input"),e.setAttribute("style",`background-color: ${s};
|
|
19
|
-
width: ${
|
|
20
|
-
height: ${
|
|
21
|
-
margin-right: ${
|
|
22
|
-
border-color: ${o};`)}function hn(i,t,e=!1){const n=i.config.type==="doughnut",s=n?t.index:t.datasetIndex,o=document.createElement("input");o.setAttribute("type","checkbox"),o.setAttribute("data-test-id",`legend-checkbox-${s}`);const a=n?i.getDataVisibility(s):i.isDatasetVisible(s);return Qh(a,t,o,e),o}function Eo(i){const{type:t}=i.config;return t==="pie"||t==="doughnut"}function Bo(i){let t=i.config.data.datasets;return Eo(i)&&(t=i.config.data.datasets[0].data),t}function zo(i,t,e){if(!e.value){const n=Bo(i);e.value=!0,n.forEach((s,o)=>{o!==t&&fi(i,o)})}}function Jh(i){let t=!0;return Bo(i).forEach((n,s)=>{t=t&&i.isDatasetVisible(s)}),t}function fi(i,t,e){Eo(i)?i.toggleDataVisibility(t):i.setDatasetVisibility(t,!i.isDatasetVisible(t)),e&&Jh(i)&&(e.value=!1),i.update()}function Wo(i,t){const e=Ro(i,""),n=Zh(i);return(i.index||i.datasetIndex)===0?t?n.style.borderRadius="25px":n.style.transform="rotate(45deg)":t?n.style.transform="rotate(45deg)":n.style.borderRadius="25px",e.appendChild(n),e}function dn(i,t){var n,s;let e=(n=i.value)==null?void 0:n.querySelector("ul");return e||(e=document.createElement("ul"),e.style.display="flex",e.style.flexDirection=t,e.style.margin="0",e.style.padding="0",(s=i.value)==null||s.appendChild(e)),e}function gi(i,t){const e=Math.round(Math.min(Math.max(t||1,0),1)*255);return i+e.toString(16).toUpperCase()}const{getPatternIndexWithShift:un}=rn();function td(){const i=v.ref(3),t=v.ref(null),e=v.reactive({dataSetIndex:-1,columnIndex:-1});function n(p,g,b,y,_){return Io(p,g,e,b,y,_)}function s(){i.value=4,i.value=3}function o(p,g,b,y,_,S){const x=i.value;return p.map((P,k)=>({borderColor:function(w){return b?"#00000000":r(k,w.index,y,S)},backgroundColor:function(w){return l(k,w.index,b,y,_,S)},borderWidth:function(){return b?1:x},data:P.data,label:P.label,stack:`Stack ${g?"0":k}`}))}function a(p,g,b,y,_){return o([p,g],!1,_,b,y)}function r(p,g,b,y){const _=un(p,y);return u(p,g)?b[_]:gi(b[_],.2)}function l(p,g,b,y,_,S){const x=un(p,S);return u(p,g)?_[x](!1,y[x],b):_[x](!0,y[x],b)}function c(){return e.dataSetIndex<0}function h(p,g){return e.dataSetIndex===p&&e.columnIndex===g}function d(p){return e.dataSetIndex===p&&e.columnIndex<0}function u(p,g){return c()||h(p,g)||d(p)}function f(){e.dataSetIndex=-1,e.columnIndex=-1}function m(){return(p,g)=>{g[0]!==void 0?(e.dataSetIndex=g[0].datasetIndex,e.columnIndex=g[0].index):f()}}return{onHoverIndex:e,reloadChart:s,getDatasets:a,getStackedDatasets:o,getOnHoverOptions:m,getBorderColor:r,getPattern:l,privateGetHtmlLegendPlugin:n,getPatternIndexWithShift:un,barChartRef:t,borderWidth:i}}const{getPatternCanvas:ed}=rn();class pi{constructor(){M(this,"chartType","");M(this,"datasetIndex",0);M(this,"dataIndex",0);M(this,"titleLines",[""]);M(this,"dataToDisplay","");M(this,"xValue","");M(this,"yValue","");M(this,"patternShifting",0)}createTooltip(t,e,n,s,o,a=!1){var c;if(!t.tooltip.dataPoints)return;this.datasetIndex=((c=t.tooltip)==null?void 0:c.dataPoints[0].datasetIndex)||0,this.dataIndex=t.tooltip.dataPoints[0].dataIndex||0,this.xValue=n.firstLineLabel||"",this.yValue=n.secondLineLabel||"",this.chartType=n.chartType,this.dataToDisplay=e(t),this.patternShifting=n.patternShifting||0;let r=document.querySelector("#chartjs-tooltip");r||(r=this.createNewTooltipElement());const l=t.tooltip;if(l.opacity===0){r.style.opacity="0";return}if(l.body){this.titleLines=l.title||[];const h=l.body.map(this.getBody);let d="background: white;";d+="border-bottom: 1px solid #CCCCCC;",d+="border-radius: 5px;",d+="padding: 10px 20px";const u=`<div style="${d}" class="tooltipTitle">`,f=this.chartType==="DOUGHNUT"?[l.title[0].split("(")[0].trim()]:h[0];let m="",p="";this.chartType==="RADAR"||this.chartType==="LINE_CHART"?(m=this.createLegendStyle(t),p=this.createLegendInnerStyle(t)):(this.chartType==="BAR_CHART"||this.chartType==="DETAILS_BAR_CHART"||this.chartType==="DOUGHNUT")&&(m=this.createPatternLegendStyle(t)),this.addLegendToDom(u,m,p,f,d,r,s,o,a)}this.handleTooltipPosition(t,l,r)}handleTooltipPosition(t,e,n){const s=t.chart.canvas.getBoundingClientRect(),o=window.innerWidth,a=s.left+window.pageXOffset+e.caretX,r=s.top+window.pageYOffset+e.caretY;n.style.left=a+"px",n.style.top=r+"px",n.style.height="auto",n.style.minWidth="17rem",n.style.opacity="1",n.style.position="absolute",n.style.zIndex="99",n.style.backgroundColor="white",n.style.pointerEvents="none",n.getBoundingClientRect().width+a>o&&(n.style.left=a-n.getBoundingClientRect().width+"px")}createNewTooltipElement(){const t=document.createElement("div");return t.id="chartjs-tooltip",t.style.backgroundColor="white",t.style.borderRadius="5px",t.style.transition="opacity .5s",t.style.boxShadow="0px 1px 5px rgba(0, 0, 0, 0.2)",t.innerHTML='<div class="tooltipCtn"></div>',document.body.appendChild(t),t}createPatternLegendStyle(t){return this.createCommonLegendSquareStyle(t)}createLegendStyle(t){let e=`background-color:${t.tooltip.labelColors[0].backgroundColor}`;return e+=this.createCommonLegendSquareStyle(t),e}createCommonLegendSquareStyle(t){let e=`;border: 2px solid ${t.tooltip.labelColors[0].borderColor}`;return e+=";min-height: 20px",e+=";min-width: 20px",e+=";border-radius: 5px",e+=";margin-right: 10px",e+=";display: flex",e+=";align-items: center",e+=";justify-content: center;",e}createLegendInnerStyle(t){let e="height: 12px";return e+=";width: 12px",e+=";background-color: #FFF",e+=`;border: 2px solid ${t.tooltip.labelColors[0].borderColor};`,t.tooltip.labelPointStyles[0].pointStyle==="circle"?e+="border-radius: 25px;":t.tooltip.labelPointStyles[0].pointStyle==="rectRot"&&(e+="transform: rotate(45deg);"),e}addLegendToDom(t,e,n,s,o,a,r,l,c=!1){let h=t,d=`<div class="legendIcon" style="${e}">`;const u=`<div style="${n}"></div>`;d+=`${u}</div>`;const f=this.setInnerHtmlToAdd(s,o,d);h+=f;const m=a==null?void 0:a.querySelector(".tooltipCtn");(m==null?void 0:m.innerHTML)!=null&&this.setInnerHtmlAndPattern(m,h,r,l,c)}setInnerHtmlToAdd(t,e,n){const a=`<span style="font-family: Arial; font-size: 16px">${t[0].split(":")[0]}</span>`;return this.chartType==="RADAR"?this.returnRadarHtml(e,n,a):this.chartType==="DOUGHNUT"?this.returnDoughnutHtml(n,a):this.returnDetailsBarchartHtml(e,n,a)}returnDoughnutHtml(t,e){const n="font-family: Arial; font-size: 16px",s=`<span style="${n}">${e.split("(")[0]}</span>`;let o=`<div style="${n}; display: flex; align-items: center; justify-content: space-between">`;return o+=`<div style="display:flex; align-items: center;" >${t+s}</div>`,o+=`<div style="${n}; margin-left:3rem;">${this.dataToDisplay}</div>`,o+="</div></div>",o}returnRadarHtml(t,e,n){const s="font-family: Arial; font-size: 16px";let o=`<div style="${s}; display: flex; align-items: center;">${e+n}</div>`;return o+="</div>",o+=`<div style="${s}; ${t}; border: none; display:flex; justify-content: space-between;">`,o+=`<div>${this.titleLines[0]}</div>`,o+=`<div style="margin-left: 20px;">${this.dataToDisplay}</div>`,o+="</div>",o+="</div><div>",o}returnDetailsBarchartHtml(t,e,n){const s="font-family: Arial; font-size: 16px";let o=`<div style="${s}; display: flex; align-items: center;">${e+n}</div>`;return o+="</div>",o+=`<div style="${s}; ${t}; display:flex; justify-content: space-between;">`,o+=`<div>${this.xValue}</div>`,o+=`<div style="margin-left: 20px;">${this.titleLines[0]}</div>`,o+="</div>",o+=`<div style="${s}; ${t}; border-: none; display:flex; justify-content: space-between;">`,o+=`<div>${this.yValue}</div>`,o+=`<div style="margin-left: 20px;">${this.dataToDisplay}</div>`,o+="</div>",o}setInnerHtmlAndPattern(t,e,n,s,o=!1){t.innerHTML=e;const a=document.querySelector(".legendIcon"),r=new Image;let l;this.chartType==="DOUGHNUT"?l=this.dataIndex+1:l=this.datasetIndex+1;const c=Hh(l,this.patternShifting);if(this.chartType!=="LINE_CHART"&&this.chartType!=="RADAR"){const h=s[c-1](!1,n[c-1],o),d=ed(h,22,22);r.src=d.toDataURL(),a.style.backgroundImage=`url(${r.src})`}}getBody(t){return t.lines}}var ve=(i=>(i.RADAR="RADAR",i.BAR_CHART="BAR_CHART",i.DETAILS_BAR_CHART="DETAILS_BAR_CHART",i.LINE_CHART="LINE_CHART",i.DOUGHNUT="DOUGHNUT",i))(ve||{});function id(i,t="#A274FF",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=o*.15;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.5*o,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.75*o,o/2,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.006*o,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.25*o,o/2,a,a),s.fill()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const l=document.createElement("canvas").getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c||new CanvasPattern}function nd(i,t="#143666",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(-o*.03,-.01*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.29*o,.33*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.63*o,.69*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.33*o,-.37*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.71*o,-.72*o,o+o/2,.04*o),s.fill(),s.restore()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas").getContext("2d");if(!r)return new CanvasPattern;const l=r.createPattern(n,"repeat");return l||new CanvasPattern}function sd(i,t="#00A3B2",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o/2),s.lineTo(0,0),s.lineTo(o/2,o/2),s.lineTo(o,0),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o),s.lineTo(0,o/2),s.lineTo(o/2,o),s.lineTo(o,o/2),s.lineTo(o+o/2,o),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,111e-6),s.lineTo(4e-6*o,-o/2),s.lineTo(o/2,111e-6),s.lineTo(o,-o/2),s.lineTo(o+o/2,111e-6),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o+o/2),s.lineTo(0,o),s.lineTo(o/2,o+o/2),s.lineTo(o,o),s.lineTo(o+o/2,o+o/2),s.stroke()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas").getContext("2d");if(!r)return new CanvasPattern;const l=r.createPattern(n,"repeat");return l||new CanvasPattern}function od(i,t="#8C1551",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=o*.15;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,a,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.005*o,s.rect(o/2,0,a,o),s.fill()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const l=document.createElement("canvas").getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c?(l.fillStyle=c,l.fillRect(0,0,o,o),c):new CanvasPattern}function ad(i,t="#F255A3",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=new DOMMatrix,a=21,r=.1*a;n.width=a,n.height=a,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,a,a),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*a,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*a,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=r,s.moveTo(r,0),s.lineTo(r,.5*a),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=r,s.moveTo(a/2+r,0),s.lineTo(a/2+r,.5*a),s.stroke()),i&&(s.beginPath(),s.fillStyle="#FFFFFF",s.globalAlpha=.5,s.lineWidth=.006*a,s.rect(0,0,a,a),s.fill());const l=document.createElement("canvas"),c=l.getContext("2d");if(!c)return new CanvasPattern;const h=c.createPattern(n,"repeat");return h?(c.fillStyle=h,c.fillRect(0,0,l.width,l.height),h.setTransform(o.rotate(45)),h):new CanvasPattern}function rd(i,t="#095359",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=.04*o;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.1005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.1005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=a,s.arc(a+.06*o,a+.06*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=a,s.arc(a+.56*o,a+.06*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.04*o,s.arc(-a+.44*o,a+.56*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.04*o,s.arc(-a+.94*o,a+.56*o,.06*o,0,2*Math.PI),s.stroke()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas"),l=r.getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c?(l.fillStyle=c,l.fillRect(0,0,r.width,r.height),c):new CanvasPattern}function mi(){return{patternsStandardList:[id,nd,sd,od,ad,rd],colourSets:[["#393879","#006974","#405D68","#005C91","#8C3500","#8C0003"],["#A274FF","#143666","#00A3B2","#8C1551","#F255A3","#095359"],["#00A3B2","#143666","#3D993D","#8C1551","#E56D17","#4C3380"],["#8C1551","#E56D17","#4C3380","#4588E5","#095359","#F255A3"],["#4588E5","#4C3380","#E56D17","#143666","#D94141","#8C1551"],["#143666","#F255A3","#095359","#4588E5","#8C1551","#E56D17"],["#A274FF","#B0BBC0","#B0BBC0","#B0BBC0","#B0BBC0","#B0BBC0"]]}}const ld={class:"container"},cd={class:"main"},hd=v.defineComponent({__name:"BarChart",props:{chartId:{type:String,default:"radar-chart"},rawTitle:{type:String,default:"sales"},unit:{type:String,default:"%"},labels:{type:Array,default:()=>[]},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},datasets:{type:Array,default:()=>[]},width:{type:String,default:"400px"},height:{type:String,default:"300px"},cssClasses:{default:"",type:String},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]},stacked:{type:Boolean,default:!1},disableAccessibility:{type:Boolean,default:!1},firstTooltip:{type:String,default:"content"},secondTooltip:{type:String,default:"content2"}},setup(i){const t=i;Wt.register(ii,si,ei,ti,oi,ri);const{colourSets:e,patternsStandardList:n}=mi(),s=v.ref(null),o=v.ref(!1),a=v.computed(()=>t.newPatternsOrder.length!==n.length?e[t.colourSet]:t.newPatternsOrder.map(C=>e[t.colourSet][C])),r=v.computed(()=>t.newPatternsOrder.length!==n.length?n:t.newPatternsOrder.map(C=>n[C])),l=v.computed(()=>t.disableAccessibility),{onHoverIndex:c,barChartRef:h,reloadChart:d,getOnHoverOptions:u,getStackedDatasets:f,privateGetHtmlLegendPlugin:m}=td(),p=v.computed(()=>{const C=P(_.value);return y(),{labels:C,datasets:f(t.datasets.map((A,D)=>({data:S(D,_.value),label:t.datasets[D].label})),t.stacked,t.disableAccessibility,a.value,r.value,0)}});let g,b;const y=()=>{g=t.firstTooltip,b=t.secondTooltip},_=v.computed(()=>{const C=t.labels;if(C.includes("other")){const A=C.indexOf("other");if(t.datasets[0].data[A].rate+""=="0"&&t.datasets[1].data[A].rate+""=="0")return A}return null}),S=(C,A,D=!1)=>{const T=Object.assign([],t.datasets[C].data);return A&&_.value&&T.splice(_.value,1),T.map($=>$.rate)},x=C=>{const A=C.tooltip.dataPoints[0].datasetIndex,D=C.tooltip.dataPoints[0].dataIndex,T=parseFloat(C.tooltip.body[0].lines[0].split(":")[1].replace(",",".")).toFixed(2)+"% ";if(!D||!A)return"";const $=t.datasets[A].data[D],Q=Nt($.amount);return T+Q+$.amountUnit},P=C=>{const A=Object.assign([],t.labels);return C&&A.splice(C,1),A.map(D=>D)},k=v.computed(()=>({onHover:u(),elements:{bar:{borderSkipped:!1}},plugins:{responsive:!0,maintainAspectRatio:!1,legend:{display:!1},title:{display:!1},tooltip:{enabled:!1,position:"nearest",external:function(C){new pi().createTooltip(C,x,{chartType:ve.BAR_CHART,firstLineLabel:g,secondLineLabel:b},a.value,r.value,t.disableAccessibility)}}},scales:{x:{stacked:!0},y:{stacked:!0,ticks:{callback:function(C){return Lo(C,t.unit)},maxTicksLimit:8}}}})),w=v.ref(m(s,o,l,a,r));return v.watch(c,()=>{d()},{deep:!0}),(C,A)=>(v.openBlock(),v.createElementBlock("div",ld,[v.createElementVNode("div",cd,[p.value?(v.openBlock(),v.createBlock(v.unref(Eh),{key:0,ref_key:"barChartRef",ref:h,data:p.value,options:k.value,plugins:w.value,style:v.normalizeStyle({width:i.width,height:i.height}),"chart-id":i.chartId,"cssClasses:":i.cssClasses,styles:i.styles},null,8,["data","options","plugins","style","chart-id","cssClasses:","styles"])):v.createCommentVNode("",!0)]),v.createElementVNode("div",{ref_key:"legendContainer",ref:s},null,512)]))}}),Pd="",bi=(i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e},yi=bi(hd,[["__scopeId","data-v-d13d8a6b"]]);yi.install=i=>{i.component("BarChart",yi)};function dd(){const i=v.ref(null),t=v.ref(null),e=v.ref(null);function n(h,d,u,f,m,p,g){return Io(h,d,t,u,f,m,p,g)}function s(h,d,u){return t.value!==null?d.map((f,m)=>t.value===m?f(!1,h[m],u):f(!0,h[m],u)):d.map((f,m)=>f(!1,h[m],u))}function o(h){return t.value!==null?h.map((d,u)=>t.value===u?d:gi(d,.2)):h}function a(){return(h,d)=>{d[0]!==void 0?t.value=d[0].element.$context.index:t.value=null}}const r=h=>h.charAt(0).toUpperCase()+h.slice(1).toLowerCase();function l(h,d,u){let f=h.slice(0),m=d.slice(0);return h.length>u&&(m=c(d,u),f=f.slice(0,u-1),f.push("others")),f.map((p,g)=>`${r(p)} (${Nt(m[g].rate)} %)`)}function c(h,d){if(d<1)return h;let u=h.slice(0);return h.length>d&&(u=u.slice(0,d),u[d-1]=h.slice(d).reduce((f,m)=>(f.rate+=m.rate,f.value+=m.value,f),{rate:h[d-1].rate,value:h[d-1].value})),u}return{onHoverIndex:t,privateGetHtmlLegendPlugin:n,getOnHoverOptions:a,groupDataAfterNthValue:c,getDoughnutLabels:l,getBackgroundColor:s,getFormatedText:r,getBorderColor:o,backgroundColor:e,doughnutRef:i}}const ud={class:"container"},fd={class:"main"},gd=v.defineComponent({__name:"DoughnutChart",props:{chartId:{type:String,default:"doughnut-chart"},data:{type:Array,default:()=>[]},labels:{type:Array,default:()=>[]},cssClasses:{default:"",type:String},disableAccessibility:{type:Boolean,default:!1},colourSet:{default:"0",type:Number},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},width:{type:String,default:"400px"},height:{type:String,default:"400px"},maxValues:{type:Number,default:5},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(i){const t=i;Wt.register(ii,si,ei,me);const{colourSets:e,patternsStandardList:n}=mi(),{onHoverIndex:s,doughnutRef:o,getBackgroundColor:a,privateGetHtmlLegendPlugin:r,getOnHoverOptions:l,groupDataAfterNthValue:c,getDoughnutLabels:h,getBorderColor:d}=dd(),u=v.ref(!1),f=v.ref(null),m=v.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(k=>e[t.colourSet][k])),p=v.computed(()=>t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(k=>n[k])),g=v.computed(()=>({labels:h(t.labels,t.data,t.maxValues),datasets:[{data:c(t.data,t.maxValues).map(k=>k.rate),backgroundColor:a(m.value,p.value,t.disableAccessibility),borderColor:d(m.value)}]})),b=k=>{const w=k.tooltip.dataPoints[0].dataIndex;if(!w)return"";const C=c(t.data,t.maxValues)[w],A=Nt(C.rate),D=Nt(C.value),T=C.unit||"";return`${D}${T} (${A})%`};function y(){return t.labels.length<=1?0:12}const _=v.computed(()=>{const k=m.value,w=p.value;return{onHover:l(),plugins:{legend:{display:!1,position:"bottom",align:"start",labels:{pointStyle:"rectRounded",usePointStyle:!0}},title:{display:!1},tooltip:{enabled:!1,external:function(C){new pi().createTooltip(C,b,{chartType:ve.DOUGHNUT},k,w,x.value)}}},radius:"90%",cutout:"70%",borderWidth:3,spacing:y(),hoverOffset:4}}),S={data:t.data,labels:t.labels},x=v.computed(()=>t.disableAccessibility),P=v.computed(()=>r(f,u,x,m,p,t.maxValues,S));return v.onMounted(()=>{a(m.value,p.value,t.disableAccessibility)}),v.watch(s,(k,w)=>{k!==w&&a(m.value,p.value,t.disableAccessibility)}),v.watch(x,()=>{a(m.value,p.value,t.disableAccessibility)}),(k,w)=>(v.openBlock(),v.createElementBlock("div",ud,[v.createElementVNode("div",fd,[g.value?(v.openBlock(),v.createBlock(v.unref(Bh),{key:0,ref_key:"doughnutRef",ref:o,data:g.value,options:_.value,plugins:P.value,"cssClasses:":i.cssClasses,"max-values":i.maxValues,style:v.normalizeStyle({width:i.width,height:i.height,cursor:"pointer"})},null,8,["data","options","plugins","cssClasses:","max-values","style"])):v.createCommentVNode("",!0)]),v.createElementVNode("div",{ref_key:"legendContainer",ref:f},null,512)]))}}),Ad="",xi=bi(gd,[["__scopeId","data-v-d03b50b1"]]);xi.install=i=>{i.component("DoughnutChart",xi)};const pd={class:"container"},md={class:"main"},bd="months",yd=v.defineComponent({__name:"LineChart",props:{chartId:{type:String,default:"radar-chart"},rawTitle:{type:String,default:"sales"},width:{type:String,default:"200px"},height:{type:String,default:"400px"},disableAccessibility:{type:Boolean,default:!1},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},lines:{type:Array,default:()=>{}},labels:{type:Array,default:()=>[]},cssClasses:{default:"",type:String},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(i){const t=i;Wt.register(ii,si,ei,be,bt,oi,ri);const{colourSets:e,patternsStandardList:n}=mi(),s=v.ref(null),o=v.ref(!1),a=v.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(p=>e[t.colourSet][p])),r=t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(p=>n[p]),l=p=>{const g=p.tooltip.dataPoints[0].datasetIndex,b=p.tooltip.dataPoints[0].dataIndex;if(!b||!g)return"";const y=t.lines[g].data[b].toFixed(2);return t.lines[g].unit?y+" "+t.lines[g].unit:y},c=v.computed(()=>t.rawTitle),h=v.computed(()=>({labels:t.labels.map(p=>p),datasets:[{type:"line",borderColor:a.value[0],pointStyle:"rectRot",pointBackgroundColor:"#FFFFFF",pointRadius:5,label:t.lines[0].label,data:t.lines[0].data,borderWidth:2},{type:"line",borderColor:a.value[1],pointStyle:"circle",pointBackgroundColor:"#FFFFFF",pointRadius:5,label:t.lines[1].label,data:t.lines[1].data,borderWidth:2}]}));function d(p,g){return[{id:"htmlLegend",afterUpdate(b){const y=dn(p,"column");for(y.style.display="flex",y.style.flexDirection="row";y.firstChild;)y.firstChild.remove();b.options.plugins.legend.labels.generateLabels(b).forEach(S=>{const x=cn(b,g,S.datasetIndex);let P;g.value?P=u(b,S):P=Wo(S),x.style.marginRight="10px",x.appendChild(P),x.appendChild(ln(S)),y.appendChild(x)})}}]}function u(p,g){const b=hn(p,g);return b.onclick=y=>{fi(p,g.datasetIndex,o),y.stopPropagation()},b}const f=d(s,o),m=v.computed(()=>({responsive:!0,maintainAspectRatio:!0,plugins:{legend:{display:!1},tooltip:{enabled:!1,external:function(p){new pi().createTooltip(p,l,{chartType:ve.LINE_CHART,firstLineLabel:bd,secondLineLabel:c.value},a.value,r,t.disableAccessibility)}}},scales:{x:{offset:!0},y:{type:"linear",display:!0,position:"left",grid:{drawOnChartArea:!0},ticks:{callback:function(p){const g=t.lines[0].unit;return Lo(p,g||null)},maxTicksLimit:8}}}}));return(p,g)=>(v.openBlock(),v.createElementBlock("div",pd,[v.createElementVNode("div",md,[h.value?(v.openBlock(),v.createBlock(v.unref(zh),{key:0,ref:"cockpitLineChartRef",data:h.value,options:m.value,plugins:v.unref(f),"chart-id":i.chartId,"cssClasses:":i.cssClasses,styles:i.styles,style:v.normalizeStyle({width:i.width,height:i.height,cursor:"pointer"})},null,8,["data","options","plugins","chart-id","cssClasses:","styles","style"])):v.createCommentVNode("",!0)]),v.createElementVNode("div",{ref_key:"legendContainer",ref:s},null,512)]))}}),Dd="",_i=bi(yd,[["__scopeId","data-v-ecb2ed0e"]]);_i.install=i=>{i.component("LineChart",_i)};function xd(i,t){const e=i.ctx,n=i.scales.r,s=i.data.labels;!e||!n||!s||(e.save(),s.forEach((o,a)=>{const r=(n.getIndexAngle(a)-Math.PI/2)%(2*Math.PI),l=n.getPointPositionForValue(a,n.max);e.textAlign=r<=Math.PI/2||r>3*Math.PI/2?"left":"right";let c=r<=Math.PI/2||r>3*Math.PI/2?15:-15,h;r<0||r>Math.PI?h=-15:h=15,r>Math.PI/4&&r<3*Math.PI/4&&(h*=3),(r<-Math.PI/4||r>5*Math.PI/4)&&(h*=3,c=0),(r>11*Math.PI/8||r<-3*Math.PI/8)&&(e.textAlign="center");const d=l.y+h*(o.length-1)/2;e.font="15px Arial",o.forEach((u,f)=>{const m=f===o.length-1?_d(t)[a]:"#000000";e.fillStyle=m;const p=l.x+c,g=d+15*f;e.fillText(u,p,g)})}),e.restore())}const _d=i=>i.areas[0].areaData.map(t=>{switch(t.color){case"red":return"#C61112";case"green":return"#46A610";default:return"#000000"}}),vd={class:"container"},Sd={class:"main"},kd=v.defineComponent({__name:"RadarChart",props:{chartId:{type:String,default:"radar-chart"},height:{type:String,default:"400px"},labels:{type:Array,default:()=>[]},disableAccessibility:{type:Boolean,default:!1},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},areas:{type:Array,default:()=>[]},cssClasses:{default:"",type:String},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(i){const t=i;Wt.register(ii,si,ei,_e,bt,be,qc);const{colourSets:e,patternsStandardList:n}=mi(),s=v.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(g=>e[t.colourSet][g])),o=v.computed(()=>t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(g=>n[g])),a=v.computed(()=>({labels:d(),datasets:[{label:"Data One",backgroundColor:gi(s.value[0],.1),borderColor:s.value[0],pointBackgroundColor:"#FFFFFF",pointBorderColor:s.value[0],pointBorderWidth:2,borderWidth:2,pointHitRadius:55,pointRadius:5,pointHoverBackgroundColor:s.value[0],pointHoverBorderColor:s.value[0],data:t.areas[0].areaData.map(g=>g.position)},{label:"Data Two",backgroundColor:gi(s.value[1],.1),borderColor:s.value[1],pointBackgroundColor:"#FFFFFF",pointBorderColor:s.value[1],pointBorderWidth:2,borderWidth:2,pointHitRadius:55,pointRadius:5,pointStyle:"rectRot",pointHoverBackgroundColor:s.value[1],pointHoverBorderColor:s.value[1],data:t.areas[1].areaData.map(g=>g.position)}]})),r={onClick:(g,b,y)=>{b[0]&&zo(y,b[0].datasetIndex,c)},plugins:{htmlLegend:{containerID:"legend-container"},legend:{display:!1},title:{display:!1},tooltip:{enabled:!1,position:"nearest",external:function(g){new pi().createTooltip(g,p,{chartType:ve.RADAR},s.value,o.value,t.disableAccessibility)}}},layout:{padding:65},scales:{r:{min:0,max:100,pointLabels:{display:!1,font:{size:16}},ticks:{display:!1,stepSize:25}}}},l=v.ref(null),c=v.ref(!1);function h(g,b){if(g.length>15&&g.includes(" ",15)){const _=g.indexOf(" ",15);return[g.substring(0,_),g.substring(_),b]}return[g,b]}const d=()=>t.labels.map((g,b)=>{const y=t.areas[0].areaData[b].value?`${u(t.areas[0].areaData[b].value+"")} ${t.areas[0].areaData[b].unit}`:"No Data";return h(g,y)}),u=g=>Nt(parseFloat(g));function f(g,b){const y=hn(g,b);return y.onclick=_=>{fi(g,b.datasetIndex,c),_.stopPropagation()},y}const m=[{id:"htmlLegend",afterUpdate(g){const b=dn(l,"row");for(;b.firstChild;)b.firstChild.remove();g.options.plugins.legend.labels.generateLabels(g).reverse().forEach(_=>{const S=cn(g,c,_.datasetIndex);let x;S.style.marginRight="0.625rem",c.value?x=f(g,_):x=Wo(_,!0),S.appendChild(x),S.appendChild(ln(_)),b.appendChild(S)})}},{id:"radarLabelPlugin",beforeDraw(g){xd(g,t)}}],p=g=>{const b=g.tooltip.dataPoints[0].datasetIndex,y=g.tooltip.dataPoints[0].dataIndex;if(b&&y){const _=t.areas[b];return _.areaData[y].value.toFixed(2)+" "+_.areaData[y].unit}return""};return(g,b)=>(v.openBlock(),v.createElementBlock("div",vd,[v.createElementVNode("div",Sd,[a.value?(v.openBlock(),v.createBlock(v.unref(Wh),{key:0,data:a.value,options:r,plugins:m,"chart-id":i.chartId,"cssClasses:":i.cssClasses,styles:i.styles,style:v.normalizeStyle({height:i.height,cursor:"pointer"})},null,8,["data","chart-id","cssClasses:","styles","style"])):v.createCommentVNode("",!0)]),v.createElementVNode("div",{ref_key:"legendContainer",ref:l,class:"legendContainer"},null,512)]))}}),Td="",vi=bi(kd,[["__scopeId","data-v-9ec69ee9"]]);vi.install=i=>{i.component("RadarChart",vi)};const Ho=Object.freeze(Object.defineProperty({__proto__:null,BarChart:yi,DoughnutChart:xi,LineChart:_i,RadarChart:vi},Symbol.toStringTag,{value:"Module"})),wd={install:i=>{Object.keys(Ho).forEach(t=>{i.component(t,Ho[t])})}};X.BarChart=yi,X.DoughnutChart=xi,X.LineChart=_i,X.RadarChart=vi,X.default=wd,Object.defineProperties(X,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
18
|
+
`):i}function Lh(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:i,label:a,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function Mo(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=X(t.bodyFont),c=X(t.titleFont),h=X(t.footerFont),d=o.length,u=s.length,f=n.length,b=K(t.padding);let p=b.height,m=0,g=n.reduce((S,v)=>S+v.before.length+v.lines.length+v.after.length,0);if(g+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),g){const S=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;p+=f*S+(g-f)*l.lineHeight+(g-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const _=function(S){m=Math.max(m,e.measureText(S).width+y)};return e.save(),e.font=c.string,R(i.title,_),e.font=l.string,R(i.beforeBody.concat(i.afterBody),_),y=t.displayColors?a+2+t.boxPadding:0,R(n,S=>{R(S.before,_),R(S.lines,_),R(S.after,_)}),y=0,e.font=h.string,R(i.footer,_),e.restore(),m+=b.width,{width:m,height:p}}function Th(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function Oh(i,t,e,n){const{x:s,width:o}=n,a=e.caretSize+e.caretPadding;if(i==="left"&&s+o+a>t.width||i==="right"&&s-o-a<0)return!0}function Ih(i,t,e,n){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i;let c="center";return n==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),Oh(c,i,t,e)&&(c="center"),c}function Po(i,t,e){const n=e.yAlign||t.yAlign||Th(i,e);return{xAlign:e.xAlign||t.xAlign||Ih(i,t,e,n),yAlign:n}}function Fh(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function Rh(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function Ao(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Wt(a);let b=Fh(t,r);const p=Rh(t,l,c);return l==="center"?r==="left"?b+=c:r==="right"&&(b-=c):r==="left"?b-=Math.max(h,u)+s:r==="right"&&(b+=Math.max(d,f)+s),{x:Z(b,0,n.width-t.width),y:Z(p,0,n.height-t.height)}}function fi(i,t,e){const n=K(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function Do(i){return mt([],kt(i))}function Eh(i,t,e){return Lt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Lo(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const To={beforeTitle:yt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:yt,beforeBody:yt,beforeLabel:yt,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 I(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:yt,afterBody:yt,beforeFooter:yt,footer:yt,afterFooter:yt};function et(i,t,e,n){const s=i[t].call(e,n);return typeof s>"u"?To[t].call(e,n):s}class bn extends lt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new ks(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Eh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=et(n,"beforeTitle",this,t),o=et(n,"title",this,t),a=et(n,"afterTitle",this,t);let r=[];return r=mt(r,kt(s)),r=mt(r,kt(o)),r=mt(r,kt(a)),r}getBeforeBody(t,e){return Do(et(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return R(t,o=>{const a={before:[],lines:[],after:[]},r=Lo(n,o);mt(a.before,kt(et(r,"beforeLabel",this,o))),mt(a.lines,et(r,"label",this,o)),mt(a.after,kt(et(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return Do(et(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=et(n,"beforeFooter",this,t),o=et(n,"footer",this,t),a=et(n,"afterFooter",this,t);let r=[];return r=mt(r,kt(s)),r=mt(r,kt(o)),r=mt(r,kt(a)),r}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;l<c;++l)r.push(Lh(this.chart,e[l]));return t.filter&&(r=r.filter((h,d,u)=>t.filter(h,d,u,n))),t.itemSort&&(r=r.sort((h,d)=>t.itemSort(h,d,n))),R(r,h=>{const d=Lo(t.callbacks,h);s.push(et(d,"labelColor",this,h)),o.push(et(d,"labelPointStyle",this,h)),a.push(et(d,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=De[n.position].call(this,s,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);const l=this._size=Mo(this,n),c=Object.assign({},r,l),h=Po(this.chart,n,c),d=Ao(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Wt(r),{x:u,y:f}=t,{width:b,height:p}=e;let m,g,y,_,S,v;return o==="center"?(S=f+p/2,s==="left"?(m=u,g=m-a,_=S+a,v=S-a):(m=u+b,g=m+a,_=S-a,v=S+a),y=m):(s==="left"?g=u+Math.max(l,h)+a:s==="right"?g=u+b-Math.max(c,d)-a:g=this.caretX,o==="top"?(_=f,S=_-a,m=g-a,y=g+a):(_=f+p,S=_+a,m=g+a,y=g-a),v=_),{x1:m,x2:g,x3:y,y1:_,y2:S,y3:v}}drawTitle(t,e,n){const s=this.title,o=s.length;let a,r,l;if(o){const c=Xt(n.rtl,this.x,this.width);for(t.x=fi(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",a=X(n.titleFont),r=n.titleSpacing,e.fillStyle=n.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=n.titleMarginBottom-r)}}_drawColorBox(t,e,n,s,o){const a=this.labelColors[n],r=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,h=X(o.bodyFont),d=fi(this,"left",o),u=s.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,b=e.y+f;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},m=s.leftForLtr(u,c)+c/2,g=b+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,qi(t,p,m,g),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,qi(t,p,m,g)}else{t.lineWidth=O(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const p=s.leftForLtr(u,c),m=s.leftForLtr(s.xPlus(u,1),c-2),g=Wt(a.borderRadius);Object.values(g).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,xe(t,{x:p,y:b,w:c,h:l,radius:g}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),xe(t,{x:m,y:b+1,w:c-2,h:l-2,radius:g}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,b,c,l),t.strokeRect(p,b,c,l),t.fillStyle=a.backgroundColor,t.fillRect(m,b+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=n,d=X(n.bodyFont);let u=d.lineHeight,f=0;const b=Xt(n.rtl,this.x,this.width),p=function(C){e.fillText(C,b.x(t.x+f),t.y+u/2),t.y+=u+o},m=b.textAlign(a);let g,y,_,S,v,w,M;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=fi(this,m,n),e.fillStyle=n.bodyColor,R(this.beforeBody,p),f=r&&m!=="right"?a==="center"?c/2+h:c+2+h:0,S=0,w=s.length;S<w;++S){for(g=s[S],y=this.labelTextColors[S],e.fillStyle=y,R(g.before,p),_=g.lines,r&&_.length&&(this._drawColorBox(e,t,S,b,n),u=Math.max(d.lineHeight,l)),v=0,M=_.length;v<M;++v)p(_[v]),u=d.lineHeight;R(g.after,p)}f=0,u=d.lineHeight,R(this.afterBody,p),t.y-=o}drawFooter(t,e,n){const s=this.footer,o=s.length;let a,r;if(o){const l=Xt(n.rtl,this.x,this.width);for(t.x=fi(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",a=X(n.footerFont),e.fillStyle=n.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:h}=n,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:b}=Wt(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+d,l),a==="top"&&this.drawCaret(t,e,n,s),e.lineTo(r+c-u,l),e.quadraticCurveTo(r+c,l,r+c,l+u),a==="center"&&o==="right"&&this.drawCaret(t,e,n,s),e.lineTo(r+c,l+h-b),e.quadraticCurveTo(r+c,l+h,r+c-b,l+h),a==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(r+f,l+h),e.quadraticCurveTo(r,l+h,r,l+h-f),a==="center"&&o==="left"&&this.drawCaret(t,e,n,s),e.lineTo(r,l+d),e.quadraticCurveTo(r,l,r+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const a=De[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=Mo(this,t),l=Object.assign({},a,this._size),c=Po(e,t,l),h=Ao(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const a=K(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),ps(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),ms(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!je(n,s),a=this._positionChanged(s,e);(o||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,n),r=this._positionChanged(a,t),l=e||!je(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e;const a=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,a=De[o.position].call(this,t,e);return a!==!1&&(n!==a.x||s!==a.y)}}k(bn,"positioners",De);var te={id:"tooltip",_element:bn,positioners:De,afterInit(i,t,e){e&&(i.tooltip=new bn({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:To},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 Bh=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function zh(i,t,e,n){const s=i.indexOf(t);if(s===-1)return Bh(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const Wh=(i,t)=>i===null?null:Z(Math.round(i),0,t);function Oo(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class ee extends Gt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:o}of e)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(I(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:zh(n,t,T(e,t),this._addedLabels),Wh(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Oo.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}}k(ee,"id","category"),k(ee,"defaults",{ticks:{callback:Oo}});function Hh(i,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,b=h-1,{min:p,max:m}=t,g=!I(a),y=!I(r),_=!I(c),S=(m-p)/(d+1);let v=jn((m-p)/b/f)*f,w,M,C,D;if(v<1e-14&&!g&&!y)return[{value:p},{value:m}];D=Math.ceil(m/v)-Math.floor(p/v),D>b&&(v=jn(D*v/b/f)*f),I(l)||(w=Math.pow(10,l),v=Math.ceil(v*w)/w),s==="ticks"?(M=Math.floor(p/v)*v,C=Math.ceil(m/v)*v):(M=p,C=m),g&&y&&o&&Xa((r-a)/o,v/1e3)?(D=Math.round(Math.min((r-a)/v,h)),v=(r-a)/D,M=a,C=r):_?(M=g?a:M,C=y?r:C,D=c-1,v=(C-M)/D):(D=(C-M)/v,ge(D,Math.round(D),v/1e3)?D=Math.round(D):D=Math.ceil(D));const A=Math.max($n(v),$n(M));w=Math.pow(10,I(l)?A:l),M=Math.round(M*w)/w,C=Math.round(C*w)/w;let P=0;for(g&&(u&&M!==a?(e.push({value:a}),M<a&&P++,ge(Math.round((M+P*v)*w)/w,a,Io(a,S,i))&&P++):M<a&&P++);P<D;++P){const L=Math.round((M+P*v)*w)/w;if(y&&L>r)break;e.push({value:L})}return y&&u&&C!==r?e.length&&ge(e[e.length-1].value,r,Io(r,S,i))?e[e.length-1].value=r:e.push({value:r}):(!y||C===r)&&e.push({value:C}),e}function Io(i,t,{horizontal:e,minRotation:n}){const s=ft(n),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class yn extends Gt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return I(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=e?s:l,r=l=>o=n?o:l;if(t){const l=ut(s),c=ut(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=Hh(s,o);return t.bounds==="ticks"&&Ga(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return Ui(t,this.chart.options.locale,this.options.ticks.format)}}class ie extends yn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=q(t)?t:0,this.max=q(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=ft(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}k(ie,"id","linear"),k(ie,"defaults",{ticks:{callback:Yi.formatters.numeric}});function xn(i){const t=i.ticks;if(t.display&&i.display){const e=K(t.backdropPadding);return T(t.font&&t.font.size,U.font.size)+e.height}return 0}function Nh(i,t,e){return e=W(e)?e:[e],{w:fr(i,t.string,e),h:e.length*t.lineHeight}}function Fo(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function Vh(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?N/o:0;for(let l=0;l<o;l++){const c=a.setContext(i.getPointLabelContext(l));s[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+s[l],r),d=X(c.font),u=Nh(i.ctx,d,i._pointLabels[l]);n[l]=u;const f=st(i.getIndexAngle(l)+r),b=Math.round(Wi(f)),p=Fo(b,h.x,u.w,0,180),m=Fo(b,h.y,u.h,90,270);jh(e,t,f,p,m)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Yh(i,n,s)}function jh(i,t,e,n,s){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,l=0;n.start<t.l?(r=(t.l-n.start)/o,i.l=Math.min(i.l,t.l-r)):n.end>t.r&&(r=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,i.b=Math.max(i.b,t.b+l))}function $h(i,t,e){const n=i.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=e,l=i.getPointPosition(t,n+s+a,o),c=Math.round(Wi(st(l.angle+Y))),h=qh(l.y,r.h,c),d=Xh(c),u=Gh(l.x,r.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+r.w,bottom:h+r.h}}function Uh(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:o}=i;return!(_t({x:e,y:n},t)||_t({x:e,y:o},t)||_t({x:s,y:n},t)||_t({x:s,y:o},t))}function Yh(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:xn(o)/2,additionalAngle:a?N/s:0};let c;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const d=$h(i,h,l);n.push(d),r==="auto"&&(d.visible=Uh(d,c),d.visible&&(c=d))}return n}function Xh(i){return i===0||i===180?"center":i<180?"left":"right"}function Gh(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function qh(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function Kh(i,t,e){const{left:n,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!I(r)){const l=Wt(t.borderRadius),c=K(t.backdropPadding);i.fillStyle=r;const h=n-c.left,d=s-c.top,u=o-n+c.width,f=a-s+c.height;Object.values(l).some(b=>b!==0)?(i.beginPath(),xe(i,{x:h,y:d,w:u,h:f,radius:l}),i.fill()):i.fillRect(h,d,u,f)}}function Zh(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const o=i._pointLabelItems[s];if(!o.visible)continue;const a=n.setContext(i.getPointLabelContext(s));Kh(e,a,o);const r=X(a.font),{x:l,y:c,textAlign:h}=o;zt(e,i._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Ro(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,H);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<n;a++)o=i.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function Jh(i,t,e,n,s){const o=i.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!n||!r||!l||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash),o.lineDashOffset=s.dashOffset,o.beginPath(),Ro(i,e,a,n),o.closePath(),o.stroke(),o.restore())}function Qh(i,t,e){return Lt(i,{label:e,index:t,type:"pointLabel"})}class Le extends yn{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=K(xn(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=q(t)&&!isNaN(t)?t:0,this.max=q(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xn(this.options))}generateTickLabels(t){yn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=E(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?Vh(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=H/(this._pointLabels.length||1),n=this.options.startAngle||0;return st(t*e+ft(n))}getDistanceFromCenterForValue(t){if(I(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(I(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return Qh(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-Y+n;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),Ro(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s,border:o}=e,a=this._pointLabels.length;let r,l,c;if(e.pointLabels.display&&Zh(this,a),s.display&&this.ticks.forEach((h,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(d),f=s.setContext(u),b=o.setContext(u);Jh(this,f,l,a,b)}}),n.display){for(t.save(),r=a-1;r>=0;r--){const h=n.setContext(this.getPointLabelContext(r)),{color:d,lineWidth:u}=h;!u||!d||(t.lineWidth=u,t.strokeStyle=d,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&!e.reverse)return;const c=n.setContext(this.getContext(l)),h=X(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;const d=K(c.backdropPadding);t.fillRect(-a/2-d.left,-o-h.size/2-d.top,a+d.width,h.size+d.height)}zt(t,r.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}k(Le,"id","radialLinear"),k(Le,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Yi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),k(Le,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),k(Le,"descriptors",{angleLines:{_fallback:"grid"}});const gi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},it=Object.keys(gi);function Eo(i,t){return i-t}function Bo(i,t){if(I(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let a=t;return typeof n=="function"&&(a=n(a)),q(a)||(a=typeof n=="string"?e.parse(a,n):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(pe(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function zo(i,t,e,n){const s=it.length;for(let o=it.indexOf(i);o<s-1;++o){const a=gi[it[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=n)return it[o]}return it[s-1]}function td(i,t,e,n,s){for(let o=it.length-1;o>=it.indexOf(e);o--){const a=it[o];if(gi[a].common&&i._adapter.diff(s,n,a)>=t-1)return a}return it[e?it.indexOf(e):0]}function ed(i){for(let t=it.indexOf(i)+1,e=it.length;t<e;++t)if(gi[it[t]].common)return it[t]}function Wo(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=Ni(e,t),o=e[n]>=t?e[n]:e[s];i[o]=!0}}function id(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,n))l=e[r],l>=0&&(t[l].major=!0);return t}function Ho(i,t,e){const n=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,n.push({value:r,major:!1});return o===0||!e?n:id(i,n,s,e)}class pi extends Gt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const n=t.time||(t.time={}),s=this._adapter=new Dl._date(t.adapters.date);s.init(e),ue(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Bo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=q(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),o=q(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,r=Ja(s,o,a);return this._unit=e.unit||(n.autoSkip?zo(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):td(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:ed(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),Ho(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Z(e,0,a),n=Z(n,0,a),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,a=o.unit||zo(o.minUnit,e,n,this._getLabelCapacity(e)),r=T(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=pe(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(n,e,a)>1e5*r)throw new Error(e+" and "+n+" are too far apart with stepSize of "+r+" "+a);const b=s.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<n;u=+t.add(u,r,a),f++)Wo(h,u,b);return(u===n||s.bounds==="ticks"||f===1)&&Wo(h,u,b),Object.keys(h).sort(Eo).map(p=>+p)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,a=e||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,n,s){const o=this.options,a=o.ticks.callback;if(a)return E(a,[t,e,n],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&r[l],d=c&&r[c],u=n[e],f=c&&d&&u&&u.major;return this._adapter.format(t,s||(f?d:h))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=ft(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:n*o+r*a,h:n*a+r*o}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,Ho(this,[t],this._majorUnit),s),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(Bo(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Gn(t.sort(Eo))}}k(pi,"id","time"),k(pi,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function mi(i,t,e){let n=0,s=i.length-1,o,a,r,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=Rt(i,"pos",t)),{pos:o,time:r}=i[n],{pos:a,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=Rt(i,"time",t)),{time:o,pos:r}=i[n],{time:a,pos:l}=i[s]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class No extends pi{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=mi(e,this.min),this._tableRange=mi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let a,r,l,c,h;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(a=0,r=s.length;a<r;++a)h=s[a+1],l=s[a-1],c=s[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(e)||n.length===1)&&n.push(e),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(mi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return mi(this._table,n*this._tableRange+this._minPos,!0)}}k(No,"id","timeseries"),k(No,"defaults",pi.defaults);const Vo={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},nd={type:{type:String,required:!0},...Vo},sd=x.version[0]==="2"?(i,t)=>Object.assign(i,{attrs:t}):(i,t)=>Object.assign(i,t);function ne(i){return x.isProxy(i)?x.toRaw(i):i}function od(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return x.isProxy(t)?new Proxy(i,{}):i}function ad(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function jo(i,t){i.labels=t}function $o(i,t,e){const n=[];i.datasets=t.map(s=>{const o=i.datasets.find(a=>a[e]===s[e]);return!o||!s.data||n.includes(o)?{...s}:(n.push(o),Object.assign(o,s),o)})}function rd(i,t){const e={labels:[],datasets:[]};return jo(e,i.labels),$o(e,i.datasets,t),e}const ld=x.defineComponent({props:nd,setup(i,t){let{expose:e}=t;const n=x.ref(null),s=x.shallowRef(null);e({chart:s});const o=()=>{if(!n.value)return;const{type:l,data:c,options:h,plugins:d,datasetIdKey:u}=i,f=rd(c,u),b=od(f,c);s.value=new wt(n.value,{type:l,data:b,options:{...h},plugins:d})},a=()=>{const l=x.toRaw(s.value);l&&(l.destroy(),s.value=null)},r=l=>{l.update(i.updateMode)};return x.onMounted(o),x.onBeforeUnmount(a),x.watch([()=>i.options,()=>i.data],(l,c)=>{let[h,d]=l,[u,f]=c;const b=x.toRaw(s.value);if(!b)return;let p=!1;if(h){const m=ne(h),g=ne(u);m&&m!==g&&(ad(b,m),p=!0)}if(d){const m=ne(d.labels),g=ne(f.labels),y=ne(d.datasets),_=ne(f.datasets);m!==g&&(jo(b.config.data,m),p=!0),y&&y!==_&&($o(b.config.data,y,i.datasetIdKey),p=!0)}p&&r(b)},{deep:!0}),()=>x.h("canvas",{ref:n})}});function Te(i,t){return wt.register(t),x.defineComponent({props:Vo,setup(e,n){let{expose:s}=n;const o=x.shallowRef(null),a=r=>{o.value=r==null?void 0:r.chart};return s({chart:o}),()=>x.h(ld,sd({ref:a},{type:i,...e}))}})}const Uo=Te("bar",ti),cd=Te("doughnut",ve),hd=Te("line",ii),dd=Te("radar",ni),ud=Te("bubble",ei);function bi(){function i(e,n=50,s=50){const o=document.createElement("canvas"),a=o.getContext("2d");return a&&(o.width=n,o.height=s,a.fillStyle=e,a.fillRect(0,0,n,s)),o}function t(e,n){return(n?e+n:e)%6}return{getPatternCanvas:i,getPatternIndexWithShift:t}}function _n(i,t){const e=parseInt(i.toFixed());return`${new Intl.NumberFormat().format(e)}${t?" "+t:""}`}function Q(i){return Math.abs(Number(i))>=1e6?vn(i/1e6)+" M":Math.abs(Number(i))>=1e3?vn(i/1e3)+" K":vn(i)}function vn(i){return new Intl.NumberFormat(new Intl.NumberFormat().resolvedOptions().locale,{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(i)}function fd(i,t){return t?(i+t)%6:i}function gd(i,t){return`${Q(i.data[t].value)} (${Q(i.data[t].rate)}%)`}const pd="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTExLjc0IDEyLjAzaC4wMi0uMDJ6TTEyIDdhMyAzIDAgMDAtMyAzIC43NS43NSAwIDAwMS41IDBBMS41IDEuNSAwIDAxMTIgOC41MWExLjUgMS41IDAgMDEuNjYgMi44NSAyLjQxIDIuNDEgMCAwMC0xLjQxIDIuMTZ2LjI1YS43NS43NSAwIDAwMS41IDB2LS4yNWEuOTEuOTEgMCAwMS41Ny0uODFBMyAzIDAgMDAxMiA3eiIvPjxjaXJjbGUgY3g9IjEyIiBjeT0iMTYuMjQiIHI9Ii43NSIvPjxwYXRoIGQ9Ik0xMiAyYTEwIDEwIDAgMTAxMCAxMEExMCAxMCAwIDAwMTIgMnptMCAxOGE4IDggMCAxMTgtOCA4IDggMCAwMS04IDh6Ii8+PC9zdmc+",{getPatternCanvas:md}=bi(),bd=14,Yo="6px",yi="22px",Xo=6,Sn="2px";function Go(i,t,e,n,s,o,a,r,l){return{id:"htmlLegend",afterUpdate(c){const d=c.config.type==="doughnut"?"column":"row",u=Si(i,d);for(u.style.margin="1.375rem 1.0625rem";u.firstChild;)u.firstChild.remove();c.options.plugins.legend.labels.generateLabels(c).forEach(b=>{const p=c.config.type==="doughnut",m=p?b.index:b.datasetIndex,g=_i(c,t,m);if(p){const _=m+1===r;g.style.marginTop="12px",_&&(g.style.position="relative")}else g.style.marginRight="10px";g.style.width="max-content",g.style.cursor="pointer";let y;t.value?y=Ko(c,b,t,e,s.value,a.value):y=qo(b,c,e,n.value,s.value,o.value,a.value),y.style.boxSizing="border-box",g.appendChild(y),g.appendChild(xi(b)),p&&r&&yd(l,r,m)&&g.appendChild(xd(l,r)),u.appendChild(g)})}}}function yd(i,t,e){return i.data.length>t&&e===t-1}function xd(i,t){const e=document.createElement("div"),n=document.createElement("div"),s=document.createElement("img");e.style.position="absolute",e.style.right="-32px",s.src=pd,s.style.top="0",s.style.width="1.5rem",s.style.filter="invert(38%) sepia(19%) saturate(18%) hue-rotate(337deg) brightness(97%) contrast(85%)",n.style.position="relative",n.style.display="flex";const o=_d(i,t);return s.onmouseover=()=>{n.firstElementChild.style.visibility="visible"},s.onmouseleave=()=>{n.firstElementChild.style.visibility="hidden"},e.appendChild(n),n.appendChild(o),n.appendChild(s),e}function _d(i,t){const e=document.createElement("div");return e.style.visibility="hidden",e.style.position="absolute",e.style.zIndex="10",e.style.width="350px",e.style.bottom="100%",e.style.left="50%",e.style.marginLeft="-150px",e.style.background="#FFFFFF",e.style.boxShadow="0px 1px 5px rgba(0, 0, 0, 0.2)",e.style.borderRadius="0.5rem",e.style.fontSize="14px",e.style.overflow="hidden",vd(i,t,e),e}function vd(i,t,e){const n=t-1;i.data.slice(n).forEach((s,o)=>{const a=n+o,r=document.createElement("div");r.style.display="flex",r.style.justifyContent="space-between",r.style.padding="0.5rem",r.style.border="1px solid #CCCCCC";const l=document.createElement("span");l.appendChild(document.createTextNode(i.labels[a]));const c=document.createElement("span");c.appendChild(document.createTextNode(gd(i,a))),r.appendChild(l),r.appendChild(c),e.appendChild(r)})}function qo(i,t,e,n,s,o,a){const r=t.config.type==="doughnut",l=r?i.index:i.datasetIndex,c=new Image,h=Zo(i,t.config.type),d=o[l](!1,s[l],n),u=md(d);return c.src=u.toDataURL(),h.style.background=`url(${c.src})`,h.style.backgroundSize="cover",h.style.borderColor=s[l],h.style.borderWidth=Sn,a&&(h.onmouseover=()=>{r?e.value=l:e.dataSetIndex=l},h.onmouseleave=()=>{r?e.value=null:e.dataSetIndex=-1}),h}function Ko(i,t,e,n,s,o){const a=i.config.type==="doughnut",r=a?t.index:t.datasetIndex,l=wn(i,t,s);return i.config.data.labels.every((d,u)=>i.getDataVisibility(u))?(a&&(e.value=!1,n.value=-1),l):(o&&(l.onmouseover=()=>{a?n.value=r:n.dataSetIndex=r,i.update()},l.onmouseleave=()=>{a?n.value=null:n.dataSetIndex=-1,i.update()}),l)}function xi(i){const t=document.createElement("p");t.style.color=i.fontColor,t.style.fontSize=`${bd}px`,t.style.margin="0",t.style.padding="0";const e=document.createTextNode(i.text);return t.appendChild(e),t}function Zo(i,t){const e=document.createElement("div");return t!=="doughnut"&&(e.style.background="rgba(0, 0, 0, 0.1)",e.style.borderColor=i.strokeStyle,e.style.borderWidth=Sn),e.style.borderRadius="5px",e.style.borderStyle="solid",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.minWidth=yi,e.style.marginRight=Yo,e.style.minHeight=yi,e}function Sd(i){const t=document.createElement("div");return t.style.height=Xo+"px",t.style.width=Xo+"px",t.style.background="white",t.style.borderStyle="solid",t.style.borderColor=i.strokeStyle,t.style.borderWidth=Sn,t}function _i(i,t,e){const n=document.createElement("li");return n.style.alignItems="center",n.style.cursor=t.value?"":"pointer",n.style.display="flex",n.style.flexDirection="row",n.setAttribute("data-test-id",`legend-item-${e}`),n.onclick=()=>{t.value?vi(i,e,t):(Qo(i,e,t),i.update())},n}function wd(i,t,e,n){let s="#fff",o="#666";i&&(s=ea(t.strokeStyle)?n:t.strokeStyle,o=ea(t.strokeStyle)?n:t.strokeStyle,e.setAttribute("checked",""+i)),e.setAttribute("class","mc-checkbox__input"),e.setAttribute("style",`background-color: ${s};
|
|
19
|
+
min-width: ${yi};
|
|
20
|
+
min-height: ${yi};
|
|
21
|
+
margin-right: ${Yo};
|
|
22
|
+
border-color: ${o};`)}function wn(i,t,e){const s=i.config.type==="doughnut"?t.index:t.datasetIndex,o=document.createElement("input");o.setAttribute("type","checkbox"),o.setAttribute("data-test-id",`legend-checkbox-${s}`);const a=ta(i,s),r=e?e[s]:void 0;return wd(a,t,o,r),o}function kn(i){const{type:t}=i.config;return t==="pie"||t==="doughnut"}function Jo(i){let t=i.config.data.datasets;return kn(i)&&(t=i.config.data.datasets[0].data),t}function Qo(i,t,e){if(!e.value){const n=Jo(i);e.value=!0,n.forEach((s,o)=>{o!==t&&vi(i,o)})}}function kd(i){let t=!0;return Jo(i).forEach((n,s)=>{t=t&&ta(i,s)}),t}function ta(i,t){return kn(i)?i.getDataVisibility(t):i.isDatasetVisible(t)}function vi(i,t,e){kn(i)?i.toggleDataVisibility(t):i.setDatasetVisibility(t,!i.isDatasetVisible(t)),e&&kd(i)&&(e.value=!1),i.update()}function Cn(i,t){const e=Zo(i,""),n=Sd(i),s=i.index||i.datasetIndex;return n.style.width="10px",n.style.height="10px",s%2===0?t?n.style.borderRadius="25px":n.style.transform="rotate(45deg)":t?n.style.transform="rotate(45deg)":n.style.borderRadius="25px",e.appendChild(n),e}function Si(i,t){var n,s;let e=(n=i.value)==null?void 0:n.querySelector("ul");return e||(e=document.createElement("ul"),e.style.display="flex",e.style.flexDirection=t,e.style.margin="0",e.style.padding="0",(s=i.value)==null||s.appendChild(e)),e}function ea(i){return i==="#00000000"}function Oe(i,t){const e=Math.round(Math.min(Math.max(t||1,0),1)*255);return i+e.toString(16).toUpperCase()}const{getPatternIndexWithShift:Mn}=bi();function Cd(){const i=x.ref(3),t=x.ref(null),e=x.reactive({dataSetIndex:-1,columnIndex:-1});function n(p,m,g,y,_,S){return Go(p,m,e,g,y,_,S)}function s(){i.value=4,i.value=3}function o(p,m,g,y,_,S){const v=i.value;return p.map((w,M)=>({borderColor:function(C){return g?"#00000000":r(M,C.index,y,S)},backgroundColor:function(C){return l(M,C.index,g,y,_,S)},borderWidth:function(){return g?1:v},data:w.data,label:w.label,stack:`Stack ${m?w.stack:M}`}))}function a(p,m,g,y,_){return o([p,m],!1,_,g,y)}function r(p,m,g,y){const _=Mn(p,y);return u(p,m)?g[_]:Oe(g[_],.2)}function l(p,m,g,y,_,S){const v=Mn(p,S);return u(p,m)?_[v](!1,y[v],g):_[v](!0,y[v],g)}function c(){return e.dataSetIndex<0}function h(p,m){return e.dataSetIndex===p&&e.columnIndex===m}function d(p){return e.dataSetIndex===p&&e.columnIndex<0}function u(p,m){return c()||h(p,m)||d(p)}function f(){e.dataSetIndex=-1,e.columnIndex=-1}function b(){return(p,m)=>{m[0]!==void 0?(e.dataSetIndex=m[0].datasetIndex,e.columnIndex=m[0].index):f()}}return{onHoverIndex:e,reloadChart:s,getDatasets:a,getStackedDatasets:o,getOnHoverOptions:b,getBorderColor:r,getPattern:l,privateGetHtmlLegendPlugin:n,getPatternIndexWithShift:Mn,barChartRef:t,borderWidth:i}}const{getPatternCanvas:Md}=bi();class se{constructor(){k(this,"chartType","");k(this,"datasetIndex",0);k(this,"dataIndex",0);k(this,"titleLines",[""]);k(this,"dataToDisplay","");k(this,"xValue","");k(this,"yValue","");k(this,"patternShifting",0)}createTooltip(t,e,n,s,o,a=!1){var c,h,d,u;if(!t.tooltip.dataPoints)return;this.datasetIndex=((c=t.tooltip)==null?void 0:c.dataPoints[0].datasetIndex)||0,this.dataIndex=t.tooltip.dataPoints[0].dataIndex||0,this.xValue=n.firstLineLabel||"",this.yValue=n.secondLineLabel||"",this.chartType=n.chartType,this.dataToDisplay=e(t),this.patternShifting=n.patternShifting||0;let r=document.querySelector("#chartjs-tooltip");r||(r=this.createNewTooltipElement());const l=t.tooltip;if(l.opacity===0){r.style.opacity="0";return}if(l.body){this.titleLines=l.title||[];const f=l.body.map(this.getBody);let b="background: white;";b+="border-bottom: 1px solid #CCCCCC;",b+="border-radius: 5px;",b+="padding: 10px 20px";const p=`<div style="${b}" class="tooltipTitle">`,m=this.chartType==="DOUGHNUT"?[l.title[0].split("(")[0].trim()]:f[0];let g="",y="";const _=(u=(d=(h=t.tooltip)==null?void 0:h.dataPoints[0])==null?void 0:d.dataset)==null?void 0:u.type;this.chartType==="RADAR"||this.chartType==="LINE_CHART"?(g=this.createLegendStyle(t),y=this.createLegendInnerStyle(t)):this.chartType==="BAR_CHART"||this.chartType==="DETAILS_BAR_CHART"||this.chartType==="DOUGHNUT"?g=this.createPatternLegendStyle(t):this.chartType==="MIXED_BAR_LINE_CHART"&&(_==="bar"?g=this.createPatternLegendStyle(t):(g=this.createLegendStyle(t),y=this.createLegendInnerStyle(t))),this.addLegendToDom(p,g,y,m,b,r,s,o,a,_)}this.handleTooltipPosition(t,l,r)}handleTooltipPosition(t,e,n){const s=t.chart.canvas.getBoundingClientRect(),o=window.innerWidth,a=s.left+window.scrollX+e.caretX,r=s.top+window.scrollY+e.caretY;n.style.left=a+"px",n.style.top=r+"px",n.style.height="auto",n.style.minWidth="17rem",n.style.opacity="1",n.style.position="absolute",n.style.zIndex="99",n.style.backgroundColor="white",n.style.pointerEvents="none",n.getBoundingClientRect().width+a>o&&(n.style.left=a-n.getBoundingClientRect().width+"px")}createNewTooltipElement(){const t=document.createElement("div");return t.id="chartjs-tooltip",t.style.backgroundColor="white",t.style.borderRadius="5px",t.style.transition="opacity .5s",t.style.boxShadow="0px 1px 5px rgba(0, 0, 0, 0.2)",t.innerHTML='<div class="tooltipCtn"></div>',document.body.appendChild(t),t}createPatternLegendStyle(t){return this.createCommonLegendSquareStyle(t)}createLegendStyle(t){let e=`background-color:${t.tooltip.labelColors[0].backgroundColor}`;return e+=this.createCommonLegendSquareStyle(t),e}createCommonLegendSquareStyle(t){let e=`;border: 2px solid ${t.tooltip.labelColors[0].borderColor}`;return e+=";min-height: 20px",e+=";min-width: 20px",e+=";border-radius: 5px",e+=";margin-right: 10px",e+=";display: flex",e+=";align-items: center",e+=";justify-content: center",e+=";background: rgba(0, 0, 0, 0.1);",e}createLegendInnerStyle(t){let e="height: 12px";return e+=";width: 12px",e+=";background-color: #FFF",e+=`;border: 2px solid ${t.tooltip.labelColors[0].borderColor};`,t.tooltip.labelPointStyles[0].pointStyle==="circle"?e+="border-radius: 25px;":t.tooltip.labelPointStyles[0].pointStyle==="rectRot"&&(e+="transform: rotate(45deg);"),e}addLegendToDom(t,e,n,s,o,a,r,l,c=!1,h){let d=t,u=`<div class="legendIcon" style="${e}">`;const f=`<div style="${n}"></div>`;u+=`${f}</div>`;const b=this.setInnerHtmlToAdd(s,o,u);d+=b;const p=a==null?void 0:a.querySelector(".tooltipCtn");(p==null?void 0:p.innerHTML)!=null&&(h?this.setInnerHtmlAndPattern(p,d,r,l,c,h):this.setInnerHtmlAndPattern(p,d,r,l,c))}setInnerHtmlToAdd(t,e,n){const a=`<span style="font-family: Arial; font-size: 16px">${t[0].split(":")[0]}</span>`;return this.chartType==="RADAR"?this.returnRadarHtml(e,n,a):this.chartType==="DOUGHNUT"?this.returnDoughnutHtml(n,a):this.returnDetailsBarchartHtml(e,n,a)}returnDoughnutHtml(t,e){const n="font-family: Arial; font-size: 16px",s=`<span style="${n}">${e.split("(")[0]}</span>`;let o=`<div style="${n}; display: flex; align-items: center; justify-content: space-between">`;return o+=`<div style="display:flex; align-items: center;" >${t+s}</div>`,o+=`<div style="${n}; margin-left:3rem;">${this.dataToDisplay}</div>`,o+="</div></div>",o}returnRadarHtml(t,e,n){const s="font-family: Arial; font-size: 16px";let o=`<div style="${s}; display: flex; align-items: center;">${e+n}</div>`;return o+="</div>",o+=`<div style="${s}; ${t}; border: none; display:flex; justify-content: space-between;">`,o+=`<div>${this.titleLines[0]}</div>`,o+=`<div style="margin-left: 20px;">${this.dataToDisplay}</div>`,o+="</div>",o+="</div><div>",o}returnDetailsBarchartHtml(t,e,n){const s="font-family: Arial; font-size: 16px";let o=`<div style="${s}; display: flex; align-items: center;">${e+n}</div>`;return o+="</div>",o+=`<div style="${s}; ${t}; display:flex; justify-content: space-between;">`,o+=`<div>${this.xValue}</div>`,o+=`<div style="margin-left: 20px;">${this.titleLines[0]}</div>`,o+="</div>",o+=`<div style="${s}; ${t}; border-: none; display:flex; justify-content: space-between;">`,o+=`<div>${this.yValue}</div>`,o+=`<div style="margin-left: 20px;">${this.dataToDisplay}</div>`,o+="</div>",o}setInnerHtmlAndPattern(t,e,n,s,o=!1,a){t.innerHTML=e;const r=document.querySelector(".legendIcon"),l=new Image;let c;this.chartType==="DOUGHNUT"?c=this.dataIndex+1:c=this.datasetIndex+1;const h=fd(c,this.patternShifting);if(this.chartType!=="LINE_CHART"&&this.chartType!=="RADAR"&&a!=="line"){const d=s[h-1](!1,n[h-1],o),u=Md(d,22,22);l.src=u.toDataURL(),r.style.backgroundImage=`url(${l.src})`}}getBody(t){return t.lines}}var oe=(i=>(i.RADAR="RADAR",i.BAR_CHART="BAR_CHART",i.MIXED_BAR_LINE_CHART="MIXED_BAR_LINE_CHART",i.DETAILS_BAR_CHART="DETAILS_BAR_CHART",i.LINE_CHART="LINE_CHART",i.DOUGHNUT="DOUGHNUT",i))(oe||{});function Pd(i,t="#A274FF",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=o*.15;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.5*o,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.75*o,o/2,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.006*o,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.25*o,o/2,a,a),s.fill()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const l=document.createElement("canvas").getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c||new CanvasPattern}function Ad(i,t="#143666",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(-o*.03,-.01*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.29*o,.33*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.63*o,.69*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.33*o,-.37*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.71*o,-.72*o,o+o/2,.04*o),s.fill(),s.restore()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas").getContext("2d");if(!r)return new CanvasPattern;const l=r.createPattern(n,"repeat");return l||new CanvasPattern}function Dd(i,t="#00A3B2",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o/2),s.lineTo(0,0),s.lineTo(o/2,o/2),s.lineTo(o,0),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o),s.lineTo(0,o/2),s.lineTo(o/2,o),s.lineTo(o,o/2),s.lineTo(o+o/2,o),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,111e-6),s.lineTo(4e-6*o,-o/2),s.lineTo(o/2,111e-6),s.lineTo(o,-o/2),s.lineTo(o+o/2,111e-6),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o+o/2),s.lineTo(0,o),s.lineTo(o/2,o+o/2),s.lineTo(o,o),s.lineTo(o+o/2,o+o/2),s.stroke()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas").getContext("2d");if(!r)return new CanvasPattern;const l=r.createPattern(n,"repeat");return l||new CanvasPattern}function Ld(i,t="#8C1551",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=o*.15;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,a,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.005*o,s.rect(o/2,0,a,o),s.fill()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const l=document.createElement("canvas").getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c?(l.fillStyle=c,l.fillRect(0,0,o,o),c):new CanvasPattern}function Td(i,t="#F255A3",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=new DOMMatrix,a=21,r=.1*a;n.width=a,n.height=a,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,a,a),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*a,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*a,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=r,s.moveTo(r,0),s.lineTo(r,.5*a),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=r,s.moveTo(a/2+r,0),s.lineTo(a/2+r,.5*a),s.stroke()),i&&(s.beginPath(),s.fillStyle="#FFFFFF",s.globalAlpha=.5,s.lineWidth=.006*a,s.rect(0,0,a,a),s.fill());const l=document.createElement("canvas"),c=l.getContext("2d");if(!c)return new CanvasPattern;const h=c.createPattern(n,"repeat");return h?(c.fillStyle=h,c.fillRect(0,0,l.width,l.height),h.setTransform(o.rotate(45)),h):new CanvasPattern}function Od(i,t="#095359",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=.04*o;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.1005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.1005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=a,s.arc(a+.06*o,a+.06*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=a,s.arc(a+.56*o,a+.06*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.04*o,s.arc(-a+.44*o,a+.56*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.04*o,s.arc(-a+.94*o,a+.56*o,.06*o,0,2*Math.PI),s.stroke()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas"),l=r.getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c?(l.fillStyle=c,l.fillRect(0,0,r.width,r.height),c):new CanvasPattern}function ae(){return{patternsStandardList:[Pd,Ad,Dd,Ld,Td,Od],colourSets:[["#393879","#006974","#405D68","#005C91","#8C3500","#8C0003"],["#A274FF","#143666","#00A3B2","#8C1551","#F255A3","#095359"],["#00A3B2","#143666","#3D993D","#8C1551","#E56D17","#4C3380"],["#8C1551","#E56D17","#4C3380","#4588E5","#095359","#F255A3"],["#4588E5","#4C3380","#E56D17","#143666","#D94141","#8C1551"],["#143666","#F255A3","#095359","#4588E5","#8C1551","#E56D17"],["#A274FF","#B0BBC0","#B0BBC0","#B0BBC0","#B0BBC0","#B0BBC0"]]}}const Id={class:"container"},Fd={class:"main"},Rd=x.defineComponent({__name:"BarChart",props:{chartId:{type:String,default:"radar-chart"},unit:{type:String,default:"%"},labels:{type:Array,default:()=>[]},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},datasets:{type:Array,default:()=>[]},width:{type:String,default:"400px"},height:{type:String,default:"300px"},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]},stacked:{type:Boolean,default:!1},disableAccessibility:{type:Boolean,default:!1},enableHoverFeature:{type:Boolean,default:!1},xAxisTitle:{type:String,default:null},yAxisTitle:{type:String,default:null},tooltipFirstLineLabel:{type:String,default:"content"},tooltipSecondLineLabel:{type:String,default:"content2"}},setup(i){const t=i;wt.register(Qt,te,Jt,Zt,ee,ie);const{colourSets:e,patternsStandardList:n}=ae(),s=x.ref(null),o=x.ref(!1),a=x.computed(()=>t.newPatternsOrder.length!==n.length?e[t.colourSet]:t.newPatternsOrder.map(A=>e[t.colourSet][A])),r=x.computed(()=>t.newPatternsOrder.length!==n.length?n:t.newPatternsOrder.map(A=>n[A])),l=x.computed(()=>t.disableAccessibility),c=x.computed(()=>t.enableHoverFeature),{onHoverIndex:h,barChartRef:d,reloadChart:u,getOnHoverOptions:f,getStackedDatasets:b,privateGetHtmlLegendPlugin:p}=Cd(),m=x.computed(()=>{const A=M(S.value);return _(),{labels:A,datasets:b(t.datasets.map((P,L)=>({data:v(L,S.value),label:t.datasets[L].label,stack:P.stack||0})),t.stacked,t.disableAccessibility,a.value,r.value,0)}});let g,y;const _=()=>{g=t.tooltipFirstLineLabel,y=t.tooltipSecondLineLabel},S=x.computed(()=>{const A=t.labels;if(A.includes("other")){const P=A.indexOf("other");if(t.datasets[0].data[P].rate+""=="0"&&t.datasets[1].data[P].rate+""=="0")return P}return null}),v=(A,P,L=!1)=>{const B=Object.assign([],t.datasets[A].data);return P&&S.value&&B.splice(S.value,1),B.map(j=>t.unit==="%"?j.rate:j.amount)},w=A=>{const P=A.tooltip.dataPoints[0].datasetIndex,L=A.tooltip.dataPoints[0].dataIndex,B=A.tooltip.body[0].lines[0].split(":")[1],j=t.datasets[P].data[L],F=j.rate?parseFloat(B.replace(",",".")).toFixed(2)+"% ":"",z=j.amountUnit?j.amountUnit:"",$=j.amount?Q(j.amount):"";return F+(F&&$?"/ ":"")+$+z},M=A=>{const P=Object.assign([],t.labels);return A&&P.splice(A,1),P.map(L=>L)},C=x.computed(()=>({onHover:t.enableHoverFeature?f():()=>{},elements:{bar:{borderSkipped:!1}},maxBarThickness:64,categoryPercentage:.6,plugins:{responsive:!0,maintainAspectRatio:!1,legend:{display:!1},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,position:"nearest",external:function(A){var L;const P=((L=A.tooltip.dataPoints)==null?void 0:L[0].dataIndex)||0;!t.labels[P]||t.labels[P]===""||new se().createTooltip(A,w,{chartType:oe.BAR_CHART,firstLineLabel:g,secondLineLabel:y},a.value,r.value,t.disableAccessibility)}}},scales:{x:{stacked:t.stacked,title:{display:t.xAxisTitle!==null,text:t.xAxisTitle}},y:{stacked:t.stacked,title:{display:t.yAxisTitle!==null,text:t.yAxisTitle},ticks:{callback:function(A){return t.unit==="%"?_n(A,t.unit):Q(A)+" "+t.unit}}}}})),D=x.computed(()=>[p(s,o,l,a,r,c)]);return x.watch(h,()=>{u()},{deep:!0}),(A,P)=>(x.openBlock(),x.createElementBlock("div",Id,[x.createElementVNode("div",Fd,[m.value?(x.openBlock(),x.createBlock(x.unref(Uo),{key:0,ref_key:"barChartRef",ref:d,id:i.chartId,data:m.value,options:C.value,plugins:D.value,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:s},null,512)]))}}),Ou="",Iu="",re=(i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e},wi=re(Rd,[["__scopeId","data-v-360144b2"]]);wi.install=i=>{i.component("BarChart",wi)};function Ed(){const i=x.ref(null),t=x.ref(null),e=x.ref(null),n=x.ref(null);function s(u,f,b,p,m,g,y,_){return Go(u,f,t,b,p,m,_,g,y)}function o(u,f,b,p){return t.value!==null&&p?f.map((m,g)=>t.value===g?m(!1,u[g],b):m(!0,u[g],b)):f.map((m,g)=>m(!1,u[g],b))}function a(u,f){return t.value!==null&&f?u.map((b,p)=>t.value===p?b:Oe(b,.2)):u}function r(){return(u,f)=>{f[0]!==void 0?t.value=f[0].element.$context.index:t.value=null}}const l=u=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase();function c(u){return{id:"centeredLabelPlugin",afterDatasetDraw:f=>{var y,_,S;const b=[];f.getDatasetMeta(0).data.forEach((v,w)=>{v.startAngle!==v.endAngle&&b.push(w)});const m=(S=(_=(y=f._metasets[0])==null?void 0:y._dataset)==null?void 0:_.raw_value)==null?void 0:S.filter((v,w)=>b.includes(w)).reduce((v,w)=>v+w,0),g=u[0].unit??"";n.value=`${Q(m)}${g}`}}}function h(u,f,b,p){let m=u.slice(0),g=f.slice(0);return u.length>b&&(g=d(f,b),m=m.slice(0,b-1),m.push(p)),m.map((y,_)=>`${l(y)} (${Q(g[_].rate)} %)`)}function d(u,f){if(f<1)return u;let b=u.slice(0);return u.length>f&&(b=b.slice(0,f),b[f-1]=u.slice(f).reduce((p,m)=>(p.rate+=m.rate,p.value+=m.value,p),{...u[f-1]})),b}return{onHoverIndex:t,privateGetHtmlLegendPlugin:s,getOnHoverOptions:r,groupDataAfterNthValue:d,getDoughnutLabels:h,getBackgroundColor:o,getFormatedText:l,getBorderColor:a,backgroundColor:e,doughnutRef:i,getCenteredLabelPlugin:c,centeredLabel:n}}const Bd={class:"container"},zd={class:"main"},Wd={key:1,class:"centered-label"},Hd=x.defineComponent({__name:"DoughnutChart",props:{chartId:{type:String,default:"doughnut-chart"},data:{type:Array,default:()=>[]},labels:{type:Array,default:()=>[]},cssClasses:{type:String,default:void 0},enableCenteredLabel:{type:Boolean,default:!1},disableAccessibility:{type:Boolean,default:!1},enableHoverFeature:{type:Boolean,default:!1},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},width:{type:String,default:"400px"},height:{type:String,default:"400px"},maxValues:{type:Number,default:5},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]},othersLabel:{type:String,default:"others"}},setup(i){const t=i;wt.register(Qt,te,Jt,Kt);const{colourSets:e,patternsStandardList:n}=ae(),{onHoverIndex:s,doughnutRef:o,centeredLabel:a,getBackgroundColor:r,privateGetHtmlLegendPlugin:l,getCenteredLabelPlugin:c,getOnHoverOptions:h,groupDataAfterNthValue:d,getDoughnutLabels:u,getBorderColor:f}=Ed(),b=x.ref(!1),p=x.ref(null),m=x.computed(()=>d(t.data,t.maxValues)),g=x.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(P=>e[t.colourSet][P])),y=x.computed(()=>t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(P=>n[P])),_=x.computed(()=>({labels:u(t.labels,t.data,t.maxValues,t.othersLabel),datasets:[{data:m.value.map(P=>P.rate),raw_value:m.value.map(P=>P.value),backgroundColor:r(g.value,y.value,t.disableAccessibility,t.enableHoverFeature),borderColor:f(g.value,t.enableHoverFeature)}]})),S=P=>{const L=P.tooltip.dataPoints[0].dataIndex,B=m.value[L],j=Q(B.rate),F=Q(B.value),z=B.unit||"";return`${F}${z} (${j})%`};function v(){return t.labels.length<=1?0:12}const w=x.computed(()=>{const P=g.value,L=y.value;return{onHover:t.enableHoverFeature?h():()=>{},plugins:{legend:{display:!1,position:"bottom",align:"start",labels:{pointStyle:"rectRounded",usePointStyle:!0}},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,external:function(B){new se().createTooltip(B,S,{chartType:oe.DOUGHNUT},P,L,C.value)}}},radius:"90%",cutout:"70%",borderWidth:3,spacing:v(),hoverOffset:4}}),M={data:t.data,labels:t.labels},C=x.computed(()=>t.disableAccessibility),D=x.computed(()=>t.enableHoverFeature),A=x.computed(()=>[l(p,b,C,g,y,t.maxValues,M,D),c(t.data)]);return x.watch(s,(P,L)=>{P!==L&&D.value&&r(g.value,y.value,t.disableAccessibility,D.value)}),x.watch(C,()=>{r(g.value,y.value,t.disableAccessibility,D.value)}),(P,L)=>(x.openBlock(),x.createElementBlock("div",Bd,[x.createElementVNode("div",zd,[_.value?(x.openBlock(),x.createBlock(x.unref(cd),{key:0,ref_key:"doughnutRef",ref:o,id:i.chartId,data:_.value,options:w.value,plugins:A.value,"max-values":i.maxValues,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","max-values","class","style"])):x.createCommentVNode("",!0),i.enableCenteredLabel?(x.openBlock(),x.createElementBlock("span",Wd,x.toDisplayString(x.unref(a)),1)):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:p},null,512)]))}}),Fu="",ki=re(Hd,[["__scopeId","data-v-42646243"]]);ki.install=i=>{i.component("DoughnutChart",ki)};const Nd={class:"container"},Vd={class:"main"},jd=x.defineComponent({__name:"LineChart",props:{chartId:{type:String,default:"radar-chart"},tooltipFirstLineLabel:{type:String,default:"content"},tooltipSecondLineLabel:{type:String,default:"content2"},width:{type:String,default:"200px"},height:{type:String,default:"400px"},disableAccessibility:{type:Boolean,default:!1},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},lines:{type:Array,default:()=>{}},labels:{type:Array,default:()=>[]},xAxisTitle:{type:String,default:null},yAxisTitle:{type:String,default:null},suggestedMin:{type:Number,default:void 0},suggestedMax:{type:Number,default:void 0},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(i){const t=i;wt.register(Qt,te,Jt,Tt,pt,ee,ie);const{colourSets:e,patternsStandardList:n}=ae(),s=x.ref(null),o=x.ref(!1),a=x.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(g=>e[t.colourSet][g])),r=t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(g=>n[g]),l=g=>{const y=g.tooltip.dataPoints[0].datasetIndex,_=g.tooltip.dataPoints[0].dataIndex,S=t.lines[y].data[_].toFixed(2);return t.lines[y].unit?S+" "+t.lines[y].unit:S},c=x.computed(()=>t.tooltipFirstLineLabel),h=x.computed(()=>t.tooltipSecondLineLabel),d=g=>{switch(g){case 1:return"circle";default:return"rectRot"}},u=x.computed(()=>({labels:t.labels.map(g=>g),datasets:t.lines.map((g,y)=>({type:"line",borderColor:a.value[y],pointStyle:d(y),pointBackgroundColor:"#FFFFFF",pointRadius:5,label:g.label,data:g.data,borderWidth:2}))}));function f(g,y){return[{id:"htmlLegend",afterUpdate(_){const S=Si(g,"column");for(S.style.display="flex",S.style.flexDirection="row",S.style.margin="1.375rem 1.0625rem";S.firstChild;)S.firstChild.remove();_.options.plugins.legend.labels.generateLabels(_).forEach(w=>{const M=_i(_,y,w.datasetIndex);let C;y.value?C=b(_,w):C=Cn(w),C.style.boxSizing="border-box",M.style.marginRight="10px",M.appendChild(C),M.appendChild(xi(w)),S.appendChild(M)})}}]}function b(g,y){const _=wn(g,y,null);return _.onclick=S=>{vi(g,y.datasetIndex,o),S.stopPropagation()},_}const p=f(s,o),m=x.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,external:function(g){new se().createTooltip(g,l,{chartType:oe.LINE_CHART,firstLineLabel:c.value,secondLineLabel:h.value},a.value,r,t.disableAccessibility)}}},scales:{x:{offset:!0,title:{display:t.xAxisTitle!==null,text:t.xAxisTitle}},y:{type:"linear",display:!0,title:{display:t.yAxisTitle!==null,text:t.yAxisTitle},suggestedMin:t.suggestedMin,suggestedMax:t.suggestedMax,position:"left",grid:{drawOnChartArea:!0},ticks:{callback:function(g){const y=t.lines[0].unit;return`${Q(g)} ${y||""}`}}}}}));return(g,y)=>(x.openBlock(),x.createElementBlock("div",Nd,[x.createElementVNode("div",Vd,[u.value?(x.openBlock(),x.createBlock(x.unref(hd),{key:0,ref:"lineChartRef",id:i.chartId,data:u.value,options:m.value,plugins:x.unref(p),class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:s},null,512)]))}}),Ru="",Ci=re(jd,[["__scopeId","data-v-e51b4953"]]);Ci.install=i=>{i.component("LineChart",Ci)};function $d(i,t){const e=i.ctx,n=i.scales.r,s=i.data.labels;!e||!n||!s||(e.save(),s.forEach((o,a)=>{const r=(n.getIndexAngle(a)-Math.PI/2)%(2*Math.PI),l=n.getPointPositionForValue(a,n.max);e.textAlign=r<=Math.PI/2||r>3*Math.PI/2?"left":"right";let c=r<=Math.PI/2||r>3*Math.PI/2?15:-15,h;r<0||r>Math.PI?h=-15:h=15,r>Math.PI/4&&r<3*Math.PI/4&&(h*=3),(r<-Math.PI/4||r>5*Math.PI/4)&&(h*=3,c=0),(r>11*Math.PI/8||r<-3*Math.PI/8)&&(e.textAlign="center");const d=l.y+h*(o.length-1)/2;e.font="12px Arial",o.forEach((u,f)=>{const b=f===o.length-1?Ud(t)[a]:"#000000";e.fillStyle=b;const p=l.x+c,m=d+15*f;e.fillText(u,p,m)})}),e.restore())}const Ud=i=>i.datasets[0].areaData.map(t=>{switch(t.color){case"red":return"#C61112";case"green":return"#46A610";default:return"#000000"}});function Yd(i,t){if(i.length>7&&i.includes(" ",7)){const n=i.indexOf(" ",7);return[i.substring(0,n),i.substring(n),t]}return[i,t]}const Xd={class:"container"},Gd=x.defineComponent({__name:"RadarChart",props:{chartId:{type:String,default:"radar-chart"},height:{type:String,default:"600px"},labels:{type:Array,default:()=>[]},disableAccessibility:{type:Boolean,default:!1},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},datasets:{type:Array,default:()=>[]},cssClasses:{default:"",type:String},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(i){const t=i;wt.register(Qt,te,Jt,Le,pt,Tt,wh);const{colourSets:e,patternsStandardList:n}=ae(),s=x.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(m=>e[t.colourSet][m])),o=x.computed(()=>t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(m=>n[m])),a=x.computed(()=>({labels:d(),datasets:r()}));function r(){return t.datasets.map((m,g)=>({label:m.label,backgroundColor:Oe(s.value[g],.1),borderColor:s.value[g],pointBackgroundColor:"#FFFFFF",pointBorderColor:s.value[g],pointBorderWidth:2,borderWidth:2,pointHitRadius:55,pointRadius:5,pointStyle:g%2===0?"circle":"rectRot",pointHoverBackgroundColor:s.value[g],pointHoverBorderColor:s.value[g],data:m.areaData.map(y=>y.position)}))}const l={onClick:(m,g,y)=>{g[0]&&Qo(y,g[0].datasetIndex,h)},plugins:{htmlLegend:{containerID:"legend-container"},legend:{display:!1},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,position:"nearest",external:function(m){new se().createTooltip(m,p,{chartType:oe.RADAR},s.value,o.value,t.disableAccessibility)}}},layout:{padding:{left:130,right:95,top:95,bottom:95}},scales:{r:{min:0,max:100,pointLabels:{display:!1,font:{weight:400,family:"Roboto"}},ticks:{display:!1,stepSize:25}}}},c=x.ref(null),h=x.ref(!1),d=()=>t.labels.map((m,g)=>{const y=t.datasets[0].areaData[g].value?`${u(t.datasets[0].areaData[g].value+"")} ${t.datasets[0].areaData[g].unit}`:"No Data";return Yd(m,y)}),u=m=>Q(parseFloat(m));function f(m,g){const y=wn(m,g,null);return y.onclick=_=>{vi(m,g.datasetIndex,h),_.stopPropagation()},y}const b=[{id:"htmlLegend",afterUpdate(m){const g=Si(c,"row");for(;g.firstChild;)g.firstChild.remove();m.options.plugins.legend.labels.generateLabels(m).reverse().forEach(_=>{const S=_i(m,h,_.datasetIndex);let v;S.style.marginRight="0.625rem",h.value?v=f(m,_):v=Cn(_,!0),S.appendChild(v),S.appendChild(xi(_)),g.appendChild(S)})}},{id:"radarLabelPlugin",beforeDraw(m){$d(m,t)}}],p=m=>{const g=m.tooltip.dataPoints[0].datasetIndex,y=m.tooltip.dataPoints[0].dataIndex,_=t.datasets[g];return _.areaData[y].value.toFixed(2)+" "+_.areaData[y].unit};return(m,g)=>(x.openBlock(),x.createElementBlock("div",Xd,[x.createElementVNode("div",{class:"main",style:x.normalizeStyle({height:i.height})},[a.value?(x.openBlock(),x.createBlock(x.unref(dd),{key:0,id:i.chartId,data:a.value,options:l,plugins:b,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","class","style"])):x.createCommentVNode("",!0)],4),x.createElementVNode("div",{ref_key:"legendContainer",ref:c,class:"legendContainer"},null,512)]))}}),Eu="",Mi=re(Gd,[["__scopeId","data-v-e82dcdc6"]]);Mi.install=i=>{i.component("RadarChart",Mi)};const ia=Object.freeze(Object.defineProperty({__proto__:null,BarChart:wi,DoughnutChart:ki,LineChart:Ci,RadarChart:Mi},Symbol.toStringTag,{value:"Module"})),{getPatternIndexWithShift:na}=bi();function qd(){const i=x.ref(2),t=x.reactive({dataSetIndex:-1,columnIndex:-1});function e(d,u,f,b,p,m){return[{id:"htmlLegend",afterUpdate(g){const y=Si(d,"column");for(y.style.display="flex",y.style.margin="1.375rem 1.0625rem",y.style.flexDirection="row-reverse",y.style.flexWrap="wrap",y.style.justifyContent="flex-end";y.firstChild;)y.firstChild.remove();g.options.plugins.legend.labels.generateLabels(g).sort((S,v)=>v.datasetIndex-S.datasetIndex).forEach(S=>{const v=_i(g,u,S.datasetIndex);let w;u.value?w=Ko(g,S,u,{datasetIndex:-1},p.value,!1):S!=null&&S.lineCap?w=Cn(S):w=qo(S,g,{datasetIndex:-1},b.value,p.value,m.value,!1),w.style.boxSizing="border-box",v.style.marginRight="10px",v.style.marginBottom="2px",v.appendChild(w),v.appendChild(xi(S)),y.appendChild(v)})}}]}function n(d,u,f,b,p){return e(d,u,t,f,b,p)}function s(d,u,f,b,p){const m=i.value;return d.map((g,y)=>{const _=g.type==="bar";return{type:g.type,fill:_?null:!1,borderWidth:function(){return u&&_?1:m},borderColor:function(S){return u&&_?"#00000000":_?o(y,S.index,f,p):f[y%f.length]},backgroundColor:function(S){return a(y,S.index,u,f,b,p)},yAxisID:_?"A":"B",pointStyle:y%2===0?"rectRot":"circle",data:g.data,label:g.label,pointBackgroundColor:"#FFFFFF",pointRadius:5,order:g.type==="line"?0:1}})}function o(d,u,f,b){const p=na(d,b);return r(d,u)?f[p]:Oe(f[p],.2)}function a(d,u,f,b,p,m){const g=na(d,m);return r(d,u)?p[g](!1,b[g],f):p[g](!0,b[g],f)}function r(d,u){return l()||c(d,u)||h(d)}function l(){return t.dataSetIndex<0}function c(d,u){return t.dataSetIndex===d&&t.columnIndex===u}function h(d){return t.dataSetIndex===d&&t.columnIndex<0}return{privateGetHtmlLegendPlugin:n,getMixedDatasets:s,getBorderColor:o,getPattern:a,onHoverIndex:t}}const Kd={class:"container"},Zd={class:"main"},Jd=x.defineComponent({__name:"MixedBarLineChart",props:{chartId:{type:String,default:"mixed-bar-line-chart"},unit:{type:String,default:""},labels:{type:Array,default:()=>[]},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},barDatasets:{type:Array,default:()=>[]},barUnit:{type:String,default:""},lineDatasets:{type:Array,default:()=>[]},lineUnit:{type:String,default:""},width:{type:String,default:"400px"},height:{type:String,default:"300px"},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]},stacked:{type:Boolean,default:!1},disableAccessibility:{type:Boolean,default:!1},tooltipFirstLineLabel:{type:String,default:"content"},tooltipSecondLineLabel:{type:String,default:"content2"},xAxisTitle:{type:String,default:null},yLeftAxisTitle:{type:String,default:null},yRightAxisTitle:{type:String,default:null}},setup(i){const t=i;wt.register(Qt,te,Jt,Zt,ee,ie,pt,Tt);const{privateGetHtmlLegendPlugin:e,getMixedDatasets:n}=qd(),{colourSets:s,patternsStandardList:o}=ae(),a=x.ref(null),r=x.ref(!1),l=x.computed(()=>{let g=[];return t.barDatasets&&(g=g.concat(t.barDatasets)),t.lineDatasets&&(g=g.concat(t.lineDatasets)),g}),c=x.computed(()=>t.newPatternsOrder.length!==o.length?s[t.colourSet]:t.newPatternsOrder.map(g=>s[t.colourSet][g])),h=x.computed(()=>t.newPatternsOrder.length!==o.length?o:t.newPatternsOrder.map(g=>o[g])),d=x.computed(()=>t.disableAccessibility),u=x.computed(()=>({labels:b(),datasets:n(l.value,d.value,c.value,h.value,0)})),f=g=>{const y=g.tooltip.dataPoints[0].datasetIndex,_=g.tooltip.dataPoints[0].dataIndex,S=l.value[y].data[_],v=l.value[y].type==="bar"?t.barUnit:t.lineUnit;return(v==="%"?parseFloat(S.toString().replace(",",".")).toFixed(2):Q(S))+v},b=()=>Object.assign([],t.labels).map(y=>y),p=x.computed(()=>({type:"bar",responsive:!0,maintainAspectRatio:!0,maxBarThickness:64,categoryPercentage:.6,elements:{bar:{borderSkipped:!1}},plugins:{legend:{display:!1},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,external:function(g){new se().createTooltip(g,f,{chartType:oe.MIXED_BAR_LINE_CHART,firstLineLabel:t.tooltipFirstLineLabel,secondLineLabel:t.tooltipSecondLineLabel},c.value,h.value,t.disableAccessibility)}}},scales:{x:{offset:!0,title:{display:t.xAxisTitle!==null,text:t.xAxisTitle}},A:{type:"linear",display:!0,position:"left",grid:{drawOnChartArea:!0},title:{display:t.yLeftAxisTitle!==null,text:t.yLeftAxisTitle},ticks:{callback:function(g){return t.barUnit==="%"?_n(g,t.unit):Q(g)+" "+t.barUnit}}},B:{type:"linear",display:!0,position:"right",grid:{drawOnChartArea:!1},title:{display:t.yRightAxisTitle!==null,text:t.yRightAxisTitle},ticks:{callback:function(g){return(t.lineUnit==="%"?_n(g,t.unit):Q(g))+" "+t.lineUnit}}}}})),m=x.ref(e(a,r,d,c,h));return(g,y)=>(x.openBlock(),x.createElementBlock("div",Kd,[x.createElementVNode("div",Zd,[u.value?(x.openBlock(),x.createBlock(x.unref(Uo),{key:0,ref:"mixedBarLineChartRef",id:i.chartId,data:u.value,options:p.value,plugins:m.value,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:a},null,512)]))}}),Bu="",zu="",Pn=re(Jd,[["__scopeId","data-v-e2792cc7"]]);Pn.install=i=>{i.component("MixedBarLineChart",Pn)};const Qd="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2IiBmaWxsPSJub25lIj4KICA8Y2lyY2xlIGN4PSI4IiBjeT0iOCIgcj0iNy41IiBzdHJva2U9IiM2NjY2NjYiLz4KICA8Y2lyY2xlIGN4PSI4IiBjeT0iMTEuMiIgcj0iNC4zIiBzdHJva2U9IiM2NjY2NjYiLz4KPC9zdmc+";/*!
|
|
23
|
+
* chartjs-plugin-datalabels v2.2.0
|
|
24
|
+
* https://chartjs-plugin-datalabels.netlify.app
|
|
25
|
+
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
26
|
+
* Released under the MIT license
|
|
27
|
+
*/var sa=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var i=window.screen;if(i)return(i.deviceXDPI||1)/(i.logicalXDPI||1)}return 1}(),Ie={toTextLines:function(i){var t=[],e;for(i=[].concat(i);i.length;)e=i.pop(),typeof e=="string"?t.unshift.apply(t,e.split(`
|
|
28
|
+
`)):Array.isArray(e)?i.push.apply(i,e):I(i)||t.unshift(""+e);return t},textSize:function(i,t,e){var n=[].concat(t),s=n.length,o=i.font,a=0,r;for(i.font=e.string,r=0;r<s;++r)a=Math.max(i.measureText(n[r]).width,a);return i.font=o,{height:s*e.lineHeight,width:a}},bound:function(i,t,e){return Math.max(i,Math.min(t,e))},arrayDiff:function(i,t){var e=i.slice(),n=[],s,o,a,r;for(s=0,a=t.length;s<a;++s)r=t[s],o=e.indexOf(r),o===-1?n.push([r,1]):e.splice(o,1);for(s=0,a=e.length;s<a;++s)n.push([e[s],-1]);return n},rasterize:function(i){return Math.round(i*sa)/sa}};function An(i,t){var e=t.x,n=t.y;if(e===null)return{x:0,y:-1};if(n===null)return{x:1,y:0};var s=i.x-e,o=i.y-n,a=Math.sqrt(s*s+o*o);return{x:a?s/a:0,y:a?o/a:-1}}function tu(i,t,e,n,s){switch(s){case"center":e=n=0;break;case"bottom":e=0,n=1;break;case"right":e=1,n=0;break;case"left":e=-1,n=0;break;case"top":e=0,n=-1;break;case"start":e=-e,n=-n;break;case"end":break;default:s*=Math.PI/180,e=Math.cos(s),n=Math.sin(s);break}return{x:i,y:t,vx:e,vy:n}}var eu=0,oa=1,aa=2,ra=4,la=8;function Pi(i,t,e){var n=eu;return i<e.left?n|=oa:i>e.right&&(n|=aa),t<e.top?n|=la:t>e.bottom&&(n|=ra),n}function iu(i,t){for(var e=i.x0,n=i.y0,s=i.x1,o=i.y1,a=Pi(e,n,t),r=Pi(s,o,t),l,c,h;!(!(a|r)||a&r);)l=a||r,l&la?(c=e+(s-e)*(t.top-n)/(o-n),h=t.top):l&ra?(c=e+(s-e)*(t.bottom-n)/(o-n),h=t.bottom):l&aa?(h=n+(o-n)*(t.right-e)/(s-e),c=t.right):l&oa&&(h=n+(o-n)*(t.left-e)/(s-e),c=t.left),l===a?(e=c,n=h,a=Pi(e,n,t)):(s=c,o=h,r=Pi(s,o,t));return{x0:e,x1:s,y0:n,y1:o}}function Ai(i,t){var e=t.anchor,n=i,s,o;return t.clamp&&(n=iu(n,t.area)),e==="start"?(s=n.x0,o=n.y0):e==="end"?(s=n.x1,o=n.y1):(s=(n.x0+n.x1)/2,o=(n.y0+n.y1)/2),tu(s,o,i.vx,i.vy,t.align)}var Di={arc:function(i,t){var e=(i.startAngle+i.endAngle)/2,n=Math.cos(e),s=Math.sin(e),o=i.innerRadius,a=i.outerRadius;return Ai({x0:i.x+n*o,y0:i.y+s*o,x1:i.x+n*a,y1:i.y+s*a,vx:n,vy:s},t)},point:function(i,t){var e=An(i,t.origin),n=e.x*i.options.radius,s=e.y*i.options.radius;return Ai({x0:i.x-n,y0:i.y-s,x1:i.x+n,y1:i.y+s,vx:e.x,vy:e.y},t)},bar:function(i,t){var e=An(i,t.origin),n=i.x,s=i.y,o=0,a=0;return i.horizontal?(n=Math.min(i.x,i.base),o=Math.abs(i.base-i.x)):(s=Math.min(i.y,i.base),a=Math.abs(i.base-i.y)),Ai({x0:n,y0:s+a,x1:n+o,y1:s,vx:e.x,vy:e.y},t)},fallback:function(i,t){var e=An(i,t.origin);return Ai({x0:i.x,y0:i.y,x1:i.x+(i.width||0),y1:i.y+(i.height||0),vx:e.x,vy:e.y},t)}},Ct=Ie.rasterize;function nu(i){var t=i.borderWidth||0,e=i.padding,n=i.size.height,s=i.size.width,o=-s/2,a=-n/2;return{frame:{x:o-e.left-t,y:a-e.top-t,w:s+e.width+t*2,h:n+e.height+t*2},text:{x:o,y:a,w:s,h:n}}}function su(i,t){var e=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!e)return null;if(e.xCenter!==void 0&&e.yCenter!==void 0)return{x:e.xCenter,y:e.yCenter};var n=e.getBasePixel();return i.horizontal?{x:n,y:null}:{x:null,y:n}}function ou(i){return i instanceof Kt?Di.arc:i instanceof Tt?Di.point:i instanceof Zt?Di.bar:Di.fallback}function au(i,t,e,n,s,o){var a=Math.PI/2;if(o){var r=Math.min(o,s/2,n/2),l=t+r,c=e+r,h=t+n-r,d=e+s-r;i.moveTo(t,c),l<h&&c<d?(i.arc(l,c,r,-Math.PI,-a),i.arc(h,c,r,-a,0),i.arc(h,d,r,0,a),i.arc(l,d,r,a,Math.PI)):l<h?(i.moveTo(l,e),i.arc(h,c,r,-a,a),i.arc(l,c,r,a,Math.PI+a)):c<d?(i.arc(l,c,r,-Math.PI,0),i.arc(l,d,r,0,Math.PI)):i.arc(l,c,r,-Math.PI,Math.PI),i.closePath(),i.moveTo(t,e)}else i.rect(t,e,n,s)}function ru(i,t,e){var n=e.backgroundColor,s=e.borderColor,o=e.borderWidth;!n&&(!s||!o)||(i.beginPath(),au(i,Ct(t.x)+o/2,Ct(t.y)+o/2,Ct(t.w)-o,Ct(t.h)-o,e.borderRadius),i.closePath(),n&&(i.fillStyle=n,i.fill()),s&&o&&(i.strokeStyle=s,i.lineWidth=o,i.lineJoin="miter",i.stroke()))}function lu(i,t,e){var n=e.lineHeight,s=i.w,o=i.x,a=i.y+n/2;return t==="center"?o+=s/2:(t==="end"||t==="right")&&(o+=s),{h:n,w:s,x:o,y:a}}function cu(i,t,e){var n=i.shadowBlur,s=e.stroked,o=Ct(e.x),a=Ct(e.y),r=Ct(e.w);s&&i.strokeText(t,o,a,r),e.filled&&(n&&s&&(i.shadowBlur=0),i.fillText(t,o,a,r),n&&s&&(i.shadowBlur=n))}function hu(i,t,e,n){var s=n.textAlign,o=n.color,a=!!o,r=n.font,l=t.length,c=n.textStrokeColor,h=n.textStrokeWidth,d=c&&h,u;if(!(!l||!a&&!d))for(e=lu(e,s,r),i.font=r.string,i.textAlign=s,i.textBaseline="middle",i.shadowBlur=n.textShadowBlur,i.shadowColor=n.textShadowColor,a&&(i.fillStyle=o),d&&(i.lineJoin="round",i.lineWidth=h,i.strokeStyle=c),u=0,l=t.length;u<l;++u)cu(i,t[u],{stroked:d,filled:a,w:e.w,x:e.x,y:e.y+e.h*u})}var ca=function(i,t,e,n){var s=this;s._config=i,s._index=n,s._model=null,s._rects=null,s._ctx=t,s._el=e};dt(ca.prototype,{_modelize:function(i,t,e,n){var s=this,o=s._index,a=X(V([e.font,{}],n,o)),r=V([e.color,U.color],n,o);return{align:V([e.align,"center"],n,o),anchor:V([e.anchor,"center"],n,o),area:n.chart.chartArea,backgroundColor:V([e.backgroundColor,null],n,o),borderColor:V([e.borderColor,null],n,o),borderRadius:V([e.borderRadius,0],n,o),borderWidth:V([e.borderWidth,0],n,o),clamp:V([e.clamp,!1],n,o),clip:V([e.clip,!1],n,o),color:r,display:i,font:a,lines:t,offset:V([e.offset,4],n,o),opacity:V([e.opacity,1],n,o),origin:su(s._el,n),padding:K(V([e.padding,4],n,o)),positioner:ou(s._el),rotation:V([e.rotation,0],n,o)*(Math.PI/180),size:Ie.textSize(s._ctx,t,a),textAlign:V([e.textAlign,"start"],n,o),textShadowBlur:V([e.textShadowBlur,0],n,o),textShadowColor:V([e.textShadowColor,r],n,o),textStrokeColor:V([e.textStrokeColor,r],n,o),textStrokeWidth:V([e.textStrokeWidth,0],n,o)}},update:function(i){var t=this,e=null,n=null,s=t._index,o=t._config,a,r,l,c=V([o.display,!0],i,s);c&&(a=i.dataset.data[s],r=T(E(o.formatter,[a,i]),a),l=I(r)?[]:Ie.toTextLines(r),l.length&&(e=t._modelize(c,l,o,i),n=nu(e))),t._model=e,t._rects=n},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(i,t){var e=this,n=i.ctx,s=e._model,o=e._rects,a;this.visible()&&(n.save(),s.clip&&(a=s.area,n.beginPath(),n.rect(a.left,a.top,a.right-a.left,a.bottom-a.top),n.clip()),n.globalAlpha=Ie.bound(0,s.opacity,1),n.translate(Ct(t.x),Ct(t.y)),n.rotate(s.rotation),ru(n,o.frame,s),hu(n,s.lines,o.text,s),n.restore())}});var du=Number.MIN_SAFE_INTEGER||-9007199254740991,uu=Number.MAX_SAFE_INTEGER||9007199254740991;function Fe(i,t,e){var n=Math.cos(e),s=Math.sin(e),o=t.x,a=t.y;return{x:o+n*(i.x-o)-s*(i.y-a),y:a+s*(i.x-o)+n*(i.y-a)}}function ha(i,t){var e=uu,n=du,s=t.origin,o,a,r,l,c;for(o=0;o<i.length;++o)a=i[o],r=a.x-s.x,l=a.y-s.y,c=t.vx*r+t.vy*l,e=Math.min(e,c),n=Math.max(n,c);return{min:e,max:n}}function Li(i,t){var e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);return{vx:(t.x-i.x)/s,vy:(t.y-i.y)/s,origin:i,ln:s}}var da=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};dt(da.prototype,{center:function(){var i=this._rect;return{x:i.x+i.w/2,y:i.y+i.h/2}},update:function(i,t,e){this._rotation=e,this._rect={x:t.x+i.x,y:t.y+i.y,w:t.w,h:t.h}},contains:function(i){var t=this,e=1,n=t._rect;return i=Fe(i,t.center(),-t._rotation),!(i.x<n.x-e||i.y<n.y-e||i.x>n.x+n.w+e*2||i.y>n.y+n.h+e*2)},intersects:function(i){var t=this._points(),e=i._points(),n=[Li(t[0],t[1]),Li(t[0],t[3])],s,o,a;for(this._rotation!==i._rotation&&n.push(Li(e[0],e[1]),Li(e[0],e[3])),s=0;s<n.length;++s)if(o=ha(t,n[s]),a=ha(e,n[s]),o.max<a.min||a.max<o.min)return!1;return!0},_points:function(){var i=this,t=i._rect,e=i._rotation,n=i.center();return[Fe({x:t.x,y:t.y},n,e),Fe({x:t.x+t.w,y:t.y},n,e),Fe({x:t.x+t.w,y:t.y+t.h},n,e),Fe({x:t.x,y:t.y+t.h},n,e)]}});function ua(i,t,e){var n=t.positioner(i,t),s=n.vx,o=n.vy;if(!s&&!o)return{x:n.x,y:n.y};var a=e.w,r=e.h,l=t.rotation,c=Math.abs(a/2*Math.cos(l))+Math.abs(r/2*Math.sin(l)),h=Math.abs(a/2*Math.sin(l))+Math.abs(r/2*Math.cos(l)),d=1/Math.max(Math.abs(s),Math.abs(o));return c*=s*d,h*=o*d,c+=t.offset*s,h+=t.offset*o,{x:n.x+c,y:n.y+h}}function fu(i,t){var e,n,s,o;for(e=i.length-1;e>=0;--e)for(s=i[e].$layout,n=e-1;n>=0&&s._visible;--n)o=i[n].$layout,o._visible&&s._box.intersects(o._box)&&t(s,o);return i}function gu(i){var t,e,n,s,o,a,r;for(t=0,e=i.length;t<e;++t)n=i[t],s=n.$layout,s._visible&&(r=new Proxy(n._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=n.geometry(),a=ua(r,n.model(),o),s._box.update(a,o,n.rotation()));return fu(i,function(l,c){var h=l._hidable,d=c._hidable;h&&d||d?c._visible=!1:h&&(l._visible=!1)})}var Re={prepare:function(i){var t=[],e,n,s,o,a;for(e=0,s=i.length;e<s;++e)for(n=0,o=i[e].length;n<o;++n)a=i[e][n],t.push(a),a.$layout={_box:new da,_hidable:!1,_visible:!0,_set:e,_idx:a._index};return t.sort(function(r,l){var c=r.$layout,h=l.$layout;return c._idx===h._idx?h._set-c._set:h._idx-c._idx}),this.update(t),t},update:function(i){var t=!1,e,n,s,o,a;for(e=0,n=i.length;e<n;++e)s=i[e],o=s.model(),a=s.$layout,a._hidable=o&&o.display==="auto",a._visible=s.visible(),t|=a._hidable;t&&gu(i)},lookup:function(i,t){var e,n;for(e=i.length-1;e>=0;--e)if(n=i[e].$layout,n&&n._visible&&n._box.contains(t))return i[e];return null},draw:function(i,t){var e,n,s,o,a,r;for(e=0,n=t.length;e<n;++e)s=t[e],o=s.$layout,o._visible&&(a=s.geometry(),r=ua(s._el,s.model(),a),o._box.update(r,a,s.rotation()),s.draw(i,r))}},pu=function(i){if(I(i))return null;var t=i,e,n,s;if(O(i))if(!I(i.label))t=i.label;else if(!I(i.r))t=i.r;else for(t="",e=Object.keys(i),s=0,n=e.length;s<n;++s)t+=(s!==0?", ":"")+e[s]+": "+i[e[s]];return""+t},mu={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:pu,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},nt="$datalabels",fa="$default";function bu(i,t){var e=i.datalabels,n={},s=[],o,a;return e===!1?null:(e===!0&&(e={}),t=dt({},[t,e]),o=t.labels||{},a=Object.keys(o),delete t.labels,a.length?a.forEach(function(r){o[r]&&s.push(dt({},[t,o[r],{_key:r}]))}):s.push(t),n=s.reduce(function(r,l){return R(l.listeners||{},function(c,h){r[h]=r[h]||{},r[h][l._key||fa]=c}),delete l.listeners,r},{}),{labels:s,listeners:n})}function Dn(i,t,e,n){if(t){var s=e.$context,o=e.$groups,a;t[o._set]&&(a=t[o._set][o._key],a&&E(a,[s,n])===!0&&(i[nt]._dirty=!0,e.update(s)))}}function yu(i,t,e,n,s){var o,a;!e&&!n||(e?n?e!==n&&(a=o=!0):a=!0:o=!0,a&&Dn(i,t.leave,e,s),o&&Dn(i,t.enter,n,s))}function xu(i,t){var e=i[nt],n=e._listeners,s,o;if(!(!n.enter&&!n.leave)){if(t.type==="mousemove")o=Re.lookup(e._labels,t);else if(t.type!=="mouseout")return;s=e._hovered,e._hovered=o,yu(i,n,s,o,t)}}function _u(i,t){var e=i[nt],n=e._listeners.click,s=n&&Re.lookup(e._labels,t);s&&Dn(i,n,s,t)}var vu={id:"datalabels",defaults:mu,beforeInit:function(i){i[nt]={_actives:[]}},beforeUpdate:function(i){var t=i[nt];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(i,t,e){var n=t.index,s=i[nt],o=s._datasets[n]=[],a=i.isDatasetVisible(n),r=i.data.datasets[n],l=bu(r,e),c=t.meta.data||[],h=i.ctx,d,u,f,b,p,m,g,y;for(h.save(),d=0,f=c.length;d<f;++d)if(g=c[d],g[nt]=[],a&&g&&i.getDataVisibility(d)&&!g.skip)for(u=0,b=l.labels.length;u<b;++u)p=l.labels[u],m=p._key,y=new ca(p,h,g,d),y.$groups={_set:n,_key:m||fa},y.$context={active:!1,chart:i,dataIndex:d,dataset:r,datasetIndex:n},y.update(y.$context),g[nt].push(y),o.push(y);h.restore(),dt(s._listeners,l.listeners,{merger:function(_,S,v){S[_]=S[_]||{},S[_][t.index]=v[_],s._listened=!0}})},afterUpdate:function(i){i[nt]._labels=Re.prepare(i[nt]._datasets)},afterDatasetsDraw:function(i){Re.draw(i,i[nt]._labels)},beforeEvent:function(i,t){if(i[nt]._listened){var e=t.event;switch(e.type){case"mousemove":case"mouseout":xu(i,e);break;case"click":_u(i,e);break}}},afterEvent:function(i){var t=i[nt],e=t._actives,n=t._actives=i.getActiveElements(),s=Ie.arrayDiff(e,n),o,a,r,l,c,h,d;for(o=0,a=s.length;o<a;++o)if(c=s[o],c[1])for(d=c[0].element[nt]||[],r=0,l=d.length;r<l;++r)h=d[r],h.$context.active=c[1]===1,h.update(h.$context);(t._dirty||s.length)&&(Re.update(t._labels),i.render()),delete t._dirty}};const ga="background: white; border-bottom: 1px solid #CCCCCC; border-radius: 5px; padding: 10px 20px";class Su extends se{constructor(){super(...arguments);k(this,"fontProperties","font-family: Arial; font-size: 16px")}createBubbleTooltip(e,n,s){if(!s||s==="")return;let o=document.querySelector("#chartjs-tooltip");o||(o=this.createNewTooltipElement());const a=e.tooltip;if(a.opacity===0){o.style.opacity="0";return}if(a.body){this.titleLines=a.title||[];const l=a.body.map(this.getBody)[0];this.addBubbleLegendToDom(n,l,o,s)}this.handleTooltipPosition(e,a,o)}addBubbleLegendToDom(e,n,s,o){n[0].split(":")[0];const a=`<span style="${this.fontProperties}">${o}</span>`;let r=`<div style="${ga}; font-weight: bold" class="tooltipTitle">${a}</div>`;const l=this.getBubbleInnerHtml(e);r+=l;const c=s==null?void 0:s.querySelector(".tooltipCtn");c.innerHTML=r}getBubbleInnerHtml(e){let n="";return e.forEach(s=>{n+=`<div style="${this.fontProperties}; ${ga}; display:flex; justify-content: space-between;">`,n+=`<div>${s.label}</div>`,n+=`<div>${s.value}${s.unit}</div>`,n+="</div>"}),`<div>${n}</div>`}}const wu={class:"container"},ku={class:"main"},Cu={class:"chart-legend"},Mu=["alt"],Pu={class:"size-legend-label"},Au=x.defineComponent({__name:"BubbleChart",props:{chartId:{type:String,default:"bubble-chart"},labels:{type:Array,default:()=>[]},colourSet:{type:Number,default:0},colours:{type:Array,default:()=>[]},shapes:{type:Array,default:()=>[]},datasets:{type:Array,default:()=>[]},width:{type:String,default:"400px"},height:{type:String,default:"300px"},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},bubbleMin:{type:Number,default:10},bubbleMax:{type:Number,default:40},plugins:{type:Array,default:()=>[]},displayBubbleLabel:{type:Boolean,default:!1},xAxis:{type:Object,default:null,required:!0},yAxis:{type:Object,default:null,required:!0},rAxis:{type:Object,default:null,required:!0},displayAxisLabels:{type:Boolean,default:!0}},setup(i){const t=i;wt.register(Qt,te,Jt,Tt,ee,ie,vu);const{colourSets:e}=ae(),n=function(a){const r=[];a.forEach(u=>{u.forEach(f=>{r.push(f.r)})});const l=Math.max(...r),c=Math.min(...r),h=t.bubbleMax,d=t.bubbleMin;return a.map(u=>l===c?u.map(f=>({x:f.x,y:f.y,r:d+(h-d)/2})):u.map(f=>({x:f.x,y:f.y,r:d+(f.r-c)*(h-d)/(l-c)})))},s=x.computed(()=>{const a=e[t.colourSet];return{datasets:n(t.datasets).map((r,l)=>({data:r,pointStyle:t.shapes[l],backgroundColor:Oe(a[t.colours[l]],.2),borderColor:a[t.colours[l]],label:t.labels[l]}))}}),o=x.computed(()=>({responsive:!1,scales:{x:{offset:!0,title:{display:t.displayAxisLabels,text:t.xAxis.title}},y:{offset:!0,title:{display:t.displayAxisLabels,text:t.yAxis.title}}},plugins:{responsive:!0,maintainAspectRatio:!1,legend:{display:!1},title:{display:!1},datalabels:{display:t.displayBubbleLabel,anchor:"end",align:"end",color:"black",formatter:function(a,r){return r.dataset.label},padding:0},tooltip:{enabled:!1,position:"nearest",external:function(a){var h,d,u,f,b,p;const r=((d=(h=a.tooltip)==null?void 0:h.dataPoints)==null?void 0:d[0].datasetIndex)||0,l=((u=a.tooltip.dataPoints)==null?void 0:u[0].dataIndex)||0,c=t.datasets[r][l];new Su().createBubbleTooltip(a,[{label:t.xAxis.title,value:`${Q(c.x)}`,unit:(f=t.xAxis)==null?void 0:f.unit},{label:t.yAxis.title,value:`${Q(c.y)}`,unit:(b=t.yAxis)==null?void 0:b.unit},{label:t.rAxis.title,value:`${Q(c.r)}`,unit:(p=t.rAxis)==null?void 0:p.unit}],t.labels[r])}}}}));return(a,r)=>(x.openBlock(),x.createElementBlock("div",wu,[x.createElementVNode("div",ku,[s.value?(x.openBlock(),x.createBlock(x.unref(ud),{key:0,ref:"bubbleChartRef",id:i.chartId,data:s.value,options:o.value,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",Cu,[x.createElementVNode("img",{src:Qd,alt:i.rAxis.title,class:"bubble-icon mu-mr-025"},null,8,Mu),x.createElementVNode("div",Pu,x.toDisplayString(i.rAxis.title),1)])]))}}),Wu="",Hu="",Ln=re(Au,[["__scopeId","data-v-8359da14"]]);Ln.install=i=>{i.component("BubbleChart",Ln)};const Du={install:(i,t)=>{Object.keys(ia).forEach(e=>{i.component(e,ia[e])})}};G.BarChart=wi,G.BubbleChart=Ln,G.DoughnutChart=ki,G.LineChart=Ci,G.MixedBarLineChart=Pn,G.RadarChart=Mi,G.default=Du,Object.defineProperties(G,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|