@oliasoft-open-source/charts-library 5.7.1 → 5.7.2
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/assets/Color-6BZIO3FS-BaAvX6Yp.js +1 -0
- package/dist/assets/DocsRenderer-LL677BLK-BK5C7Jzn.js +41 -0
- package/dist/assets/WithTooltip-65CFNBJE-BQ4nRetu.js +9 -0
- package/dist/assets/bar-chart.stories-D5i9vPgt.js +138 -0
- package/dist/assets/chunk-242VQQM5-DegdISsM.js +1 -0
- package/dist/assets/chunk-CYSK6WYR-BpIZnq_i.js +1 -0
- package/dist/assets/chunk-YKABRMAI-ChBkp0ra.js +18 -0
- package/dist/assets/components-DgLnPVTi.js +92 -0
- package/dist/assets/formatter-EIJCOSYU-By9veOc8.js +1 -0
- package/dist/assets/get-draggableData-C4qYyiBf.js +2 -0
- package/dist/assets/iframe-DvGneWFZ.js +1228 -0
- package/dist/assets/jsx-runtime-S4TgXXQD.js +1 -0
- package/dist/assets/{legend-Cr-ixvvn.js → legend-DnGwExsY.js} +15 -15
- package/dist/assets/{legend-context-bgD9JX7p.js → legend-context-DrT75Hl_.js} +2 -2
- package/dist/assets/line-chart-Ds2L0-Ky.js +1 -0
- package/dist/assets/line-chart.stories-8UAM62iU.js +1207 -0
- package/dist/assets/{line-chart.test-case.stories-DFLUWQxt.js → line-chart.test-case.stories-BPzBXXrt.js} +1 -1
- package/dist/assets/pie-chart.stories-qKjdYhwq.js +45 -0
- package/dist/assets/react-18-CaPDGmKz.js +1 -0
- package/dist/assets/{react-RY0obRf3.js → react-B3R5p1NM.js} +1 -1
- package/dist/assets/react-dom-DuTm0_Xz.js +8 -0
- package/dist/assets/scatter-chart.stories-CzYwqOiR.js +41 -0
- package/dist/assets/syntaxhighlighter-ED5Y7EFY-BHci-LOP.js +6 -0
- package/dist/assets/{theming-DgjcY9r7.js → theming-Y5Cbkxro.js} +1 -1
- package/dist/iframe.html +2 -5
- package/dist/project.json +1 -1
- package/dist/vite-inject-mocker-entry.js +1 -1
- package/package.json +1 -1
- package/dist/assets/Color-6BZIO3FS-s0pybgGT.js +0 -1
- package/dist/assets/DocsRenderer-LL677BLK-IiQab3mR.js +0 -2
- package/dist/assets/WithTooltip-65CFNBJE-CLKwlfWd.js +0 -9
- package/dist/assets/bar-chart.stories-Sq6kGcCe.js +0 -138
- package/dist/assets/components-BJbtgP_z.js +0 -250
- package/dist/assets/formatter-EIJCOSYU-C_ABwEuZ.js +0 -1
- package/dist/assets/get-draggableData-CHqgKQpf.js +0 -2
- package/dist/assets/iframe-BDie4XE6.js +0 -1133
- package/dist/assets/line-chart-Cc_EvRxN.js +0 -1
- package/dist/assets/line-chart.stories-DVnjeEYv.js +0 -1207
- package/dist/assets/pie-chart.stories-BZ8-Flt7.js +0 -45
- package/dist/assets/react-18-BP1-1NuC.js +0 -1
- package/dist/assets/scatter-chart.stories--7xp7w4K.js +0 -41
- package/dist/assets/syntaxhighlighter-ED5Y7EFY-Y-Tk5YPV.js +0 -6
- /package/dist/assets/{bar-chart-const-BdWUR8Vo.js → bar-chart-const-Dmo8UTJN.js} +0 -0
- /package/dist/assets/{get-custom-legend-plugin-example-BMz6NyH9.js → get-custom-legend-plugin-example-Decjgf1l.js} +0 -0
- /package/dist/assets/{preload-helper-MHdlos90.js → preload-helper-Bhb7V-Yo.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{T as e,b as t,l as n,m as r}from"./iframe-BDie4XE6.js";function i(e){return e+.5|0}var a=(e,t,n)=>Math.max(Math.min(e,n),t);function o(e){return a(i(e*2.55),0,255)}function s(e){return a(i(e*255),0,255)}function c(e){return a(i(e/2.55)/100,0,1)}function l(e){return a(i(e*100),0,100)}var u={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},d=[...`0123456789ABCDEF`],f=e=>d[e&15],p=e=>d[(e&240)>>4]+d[e&15],m=e=>(e&240)>>4==(e&15),h=e=>m(e.r)&&m(e.g)&&m(e.b)&&m(e.a);function g(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&u[e[1]]*17,g:255&u[e[2]]*17,b:255&u[e[3]]*17,a:t===5?u[e[4]]*17:255}:(t===7||t===9)&&(n={r:u[e[1]]<<4|u[e[2]],g:u[e[3]]<<4|u[e[4]],b:u[e[5]]<<4|u[e[6]],a:t===9?u[e[7]]<<4|u[e[8]]:255})),n}var _=(e,t)=>e<255?t(e):``;function v(e){var t=h(e)?f:p;return e?`#`+t(e.r)+t(e.g)+t(e.b)+_(e.a,t):void 0}var y=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function b(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function x(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function S(e,t,n){let r=b(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function C(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function w(e){let t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c,l;return i!==a&&(l=i-a,c=o>.5?l/(2-i-a):l/(i+a),s=C(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function T(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(s)}function E(e,t,n){return T(b,e,t,n)}function D(e,t,n){return T(S,e,t,n)}function ee(e,t,n){return T(x,e,t,n)}function te(e){return(e%360+360)%360}function ne(e){let t=y.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?o(+t[5]):s(+t[5]));let i=te(+t[2]),a=t[3]/100,c=t[4]/100;return r=t[1]===`hwb`?D(i,a,c):t[1]===`hsv`?ee(i,a,c):E(i,a,c),{r:r[0],g:r[1],b:r[2],a:n}}function re(e,t){var n=w(e);n[0]=te(n[0]+t),n=E(n),e.r=n[0],e.g=n[1],e.b=n[2]}function ie(e){if(!e)return;let t=w(e),n=t[0],r=l(t[1]),i=l(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${c(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var ae={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`},oe={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 se(){let e={},t=Object.keys(oe),n=Object.keys(ae),r,i,a,o,s;for(r=0;r<t.length;r++){for(o=s=t[r],i=0;i<n.length;i++)a=n[i],s=s.replace(a,ae[a]);a=parseInt(oe[o],16),e[s]=[a>>16&255,a>>8&255,a&255]}return e}var ce;function le(e){ce||(ce=se(),ce.transparent=[0,0,0,0]);let t=ce[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var ue=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function de(e){let t=ue.exec(e),n=255,r,i,s;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?o(e):a(e*255,0,255)}return r=+t[1],i=+t[3],s=+t[5],r=255&(t[2]?o(r):a(r,0,255)),i=255&(t[4]?o(i):a(i,0,255)),s=255&(t[6]?o(s):a(s,0,255)),{r,g:i,b:s,a:n}}}function fe(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${c(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var pe=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,me=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function he(e,t,n){let r=me(c(e.r)),i=me(c(e.g)),a=me(c(e.b));return{r:s(pe(r+n*(me(c(t.r))-r))),g:s(pe(i+n*(me(c(t.g))-i))),b:s(pe(a+n*(me(c(t.b))-a))),a:e.a+n*(t.a-e.a)}}function ge(e,t,n){if(e){let r=w(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=E(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function O(e,t){return e&&Object.assign(t||{},e)}function _e(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=s(e[3]))):(t=O(e,{r:0,g:0,b:0,a:1}),t.a=s(t.a)),t}function ve(e){return e.charAt(0)===`r`?de(e):ne(e)}var ye=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=_e(t):n===`string`&&(r=g(t)||le(t)||ve(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=O(this._rgb);return e&&(e.a=c(e.a)),e}set rgb(e){this._rgb=_e(e)}rgbString(){return this._valid?fe(this._rgb):void 0}hexString(){return this._valid?v(this._rgb):void 0}hslString(){return this._valid?ie(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=he(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=s(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=i(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return ge(this._rgb,2,e),this}darken(e){return ge(this._rgb,2,-e),this}saturate(e){return ge(this._rgb,1,e),this}desaturate(e){return ge(this._rgb,1,-e),this}rotate(e){return re(this._rgb,e),this}};function be(){}var xe=(()=>{let e=0;return()=>e++})();function k(e){return e==null}function A(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function j(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function M(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function Se(e,t){return M(e)?e:t}function N(e,t){return e===void 0?t:e}var Ce=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,we=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function P(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function F(e,t,n,r){let i,a,o;if(A(e))if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<a;i++)t.call(n,e[i],i);else if(j(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function Te(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function Ee(e){if(A(e))return e.map(Ee);if(j(e)){let t=Object.create(null),n=Object.keys(e),r=n.length,i=0;for(;i<r;++i)t[n[i]]=Ee(e[n[i]]);return t}return e}function De(e){return[`__proto__`,`prototype`,`constructor`].indexOf(e)===-1}function Oe(e,t,n,r){if(!De(e))return;let i=t[e],a=n[e];j(i)&&j(a)?ke(i,a,r):t[e]=Ee(a)}function ke(e,t,n){let r=A(t)?t:[t],i=r.length;if(!j(e))return e;n||={};let a=n.merger||Oe,o;for(let t=0;t<i;++t){if(o=r[t],!j(o))continue;let i=Object.keys(o);for(let t=0,r=i.length;t<r;++t)a(i[t],e,o,n)}return e}function Ae(e,t){return ke(e,t,{merger:je})}function je(e,t,n){if(!De(e))return;let r=t[e],i=n[e];j(r)&&j(i)?Ae(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ee(i))}var Me={"":e=>e,x:e=>e.x,y:e=>e.y};function Ne(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function Pe(e){let t=Ne(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Fe(e,t){return(Me[t]||(Me[t]=Pe(t)))(e)}function Ie(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Le=e=>e!==void 0,Re=e=>typeof e==`function`,ze=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Be(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var I=Math.PI,L=2*I,Ve=L+I,He=1/0,Ue=I/180,R=I/2,We=I/4,Ge=I*2/3,Ke=Math.log10,qe=Math.sign;function Je(e,t,n){return Math.abs(e-t)<n}function Ye(e){let t=Math.round(e);e=Je(e,t,e/1e3)?t:e;let n=10**Math.floor(Ke(e)),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Xe(e){let t=[],n=Math.sqrt(e),r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((e,t)=>e-t).pop(),t}function Ze(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function Qe(e){return!Ze(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function $e(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function et(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function tt(e){return I/180*e}function nt(e){return 180/I*e}function rt(e){if(!M(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function it(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a<-.5*I&&(a+=L),{angle:a,distance:i}}function at(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function ot(e,t){return(e-t+Ve)%L-I}function z(e){return(e%L+L)%L}function st(e,t,n,r){let i=z(e),a=z(t),o=z(n),s=z(a-i),c=z(o-i),l=z(i-a),u=z(i-o);return i===a||i===o||r&&a===o||s>c&&l<u}function B(e,t,n){return Math.max(t,Math.min(n,e))}function ct(e){return B(e,-32768,32767)}function lt(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ut(e,t,n){n||=(n=>e[n]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var dt=(e,t,n,r)=>ut(e,n,r?r=>{let i=e[r][t];return i<n||i===n&&e[r+1][t]===n}:r=>e[r][t]<n),ft=(e,t,n)=>ut(e,n,r=>e[r][t]>=n);function pt(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}var mt=[`push`,`pop`,`shift`,`splice`,`unshift`];function ht(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,`_chartjs`,{configurable:!0,enumerable:!1,value:{listeners:[t]}}),mt.forEach(t=>{let n=`_onData`+Ie(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function gt(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(mt.forEach(t=>{delete e[t]}),delete e._chartjs)}function _t(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var vt=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function yt(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,vt.call(window,()=>{r=!1,e.apply(t,n)}))}}function bt(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var xt=e=>e===`start`?`left`:e===`end`?`right`:`center`,V=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,St=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function Ct(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(dt(c,u,d).lo,n?r:dt(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!k(e[s.axis]));i-=Math.max(0,e)}i=B(i,0,r-1)}if(m){let e=Math.max(dt(c,o.axis,f,!0).hi+1,n?0:dt(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!k(e[s.axis]));e+=Math.max(0,t)}a=B(e,i,r)-i}else a=r-i}return{start:i,count:a}}function wt(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var Tt=e=>e===0||e===1,Et=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*L/n)),Dt=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*L/n)+1,Ot={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*R)+1,easeOutSine:e=>Math.sin(e*R),easeInOutSine:e=>-.5*(Math.cos(I*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>Tt(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Tt(e)?e:Et(e,.075,.3),easeOutElastic:e=>Tt(e)?e:Dt(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return Tt(e)?e:e<.5?.5*Et(e*2,t,n):.5+.5*Dt(e*2-1,t,n)},easeInBack(e){let t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){let t=1.70158;return--e*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Ot.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?Ot.easeInBounce(e*2)*.5:Ot.easeOutBounce(e*2-1)*.5+.5};function kt(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function At(e){return kt(e)?e:new ye(e)}function jt(e){return kt(e)?e:new ye(e).saturate(.5).darken(.1).hexString()}var Mt=[`x`,`y`,`borderWidth`,`radius`,`tension`],Nt=[`color`,`borderColor`,`backgroundColor`];function Pt(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:Nt},numbers:{type:`number`,properties:Mt}}),e.describe(`animations`,{_fallback:`animation`}),e.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:e=>e|0}}}})}function Ft(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var It=new Map;function Lt(e,t){t||={};let n=e+JSON.stringify(t),r=It.get(n);return r||(r=new Intl.NumberFormat(e,t),It.set(n,r)),r}function Rt(e,t,n){return Lt(t,n).format(e)}var zt={values(e){return A(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Bt(e,n)}let o=Ke(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Rt(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Ke(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?zt.numeric.call(this,e,t,n):``}};function Bt(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Vt={formatters:zt};function Ht(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Vt.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var Ut=Object.create(null),Wt=Object.create(null);function Gt(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;t<r;++t){let r=n[t];e=e[r]||(e[r]=Object.create(null))}return e}function Kt(e,t,n){return typeof t==`string`?ke(Gt(e,t),n):ke(Gt(e,``),t)}var H=new class{constructor(e,t){this.animation=void 0,this.backgroundColor=`rgba(0,0,0,0.1)`,this.borderColor=`rgba(0,0,0,0.1)`,this.color=`#666`,this.datasets={},this.devicePixelRatio=e=>e.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=(e,t)=>jt(t.backgroundColor),this.hoverBorderColor=(e,t)=>jt(t.borderColor),this.hoverColor=(e,t)=>jt(t.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(e),this.apply(t)}set(e,t){return Kt(this,e,t)}get(e){return Gt(this,e)}describe(e,t){return Kt(Wt,e,t)}override(e,t){return Kt(Ut,e,t)}route(e,t,n,r){let i=Gt(this,e),a=Gt(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return j(e)?Object.assign({},t,e):N(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Pt,Ft,Ht]);function qt(e){return!e||k(e.size)||k(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Jt(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Yt(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;c<s;c++)if(d=n[c],d!=null&&!A(d))o=Jt(e,i,a,o,d);else if(A(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!A(f)&&(o=Jt(e,i,a,o,f));e.restore();let p=a.length/2;if(p>n.length){for(c=0;c<p;c++)delete i[a[c]];a.splice(0,p)}return o}function Xt(e,t,n){let r=e.currentDevicePixelRatio,i=n===0?0:Math.max(n/2,.5);return Math.round((t-i)*r)/r+i}function Zt(e,t){!t&&!e||(t||=e.getContext(`2d`),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Qt(e,t,n,r){$t(e,t,n,r,null)}function $t(e,t,n,r,i){let a,o,s,c,l,u,d,f,p=t.pointStyle,m=t.rotation,h=t.radius,g=(m||0)*Ue;if(p&&typeof p==`object`&&(a=p.toString(),a===`[object HTMLImageElement]`||a===`[object HTMLCanvasElement]`)){e.save(),e.translate(n,r),e.rotate(g),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(h)||h<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,h,0,0,L):e.arc(n,r,h,0,L),e.closePath();break;case`triangle`:u=i?i/2:h,e.moveTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Ge,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Ge,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),e.closePath();break;case`rectRounded`:l=h*.516,c=h-l,o=Math.cos(g+We)*c,d=Math.cos(g+We)*(i?i/2-l:c),s=Math.sin(g+We)*c,f=Math.sin(g+We)*(i?i/2-l:c),e.arc(n-d,r-s,l,g-I,g-R),e.arc(n+f,r-o,l,g-R,g),e.arc(n+d,r+s,l,g,g+R),e.arc(n-f,r+o,l,g+R,g+I),e.closePath();break;case`rect`:if(!m){c=Math.SQRT1_2*h,u=i?i/2:c,e.rect(n-u,r-c,2*u,2*c);break}g+=We;case`rectRot`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+f,r-o),e.lineTo(n+d,r+s),e.lineTo(n-f,r+o),e.closePath();break;case`crossRot`:g+=We;case`cross`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`star`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),g+=We,d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`line`:o=i?i/2:Math.cos(g)*h,s=Math.sin(g)*h,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case`dash`:e.moveTo(n,r),e.lineTo(n+Math.cos(g)*(i?i/2:h),r+Math.sin(g)*h);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function en(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function tn(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function nn(e){e.restore()}function rn(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i===`middle`){let r=(t.x+n.x)/2;e.lineTo(r,t.y),e.lineTo(r,n.y)}else i===`after`==!!r?e.lineTo(n.x,t.y):e.lineTo(t.x,n.y);e.lineTo(n.x,n.y)}function an(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function on(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),k(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function sn(e,t,n,r,i){if(i.strikethrough||i.underline){let a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,c=n-a.actualBoundingBoxAscent,l=n+a.actualBoundingBoxDescent,u=i.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(s,u),e.stroke()}}function cn(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function ln(e,t,n,r,i,a={}){let o=A(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,on(e,a),c=0;c<o.length;++c)l=o[c],a.backdrop&&cn(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),k(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(l,n,r,a.maxWidth)),e.fillText(l,n,r,a.maxWidth),sn(e,n,r,l,a),r+=Number(i.lineHeight);e.restore()}function un(e,t){let{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*I,I,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,I,R,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,R,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-R,!0),e.lineTo(n+o.topLeft,r)}var dn=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,fn=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function pn(e,t){let n=(``+e).match(dn);if(!n||n[1]===`normal`)return t*1.2;switch(e=+n[2],n[3]){case`px`:return e;case`%`:e/=100;break}return t*e}var mn=e=>+e||0;function hn(e,t){let n={},r=j(t),i=r?Object.keys(t):t,a=j(e)?r?n=>N(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=mn(a(e));return n}function gn(e){return hn(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function _n(e){return hn(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function U(e){let t=gn(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function W(e,t){e||={},t||=H.font;let n=N(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=N(e.style,t.style);r&&!(``+r).match(fn)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:N(e.family,t.family),lineHeight:pn(N(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:N(e.weight,t.weight),string:``};return i.string=qt(i),i}function G(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;a<o;++a)if(s=e[a],s!==void 0&&(t!==void 0&&typeof s==`function`&&(s=s(t),i=!1),n!==void 0&&A(s)&&(s=s[n%s.length],i=!1),s!==void 0))return r&&!i&&(r.cacheable=!1),s}function vn(e,t,n){let{min:r,max:i}=e,a=we(t,(i-r)/2),o=(e,t)=>n&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function yn(e,t){return Object.assign(Object.create(e),t)}function bn(e,t=[``],n,r,i=()=>e[0]){let a=n||e;r===void 0&&(r=In(`_fallback`,e));let o={[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>bn([n,...e],t,a,r)};return new Proxy(o,{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return Tn(n,r,()=>Fn(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Ln(e).includes(t)},ownKeys(e){return Ln(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function xn(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Sn(e,r),setContext:t=>xn(e,t,n,r),override:i=>xn(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return Tn(e,t,()=>En(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function Sn(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Re(n)?n:()=>n,isIndexable:Re(r)?r:()=>r}}var Cn=(e,t)=>e?e+Ie(t):t,wn=(e,t)=>j(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Tn(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function En(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Re(s)&&o.isScriptable(t)&&(s=Dn(t,s,e,n)),A(s)&&s.length&&(s=On(t,s,e,o.isIndexable)),wn(t,s)&&(s=xn(s,i,a&&a[t],o)),s}function Dn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),wn(e,c)&&(c=Mn(i._scopes,i,e,c)),c}function On(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(j(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Mn(r,i,e,c);t.push(xn(n,a,o&&o[e],s))}}return t}function kn(e,t,n){return Re(e)?e(t,n):e}var An=(e,t)=>e===!0?t:typeof e==`string`?Fe(t,e):void 0;function jn(e,t,n,r,i){for(let a of t){let t=An(n,a);if(t){e.add(t);let a=kn(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Mn(e,t,n,r){let i=t._rootScopes,a=kn(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Nn(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Nn(s,o,a,c,r),c===null)?!1:bn(Array.from(s),[``],i,a,()=>Pn(t,n,r))}function Nn(e,t,n,r,i){for(;n;)n=jn(e,t,n,r,i);return n}function Pn(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return A(i)&&j(n)?n:i||{}}function Fn(e,t,n,r){let i;for(let a of t)if(i=In(Cn(a,e),n),i!==void 0)return wn(e,i)?Mn(n,r,e,i):i}function In(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Ln(e){let t=e._keys;return t||=e._keys=Rn(e._scopes),t}function Rn(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}var zn=2**-52||1e-14,Bn=(e,t)=>t<e.length&&!e[t].skip&&e[t],Vn=e=>e===`x`?`y`:`x`;function Hn(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=at(a,i),c=at(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Un(e,t,n){let r=e.length,i,a,o,s,c,l=Bn(e,0);for(let u=0;u<r-1;++u)if(c=l,l=Bn(e,u+1),!(!c||!l)){if(Je(t[u],0,zn)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],a=n[u+1]/t[u],s=i**2+a**2,!(s<=9)&&(o=3/Math.sqrt(s),n[u]=i*o*t[u],n[u+1]=a*o*t[u])}}function Wn(e,t,n=`x`){let r=Vn(n),i=e.length,a,o,s,c=Bn(e,0);for(let l=0;l<i;++l){if(o=s,s=c,c=Bn(e,l+1),!s)continue;let i=s[n],u=s[r];o&&(a=(i-o[n])/3,s[`cp1${n}`]=i-a,s[`cp1${r}`]=u-a*t[l]),c&&(a=(c[n]-i)/3,s[`cp2${n}`]=i+a,s[`cp2${r}`]=u+a*t[l])}}function Gn(e,t=`x`){let n=Vn(t),r=e.length,i=Array(r).fill(0),a=Array(r),o,s,c,l=Bn(e,0);for(o=0;o<r;++o)if(s=c,c=l,l=Bn(e,o+1),c){if(l){let e=l[t]-c[t];i[o]=e===0?0:(l[n]-c[n])/e}a[o]=s?l?qe(i[o-1])===qe(i[o])?(i[o-1]+i[o])/2:0:i[o-1]:i[o]}Un(e,i,a),Wn(e,a,t)}function Kn(e,t,n){return Math.max(Math.min(e,n),t)}function qn(e,t){let n,r,i,a,o,s=en(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&en(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=Kn(i.cp1x,t.left,t.right),i.cp1y=Kn(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=Kn(i.cp2x,t.left,t.right),i.cp2y=Kn(i.cp2y,t.top,t.bottom)))}function Jn(e,t,n,r,i){let a,o,s,c;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),t.cubicInterpolationMode===`monotone`)Gn(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;a<o;++a)s=e[a],c=Hn(n,s,e[Math.min(a+1,o-(r?0:1))%o],t.tension),s.cp1x=c.previous.x,s.cp1y=c.previous.y,s.cp2x=c.next.x,s.cp2y=c.next.y,n=s}t.capBezierPoints&&qn(e,n)}function Yn(){return typeof window<`u`&&typeof document<`u`}function Xn(e){let t=e.parentNode;return t&&t.toString()===`[object ShadowRoot]`&&(t=t.host),t}function Zn(e,t,n){let r;return typeof e==`string`?(r=parseInt(e,10),e.indexOf(`%`)!==-1&&(r=r/100*t.parentNode[n])):r=e,r}var Qn=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function $n(e,t){return Qn(e).getPropertyValue(t)}var er=[`top`,`right`,`bottom`,`left`];function tr(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=er[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var nr=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function rr(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(nr(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function ir(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=Qn(n),a=i.boxSizing===`border-box`,o=tr(i,`padding`),s=tr(i,`border`,`width`),{x:c,y:l,box:u}=rr(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function ar(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&Xn(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=Qn(a),s=tr(o,`border`,`width`),c=tr(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Zn(o.maxWidth,a,`clientWidth`),i=Zn(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||He,maxHeight:i||He}}var or=e=>Math.round(e*10)/10;function sr(e,t,n,r){let i=Qn(e),a=tr(i,`margin`),o=Zn(i.maxWidth,e,`clientWidth`)||He,s=Zn(i.maxHeight,e,`clientHeight`)||He,c=ar(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=tr(i,`border`,`width`),t=tr(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=or(Math.min(l,o,c.maxWidth)),u=or(Math.min(u,s,c.maxHeight)),l&&!u&&(u=or(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=or(Math.floor(u*r))),{width:l,height:u}}function cr(e,t,n){let r=t||1,i=or(e.height*r),a=or(e.width*r);e.height=or(e.height),e.width=or(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var lr=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Yn()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function ur(e,t){let n=$n(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function dr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function fr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function pr(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=dr(e,i,n),s=dr(i,a,n),c=dr(a,t,n);return dr(dr(o,s,n),dr(s,c,n),n)}var mr=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},hr=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function gr(e,t,n){return e?mr(t,n):hr()}function _r(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function vr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function yr(e){return e===`angle`?{between:st,compare:ot,normalize:z}:{between:lt,compare:(e,t)=>e-t,normalize:e=>e}}function br({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function xr(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=yr(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;f<p&&o(s(t[l%c][r]),i,a);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:e.style}}function Sr(e,t,n){if(!n)return[e];let{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:c,normalize:l}=yr(r),{start:u,end:d,loop:f,style:p}=xr(e,t,n),m=[],h=!1,g=null,_,v,y,b=()=>c(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(br({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(br({start:g,end:d,loop:f,count:o,style:p})),m}function Cr(e,t){let n=[],r=e.segments;for(let i=0;i<r.length;i++){let a=Sr(r[i],e.points,t);a.length&&n.push(...a)}return n}function wr(e,t,n,r){let i=0,a=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(a+=i);a>i&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function Tr(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function Er(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=wr(n,i,a,r);return r===!0?Dr(e,[{start:o,end:s,loop:a}],n,t):Dr(e,Tr(n,o,s<o?s+i:s,!!e._fullLoop&&o===0&&s===i-1),n,t)}function Dr(e,t,n,r){return!r||!r.setContext||!n?t:Or(e,t,n,r)}function Or(e,t,n,r){let i=e._chart.getContext(),a=kr(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,c=n.length,l=[],u=a,d=t[0].start,f=d;function p(e,t,r,i){let a=s?-1:1;if(e!==t){for(e+=c;n[e%c].skip;)e-=a;for(;n[t%c].skip;)t+=a;e%c!==t%c&&(l.push({start:e%c,end:t%c,loop:r,style:i}),u=i,d=t%c)}}for(let e of t){d=s?d:e.start;let t=n[d%c],a;for(f=d+1;f<=e.end;f++){let s=n[f%c];a=kr(r.setContext(yn(i,{type:`segment`,p0:t,p1:s,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:o}))),Ar(a,u)&&p(d,f-1,e.loop,u),t=s,u=a}d<f-1&&p(d,f-1,e.loop,u)}return l}function kr(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Ar(e,t){if(!t)return!1;let n=[],r=function(e,t){return kt(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function jr(e,t,n){return e.options.clip?e[n]:t[n]}function Mr(e,t){let{xScale:n,yScale:r}=e;return n&&r?{left:jr(n,t,`left`),right:jr(n,t,`right`),top:jr(r,t,`top`),bottom:jr(r,t,`bottom`)}:t}function Nr(e,t){let n=t._clip;if(n.disabled)return!1;let r=Mr(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}var Pr=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let i=t.listeners[r],a=t.duration;i.forEach(r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,vt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},Fr=`transparent`,Ir={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=At(e||Fr),i=r.valid&&At(t||Fr);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Lr=class{constructor(e,t,n,r){let i=t[n];r=G([e.to,r,i,e.from]);let a=G([e.from,i,r]);this._active=!0,this._fn=e.fn||Ir[e.type||typeof a],this._easing=Ot[e.easing]||Ot.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=G([e.to,t,r,e.from]),this._from=G([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t<n),!this._active){this._target[r]=o,this._notify(!0);return}if(t<0){this._target[r]=i;return}s=t/n%2,s=a&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}},Rr=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!j(e))return;let t=Object.keys(H.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{let i=e[r];if(!j(i))return;let a={};for(let e of t)a[e]=i[e];(A(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Br(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&zr(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,l,o);continue}else u.cancel();if(!d||!d.duration){e[c]=l;continue}i[c]=u=new Lr(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Pr.add(this._chart,n),!0}};function zr(e,t){let n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){let i=e[r[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function Br(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Vr(e,t){let n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function Hr(e,t,n){if(n===!1)return!1;let r=Vr(e,n),i=Vr(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Ur(e){let t,n,r,i;return j(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function Wr(e,t){let n=[],r=e._getSortedDatasetMetas(t),i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function Gr(e,t,n,r={}){let i=e.keys,a=r.mode===`single`,o,s,c,l;if(t===null)return;let u=!1;for(o=0,s=i.length;o<s;++o){if(c=+i[o],c===n){if(u=!0,r.all)continue;break}l=e.values[c],M(l)&&(a||t===0||qe(t)===qe(l))&&(t+=l)}return!u&&!r.all?0:t}function Kr(e,t){let{iScale:n,vScale:r}=t,i=n.axis===`x`?`x`:`y`,a=r.axis===`x`?`x`:`y`,o=Object.keys(e),s=Array(o.length),c,l,u;for(c=0,l=o.length;c<l;++c)u=o[c],s[c]={[i]:u,[a]:e[u]};return s}function qr(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Jr(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Yr(e){let{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:-1/0,max:i?n:1/0}}function Xr(e,t,n){let r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Zr(e,t,n,r){for(let i of t.getMatchingVisibleMetas(r).reverse()){let t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function Qr(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Jr(a,o,r),d=t.length,f;for(let e=0;e<d;++e){let n=t[e],{[c]:a,[l]:d}=n,p=n._stacks||={};f=p[l]=Xr(i,u,a),f[s]=d,f._top=Zr(f,o,!0,r.type),f._bottom=Zr(f,o,!1,r.type);let m=f._visualValues||={};m[s]=d}}function $r(e,t){let n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function ei(e,t){return yn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function ti(e,t,n){return yn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function ni(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var ri=e=>e===`reset`||e===`none`,ii=(e,t)=>t?e:Object.assign({},e),ai=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Wr(n,!0),values:null},oi=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=qr(e.vScale,e),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(e){this.index!==e&&ni(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=N(n.xAxisID,$r(e,`x`)),a=t.yAxisID=N(n.yAxisID,$r(e,`y`)),o=t.rAxisID=N(n.rAxisID,$r(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&>(this._data,this),e._stacked&&ni(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(j(t)){let e=this._cachedMeta;this._data=Kr(t,e)}else if(n!==t){if(n){gt(n,this);let e=this._cachedMeta;ni(e),e._parsed=[]}t&&Object.isExtensible(t)&&ht(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=qr(t.vScale,t),t.stack!==n.stack&&(r=!0,ni(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(Qr(this,t._parsed),t._stacked=qr(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length?!0:n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=A(r[e])?this.parseArrayData(n,r,e,t):j(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]<c[o];for(l=0;l<t;++l)n._parsed[l+e]=u=d[l],s&&(i()&&(s=!1),c=u);n._sorted=s}a&&Qr(this,d)}parsePrimitiveData(e,t,n,r){let{iScale:i,vScale:a}=e,o=i.axis,s=a.axis,c=i.getLabels(),l=i===a,u=Array(r),d,f,p;for(d=0,f=r;d<f;++d)p=d+n,u[d]={[o]:l||i.parse(c[p],p),[s]:a.parse(t[p],p)};return u}parseArrayData(e,t,n,r){let{xScale:i,yScale:a}=e,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={x:i.parse(u[0],l),y:a.parse(u[1],l)};return o}parseObjectData(e,t,n,r){let{xScale:i,yScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=Array(r),l,u,d,f;for(l=0,u=r;l<u;++l)d=l+n,f=t[d],c[l]={x:i.parse(Fe(f,o),d),y:a.parse(Fe(f,s),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){let r=this.chart,i=this._cachedMeta,a=t[e.axis];return Gr({keys:Wr(r,!0),values:t._stacks[e.axis]._visualValues},a,i.index,{mode:n})}updateRangeFromParsed(e,t,n,r){let i=n[t.axis],a=i===null?NaN:i,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,a=Gr(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){let n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,a=r.length,o=this._getOtherScale(e),s=ai(t,n,this.chart),c={min:1/0,max:-1/0},{min:l,max:u}=Yr(o),d,f;function p(){f=r[d];let t=f[o.axis];return!M(f[e.axis])||l>t||u<t}for(d=0;d<a&&!(!p()&&(this.updateRangeFromParsed(c,e,f,s),i));++d);if(i){for(d=a-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r][e.axis],M(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,n=t.iScale,r=t.vScale,i=this.getParsed(e);return{label:n?``+n.getLabelForValue(i[n.axis]):``,value:r?``+r.getLabelForValue(i[r.axis]):``}}_update(e){let t=this._cachedMeta;this.update(e||`default`),t._clip=Ur(N(this.options.clip,Hr(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],i=t.chartArea,a=[],o=this._drawStart||0,s=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop,l;for(n.dataset&&n.dataset.draw(e,i,o,s),l=o;l<o+s;++l){let t=r[l];t.hidden||(t.active&&c?a.push(t):t.draw(e,i))}for(l=0;l<a.length;++l)a[l].draw(e,i)}getStyle(e,t){let n=t?`active`:`default`;return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){let r=this.getDataset(),i;if(e>=0&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];i=t.$context||=ti(this.getContext(),e,t),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||=ei(this.chart.getContext(),this.index),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t=`default`,n){let r=t===`active`,i=this._cachedDataOpts,a=e+`-`+t,o=i[a],s=this.enableOptionSharing&&Le(n);if(o)return ii(o,s);let c=this.chart.config,l=c.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,`hover`,e,``]:[e,``],d=c.getOptionScopes(this.getDataset(),l),f=Object.keys(H.elements[e]),p=c.resolveNamedOptions(d,f,()=>this.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(ii(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new Rr(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||ri(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){ri(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!ri(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,t,n=!0){let r=this._cachedMeta,i=r.data,a=e+t,o,s=e=>{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;o<a;++o)i[o]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(i,e,t,`reset`)}updateElements(e,t,n,r){}_removeElements(e,t){let n=this._cachedMeta;if(this._parsing){let r=n._parsed.splice(e,t);n._stacked&&ni(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync([`_insertElements`,this.getDataset().data.length-e,e])}_onDataPop(){this._sync([`_removeElements`,this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync([`_removeElements`,0,1])}_onDataSplice(e,t){t&&this._sync([`_removeElements`,e,t]);let n=arguments.length-2;n&&this._sync([`_insertElements`,e,n])}_onDataUnshift(){this._sync([`_insertElements`,0,arguments.length])}};function si(e,t){if(!e._cache.$bar){let n=e.getMatchingVisibleMetas(t),r=[];for(let t=0,i=n.length;t<i;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=_t(r.sort((e,t)=>e-t))}return e._cache.$bar}function ci(e){let t=e.iScale,n=si(t,e.type),r=t._length,i,a,o,s,c=()=>{o===32767||o===-32768||(Le(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i<a;++i)o=t.getPixelForValue(n[i]),c();for(s=void 0,i=0,a=t.ticks.length;i<a;++i)o=t.getPixelForTick(i),c();return r}function li(e,t,n,r){let i=n.barThickness,a,o;return k(i)?(a=t.min*n.categoryPercentage,o=n.barPercentage):(a=i*r,o=1),{chunk:a/r,ratio:o,start:t.pixels[e]-a/2}}function ui(e,t,n,r){let i=t.pixels,a=i[e],o=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null,c=n.categoryPercentage;o===null&&(o=a-(s===null?t.end-t.start:s-a)),s===null&&(s=a+a-o);let l=a-(a-Math.min(o,s))/2*c;return{chunk:Math.abs(s-o)/2*c/r,ratio:n.barPercentage,start:l}}function di(e,t,n,r){let i=n.parse(e[0],r),a=n.parse(e[1],r),o=Math.min(i,a),s=Math.max(i,a),c=o,l=s;Math.abs(o)>Math.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function fi(e,t,n,r){return A(e)?di(e,t,n,r):t[n.axis]=n.parse(e,r),t}function pi(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l<u;++l)f=t[l],d={},d[i.axis]=s||i.parse(o[l],l),c.push(fi(f,d,a,l));return c}function mi(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function hi(e,t,n){return e===0?(t.isHorizontal()?1:-1)*(t.min>=n?1:-1):qe(e)}function gi(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.base<e.y,n=`bottom`,r=`top`),t?(i=`end`,a=`start`):(i=`start`,a=`end`),{start:n,end:r,reverse:t,top:i,bottom:a}}function _i(e,t,n,r){let i=t.borderSkipped,a={};if(!i){e.borderSkipped=a;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:s,reverse:c,top:l,bottom:u}=gi(e);i===`middle`&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=l:(n._bottom||0)===r?i=u:(a[vi(u,o,s,c)]=!0,i=l)),a[vi(i,o,s,c)]=!0,e.borderSkipped=a}function vi(e,t,n,r){return r?(e=yi(e,t,n),e=bi(e,n,t)):e=bi(e,t,n),e}function yi(e,t,n){return e===t?n:e===n?t:e}function bi(e,t,n){return e===`start`?t:e===`end`?n:e}function xi(e,{inflateAmount:t},n){e.inflateAmount=t===`auto`?n===1?.33:0:t}var Si=class extends oi{static id=`bar`;static defaults={datasetElementType:!1,dataElementType:`bar`,categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:`number`,properties:[`x`,`y`,`base`,`width`,`height`]}}};static overrides={scales:{_index_:{type:`category`,offset:!0,grid:{offset:!0}},_value_:{type:`linear`,beginAtZero:!0}}};parsePrimitiveData(e,t,n,r){return pi(e,t,n,r)}parseArrayData(e,t,n,r){return pi(e,t,n,r)}parseObjectData(e,t,n,r){let{iScale:i,vScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=i.axis===`x`?o:s,l=a.axis===`x`?o:s,u=[],d,f,p,m;for(d=n,f=n+r;d<f;++d)m=t[d],p={},p[i.axis]=i.parse(Fe(m,c),d),u.push(fi(Fe(m,l),p,a,d));return u}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);let i=n._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){let{iScale:t,vScale:n}=this._cachedMeta,r=this.getParsed(e),i=r._custom,a=mi(i)?`[`+i.start+`, `+i.end+`]`:``+n.getLabelForValue(r[n.axis]);return{label:``+t.getLabelForValue(r[t.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){let t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){let i=r===`reset`,{index:a,_cachedMeta:{vScale:o}}=this,s=o.getBasePixel(),c=o.isHorizontal(),l=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,r);for(let f=t;f<t+n;f++){let t=this.getParsed(f),n=i||k(t[o.axis])?{base:s,head:s}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,l),m=(t._stacks||{})[o.axis],h={horizontal:c,base:n.base,enableBorderRadius:!m||mi(t._custom)||a===m._top||a===m._bottom,x:c?n.head:p.center,y:c?p.center:n.head,height:c?p.size:Math.abs(n.size),width:c?Math.abs(n.size):p.size};d&&(h.options=u||this.resolveDataElementOptions(f,e[f].active?`active`:r));let g=h.options||e[f].options;_i(h,g,m,a),xi(h,g,l.ratio),this.updateElement(e[f],f,h,r)}}_getStacks(e,t){let{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(k(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[N(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;i<a;++i)r.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));let o=e.barThickness;return{min:o||ci(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:o?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){let{_cachedMeta:{vScale:t,_stacked:n,index:r},options:{base:i,minBarLength:a}}=this,o=i||0,s=this.getParsed(e),c=s._custom,l=mi(c),u=s[t.axis],d=0,f=n?this.applyStack(t,s,n):u,p,m;f!==u&&(d=f-u,f=u),l&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&qe(u)!==qe(c.barEnd)&&(d=0),d+=u);let h=!k(i)&&!l?i:d,g=t.getPixelForValue(h);if(p=this.chart.getDataVisibility(e)?t.getPixelForValue(d+f):g,m=p-g,Math.abs(m)<a){m=hi(m,t,o)*a,u===o&&(g-=m/2);let e=t.getPixelForDecimal(0),i=t.getPixelForDecimal(1),c=Math.min(e,i),d=Math.max(e,i);g=Math.max(Math.min(g,d),c),p=g+m,n&&!l&&(s._stacks[t.axis]._visualValues[r]=t.getValueForPixel(p)-t.getValueForPixel(g))}if(g===t.getPixelForValue(o)){let e=qe(m)*t.getLineWidthForValue(o)/2;g+=e,m-=e}return{size:m,base:g,head:p,center:p+m/2}}_calculateBarIndexPixels(e,t){let n=t.scale,r=this.options,i=r.skipNull,a=N(r.maxBarThickness,1/0),o,s,c=this._getAxisCount();if(t.grouped){let n=i?this._getStackCount(e):t.stackCount,l=r.barThickness===`flex`?ui(e,t,r,n*c):li(e,t,r,n*c),u=this.chart.options.indexAxis===`x`?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(N(u,this.getFirstScaleIdForIndexAxis())),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+d;o=l.start+l.chunk*f+l.chunk/2,s=Math.min(a,l.chunk*l.ratio)}else o=n.getPixelForValue(this.getParsed(e)[n.axis],e),s=Math.min(a,t.min*t.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}}draw(){let e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length,i=0;for(;i<r;++i)this.getParsed(i)[t.axis]!==null&&!n[i].hidden&&n[i].draw(this._ctx)}};function Ci(e,t,n){let r=1,i=1,a=0,o=0;if(t<L){let s=e,c=s+t,l=Math.cos(s),u=Math.sin(s),d=Math.cos(c),f=Math.sin(c),p=(e,t,r)=>st(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>st(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(R,u,f),_=m(I,l,d),v=m(I+R,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var wi=class extends oi{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(j(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Fe(n[t],e)}let a,o;for(a=e,o=e+t;a<o;++a)r._parsed[a]=i(a)}}_getRotation(){return tt(this.options.rotation-90)}_getCircumference(){return tt(this.options.circumference)}_getRotationExtents(){let e=L,t=-L;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),a=r._getCircumference();e=Math.min(e,i),t=Math.max(t,i+a)}return{rotation:e,circumference:t-e}}update(e){let{chartArea:t}=this.chart,n=this._cachedMeta,r=n.data,i=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(t.width,t.height)-i)/2,0),o=Math.min(Ce(this.options.cutout,a),1),s=this._getRingWeight(this.index),{circumference:c,rotation:l}=this._getRotationExtents(),{ratioX:u,ratioY:d,offsetX:f,offsetY:p}=Ci(l,c,o),m=(t.width-i)/u,h=(t.height-i)/d,g=Math.max(Math.min(m,h)/2,0),_=we(this.options.radius,g),v=(_-Math.max(_*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*_,this.offsetY=p*_,n.total=this.calculateTotal(),this.outerRadius=_-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*s,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){let n=this.options,r=this._cachedMeta,i=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/L)}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.chartArea,s=a.options.animation,c=(o.left+o.right)/2,l=(o.top+o.bottom)/2,u=i&&s.animateScale,d=u?0:this.innerRadius,f=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(t,r),h=this._getRotation(),g;for(g=0;g<t;++g)h+=this._circumference(g,i);for(g=t;g<t+n;++g){let t=this._circumference(g,i),n=e[g],a={x:c+this.offsetX,y:l+this.offsetY,startAngle:h,endAngle:h+t,circumference:t,outerRadius:f,innerRadius:d};m&&(a.options=p||this.resolveDataElementOptions(g,n.active?`active`:r)),h+=t,this.updateElement(n,g,a,r)}}calculateTotal(){let e=this._cachedMeta,t=e.data,n=0,r;for(r=0;r<t.length;r++){let i=e._parsed[r];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(r)&&!t[r].hidden&&(n+=Math.abs(i))}return n}calculateCircumference(e){let t=this._cachedMeta.total;return t>0&&!isNaN(e)?Math.abs(e)/t*L:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Rt(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){a=n.getDatasetMeta(r),e=a.data,o=a.controller;break}}if(!e)return 0;for(r=0,i=e.length;r<i;++r)s=o.resolveDataElementOptions(r),s.borderAlign!==`inner`&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){let e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(N(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}},Ti=class extends oi{static id=`line`;static defaults={datasetElementType:`line`,dataElementType:`point`,showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:`category`},_value_:{type:`linear`}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){let t=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=t,a=this.chart._animationsDisabled,{start:o,count:s}=Ct(t,r,a);this._drawStart=o,this._drawCount=s,wt(t)&&(o=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;let c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},e),this.updateElements(r,o,s,e)}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o,_stacked:s,_dataset:c}=this._cachedMeta,{sharedOptions:l,includeOptions:u}=this._getSharedOptions(t,r),d=a.axis,f=o.axis,{spanGaps:p,segment:m}=this.options,h=Qe(p)?p:1/0,g=this.chart._animationsDisabled||i||r===`none`,_=t+n,v=e.length,y=t>0&&this.getParsed(t-1);for(let n=0;n<v;++n){let p=e[n],v=g?p:{};if(n<t||n>=_){v.skip=!0;continue}let b=this.getParsed(n),x=k(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},Ei=class extends wi{static id=`pie`;static defaults={cutout:0,rotation:0,circumference:360,radius:`100%`}},Di=class extends oi{static id=`scatter`;static defaults={datasetElementType:!1,dataElementType:`point`,showLine:!1,fill:!1};static overrides={interaction:{mode:`point`},scales:{x:{type:`linear`},y:{type:`linear`}}};getLabelAndValue(e){let t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=t,a=this.getParsed(e),o=r.getLabelForValue(a.x),s=i.getLabelForValue(a.y);return{label:n[e]||``,value:`(`+o+`, `+s+`)`}}update(e){let t=this._cachedMeta,{data:n=[]}=t,r=this.chart._animationsDisabled,{start:i,count:a}=Ct(t,n,r);if(this._drawStart=i,this._drawCount=a,wt(t)&&(i=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:i,_dataset:a}=t;i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;let o=this.resolveDatasetElementOptions(e);o.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:o},e)}else this.datasetElementType&&=(delete t.dataset,!1);this.updateElements(n,i,a,e)}addElements(){let{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement(`line`)),super.addElements()}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o,_stacked:s,_dataset:c}=this._cachedMeta,l=this.resolveDataElementOptions(t,r),u=this.getSharedOptions(l),d=this.includeOptions(r,u),f=a.axis,p=o.axis,{spanGaps:m,segment:h}=this.options,g=Qe(m)?m:1/0,_=this.chart._animationsDisabled||i||r===`none`,v=t>0&&this.getParsed(t-1);for(let l=t;l<t+n;++l){let t=e[l],n=this.getParsed(l),m=_?t:{},y=k(n[p]),b=m[f]=a.getPixelForValue(n[f],l),x=m[p]=i||y?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,n,s):n[p],l);m.skip=isNaN(b)||isNaN(x)||y,m.stop=l>0&&Math.abs(n[f]-v[f])>g,h&&(m.parsed=n,m.raw=c.data[l]),d&&(m.options=u||this.resolveDataElementOptions(l,t.active?`active`:r)),_||this.updateElement(t,l,m,r),v=n}this.updateSharedOptions(u,r,l)}getMaxOverflow(){let e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){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}let n=e.dataset,r=n.options&&n.options.borderWidth||0;if(!t.length)return r;let i=t[0].size(this.resolveDataElementOptions(0)),a=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(r,i,a)/2}};function Oi(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var ki={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Oi()}parse(){return Oi()}format(){return Oi()}add(){return Oi()}diff(){return Oi()}startOf(){return Oi()}endOf(){return Oi()}}};function Ai(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ft:dt;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!k(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!k(e[t.axis]));r.hi+=Math.max(0,o)}return r}else if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function ji(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e<n;++e){let{index:n,data:s}=a[e],{lo:c,hi:l}=Ai(a[e],t,o,i);for(let e=c;e<=l;++e){let t=s[e];t.skip||r(t,n,e)}}}function Mi(e){let t=e.indexOf(`x`)!==-1,n=e.indexOf(`y`)!==-1;return function(e,r){let i=t?Math.abs(e.x-r.x):0,a=n?Math.abs(e.y-r.y):0;return Math.sqrt(i**2+a**2)}}function Ni(e,t,n,r,i){let a=[];return!i&&!e.isPointInArea(t)||ji(e,n,t,function(n,o,s){!i&&!en(n,e.chartArea,0)||n.inRange(t.x,t.y,r)&&a.push({element:n,datasetIndex:o,index:s})},!0),a}function Pi(e,t,n,r){let i=[];function a(e,n,a){let{startAngle:o,endAngle:s}=e.getProps([`startAngle`,`endAngle`],r),{angle:c}=it(e,{x:t.x,y:t.y});st(c,o,s)&&i.push({element:e,datasetIndex:n,index:a})}return ji(e,n,t,a),i}function Fi(e,t,n,r,i,a){let o=[],s=Mi(n),c=1/0;function l(n,l,u){let d=n.inRange(t.x,t.y,i);if(r&&!d)return;let f=n.getCenterPoint(i);if(!(a||e.isPointInArea(f))&&!d)return;let p=s(t,f);p<c?(o=[{element:n,datasetIndex:l,index:u}],c=p):p===c&&o.push({element:n,datasetIndex:l,index:u})}return ji(e,n,t,l),o}function Ii(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n===`r`&&!r?Pi(e,t,n,i):Fi(e,t,n,r,i,a)}function Li(e,t,n,r,i){let a=[],o=n===`x`?`inXRange`:`inYRange`,s=!1;return ji(e,n,t,(e,r,c)=>{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Ri={evaluateInteractionItems:ji,modes:{index(e,t,n,r){let i=ir(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Ni(e,i,a,r,o):Ii(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=ir(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Ni(e,i,a,r,o):Ii(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point(e,t,n,r){return Ni(e,ir(t,e),n.axis||`xy`,r,n.includeInvisible||!1)},nearest(e,t,n,r){let i=ir(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1;return Ii(e,i,a,n.intersect,r,o)},x(e,t,n,r){return Li(e,ir(t,e),`x`,n.intersect,r)},y(e,t,n,r){return Li(e,ir(t,e),`y`,n.intersect,r)}}},zi=[`left`,`top`,`right`,`bottom`];function Bi(e,t){return e.filter(e=>e.pos===t)}function Vi(e,t){return e.filter(e=>zi.indexOf(e.pos)===-1&&e.box.axis===t)}function Hi(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function Ui(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function Wi(e){let t={};for(let n of e){let{stack:e,pos:r,stackWeight:i}=n;if(!e||!zi.includes(r))continue;let a=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function Gi(e,t){let n=Wi(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t,a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];let{fullSize:o}=s.box,c=n[s.stack],l=c&&s.stackWeight/c.weight;s.horizontal?(s.width=l?l*r:o&&t.availableWidth,s.height=i):(s.width=r,s.height=l?l*i:o&&t.availableHeight)}return n}function Ki(e){let t=Ui(e),n=Hi(t.filter(e=>e.box.fullSize),!0),r=Hi(Bi(t,`left`),!0),i=Hi(Bi(t,`right`)),a=Hi(Bi(t,`top`),!0),o=Hi(Bi(t,`bottom`)),s=Vi(t,`x`),c=Vi(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:Bi(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function qi(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Ji(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Yi(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!j(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&Ji(o,a.getPadding());let s=Math.max(0,t.outerWidth-qi(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-qi(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function Xi(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function Zi(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function Qi(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a<o;++a){s=e[a],c=s.box,c.update(s.width||t.w,s.height||t.h,Zi(s.horizontal,t));let{same:o,other:d}=Yi(t,n,s,r);l|=o&&i.length,u||=d,c.fullSize||i.push(s)}return l&&Qi(i,t,n,r)||u}function $i(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function ea(e,t,n,r){let i=n.padding,{x:a,y:o}=t;for(let s of e){let e=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},l=s.stackWeight/c.weight||1;if(s.horizontal){let r=t.w*l,a=c.size||e.height;Le(c.start)&&(o=c.start),e.fullSize?$i(e,i.left,o,n.outerWidth-i.right-i.left,a):$i(e,t.left+c.placed,o,r,a),c.start=o,c.placed+=r,o=e.bottom}else{let r=t.h*l,o=c.size||e.width;Le(c.start)&&(a=c.start),e.fullSize?$i(e,a,i.top,o,n.outerHeight-i.bottom-i.top):$i(e,a,t.top+c.placed,o,r),c.start=a,c.placed+=r,a=e.right}}t.x=a,t.y=o}var ta={addBox(e,t){e.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)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;let i=U(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=Ki(e.boxes),c=s.vertical,l=s.horizontal;F(e.boxes,e=>{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Ji(f,U(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Gi(c.concat(l),d);Qi(s.fullSize,p,d,m),Qi(c,p,d,m),Qi(l,p,d,m)&&Qi(c,p,d,m),Xi(p),ea(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,ea(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},F(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},na=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},ra=class extends na{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},ia=`$chartjs`,aa={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},oa=e=>e===null||e===``;function sa(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[ia]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,oa(i)){let t=ur(e,`width`);t!==void 0&&(e.width=t)}if(oa(r))if(e.style.height===``)e.height=e.width/(t||2);else{let t=ur(e,`height`);t!==void 0&&(e.height=t)}return e}var ca=lr?{passive:!0}:!1;function la(e,t,n){e&&e.addEventListener(t,n,ca)}function ua(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ca)}function da(e,t){let n=aa[e.type]||e.type,{x:r,y:i}=ir(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function fa(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function pa(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=fa(n.addedNodes,r),t&&=!fa(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function ma(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=fa(n.removedNodes,r),t&&=!fa(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var ha=new Map,ga=0;function _a(){let e=window.devicePixelRatio;e!==ga&&(ga=e,ha.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function va(e,t){ha.size||window.addEventListener(`resize`,_a),ha.set(e,t)}function ya(e){ha.delete(e),ha.size||window.removeEventListener(`resize`,_a)}function ba(e,t,n){let r=e.canvas,i=r&&Xn(r);if(!i)return;let a=yt((e,t)=>{let r=i.clientWidth;n(e,t),r<i.clientWidth&&n()},window),o=new ResizeObserver(e=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0&&r===0||a(n,r)});return o.observe(i),va(e,a),o}function xa(e,t,n){n&&n.disconnect(),t===`resize`&&ya(e)}function Sa(e,t,n){let r=e.canvas,i=yt(t=>{e.ctx!==null&&n(da(t,e))},e);return la(r,t,i),i}var Ca=class extends na{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(sa(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[ia])return!1;let n=t[ia].initial;[`height`,`width`].forEach(e=>{let r=n[e];k(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[ia],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:pa,detach:ma,resize:ba}[t]||Sa)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:xa,detach:xa,resize:xa}[t]||ua)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return sr(e,t,n,r)}isAttached(e){let t=e&&Xn(e);return!!(t&&t.isConnected)}};function wa(e){return!Yn()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?ra:Ca}var Ta=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return Qe(this.x)&&Qe(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function Ea(e,t){let n=e.options.ticks,r=Da(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?ka(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Aa(t,l,a,o/i),l;let u=Oa(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(ja(t,l,u,k(r)?0:s-r,s),e=0,n=o-1;e<n;e++)ja(t,l,u,a[e],a[e+1]);return ja(t,l,u,c,k(r)?t.length:c+r),l}return ja(t,l,u),l}function Da(e){let t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function Oa(e,t,n){let r=Ma(e),i=t.length/n;if(!r)return Math.max(i,1);let a=Xe(r);for(let e=0,t=a.length-1;e<t;e++){let t=a[e];if(t>i)return t}return Math.max(i,1)}function ka(e){let t=[],n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Aa(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function ja(e,t,n,r,i){let a=N(r,0),o=Math.min(N(i,e.length),e.length),s=0,c,l,u;for(n=Math.ceil(n),i&&(c=i-r,n=c/Math.floor(c/n)),u=a;u<0;)s++,u=Math.round(a+s*n);for(l=Math.max(a,0);l<o;l++)l===u&&(t.push(e[l]),s++,u=Math.round(a+s*n))}function Ma(e){let t=e.length,n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}var Na=e=>e===`left`?`right`:e===`right`?`left`:e,Pa=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Fa=(e,t)=>Math.min(t||e,e);function Ia(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function La(e,t,n){let r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6,c=e.getPixelForTick(i),l;if(!(n&&(l=r===1?Math.max(c-a,o-c):t===0?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<a-s||c>o+s)))return c}function Ra(e,t){F(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;i<r;++i)delete e.data[n[i]];n.splice(0,r)}})}function za(e){return e.drawTicks?e.tickLength:0}function Ba(e,t){if(!e.display)return 0;let n=W(e.font,t),r=U(e.padding);return(A(e.text)?e.text.length:1)*n.lineHeight+r.height}function Va(e,t){return yn(e,{scale:t,type:`scale`})}function Ha(e,t,n){return yn(e,{tick:n,index:t,type:`tick`})}function Ua(e,t,n){let r=xt(e);return(n&&t!==`right`||!n&&t===`right`)&&(r=Na(r)),r}function Wa(e,t,n,r){let{top:i,left:a,bottom:o,right:s,chart:c}=e,{chartArea:l,scales:u}=c,d=0,f,p,m,h=o-i,g=s-a;if(e.isHorizontal()){if(p=V(r,a,s),j(n)){let e=Object.keys(n)[0],r=n[e];m=u[e].getPixelForValue(r)+h-t}else m=n===`center`?(l.bottom+l.top)/2+h-t:Pa(e,n,t);f=s-a}else{if(j(n)){let e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-g+t}else p=n===`center`?(l.left+l.right)/2-g+t:Pa(e,n,t);m=V(r,o,i),d=n===`left`?-R:R}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}var Ga=class e extends Ta{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=Se(e,1/0),t=Se(t,-1/0),n=Se(n,1/0),r=Se(r,-1/0),{min:Se(e,n),max:Se(t,r),minDefined:M(e),maxDefined:M(t)}}getMinMax(e){let{min:t,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),a;if(r&&i)return{min:t,max:n};let o=this.getMatchingVisibleMetas();for(let s=0,c=o.length;s<c;++s)a=o[s].controller.getMinMax(this,e),r||(t=Math.min(t,a.min)),i||(n=Math.max(n,a.max));return t=i&&t>n?n:t,n=r&&t>n?t:n,{min:Se(t,Se(n,t)),max:Se(n,Se(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){P(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=vn(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o<this.ticks.length;this._convertTicksToLabels(s?Ia(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source===`auto`)&&(this.ticks=Ea(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,e=!e),this._startPixel=t,this._endPixel=n,this._reversePixels=e,this._length=n-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){P(this.options.afterUpdate,[this])}beforeSetDimensions(){P(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(){P(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),P(this.options[e],[this])}beforeDataLimits(){this._callHooks(`beforeDataLimits`)}determineDataLimits(){}afterDataLimits(){this._callHooks(`afterDataLimits`)}beforeBuildTicks(){this._callHooks(`beforeBuildTicks`)}buildTicks(){return[]}afterBuildTicks(){this._callHooks(`afterBuildTicks`)}beforeTickToLabelConversion(){P(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=P(t.callback,[i.value,n,e],this)}afterTickToLabelConversion(){P(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){P(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,n=Fa(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,i=t.maxRotation,a=r,o,s,c;if(!this._isVisible()||!t.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=B(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-za(e.grid)-t.padding-Ba(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=nt(Math.min(Math.asin(B((l.highest.height+6)/o,-1,1)),Math.asin(B(s/c,-1,1))-Math.asin(B(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){P(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){P(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Ba(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=za(i)+a):(e.height=this.maxHeight,e.width=za(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=tt(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+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(){P(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t<n;t++)k(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=Ia(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){let{ctx:r,_longestTextCache:i}=this,a=[],o=[],s=Math.floor(t/Fa(t,n)),c=0,l=0,u,d,f,p,m,h,g,_,v,y,b;for(u=0;u<t;u+=s){if(p=e[u].label,m=this._resolveTickFontOptions(u),r.font=h=m.string,g=i[h]=i[h]||{data:{},gc:[]},_=m.lineHeight,v=y=0,!k(p)&&!A(p))v=Jt(r,g.data,g.gc,v,p),y=_;else if(A(p))for(d=0,f=p.length;d<f;++d)b=p[d],!k(b)&&!A(b)&&(v=Jt(r,g.data,g.gc,v,b),y+=_);a.push(v),o.push(y),c=Math.max(v,c),l=Math.max(y,l)}Ra(i,t);let x=a.indexOf(c),S=o.indexOf(l),C=e=>({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ct(this._alignToPixels?Xt(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let n=t[e];return n.$context||=Ha(this.getContext(),e,n)}return this.$context||=Va(this.chart.getContext(),this)}_tickSize(){let e=this.options.ticks,t=tt(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=this._getLabelSizes(),a=e.autoSkipPadding||0,o=i?i.widest.width+a:0,s=i?i.highest.height+a:0;return this.isHorizontal()?s*n>o*r?o/n:s/r:s*r<o*n?s/n:o/r}_isVisible(){let e=this.options.display;return e===`auto`?this.getMatchingVisibleMetas().length>0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+(s?1:0),u=za(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Xt(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(j(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(j(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=N(r.ticks.maxTicksLimit,l),te=Math.max(1,Math.ceil(l/ee));for(_=0;_<l;_+=te){let e=this.getContext(_),t=i.setContext(e),r=o.setContext(e),a=t.lineWidth,l=t.color,u=r.dash||[],f=r.dashOffset,p=t.tickWidth,m=t.tickColor,h=t.tickBorderDash||[],g=t.tickBorderDashOffset;v=La(this,_,s),v!==void 0&&(y=Xt(n,v,a),c?b=S=w=E=y:x=C=T=D=y,d.push({tx1:b,ty1:x,tx2:S,ty2:C,x1:w,y1:T,x2:E,y2:D,width:a,color:l,borderDash:u,borderDashOffset:f,tickWidth:p,tickColor:m,tickBorderDash:h,tickBorderDashOffset:g}))}return this._ticksLength=l,this._borderValue=g,d}_computeLabelItems(e){let t=this.axis,n=this.options,{position:r,ticks:i}=n,a=this.isHorizontal(),o=this.ticks,{align:s,crossAlign:c,padding:l,mirror:u}=i,d=za(n.grid),f=d+l,p=u?-l:f,m=-tt(this.labelRotation),h=[],g,_,v,y,b,x,S,C,w,T,E,D,ee=`middle`;if(r===`top`)x=this.bottom-p,S=this._getXAxisLabelAlignment();else if(r===`bottom`)x=this.top+p,S=this._getXAxisLabelAlignment();else if(r===`left`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(r===`right`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(t===`x`){if(r===`center`)x=(e.top+e.bottom)/2+f;else if(j(r)){let e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+f}S=this._getXAxisLabelAlignment()}else if(t===`y`){if(r===`center`)b=(e.left+e.right)/2-f;else if(j(r)){let e=Object.keys(r)[0],t=r[e];b=this.chart.scales[e].getPixelForValue(t)}S=this._getYAxisLabelAlignment(d).textAlign}t===`y`&&(s===`start`?ee=`top`:s===`end`&&(ee=`bottom`));let te=this._getLabelSizes();for(g=0,_=o.length;g<_;++g){v=o[g],y=v.label;let e=i.setContext(this.getContext(g));C=this.getPixelForTick(g)+i.labelOffset,w=this._resolveTickFontOptions(g),T=w.lineHeight,E=A(y)?y.length:1;let t=E/2,n=e.color,s=e.textStrokeColor,l=e.textStrokeWidth,d=S;a?(b=C,S===`inner`&&(d=g===_-1?this.options.reverse?`left`:`right`:g===0?this.options.reverse?`right`:`left`:`center`),D=r===`top`?c===`near`||m!==0?-E*T+T/2:c===`center`?-te.highest.height/2-t*T+T:-te.highest.height+T/2:c===`near`||m!==0?T/2:c===`center`?te.highest.height/2-t*T:te.highest.height-E*T,u&&(D*=-1),m!==0&&!e.showLabelBackdrop&&(b+=T/2*Math.sin(m))):(x=C,D=(1-E)*T/2);let f;if(e.showLabelBackdrop){let t=U(e.backdropPadding),n=te.heights[g],r=te.widths[g],i=D-t.top,a=0-t.left;switch(ee){case`middle`:i-=n/2;break;case`bottom`:i-=n;break}switch(S){case`center`:a-=r/2;break;case`right`:a-=r;break;case`inner`:g===_-1?a-=r:g>0&&(a-=r/2);break}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-tt(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i<a;++i){let e=r[i];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),a=n.display?i.width:0;if(!a)return;let o=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue,c,l,u,d;this.isHorizontal()?(c=Xt(e,this.left,a)-a/2,l=Xt(e,this.right,o)+o/2,u=d=s):(u=Xt(e,this.top,a)-a/2,d=Xt(e,this.bottom,o)+o/2,c=l=s),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(c,u),t.lineTo(l,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let t=this.ctx,n=this._computeLabelArea();n&&tn(t,n);let r=this.getLabelItems(e);for(let e of r){let n=e.options,r=e.font,i=e.label,a=e.textOffset;ln(t,i,0,a,r,n)}n&&nn(t)}drawTitle(){let{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;let i=W(n.font),a=U(n.padding),o=n.align,s=i.lineHeight/2;t===`bottom`||t===`center`||j(t)?(s+=a.bottom,A(n.text)&&(s+=i.lineHeight*(n.text.length-1))):s+=a.top;let{titleX:c,titleY:l,maxWidth:u,rotation:d}=Wa(this,s,t,o);ln(e,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:Ua(o,t,r),textBaseline:`middle`,translation:[c,l]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,r=N(t.grid&&t.grid.z,-1),i=N(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:e=>{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i<a;++i){let a=t[i];a[n]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){return W(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},Ka=class{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),n;Ya(t)&&(n=this.register(t));let r=this.items,i=e.id,a=this.scope+`.`+i;if(!i)throw Error(`class does not have id: `+e);return i in r?a:(r[i]=e,qa(e,a,n),this.override&&H.override(e.id,e.overrides),a)}get(e){return this.items[e]}unregister(e){let t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in H[r]&&(delete H[r][n],this.override&&delete Ut[n])}};function qa(e,t,n){let r=ke(Object.create(null),[n?H.get(n):{},H.get(t),e.defaults]);H.set(t,r),e.defaultRoutes&&Ja(t,e.defaultRoutes),e.descriptors&&H.describe(t,e.descriptors)}function Ja(e,t){Object.keys(t).forEach(n=>{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);H.route(a,i,c,s)})}function Ya(e){return`id`in e&&`defaults`in e}var Xa=new class{constructor(){this.controllers=new Ka(oi,`datasets`,!0),this.elements=new Ka(Ta,`elements`),this.plugins=new Ka(Object,`plugins`),this.scales=new Ka(Ga,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):F(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Ie(e);P(n[`before`+r],[],n),t[e](n),P(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){let r=t.get(e);if(r===void 0)throw Error(`"`+e+`" is not a registered `+n+`.`);return r}},Za=class{constructor(){this._init=void 0}notify(e,t,n,r){if(t===`beforeInit`&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,`install`)),this._init===void 0)return;let i=r?this._descriptors(e).filter(r):this._descriptors(e),a=this._notify(i,e,t,n);return t===`afterDestroy`&&(this._notify(i,e,`stop`),this._notify(this._init,e,`uninstall`),this._init=void 0),a}_notify(e,t,n,r){r||={};for(let i of e){let e=i.plugin,a=e[n];if(P(a,[t,r,i.options],e)===!1&&r.cancelable)return!1}return!0}invalidate(){k(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let n=e&&e.config,r=N(n.options&&n.options.plugins,{}),i=Qa(n);return r===!1&&!t?[]:eo(e,i,r,t)}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function Qa(e){let t={},n=[],r=Object.keys(Xa.plugins.items);for(let e=0;e<r.length;e++)n.push(Xa.getPlugin(r[e]));let i=e.plugins||[];for(let e=0;e<i.length;e++){let r=i[e];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function $a(e,t){return!t&&e===!1?null:e===!0?{}:e}function eo(e,{plugins:t,localIds:n},r,i){let a=[],o=e.getContext();for(let s of t){let t=s.id,c=$a(r[t],i);c!==null&&a.push({plugin:s,options:to(e.config,{plugin:s,local:n[t]},c,o)})}return a}function to(e,{plugin:t,local:n},r,i){let a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[``],{scriptable:!1,indexable:!1,allKeys:!0})}function no(e,t){let n=H.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||`x`}function ro(e,t){let n=e;return e===`_index_`?n=t:e===`_value_`&&(n=t===`x`?`y`:`x`),n}function io(e,t){return e===t?`_index_`:`_value_`}function ao(e){if(e===`x`||e===`y`||e===`r`)return e}function oo(e){if(e===`top`||e===`bottom`)return`x`;if(e===`left`||e===`right`)return`y`}function so(e,...t){if(ao(e))return e;for(let n of t){let t=n.axis||oo(n.position)||e.length>1&&ao(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function co(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function lo(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return co(e,`x`,n[0])||co(e,`y`,n[0])}return{}}function uo(e,t){let n=Ut[e.type]||{scales:{}},r=t.scales||{},i=no(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!j(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=so(t,o,lo(t,e),H.scales[o.type]),c=io(s,i),l=n.scales||{};a[t]=Ae(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||no(i,t),s=(Ut[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=ro(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),Ae(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];Ae(t,[H.scales[t.type],H.scale])}),a}function fo(e){let t=e.options||={};t.plugins=N(t.plugins,{}),t.scales=uo(e,t)}function po(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function mo(e){return e||={},e.data=po(e.data),fo(e),e}var ho=new Map,go=new Set;function _o(e,t){let n=ho.get(e);return n||(n=t(),ho.set(e,n),go.add(n)),n}var vo=(e,t,n)=>{let r=Fe(t,n);r!==void 0&&e.add(r)},yo=class{constructor(e){this._config=mo(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=po(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),fo(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return _o(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return _o(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return _o(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return _o(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>vo(s,e,t))),t.forEach(e=>vo(s,r,e)),t.forEach(e=>vo(s,Ut[i]||{},e)),t.forEach(e=>vo(s,H,e)),t.forEach(e=>vo(s,Wt,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),go.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Ut[t]||{},H.datasets[t]||{},{type:t},H,Wt]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=bo(this._resolverCache,e,r),s=a;if(So(a,t)){i.$shared=!1,n=Re(n)?n():n;let t=this.createResolver(e,n,o);s=xn(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=bo(this._resolverCache,e,n);return j(t)?xn(i,t,void 0,r):i}};function bo(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:bn(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var xo=e=>j(e)&&Object.getOwnPropertyNames(e).some(t=>Re(e[t]));function So(e,t){let{isScriptable:n,isIndexable:r}=Sn(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Re(o)||xo(o))||a&&A(o))return!0}return!1}var Co=`4.5.1`,wo=[`top`,`bottom`,`left`,`right`,`chartArea`];function To(e,t){return e===`top`||e===`bottom`||wo.indexOf(e)===-1&&t===`x`}function Eo(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Do(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),P(n&&n.onComplete,[e],t)}function Oo(e){let t=e.chart,n=t.options.animation;P(n&&n.onProgress,[e],t)}function ko(e){return Yn()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Ao={},jo=e=>{let t=ko(e);return Object.values(Ao).filter(e=>e.canvas===t).pop()};function Mo(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function No(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var Po=class{static defaults=H;static instances=Ao;static overrides=Ut;static registry=Xa;static version=Co;static getChart=jo;static register(...e){Xa.add(...e),Fo()}static unregister(...e){Xa.remove(...e),Fo()}constructor(e,t){let n=this.config=new yo(t),r=ko(e),i=jo(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(wa(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=xe(),this.ctx=o,this.canvas=s,this.width=l,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 Za,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=bt(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],Ao[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}Pr.listen(this,`complete`,Do),Pr.listen(this,`progress`,Oo),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return k(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Xa}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():cr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Zt(this.canvas,this.ctx),this}stop(){return Pr.stop(this),this}resize(e,t){Pr.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,cr(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),P(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){F(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=so(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),F(i,t=>{let i=t.options,a=i.id,o=so(a,i),s=N(i.type,t.dtype);(i.position===void 0||To(i.position,o)!==To(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(Xa.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),F(r,(e,t)=>{e||delete n[t]}),F(n,e=>{ta.configure(this,e,e.options),ta.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(Eo(`order`,`index`))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){let r=t[n],i=this.getDatasetMeta(n),a=r.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=a,i.indexAxis=r.indexAxis||no(a,this.options),i.order=r.order||0,i.index=n,i.label=``+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{let t=Xa.getController(a),{datasetElementType:r,dataElementType:o}=H.datasets[a];Object.assign(t,{dataElementType:Xa.getElement(o),datasetElementType:r&&Xa.getElement(r)}),i.controller=new t(this,n),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){F(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e<t;e++){let{controller:t}=this.getDatasetMeta(e),n=!r&&i.indexOf(t)===-1;t.buildOrUpdateElements(n),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),r||F(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(Eo(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){F(this.scales,e=>{ta.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!ze(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)Mo(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;e<t;e++)if(!ze(r,n(e)))return;return Array.from(r).map(e=>e.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;ta.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],F(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,Re(e)?e({datasetIndex:t}):e);this.notifyPlugins(`afterDatasetsUpdate`,{mode:e})}}_updateDataset(e,t){let n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins(`beforeDatasetUpdate`,r)!==!1&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins(`afterDatasetUpdate`,r))}render(){this.notifyPlugins(`beforeRender`,{cancelable:!0})!==!1&&(Pr.has(this)?this.attached&&!Pr.running(this)&&Pr.start(this):(this.draw(),Do({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins(`beforeDraw`,{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins(`afterDraw`)}_getSortedDatasetMetas(e){let t=this._sortedMetasets,n=[],r,i;for(r=0,i=t.length;r<i;++r){let i=t[r];(!e||i.visible)&&n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins(`beforeDatasetsDraw`,{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Nr(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&tn(t,r),e.controller.draw(),r&&nn(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return en(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Ri.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=yn(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);Le(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Pr.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins(`beforeDestroy`);let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Zt(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Ao[this.id],this.notifyPlugins(`afterDestroy`)}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};F(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){F(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},F(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o<s;++o){a=e[o];let t=a&&this.getDatasetMeta(a.datasetIndex).controller;t&&t[r+`HoverStyle`](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});Te(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=Be(e),c=No(e,this._lastEvent,n,s);n&&(this._lastEvent=null,P(i.onHover,[e,o,this],this),s&&P(i.onClick,[e,o,this],this));let l=!Te(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Fo(){return F(Po.instances,e=>e._plugins.invalidate())}function Io(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,z(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,z(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*z(r-n));if(u===`round`)e.arc(i,a,t,n-I/2,r+I/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+I/2)+i,c=-o*Math.sin(n+I/2)+a,l=o*Math.cos(r+I/2)+i,u=o*Math.sin(r+I/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function Lo(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+R,r-R),e.closePath(),e.clip()}function Ro(e){return hn(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function zo(e,t,n,r){let i=Ro(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return B(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:B(i.innerStart,0,o),innerEnd:B(i.innerEnd,0,o)}}function Bo(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Vo(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/I)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=zo(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,ee=g+b/E,te=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=Bo(C,T,o,s);e.arc(t.x,t.y,y,T,_+R)}let n=Bo(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=Bo(D,te,o,s);e.arc(t.x,t.y,x,_+R,te+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=Bo(E,ee,o,s);e.arc(t.x,t.y,b,ee+Math.PI,g-R)}let i=Bo(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=Bo(S,w,o,s);e.arc(t.x,t.y,v,g-R,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function Ho(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Vo(e,t,n,r,c,i);for(let t=0;t<a;++t)e.fill();isNaN(s)||(c=o+(s%L||L))}return Vo(e,t,n,r,c,i),e.fill(),c}function Uo(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=c,m=c.borderAlign===`inner`;if(!l)return;e.setLineDash(d||[]),e.lineDashOffset=f,m?(e.lineWidth=l*2,e.lineJoin=u||`round`):(e.lineWidth=l,e.lineJoin=u||`bevel`);let h=t.endAngle;if(a){Vo(e,t,n,r,h,i);for(let t=0;t<a;++t)e.stroke();isNaN(s)||(h=o+(s%L||L))}m&&Lo(e,t,h),c.selfJoin&&h-o>=I&&p===0&&u!==`miter`&&Io(e,t,h),a||(Vo(e,t,n,r,h,i),e.stroke())}var Wo=class extends Ta{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=it(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=N(l,o-a),f=st(r,a,o)&&a!==o,p=d>=L||f,m=lt(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>L?Math.floor(n/L):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(I,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Ho(e,this,s,i,a),Uo(e,this,s,i,a),e.restore()}};function Go(e,t,n=t){e.lineCap=N(n.borderCapStyle,t.borderCapStyle),e.setLineDash(N(n.borderDash,t.borderDash)),e.lineDashOffset=N(n.borderDashOffset,t.borderDashOffset),e.lineJoin=N(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=N(n.borderWidth,t.borderWidth),e.strokeStyle=N(n.borderColor,t.borderColor)}function Ko(e,t,n){e.lineTo(n.x,n.y)}function qo(e){return e.stepped?rn:e.tension||e.cubicInterpolationMode===`monotone`?an:Ko}function Jo(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=i<o&&a<o||i>s&&a>s;return{count:r,start:c,loop:t.loop,ilen:l<c&&!u?r+l-c:l-c}}function Yo(e,t,n,r){let{points:i,options:a}=t,{count:o,start:s,loop:c,ilen:l}=Jo(i,n,r),u=qo(a),{move:d=!0,reverse:f}=r||{},p,m,h;for(p=0;p<=l;++p)m=i[(s+(f?l-p:p))%o],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,h,m,f,a.stepped),h=m);return c&&(m=i[(s+(f?l:0))%o],u(e,h,m,f,a.stepped)),!!c}function Xo(e,t,n,r){let i=t.points,{count:a,start:o,ilen:s}=Jo(i,n,r),{move:c=!0,reverse:l}=r||{},u=0,d=0,f,p,m,h,g,_,v=e=>(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(n<h?h=n:n>g&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function Zo(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?Xo:Yo}function Qo(e){return e.stepped?fr:e.tension||e.cubicInterpolationMode===`monotone`?pr:dr}function $o(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Go(e,t.options),e.stroke(i)}function es(e,t,n,r){let{segments:i,options:a}=t,o=Zo(t);for(let s of i)Go(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var ts=typeof Path2D==`function`;function ns(e,t,n,r){ts&&!t.options.segment?$o(e,t,n,r):es(e,t,n,r)}var rs=class extends Ta{static id=`line`;static defaults={borderCapStyle:`butt`,borderDash:[],borderDashOffset:0,borderJoinStyle:`miter`,borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:`default`,fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`&&e!==`fill`};constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Jn(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=Er(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=Cr(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=Qo(n),c,l;for(c=0,l=a.length;c<l;++c){let{start:l,end:u}=a[c],d=i[l],f=i[u];if(d===f){o.push(d);continue}let p=s(d,f,Math.abs((r-d[t])/(f[t]-d[t])),n.stepped);p[t]=e[t],o.push(p)}return o.length===1?o[0]:o}pathSegment(e,t,n){return Zo(this)(e,this,t,n)}path(e,t,n){let r=this.segments,i=Zo(this),a=this._loop;t||=0,n||=this.points.length-t;for(let o of r)a&=i(e,this,o,{start:t,end:t+n-1});return!!a}draw(e,t,n,r){let i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),ns(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function is(e,t,n,r){let i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}var as=class extends Ta{static id=`point`;parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:`circle`,radius:3,rotation:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){let r=this.options,{x:i,y:a}=this.getProps([`x`,`y`],n);return(e-i)**2+(t-a)**2<(r.hitRadius+r.radius)**2}inXRange(e,t){return is(this,e,`x`,t)}inYRange(e,t){return is(this,e,`y`,t)}getCenterPoint(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);let n=t&&e.borderWidth||0;return(t+n)*2}draw(e,t){let n=this.options;this.skip||n.radius<.1||!en(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Qt(e,n,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};function os(e,t){let{x:n,y:r,base:i,width:a,height:o}=e.getProps([`x`,`y`,`base`,`width`,`height`],t),s,c,l,u,d;return e.horizontal?(d=o/2,s=Math.min(n,i),c=Math.max(n,i),l=r-d,u=r+d):(d=a/2,s=n-d,c=n+d,l=Math.min(r,i),u=Math.max(r,i)),{left:s,top:l,right:c,bottom:u}}function ss(e,t,n,r){return e?0:B(t,n,r)}function cs(e,t,n){let r=e.options.borderWidth,i=e.borderSkipped,a=gn(r);return{t:ss(i.top,a.top,0,n),r:ss(i.right,a.right,0,t),b:ss(i.bottom,a.bottom,0,n),l:ss(i.left,a.left,0,t)}}function ls(e,t,n){let{enableBorderRadius:r}=e.getProps([`enableBorderRadius`]),i=e.options.borderRadius,a=_n(i),o=Math.min(t,n),s=e.borderSkipped,c=r||j(i);return{topLeft:ss(!c||s.top||s.left,a.topLeft,0,o),topRight:ss(!c||s.top||s.right,a.topRight,0,o),bottomLeft:ss(!c||s.bottom||s.left,a.bottomLeft,0,o),bottomRight:ss(!c||s.bottom||s.right,a.bottomRight,0,o)}}function us(e){let t=os(e),n=t.right-t.left,r=t.bottom-t.top,i=cs(e,n/2,r/2),a=ls(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function ds(e,t,n,r){let i=t===null,a=n===null,o=e&&!(i&&a)&&os(e,r);return o&&(i||lt(t,o.left,o.right))&&(a||lt(n,o.top,o.bottom))}function fs(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function ps(e,t){e.rect(t.x,t.y,t.w,t.h)}function ms(e,t,n={}){let r=e.x===n.x?0:-t,i=e.y===n.y?0:-t,a=(e.x+e.w===n.x+n.w?0:t)-r,o=(e.y+e.h===n.y+n.h?0:t)-i;return{x:e.x+r,y:e.y+i,w:e.w+a,h:e.h+o,radius:e.radius}}var hs=class extends Ta{static id=`bar`;static defaults={borderSkipped:`start`,borderWidth:0,borderRadius:0,inflateAmount:`auto`,pointStyle:void 0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};constructor(e){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,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:i,outer:a}=us(this),o=fs(a.radius)?un:ps;e.save(),(a.w!==i.w||a.h!==i.h)&&(e.beginPath(),o(e,ms(a,t,i)),e.clip(),o(e,ms(i,-t,a)),e.fillStyle=n,e.fill(`evenodd`)),e.beginPath(),o(e,ms(i,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return ds(this,e,t,n)}inXRange(e,t){return ds(this,e,null,t)}inYRange(e,t){return ds(this,null,e,t)}getCenterPoint(e){let{x:t,y:n,base:r,horizontal:i}=this.getProps([`x`,`y`,`base`,`horizontal`],e);return{x:i?(t+r)/2:t,y:i?n:(n+r)/2}}getRange(e){return e===`x`?this.width/2:this.height/2}};function gs(e,t,n){let r=e.segments,i=e.points,a=t.points,o=[];for(let e of r){let{start:r,end:s}=e;s=ys(r,s,i);let c=_s(n,i[r],i[s],e.loop);if(!t.segments){o.push({source:e,target:c,start:i[r],end:i[s]});continue}let l=Cr(t,c);for(let t of l){let r=_s(n,a[t.start],a[t.end],t.loop),s=Sr(e,i,r);for(let e of s)o.push({source:e,target:t,start:{[n]:bs(c,r,`start`,Math.max)},end:{[n]:bs(c,r,`end`,Math.min)}})}}return o}function _s(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e===`angle`&&(i=z(i),a=z(a)),{property:e,start:i,end:a}}function vs(e,t){let{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:e,end:t})=>{t=ys(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function ys(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function bs(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function xs(e,t){let n=[],r=!1;return A(e)?(r=!0,n=e):n=vs(e,t),n.length?new rs({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Ss(e){return e&&e.fill!==!1}function Cs(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!M(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function ws(e,t,n){let r=Os(e);if(j(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return M(i)&&Math.floor(i)===i?Ts(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function Ts(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function Es(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:j(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Ds(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:j(e)?e.value:t.getBaseValue(),r}function Os(e){let t=e.options,n=t.fill,r=N(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function ks(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=As(t,n);s.push(xs({x:null,y:t.bottom},r));for(let e=0;e<a.length;e++){let t=a[e];for(let e=t.start;e<=t.end;e++)js(i,o[e],s)}return new rs({points:i,options:{}})}function As(e,t){let n=[],r=e.getMatchingVisibleMetas(`line`);for(let e=0;e<r.length;e++){let i=r[e];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function js(e,t,n){let r=[];for(let i=0;i<n.length;i++){let a=n[i],{first:o,last:s,point:c}=Ms(a,t,`x`);if(!(!c||o&&s)){if(o)r.unshift(c);else if(e.push(c),!s)break}}e.push(...r)}function Ms(e,t,n){let r=e.interpolate(t,n);if(!r)return{};let i=r[n],a=e.segments,o=e.points,s=!1,c=!1;for(let e=0;e<a.length;e++){let t=a[e],r=o[t.start][n],l=o[t.end][n];if(lt(i,r,l)){s=i===r,c=i===l;break}}return{first:s,last:c,point:r}}var Ns=class{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){let{x:r,y:i,radius:a}=this;return t||={start:0,end:L},e.arc(r,i,a,t.end,t.start,!0),!n.bounds}interpolate(e){let{x:t,y:n,radius:r}=this,i=e.angle;return{x:t+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}};function Ps(e){let{chart:t,fill:n,line:r}=e;if(M(n))return Fs(t,n);if(n===`stack`)return ks(e);if(n===`shape`)return!0;let i=Is(e);return i instanceof Ns?i:xs(i,r)}function Fs(e,t){let n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Is(e){return(e.scale||{}).getPointPositionForValue?Rs(e):Ls(e)}function Ls(e){let{scale:t={},fill:n}=e,r=Es(n,t);if(M(r)){let e=t.isHorizontal();return{x:e?r:null,y:e?null:r}}return null}function Rs(e){let{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,o=Ds(n,t,a),s=[];if(r.grid.circular){let e=t.getPointPositionForValue(0,a);return new Ns({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(o)})}for(let e=0;e<i;++e)s.push(t.getPointPositionForValue(e,o));return s}function zs(e,t,n){let r=Ps(t),{chart:i,index:a,line:o,scale:s,axis:c}=t,l=o.options,u=l.fill,d=l.backgroundColor,{above:f=d,below:p=d}=u||{},m=Nr(i,i.getDatasetMeta(a));r&&o.points.length&&(tn(e,n),Bs(e,{line:o,target:r,above:f,below:p,area:n,scale:s,axis:c,clip:m}),nn(e))}function Bs(e,t){let{line:n,target:r,above:i,below:a,area:o,scale:s,clip:c}=t,l=n._loop?`angle`:t.axis;e.save();let u=a;a!==i&&(l===`x`?(Vs(e,r,o.top),Us(e,{line:n,target:r,color:i,scale:s,property:l,clip:c}),e.restore(),e.save(),Vs(e,r,o.bottom)):l===`y`&&(Hs(e,r,o.left),Us(e,{line:n,target:r,color:a,scale:s,property:l,clip:c}),e.restore(),e.save(),Hs(e,r,o.right),u=i)),Us(e,{line:n,target:r,color:u,scale:s,property:l,clip:c}),e.restore()}function Vs(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[ys(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(l.x,n),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(u.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Hs(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[ys(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(n,l.y),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(n,u.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Us(e,t){let{line:n,target:r,property:i,color:a,scale:o,clip:s}=t,c=gs(n,r,i);for(let{source:t,target:l,start:u,end:d}of c){let{style:{backgroundColor:c=a}={}}=t,f=r!==!0;e.save(),e.fillStyle=c,Ws(e,o,s,f&&_s(i,u,d)),e.beginPath();let p=!!n.pathSegment(e,t),m;if(f){p?e.closePath():Gs(e,r,d,i);let t=!!r.pathSegment(e,l,{move:p,reverse:!0});m=p&&t,m||Gs(e,r,u,i)}e.closePath(),e.fill(m?`evenodd`:`nonzero`),e.restore()}}function Ws(e,t,n,r){let i=t.chart.chartArea,{property:a,start:o,end:s}=r||{};if(a===`x`||a===`y`){let t,r,c,l;a===`x`?(t=o,r=i.top,c=s,l=i.bottom):(t=i.left,r=o,c=i.right,l=s),e.beginPath(),n&&(t=Math.max(t,n.left),c=Math.min(c,n.right),r=Math.max(r,n.top),l=Math.min(l,n.bottom)),e.rect(t,r,c-t,l-r),e.clip()}}function Gs(e,t,n,r){let i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Ks={id:`filler`,afterDatasetsUpdate(e,t,n){let r=(e.data.datasets||[]).length,i=[],a,o,s,c;for(o=0;o<r;++o)a=e.getDatasetMeta(o),s=a.dataset,c=null,s&&s.options&&s instanceof rs&&(c={visible:e.isDatasetVisible(o),index:o,fill:ws(s,o,r),chart:e,axis:a.controller.options.indexAxis,scale:a.vScale,line:s}),a.$filler=c,i.push(c);for(o=0;o<r;++o)c=i[o],!(!c||c.fill===!1)&&(c.fill=Cs(i,o,n.propagate))},beforeDraw(e,t,n){let r=n.drawTime===`beforeDraw`,i=e.getSortedVisibleDatasetMetas(),a=e.chartArea;for(let t=i.length-1;t>=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&zs(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;Ss(n)&&zs(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;!Ss(r)||n.drawTime!==`beforeDatasetDraw`||zs(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},qs=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Js=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Ys=class extends Ta{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=P(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=W(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=qs(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=Xs(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=gr(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=V(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=V(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=V(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=V(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;tn(e,this),this._draw(),nn(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=H.color,s=gr(e.rtl,this.left,this.width),c=W(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=qs(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=N(n.lineWidth,1);if(r.fillStyle=N(n.fillStyle,o),r.lineCap=N(n.lineCap,`butt`),r.lineDashOffset=N(n.lineDashOffset,0),r.lineJoin=N(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=N(n.strokeStyle,o),r.setLineDash(N(n.lineDash,[])),a.usePointStyle)$t(r,{radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},s.xPlus(e,p/2),t+d,a.pointStyleWidth&&p);else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=_n(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?un(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){ln(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:V(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:V(i,this.top+y+l,this.bottom-t[0].height),line:0},_r(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;if(s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=V(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=V(i,this.top+y+l,this.bottom-t[f.line].height)),g(s.x(S),C,o),S=St(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=$s(o,e)+l}else f.y+=b}),vr(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=W(t.font),r=U(t.padding);if(!t.display)return;let i=gr(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=V(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+V(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=V(o,u,u+d);a.textAlign=i.textAlign(xt(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,ln(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=W(e.font),n=U(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(lt(e,this.left,this.right)&<(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],lt(e,r.left,r.left+r.width)&<(t,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){let t=this.options;if(!ec(e.type,t))return;let n=this._getLegendItemAt(e.x,e.y);if(e.type===`mousemove`||e.type===`mouseout`){let r=this._hoveredItem,i=Js(r,n);r&&!i&&P(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!i&&P(t.onHover,[e,n,this],this)}else n&&P(t.onClick,[e,n,this],this)}};function Xs(e,t,n,r,i){return{itemWidth:Zs(r,e,t,n),itemHeight:Qs(i,r,t.lineHeight)}}function Zs(e,t,n,r){let i=e.text;return i&&typeof i!=`string`&&(i=i.reduce((e,t)=>e.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function Qs(e,t,n){let r=e;return typeof t.text!=`string`&&(r=$s(t,n)),r}function $s(e,t){return t*(e.text?e.text.length:0)}function ec(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var tc={id:`legend`,_element:Ys,start(e,t,n){let r=e.legend=new Ys({ctx:e.ctx,options:n,chart:e});ta.configure(e,r,n),ta.addBox(e,r)},stop(e){ta.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;ta.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=U(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},nc=class extends Ta{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let r=A(n.text)?n.text.length:1;this._padding=U(n.padding);let i=r*W(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){let e=this.options.position;return e===`top`||e===`bottom`}_drawArgs(e){let{top:t,left:n,bottom:r,right:i,options:a}=this,o=a.align,s=0,c,l,u;return this.isHorizontal()?(l=V(o,n,i),u=t+e,c=i-n):(a.position===`left`?(l=n+e,u=V(o,r,t),s=I*-.5):(l=i-e,u=V(o,t,r),s=I*.5),c=r-t),{titleX:l,titleY:u,maxWidth:c,rotation:s}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let n=W(t.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:o,rotation:s}=this._drawArgs(r);ln(e,t.text,0,0,n,{color:t.color,maxWidth:o,rotation:s,textAlign:xt(t.align),textBaseline:`middle`,translation:[i,a]})}};function rc(e,t){let n=new nc({ctx:e.ctx,options:t,chart:e});ta.configure(e,n,t),ta.addBox(e,n),e.titleBlock=n}var ic={id:`title`,_element:nc,start(e,t,n){rc(e,n)},stop(e){let t=e.titleBlock;ta.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let r=e.titleBlock;ta.configure(e,r,n),r.options=n},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}},ac={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){let n=e[t].element;if(n&&n.hasValue()){let e=n.tooltipPosition();r.add(e.x),i+=e.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((e,t)=>e+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a<o;++a){let n=e[a].element;if(n&&n.hasValue()){let e=at(t,n.getCenterPoint());e<i&&(i=e,s=n)}}if(s){let e=s.tooltipPosition();n=e.x,r=e.y}return{x:n,y:r}}};function oc(e,t){return t&&(A(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function sc(e){return(typeof e==`string`||e instanceof String)&&e.indexOf(`
|
|
1
|
+
import{A as e,T as t,i as n}from"./iframe-DvGneWFZ.js";import{t as r}from"./jsx-runtime-S4TgXXQD.js";function i(e){return e+.5|0}var a=(e,t,n)=>Math.max(Math.min(e,n),t);function o(e){return a(i(e*2.55),0,255)}function s(e){return a(i(e*255),0,255)}function c(e){return a(i(e/2.55)/100,0,1)}function l(e){return a(i(e*100),0,100)}var u={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},d=[...`0123456789ABCDEF`],f=e=>d[e&15],p=e=>d[(e&240)>>4]+d[e&15],m=e=>(e&240)>>4==(e&15),h=e=>m(e.r)&&m(e.g)&&m(e.b)&&m(e.a);function g(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&u[e[1]]*17,g:255&u[e[2]]*17,b:255&u[e[3]]*17,a:t===5?u[e[4]]*17:255}:(t===7||t===9)&&(n={r:u[e[1]]<<4|u[e[2]],g:u[e[3]]<<4|u[e[4]],b:u[e[5]]<<4|u[e[6]],a:t===9?u[e[7]]<<4|u[e[8]]:255})),n}var _=(e,t)=>e<255?t(e):``;function v(e){var t=h(e)?f:p;return e?`#`+t(e.r)+t(e.g)+t(e.b)+_(e.a,t):void 0}var y=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function b(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function x(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function S(e,t,n){let r=b(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function C(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function w(e){let t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c,l;return i!==a&&(l=i-a,c=o>.5?l/(2-i-a):l/(i+a),s=C(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function T(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(s)}function E(e,t,n){return T(b,e,t,n)}function D(e,t,n){return T(S,e,t,n)}function ee(e,t,n){return T(x,e,t,n)}function te(e){return(e%360+360)%360}function ne(e){let t=y.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?o(+t[5]):s(+t[5]));let i=te(+t[2]),a=t[3]/100,c=t[4]/100;return r=t[1]===`hwb`?D(i,a,c):t[1]===`hsv`?ee(i,a,c):E(i,a,c),{r:r[0],g:r[1],b:r[2],a:n}}function re(e,t){var n=w(e);n[0]=te(n[0]+t),n=E(n),e.r=n[0],e.g=n[1],e.b=n[2]}function ie(e){if(!e)return;let t=w(e),n=t[0],r=l(t[1]),i=l(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${c(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var ae={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`},oe={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 se(){let e={},t=Object.keys(oe),n=Object.keys(ae),r,i,a,o,s;for(r=0;r<t.length;r++){for(o=s=t[r],i=0;i<n.length;i++)a=n[i],s=s.replace(a,ae[a]);a=parseInt(oe[o],16),e[s]=[a>>16&255,a>>8&255,a&255]}return e}var ce;function le(e){ce||(ce=se(),ce.transparent=[0,0,0,0]);let t=ce[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var ue=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function de(e){let t=ue.exec(e),n=255,r,i,s;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?o(e):a(e*255,0,255)}return r=+t[1],i=+t[3],s=+t[5],r=255&(t[2]?o(r):a(r,0,255)),i=255&(t[4]?o(i):a(i,0,255)),s=255&(t[6]?o(s):a(s,0,255)),{r,g:i,b:s,a:n}}}function fe(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${c(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var pe=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,me=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function he(e,t,n){let r=me(c(e.r)),i=me(c(e.g)),a=me(c(e.b));return{r:s(pe(r+n*(me(c(t.r))-r))),g:s(pe(i+n*(me(c(t.g))-i))),b:s(pe(a+n*(me(c(t.b))-a))),a:e.a+n*(t.a-e.a)}}function ge(e,t,n){if(e){let r=w(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=E(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function O(e,t){return e&&Object.assign(t||{},e)}function _e(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=s(e[3]))):(t=O(e,{r:0,g:0,b:0,a:1}),t.a=s(t.a)),t}function ve(e){return e.charAt(0)===`r`?de(e):ne(e)}var ye=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=_e(t):n===`string`&&(r=g(t)||le(t)||ve(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=O(this._rgb);return e&&(e.a=c(e.a)),e}set rgb(e){this._rgb=_e(e)}rgbString(){return this._valid?fe(this._rgb):void 0}hexString(){return this._valid?v(this._rgb):void 0}hslString(){return this._valid?ie(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=he(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=s(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=i(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return ge(this._rgb,2,e),this}darken(e){return ge(this._rgb,2,-e),this}saturate(e){return ge(this._rgb,1,e),this}desaturate(e){return ge(this._rgb,1,-e),this}rotate(e){return re(this._rgb,e),this}};function be(){}var xe=(()=>{let e=0;return()=>e++})();function k(e){return e==null}function A(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function j(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function M(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function Se(e,t){return M(e)?e:t}function N(e,t){return e===void 0?t:e}var Ce=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,we=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function P(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function F(e,t,n,r){let i,a,o;if(A(e))if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<a;i++)t.call(n,e[i],i);else if(j(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function Te(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function Ee(e){if(A(e))return e.map(Ee);if(j(e)){let t=Object.create(null),n=Object.keys(e),r=n.length,i=0;for(;i<r;++i)t[n[i]]=Ee(e[n[i]]);return t}return e}function De(e){return[`__proto__`,`prototype`,`constructor`].indexOf(e)===-1}function Oe(e,t,n,r){if(!De(e))return;let i=t[e],a=n[e];j(i)&&j(a)?ke(i,a,r):t[e]=Ee(a)}function ke(e,t,n){let r=A(t)?t:[t],i=r.length;if(!j(e))return e;n||={};let a=n.merger||Oe,o;for(let t=0;t<i;++t){if(o=r[t],!j(o))continue;let i=Object.keys(o);for(let t=0,r=i.length;t<r;++t)a(i[t],e,o,n)}return e}function Ae(e,t){return ke(e,t,{merger:je})}function je(e,t,n){if(!De(e))return;let r=t[e],i=n[e];j(r)&&j(i)?Ae(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ee(i))}var Me={"":e=>e,x:e=>e.x,y:e=>e.y};function Ne(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function Pe(e){let t=Ne(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Fe(e,t){return(Me[t]||(Me[t]=Pe(t)))(e)}function Ie(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Le=e=>e!==void 0,Re=e=>typeof e==`function`,ze=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Be(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var I=Math.PI,L=2*I,Ve=L+I,He=1/0,Ue=I/180,R=I/2,We=I/4,Ge=I*2/3,Ke=Math.log10,qe=Math.sign;function Je(e,t,n){return Math.abs(e-t)<n}function Ye(e){let t=Math.round(e);e=Je(e,t,e/1e3)?t:e;let n=10**Math.floor(Ke(e)),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Xe(e){let t=[],n=Math.sqrt(e),r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((e,t)=>e-t).pop(),t}function Ze(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function Qe(e){return!Ze(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function $e(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function et(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function tt(e){return I/180*e}function nt(e){return 180/I*e}function rt(e){if(!M(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function it(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a<-.5*I&&(a+=L),{angle:a,distance:i}}function at(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function ot(e,t){return(e-t+Ve)%L-I}function z(e){return(e%L+L)%L}function st(e,t,n,r){let i=z(e),a=z(t),o=z(n),s=z(a-i),c=z(o-i),l=z(i-a),u=z(i-o);return i===a||i===o||r&&a===o||s>c&&l<u}function B(e,t,n){return Math.max(t,Math.min(n,e))}function ct(e){return B(e,-32768,32767)}function lt(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ut(e,t,n){n||=(n=>e[n]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var dt=(e,t,n,r)=>ut(e,n,r?r=>{let i=e[r][t];return i<n||i===n&&e[r+1][t]===n}:r=>e[r][t]<n),ft=(e,t,n)=>ut(e,n,r=>e[r][t]>=n);function pt(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}var mt=[`push`,`pop`,`shift`,`splice`,`unshift`];function ht(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,`_chartjs`,{configurable:!0,enumerable:!1,value:{listeners:[t]}}),mt.forEach(t=>{let n=`_onData`+Ie(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function gt(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(mt.forEach(t=>{delete e[t]}),delete e._chartjs)}function _t(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var vt=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function yt(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,vt.call(window,()=>{r=!1,e.apply(t,n)}))}}function bt(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var xt=e=>e===`start`?`left`:e===`end`?`right`:`center`,V=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,St=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function Ct(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(dt(c,u,d).lo,n?r:dt(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!k(e[s.axis]));i-=Math.max(0,e)}i=B(i,0,r-1)}if(m){let e=Math.max(dt(c,o.axis,f,!0).hi+1,n?0:dt(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!k(e[s.axis]));e+=Math.max(0,t)}a=B(e,i,r)-i}else a=r-i}return{start:i,count:a}}function wt(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var Tt=e=>e===0||e===1,Et=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*L/n)),Dt=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*L/n)+1,Ot={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*R)+1,easeOutSine:e=>Math.sin(e*R),easeInOutSine:e=>-.5*(Math.cos(I*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>Tt(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Tt(e)?e:Et(e,.075,.3),easeOutElastic:e=>Tt(e)?e:Dt(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return Tt(e)?e:e<.5?.5*Et(e*2,t,n):.5+.5*Dt(e*2-1,t,n)},easeInBack(e){let t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){let t=1.70158;return--e*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Ot.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?Ot.easeInBounce(e*2)*.5:Ot.easeOutBounce(e*2-1)*.5+.5};function kt(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function At(e){return kt(e)?e:new ye(e)}function jt(e){return kt(e)?e:new ye(e).saturate(.5).darken(.1).hexString()}var Mt=[`x`,`y`,`borderWidth`,`radius`,`tension`],Nt=[`color`,`borderColor`,`backgroundColor`];function Pt(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:Nt},numbers:{type:`number`,properties:Mt}}),e.describe(`animations`,{_fallback:`animation`}),e.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:e=>e|0}}}})}function Ft(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var It=new Map;function Lt(e,t){t||={};let n=e+JSON.stringify(t),r=It.get(n);return r||(r=new Intl.NumberFormat(e,t),It.set(n,r)),r}function Rt(e,t,n){return Lt(t,n).format(e)}var zt={values(e){return A(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Bt(e,n)}let o=Ke(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Rt(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Ke(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?zt.numeric.call(this,e,t,n):``}};function Bt(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Vt={formatters:zt};function Ht(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Vt.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var Ut=Object.create(null),Wt=Object.create(null);function Gt(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;t<r;++t){let r=n[t];e=e[r]||(e[r]=Object.create(null))}return e}function Kt(e,t,n){return typeof t==`string`?ke(Gt(e,t),n):ke(Gt(e,``),t)}var H=new class{constructor(e,t){this.animation=void 0,this.backgroundColor=`rgba(0,0,0,0.1)`,this.borderColor=`rgba(0,0,0,0.1)`,this.color=`#666`,this.datasets={},this.devicePixelRatio=e=>e.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=(e,t)=>jt(t.backgroundColor),this.hoverBorderColor=(e,t)=>jt(t.borderColor),this.hoverColor=(e,t)=>jt(t.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(e),this.apply(t)}set(e,t){return Kt(this,e,t)}get(e){return Gt(this,e)}describe(e,t){return Kt(Wt,e,t)}override(e,t){return Kt(Ut,e,t)}route(e,t,n,r){let i=Gt(this,e),a=Gt(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return j(e)?Object.assign({},t,e):N(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Pt,Ft,Ht]);function qt(e){return!e||k(e.size)||k(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Jt(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Yt(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;c<s;c++)if(d=n[c],d!=null&&!A(d))o=Jt(e,i,a,o,d);else if(A(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!A(f)&&(o=Jt(e,i,a,o,f));e.restore();let p=a.length/2;if(p>n.length){for(c=0;c<p;c++)delete i[a[c]];a.splice(0,p)}return o}function Xt(e,t,n){let r=e.currentDevicePixelRatio,i=n===0?0:Math.max(n/2,.5);return Math.round((t-i)*r)/r+i}function Zt(e,t){!t&&!e||(t||=e.getContext(`2d`),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Qt(e,t,n,r){$t(e,t,n,r,null)}function $t(e,t,n,r,i){let a,o,s,c,l,u,d,f,p=t.pointStyle,m=t.rotation,h=t.radius,g=(m||0)*Ue;if(p&&typeof p==`object`&&(a=p.toString(),a===`[object HTMLImageElement]`||a===`[object HTMLCanvasElement]`)){e.save(),e.translate(n,r),e.rotate(g),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(h)||h<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,h,0,0,L):e.arc(n,r,h,0,L),e.closePath();break;case`triangle`:u=i?i/2:h,e.moveTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Ge,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Ge,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),e.closePath();break;case`rectRounded`:l=h*.516,c=h-l,o=Math.cos(g+We)*c,d=Math.cos(g+We)*(i?i/2-l:c),s=Math.sin(g+We)*c,f=Math.sin(g+We)*(i?i/2-l:c),e.arc(n-d,r-s,l,g-I,g-R),e.arc(n+f,r-o,l,g-R,g),e.arc(n+d,r+s,l,g,g+R),e.arc(n-f,r+o,l,g+R,g+I),e.closePath();break;case`rect`:if(!m){c=Math.SQRT1_2*h,u=i?i/2:c,e.rect(n-u,r-c,2*u,2*c);break}g+=We;case`rectRot`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+f,r-o),e.lineTo(n+d,r+s),e.lineTo(n-f,r+o),e.closePath();break;case`crossRot`:g+=We;case`cross`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`star`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),g+=We,d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`line`:o=i?i/2:Math.cos(g)*h,s=Math.sin(g)*h,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case`dash`:e.moveTo(n,r),e.lineTo(n+Math.cos(g)*(i?i/2:h),r+Math.sin(g)*h);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function en(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function tn(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function nn(e){e.restore()}function rn(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i===`middle`){let r=(t.x+n.x)/2;e.lineTo(r,t.y),e.lineTo(r,n.y)}else i===`after`==!!r?e.lineTo(n.x,t.y):e.lineTo(t.x,n.y);e.lineTo(n.x,n.y)}function an(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function on(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),k(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function sn(e,t,n,r,i){if(i.strikethrough||i.underline){let a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,c=n-a.actualBoundingBoxAscent,l=n+a.actualBoundingBoxDescent,u=i.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(s,u),e.stroke()}}function cn(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function ln(e,t,n,r,i,a={}){let o=A(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,on(e,a),c=0;c<o.length;++c)l=o[c],a.backdrop&&cn(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),k(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(l,n,r,a.maxWidth)),e.fillText(l,n,r,a.maxWidth),sn(e,n,r,l,a),r+=Number(i.lineHeight);e.restore()}function un(e,t){let{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*I,I,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,I,R,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,R,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-R,!0),e.lineTo(n+o.topLeft,r)}var dn=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,fn=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function pn(e,t){let n=(``+e).match(dn);if(!n||n[1]===`normal`)return t*1.2;switch(e=+n[2],n[3]){case`px`:return e;case`%`:e/=100;break}return t*e}var mn=e=>+e||0;function hn(e,t){let n={},r=j(t),i=r?Object.keys(t):t,a=j(e)?r?n=>N(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=mn(a(e));return n}function gn(e){return hn(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function _n(e){return hn(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function U(e){let t=gn(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function W(e,t){e||={},t||=H.font;let n=N(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=N(e.style,t.style);r&&!(``+r).match(fn)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:N(e.family,t.family),lineHeight:pn(N(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:N(e.weight,t.weight),string:``};return i.string=qt(i),i}function G(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;a<o;++a)if(s=e[a],s!==void 0&&(t!==void 0&&typeof s==`function`&&(s=s(t),i=!1),n!==void 0&&A(s)&&(s=s[n%s.length],i=!1),s!==void 0))return r&&!i&&(r.cacheable=!1),s}function vn(e,t,n){let{min:r,max:i}=e,a=we(t,(i-r)/2),o=(e,t)=>n&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function yn(e,t){return Object.assign(Object.create(e),t)}function bn(e,t=[``],n,r,i=()=>e[0]){let a=n||e;r===void 0&&(r=In(`_fallback`,e));let o={[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>bn([n,...e],t,a,r)};return new Proxy(o,{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return Tn(n,r,()=>Fn(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Ln(e).includes(t)},ownKeys(e){return Ln(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function xn(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Sn(e,r),setContext:t=>xn(e,t,n,r),override:i=>xn(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return Tn(e,t,()=>En(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function Sn(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Re(n)?n:()=>n,isIndexable:Re(r)?r:()=>r}}var Cn=(e,t)=>e?e+Ie(t):t,wn=(e,t)=>j(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Tn(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function En(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Re(s)&&o.isScriptable(t)&&(s=Dn(t,s,e,n)),A(s)&&s.length&&(s=On(t,s,e,o.isIndexable)),wn(t,s)&&(s=xn(s,i,a&&a[t],o)),s}function Dn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),wn(e,c)&&(c=Mn(i._scopes,i,e,c)),c}function On(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(j(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Mn(r,i,e,c);t.push(xn(n,a,o&&o[e],s))}}return t}function kn(e,t,n){return Re(e)?e(t,n):e}var An=(e,t)=>e===!0?t:typeof e==`string`?Fe(t,e):void 0;function jn(e,t,n,r,i){for(let a of t){let t=An(n,a);if(t){e.add(t);let a=kn(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Mn(e,t,n,r){let i=t._rootScopes,a=kn(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Nn(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Nn(s,o,a,c,r),c===null)?!1:bn(Array.from(s),[``],i,a,()=>Pn(t,n,r))}function Nn(e,t,n,r,i){for(;n;)n=jn(e,t,n,r,i);return n}function Pn(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return A(i)&&j(n)?n:i||{}}function Fn(e,t,n,r){let i;for(let a of t)if(i=In(Cn(a,e),n),i!==void 0)return wn(e,i)?Mn(n,r,e,i):i}function In(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Ln(e){let t=e._keys;return t||=e._keys=Rn(e._scopes),t}function Rn(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}var zn=2**-52||1e-14,Bn=(e,t)=>t<e.length&&!e[t].skip&&e[t],Vn=e=>e===`x`?`y`:`x`;function Hn(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=at(a,i),c=at(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Un(e,t,n){let r=e.length,i,a,o,s,c,l=Bn(e,0);for(let u=0;u<r-1;++u)if(c=l,l=Bn(e,u+1),!(!c||!l)){if(Je(t[u],0,zn)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],a=n[u+1]/t[u],s=i**2+a**2,!(s<=9)&&(o=3/Math.sqrt(s),n[u]=i*o*t[u],n[u+1]=a*o*t[u])}}function Wn(e,t,n=`x`){let r=Vn(n),i=e.length,a,o,s,c=Bn(e,0);for(let l=0;l<i;++l){if(o=s,s=c,c=Bn(e,l+1),!s)continue;let i=s[n],u=s[r];o&&(a=(i-o[n])/3,s[`cp1${n}`]=i-a,s[`cp1${r}`]=u-a*t[l]),c&&(a=(c[n]-i)/3,s[`cp2${n}`]=i+a,s[`cp2${r}`]=u+a*t[l])}}function Gn(e,t=`x`){let n=Vn(t),r=e.length,i=Array(r).fill(0),a=Array(r),o,s,c,l=Bn(e,0);for(o=0;o<r;++o)if(s=c,c=l,l=Bn(e,o+1),c){if(l){let e=l[t]-c[t];i[o]=e===0?0:(l[n]-c[n])/e}a[o]=s?l?qe(i[o-1])===qe(i[o])?(i[o-1]+i[o])/2:0:i[o-1]:i[o]}Un(e,i,a),Wn(e,a,t)}function Kn(e,t,n){return Math.max(Math.min(e,n),t)}function qn(e,t){let n,r,i,a,o,s=en(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&en(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=Kn(i.cp1x,t.left,t.right),i.cp1y=Kn(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=Kn(i.cp2x,t.left,t.right),i.cp2y=Kn(i.cp2y,t.top,t.bottom)))}function Jn(e,t,n,r,i){let a,o,s,c;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),t.cubicInterpolationMode===`monotone`)Gn(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;a<o;++a)s=e[a],c=Hn(n,s,e[Math.min(a+1,o-(r?0:1))%o],t.tension),s.cp1x=c.previous.x,s.cp1y=c.previous.y,s.cp2x=c.next.x,s.cp2y=c.next.y,n=s}t.capBezierPoints&&qn(e,n)}function Yn(){return typeof window<`u`&&typeof document<`u`}function Xn(e){let t=e.parentNode;return t&&t.toString()===`[object ShadowRoot]`&&(t=t.host),t}function Zn(e,t,n){let r;return typeof e==`string`?(r=parseInt(e,10),e.indexOf(`%`)!==-1&&(r=r/100*t.parentNode[n])):r=e,r}var Qn=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function $n(e,t){return Qn(e).getPropertyValue(t)}var er=[`top`,`right`,`bottom`,`left`];function tr(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=er[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var nr=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function rr(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(nr(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function ir(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=Qn(n),a=i.boxSizing===`border-box`,o=tr(i,`padding`),s=tr(i,`border`,`width`),{x:c,y:l,box:u}=rr(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function ar(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&Xn(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=Qn(a),s=tr(o,`border`,`width`),c=tr(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Zn(o.maxWidth,a,`clientWidth`),i=Zn(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||He,maxHeight:i||He}}var or=e=>Math.round(e*10)/10;function sr(e,t,n,r){let i=Qn(e),a=tr(i,`margin`),o=Zn(i.maxWidth,e,`clientWidth`)||He,s=Zn(i.maxHeight,e,`clientHeight`)||He,c=ar(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=tr(i,`border`,`width`),t=tr(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=or(Math.min(l,o,c.maxWidth)),u=or(Math.min(u,s,c.maxHeight)),l&&!u&&(u=or(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=or(Math.floor(u*r))),{width:l,height:u}}function cr(e,t,n){let r=t||1,i=or(e.height*r),a=or(e.width*r);e.height=or(e.height),e.width=or(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var lr=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Yn()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function ur(e,t){let n=$n(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function dr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function fr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function pr(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=dr(e,i,n),s=dr(i,a,n),c=dr(a,t,n);return dr(dr(o,s,n),dr(s,c,n),n)}var mr=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},hr=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function gr(e,t,n){return e?mr(t,n):hr()}function _r(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function vr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function yr(e){return e===`angle`?{between:st,compare:ot,normalize:z}:{between:lt,compare:(e,t)=>e-t,normalize:e=>e}}function br({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function xr(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=yr(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;f<p&&o(s(t[l%c][r]),i,a);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:e.style}}function Sr(e,t,n){if(!n)return[e];let{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:c,normalize:l}=yr(r),{start:u,end:d,loop:f,style:p}=xr(e,t,n),m=[],h=!1,g=null,_,v,y,b=()=>c(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(br({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(br({start:g,end:d,loop:f,count:o,style:p})),m}function Cr(e,t){let n=[],r=e.segments;for(let i=0;i<r.length;i++){let a=Sr(r[i],e.points,t);a.length&&n.push(...a)}return n}function wr(e,t,n,r){let i=0,a=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(a+=i);a>i&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function Tr(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function Er(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=wr(n,i,a,r);return r===!0?Dr(e,[{start:o,end:s,loop:a}],n,t):Dr(e,Tr(n,o,s<o?s+i:s,!!e._fullLoop&&o===0&&s===i-1),n,t)}function Dr(e,t,n,r){return!r||!r.setContext||!n?t:Or(e,t,n,r)}function Or(e,t,n,r){let i=e._chart.getContext(),a=kr(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,c=n.length,l=[],u=a,d=t[0].start,f=d;function p(e,t,r,i){let a=s?-1:1;if(e!==t){for(e+=c;n[e%c].skip;)e-=a;for(;n[t%c].skip;)t+=a;e%c!==t%c&&(l.push({start:e%c,end:t%c,loop:r,style:i}),u=i,d=t%c)}}for(let e of t){d=s?d:e.start;let t=n[d%c],a;for(f=d+1;f<=e.end;f++){let s=n[f%c];a=kr(r.setContext(yn(i,{type:`segment`,p0:t,p1:s,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:o}))),Ar(a,u)&&p(d,f-1,e.loop,u),t=s,u=a}d<f-1&&p(d,f-1,e.loop,u)}return l}function kr(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Ar(e,t){if(!t)return!1;let n=[],r=function(e,t){return kt(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function jr(e,t,n){return e.options.clip?e[n]:t[n]}function Mr(e,t){let{xScale:n,yScale:r}=e;return n&&r?{left:jr(n,t,`left`),right:jr(n,t,`right`),top:jr(r,t,`top`),bottom:jr(r,t,`bottom`)}:t}function Nr(e,t){let n=t._clip;if(n.disabled)return!1;let r=Mr(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}var Pr=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let i=t.listeners[r],a=t.duration;i.forEach(r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,vt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},Fr=`transparent`,Ir={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=At(e||Fr),i=r.valid&&At(t||Fr);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Lr=class{constructor(e,t,n,r){let i=t[n];r=G([e.to,r,i,e.from]);let a=G([e.from,i,r]);this._active=!0,this._fn=e.fn||Ir[e.type||typeof a],this._easing=Ot[e.easing]||Ot.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=G([e.to,t,r,e.from]),this._from=G([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t<n),!this._active){this._target[r]=o,this._notify(!0);return}if(t<0){this._target[r]=i;return}s=t/n%2,s=a&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}},Rr=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!j(e))return;let t=Object.keys(H.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{let i=e[r];if(!j(i))return;let a={};for(let e of t)a[e]=i[e];(A(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Br(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&zr(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,l,o);continue}else u.cancel();if(!d||!d.duration){e[c]=l;continue}i[c]=u=new Lr(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Pr.add(this._chart,n),!0}};function zr(e,t){let n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){let i=e[r[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function Br(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Vr(e,t){let n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function Hr(e,t,n){if(n===!1)return!1;let r=Vr(e,n),i=Vr(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Ur(e){let t,n,r,i;return j(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function Wr(e,t){let n=[],r=e._getSortedDatasetMetas(t),i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function Gr(e,t,n,r={}){let i=e.keys,a=r.mode===`single`,o,s,c,l;if(t===null)return;let u=!1;for(o=0,s=i.length;o<s;++o){if(c=+i[o],c===n){if(u=!0,r.all)continue;break}l=e.values[c],M(l)&&(a||t===0||qe(t)===qe(l))&&(t+=l)}return!u&&!r.all?0:t}function Kr(e,t){let{iScale:n,vScale:r}=t,i=n.axis===`x`?`x`:`y`,a=r.axis===`x`?`x`:`y`,o=Object.keys(e),s=Array(o.length),c,l,u;for(c=0,l=o.length;c<l;++c)u=o[c],s[c]={[i]:u,[a]:e[u]};return s}function qr(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Jr(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Yr(e){let{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:-1/0,max:i?n:1/0}}function Xr(e,t,n){let r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Zr(e,t,n,r){for(let i of t.getMatchingVisibleMetas(r).reverse()){let t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function Qr(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Jr(a,o,r),d=t.length,f;for(let e=0;e<d;++e){let n=t[e],{[c]:a,[l]:d}=n,p=n._stacks||={};f=p[l]=Xr(i,u,a),f[s]=d,f._top=Zr(f,o,!0,r.type),f._bottom=Zr(f,o,!1,r.type);let m=f._visualValues||={};m[s]=d}}function $r(e,t){let n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function ei(e,t){return yn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function ti(e,t,n){return yn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function ni(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var ri=e=>e===`reset`||e===`none`,ii=(e,t)=>t?e:Object.assign({},e),ai=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Wr(n,!0),values:null},oi=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=qr(e.vScale,e),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(e){this.index!==e&&ni(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=N(n.xAxisID,$r(e,`x`)),a=t.yAxisID=N(n.yAxisID,$r(e,`y`)),o=t.rAxisID=N(n.rAxisID,$r(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&>(this._data,this),e._stacked&&ni(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(j(t)){let e=this._cachedMeta;this._data=Kr(t,e)}else if(n!==t){if(n){gt(n,this);let e=this._cachedMeta;ni(e),e._parsed=[]}t&&Object.isExtensible(t)&&ht(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=qr(t.vScale,t),t.stack!==n.stack&&(r=!0,ni(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(Qr(this,t._parsed),t._stacked=qr(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length?!0:n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=A(r[e])?this.parseArrayData(n,r,e,t):j(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]<c[o];for(l=0;l<t;++l)n._parsed[l+e]=u=d[l],s&&(i()&&(s=!1),c=u);n._sorted=s}a&&Qr(this,d)}parsePrimitiveData(e,t,n,r){let{iScale:i,vScale:a}=e,o=i.axis,s=a.axis,c=i.getLabels(),l=i===a,u=Array(r),d,f,p;for(d=0,f=r;d<f;++d)p=d+n,u[d]={[o]:l||i.parse(c[p],p),[s]:a.parse(t[p],p)};return u}parseArrayData(e,t,n,r){let{xScale:i,yScale:a}=e,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={x:i.parse(u[0],l),y:a.parse(u[1],l)};return o}parseObjectData(e,t,n,r){let{xScale:i,yScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=Array(r),l,u,d,f;for(l=0,u=r;l<u;++l)d=l+n,f=t[d],c[l]={x:i.parse(Fe(f,o),d),y:a.parse(Fe(f,s),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){let r=this.chart,i=this._cachedMeta,a=t[e.axis];return Gr({keys:Wr(r,!0),values:t._stacks[e.axis]._visualValues},a,i.index,{mode:n})}updateRangeFromParsed(e,t,n,r){let i=n[t.axis],a=i===null?NaN:i,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,a=Gr(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){let n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,a=r.length,o=this._getOtherScale(e),s=ai(t,n,this.chart),c={min:1/0,max:-1/0},{min:l,max:u}=Yr(o),d,f;function p(){f=r[d];let t=f[o.axis];return!M(f[e.axis])||l>t||u<t}for(d=0;d<a&&!(!p()&&(this.updateRangeFromParsed(c,e,f,s),i));++d);if(i){for(d=a-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r][e.axis],M(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,n=t.iScale,r=t.vScale,i=this.getParsed(e);return{label:n?``+n.getLabelForValue(i[n.axis]):``,value:r?``+r.getLabelForValue(i[r.axis]):``}}_update(e){let t=this._cachedMeta;this.update(e||`default`),t._clip=Ur(N(this.options.clip,Hr(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],i=t.chartArea,a=[],o=this._drawStart||0,s=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop,l;for(n.dataset&&n.dataset.draw(e,i,o,s),l=o;l<o+s;++l){let t=r[l];t.hidden||(t.active&&c?a.push(t):t.draw(e,i))}for(l=0;l<a.length;++l)a[l].draw(e,i)}getStyle(e,t){let n=t?`active`:`default`;return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){let r=this.getDataset(),i;if(e>=0&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];i=t.$context||=ti(this.getContext(),e,t),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||=ei(this.chart.getContext(),this.index),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t=`default`,n){let r=t===`active`,i=this._cachedDataOpts,a=e+`-`+t,o=i[a],s=this.enableOptionSharing&&Le(n);if(o)return ii(o,s);let c=this.chart.config,l=c.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,`hover`,e,``]:[e,``],d=c.getOptionScopes(this.getDataset(),l),f=Object.keys(H.elements[e]),p=c.resolveNamedOptions(d,f,()=>this.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(ii(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new Rr(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||ri(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){ri(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!ri(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,t,n=!0){let r=this._cachedMeta,i=r.data,a=e+t,o,s=e=>{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;o<a;++o)i[o]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(i,e,t,`reset`)}updateElements(e,t,n,r){}_removeElements(e,t){let n=this._cachedMeta;if(this._parsing){let r=n._parsed.splice(e,t);n._stacked&&ni(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync([`_insertElements`,this.getDataset().data.length-e,e])}_onDataPop(){this._sync([`_removeElements`,this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync([`_removeElements`,0,1])}_onDataSplice(e,t){t&&this._sync([`_removeElements`,e,t]);let n=arguments.length-2;n&&this._sync([`_insertElements`,e,n])}_onDataUnshift(){this._sync([`_insertElements`,0,arguments.length])}};function si(e,t){if(!e._cache.$bar){let n=e.getMatchingVisibleMetas(t),r=[];for(let t=0,i=n.length;t<i;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=_t(r.sort((e,t)=>e-t))}return e._cache.$bar}function ci(e){let t=e.iScale,n=si(t,e.type),r=t._length,i,a,o,s,c=()=>{o===32767||o===-32768||(Le(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i<a;++i)o=t.getPixelForValue(n[i]),c();for(s=void 0,i=0,a=t.ticks.length;i<a;++i)o=t.getPixelForTick(i),c();return r}function li(e,t,n,r){let i=n.barThickness,a,o;return k(i)?(a=t.min*n.categoryPercentage,o=n.barPercentage):(a=i*r,o=1),{chunk:a/r,ratio:o,start:t.pixels[e]-a/2}}function ui(e,t,n,r){let i=t.pixels,a=i[e],o=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null,c=n.categoryPercentage;o===null&&(o=a-(s===null?t.end-t.start:s-a)),s===null&&(s=a+a-o);let l=a-(a-Math.min(o,s))/2*c;return{chunk:Math.abs(s-o)/2*c/r,ratio:n.barPercentage,start:l}}function di(e,t,n,r){let i=n.parse(e[0],r),a=n.parse(e[1],r),o=Math.min(i,a),s=Math.max(i,a),c=o,l=s;Math.abs(o)>Math.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function fi(e,t,n,r){return A(e)?di(e,t,n,r):t[n.axis]=n.parse(e,r),t}function pi(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l<u;++l)f=t[l],d={},d[i.axis]=s||i.parse(o[l],l),c.push(fi(f,d,a,l));return c}function mi(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function hi(e,t,n){return e===0?(t.isHorizontal()?1:-1)*(t.min>=n?1:-1):qe(e)}function gi(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.base<e.y,n=`bottom`,r=`top`),t?(i=`end`,a=`start`):(i=`start`,a=`end`),{start:n,end:r,reverse:t,top:i,bottom:a}}function _i(e,t,n,r){let i=t.borderSkipped,a={};if(!i){e.borderSkipped=a;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:s,reverse:c,top:l,bottom:u}=gi(e);i===`middle`&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=l:(n._bottom||0)===r?i=u:(a[vi(u,o,s,c)]=!0,i=l)),a[vi(i,o,s,c)]=!0,e.borderSkipped=a}function vi(e,t,n,r){return r?(e=yi(e,t,n),e=bi(e,n,t)):e=bi(e,t,n),e}function yi(e,t,n){return e===t?n:e===n?t:e}function bi(e,t,n){return e===`start`?t:e===`end`?n:e}function xi(e,{inflateAmount:t},n){e.inflateAmount=t===`auto`?n===1?.33:0:t}var Si=class extends oi{static id=`bar`;static defaults={datasetElementType:!1,dataElementType:`bar`,categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:`number`,properties:[`x`,`y`,`base`,`width`,`height`]}}};static overrides={scales:{_index_:{type:`category`,offset:!0,grid:{offset:!0}},_value_:{type:`linear`,beginAtZero:!0}}};parsePrimitiveData(e,t,n,r){return pi(e,t,n,r)}parseArrayData(e,t,n,r){return pi(e,t,n,r)}parseObjectData(e,t,n,r){let{iScale:i,vScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=i.axis===`x`?o:s,l=a.axis===`x`?o:s,u=[],d,f,p,m;for(d=n,f=n+r;d<f;++d)m=t[d],p={},p[i.axis]=i.parse(Fe(m,c),d),u.push(fi(Fe(m,l),p,a,d));return u}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);let i=n._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){let{iScale:t,vScale:n}=this._cachedMeta,r=this.getParsed(e),i=r._custom,a=mi(i)?`[`+i.start+`, `+i.end+`]`:``+n.getLabelForValue(r[n.axis]);return{label:``+t.getLabelForValue(r[t.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){let t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){let i=r===`reset`,{index:a,_cachedMeta:{vScale:o}}=this,s=o.getBasePixel(),c=o.isHorizontal(),l=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,r);for(let f=t;f<t+n;f++){let t=this.getParsed(f),n=i||k(t[o.axis])?{base:s,head:s}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,l),m=(t._stacks||{})[o.axis],h={horizontal:c,base:n.base,enableBorderRadius:!m||mi(t._custom)||a===m._top||a===m._bottom,x:c?n.head:p.center,y:c?p.center:n.head,height:c?p.size:Math.abs(n.size),width:c?Math.abs(n.size):p.size};d&&(h.options=u||this.resolveDataElementOptions(f,e[f].active?`active`:r));let g=h.options||e[f].options;_i(h,g,m,a),xi(h,g,l.ratio),this.updateElement(e[f],f,h,r)}}_getStacks(e,t){let{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(k(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[N(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;i<a;++i)r.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));let o=e.barThickness;return{min:o||ci(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:o?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){let{_cachedMeta:{vScale:t,_stacked:n,index:r},options:{base:i,minBarLength:a}}=this,o=i||0,s=this.getParsed(e),c=s._custom,l=mi(c),u=s[t.axis],d=0,f=n?this.applyStack(t,s,n):u,p,m;f!==u&&(d=f-u,f=u),l&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&qe(u)!==qe(c.barEnd)&&(d=0),d+=u);let h=!k(i)&&!l?i:d,g=t.getPixelForValue(h);if(p=this.chart.getDataVisibility(e)?t.getPixelForValue(d+f):g,m=p-g,Math.abs(m)<a){m=hi(m,t,o)*a,u===o&&(g-=m/2);let e=t.getPixelForDecimal(0),i=t.getPixelForDecimal(1),c=Math.min(e,i),d=Math.max(e,i);g=Math.max(Math.min(g,d),c),p=g+m,n&&!l&&(s._stacks[t.axis]._visualValues[r]=t.getValueForPixel(p)-t.getValueForPixel(g))}if(g===t.getPixelForValue(o)){let e=qe(m)*t.getLineWidthForValue(o)/2;g+=e,m-=e}return{size:m,base:g,head:p,center:p+m/2}}_calculateBarIndexPixels(e,t){let n=t.scale,r=this.options,i=r.skipNull,a=N(r.maxBarThickness,1/0),o,s,c=this._getAxisCount();if(t.grouped){let n=i?this._getStackCount(e):t.stackCount,l=r.barThickness===`flex`?ui(e,t,r,n*c):li(e,t,r,n*c),u=this.chart.options.indexAxis===`x`?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(N(u,this.getFirstScaleIdForIndexAxis())),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+d;o=l.start+l.chunk*f+l.chunk/2,s=Math.min(a,l.chunk*l.ratio)}else o=n.getPixelForValue(this.getParsed(e)[n.axis],e),s=Math.min(a,t.min*t.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}}draw(){let e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length,i=0;for(;i<r;++i)this.getParsed(i)[t.axis]!==null&&!n[i].hidden&&n[i].draw(this._ctx)}};function Ci(e,t,n){let r=1,i=1,a=0,o=0;if(t<L){let s=e,c=s+t,l=Math.cos(s),u=Math.sin(s),d=Math.cos(c),f=Math.sin(c),p=(e,t,r)=>st(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>st(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(R,u,f),_=m(I,l,d),v=m(I+R,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var wi=class extends oi{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(j(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Fe(n[t],e)}let a,o;for(a=e,o=e+t;a<o;++a)r._parsed[a]=i(a)}}_getRotation(){return tt(this.options.rotation-90)}_getCircumference(){return tt(this.options.circumference)}_getRotationExtents(){let e=L,t=-L;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),a=r._getCircumference();e=Math.min(e,i),t=Math.max(t,i+a)}return{rotation:e,circumference:t-e}}update(e){let{chartArea:t}=this.chart,n=this._cachedMeta,r=n.data,i=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(t.width,t.height)-i)/2,0),o=Math.min(Ce(this.options.cutout,a),1),s=this._getRingWeight(this.index),{circumference:c,rotation:l}=this._getRotationExtents(),{ratioX:u,ratioY:d,offsetX:f,offsetY:p}=Ci(l,c,o),m=(t.width-i)/u,h=(t.height-i)/d,g=Math.max(Math.min(m,h)/2,0),_=we(this.options.radius,g),v=(_-Math.max(_*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*_,this.offsetY=p*_,n.total=this.calculateTotal(),this.outerRadius=_-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*s,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){let n=this.options,r=this._cachedMeta,i=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/L)}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.chartArea,s=a.options.animation,c=(o.left+o.right)/2,l=(o.top+o.bottom)/2,u=i&&s.animateScale,d=u?0:this.innerRadius,f=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(t,r),h=this._getRotation(),g;for(g=0;g<t;++g)h+=this._circumference(g,i);for(g=t;g<t+n;++g){let t=this._circumference(g,i),n=e[g],a={x:c+this.offsetX,y:l+this.offsetY,startAngle:h,endAngle:h+t,circumference:t,outerRadius:f,innerRadius:d};m&&(a.options=p||this.resolveDataElementOptions(g,n.active?`active`:r)),h+=t,this.updateElement(n,g,a,r)}}calculateTotal(){let e=this._cachedMeta,t=e.data,n=0,r;for(r=0;r<t.length;r++){let i=e._parsed[r];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(r)&&!t[r].hidden&&(n+=Math.abs(i))}return n}calculateCircumference(e){let t=this._cachedMeta.total;return t>0&&!isNaN(e)?Math.abs(e)/t*L:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Rt(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){a=n.getDatasetMeta(r),e=a.data,o=a.controller;break}}if(!e)return 0;for(r=0,i=e.length;r<i;++r)s=o.resolveDataElementOptions(r),s.borderAlign!==`inner`&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){let e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(N(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}},Ti=class extends oi{static id=`line`;static defaults={datasetElementType:`line`,dataElementType:`point`,showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:`category`},_value_:{type:`linear`}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){let t=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=t,a=this.chart._animationsDisabled,{start:o,count:s}=Ct(t,r,a);this._drawStart=o,this._drawCount=s,wt(t)&&(o=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;let c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},e),this.updateElements(r,o,s,e)}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o,_stacked:s,_dataset:c}=this._cachedMeta,{sharedOptions:l,includeOptions:u}=this._getSharedOptions(t,r),d=a.axis,f=o.axis,{spanGaps:p,segment:m}=this.options,h=Qe(p)?p:1/0,g=this.chart._animationsDisabled||i||r===`none`,_=t+n,v=e.length,y=t>0&&this.getParsed(t-1);for(let n=0;n<v;++n){let p=e[n],v=g?p:{};if(n<t||n>=_){v.skip=!0;continue}let b=this.getParsed(n),x=k(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},Ei=class extends wi{static id=`pie`;static defaults={cutout:0,rotation:0,circumference:360,radius:`100%`}},Di=class extends oi{static id=`scatter`;static defaults={datasetElementType:!1,dataElementType:`point`,showLine:!1,fill:!1};static overrides={interaction:{mode:`point`},scales:{x:{type:`linear`},y:{type:`linear`}}};getLabelAndValue(e){let t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=t,a=this.getParsed(e),o=r.getLabelForValue(a.x),s=i.getLabelForValue(a.y);return{label:n[e]||``,value:`(`+o+`, `+s+`)`}}update(e){let t=this._cachedMeta,{data:n=[]}=t,r=this.chart._animationsDisabled,{start:i,count:a}=Ct(t,n,r);if(this._drawStart=i,this._drawCount=a,wt(t)&&(i=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:i,_dataset:a}=t;i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;let o=this.resolveDatasetElementOptions(e);o.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:o},e)}else this.datasetElementType&&=(delete t.dataset,!1);this.updateElements(n,i,a,e)}addElements(){let{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement(`line`)),super.addElements()}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o,_stacked:s,_dataset:c}=this._cachedMeta,l=this.resolveDataElementOptions(t,r),u=this.getSharedOptions(l),d=this.includeOptions(r,u),f=a.axis,p=o.axis,{spanGaps:m,segment:h}=this.options,g=Qe(m)?m:1/0,_=this.chart._animationsDisabled||i||r===`none`,v=t>0&&this.getParsed(t-1);for(let l=t;l<t+n;++l){let t=e[l],n=this.getParsed(l),m=_?t:{},y=k(n[p]),b=m[f]=a.getPixelForValue(n[f],l),x=m[p]=i||y?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,n,s):n[p],l);m.skip=isNaN(b)||isNaN(x)||y,m.stop=l>0&&Math.abs(n[f]-v[f])>g,h&&(m.parsed=n,m.raw=c.data[l]),d&&(m.options=u||this.resolveDataElementOptions(l,t.active?`active`:r)),_||this.updateElement(t,l,m,r),v=n}this.updateSharedOptions(u,r,l)}getMaxOverflow(){let e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){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}let n=e.dataset,r=n.options&&n.options.borderWidth||0;if(!t.length)return r;let i=t[0].size(this.resolveDataElementOptions(0)),a=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(r,i,a)/2}};function Oi(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var ki={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Oi()}parse(){return Oi()}format(){return Oi()}add(){return Oi()}diff(){return Oi()}startOf(){return Oi()}endOf(){return Oi()}}};function Ai(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ft:dt;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!k(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!k(e[t.axis]));r.hi+=Math.max(0,o)}return r}else if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function ji(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e<n;++e){let{index:n,data:s}=a[e],{lo:c,hi:l}=Ai(a[e],t,o,i);for(let e=c;e<=l;++e){let t=s[e];t.skip||r(t,n,e)}}}function Mi(e){let t=e.indexOf(`x`)!==-1,n=e.indexOf(`y`)!==-1;return function(e,r){let i=t?Math.abs(e.x-r.x):0,a=n?Math.abs(e.y-r.y):0;return Math.sqrt(i**2+a**2)}}function Ni(e,t,n,r,i){let a=[];return!i&&!e.isPointInArea(t)||ji(e,n,t,function(n,o,s){!i&&!en(n,e.chartArea,0)||n.inRange(t.x,t.y,r)&&a.push({element:n,datasetIndex:o,index:s})},!0),a}function Pi(e,t,n,r){let i=[];function a(e,n,a){let{startAngle:o,endAngle:s}=e.getProps([`startAngle`,`endAngle`],r),{angle:c}=it(e,{x:t.x,y:t.y});st(c,o,s)&&i.push({element:e,datasetIndex:n,index:a})}return ji(e,n,t,a),i}function Fi(e,t,n,r,i,a){let o=[],s=Mi(n),c=1/0;function l(n,l,u){let d=n.inRange(t.x,t.y,i);if(r&&!d)return;let f=n.getCenterPoint(i);if(!(a||e.isPointInArea(f))&&!d)return;let p=s(t,f);p<c?(o=[{element:n,datasetIndex:l,index:u}],c=p):p===c&&o.push({element:n,datasetIndex:l,index:u})}return ji(e,n,t,l),o}function Ii(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n===`r`&&!r?Pi(e,t,n,i):Fi(e,t,n,r,i,a)}function Li(e,t,n,r,i){let a=[],o=n===`x`?`inXRange`:`inYRange`,s=!1;return ji(e,n,t,(e,r,c)=>{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Ri={evaluateInteractionItems:ji,modes:{index(e,t,n,r){let i=ir(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Ni(e,i,a,r,o):Ii(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=ir(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Ni(e,i,a,r,o):Ii(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point(e,t,n,r){return Ni(e,ir(t,e),n.axis||`xy`,r,n.includeInvisible||!1)},nearest(e,t,n,r){let i=ir(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1;return Ii(e,i,a,n.intersect,r,o)},x(e,t,n,r){return Li(e,ir(t,e),`x`,n.intersect,r)},y(e,t,n,r){return Li(e,ir(t,e),`y`,n.intersect,r)}}},zi=[`left`,`top`,`right`,`bottom`];function Bi(e,t){return e.filter(e=>e.pos===t)}function Vi(e,t){return e.filter(e=>zi.indexOf(e.pos)===-1&&e.box.axis===t)}function Hi(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function Ui(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function Wi(e){let t={};for(let n of e){let{stack:e,pos:r,stackWeight:i}=n;if(!e||!zi.includes(r))continue;let a=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function Gi(e,t){let n=Wi(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t,a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];let{fullSize:o}=s.box,c=n[s.stack],l=c&&s.stackWeight/c.weight;s.horizontal?(s.width=l?l*r:o&&t.availableWidth,s.height=i):(s.width=r,s.height=l?l*i:o&&t.availableHeight)}return n}function Ki(e){let t=Ui(e),n=Hi(t.filter(e=>e.box.fullSize),!0),r=Hi(Bi(t,`left`),!0),i=Hi(Bi(t,`right`)),a=Hi(Bi(t,`top`),!0),o=Hi(Bi(t,`bottom`)),s=Vi(t,`x`),c=Vi(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:Bi(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function qi(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Ji(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Yi(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!j(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&Ji(o,a.getPadding());let s=Math.max(0,t.outerWidth-qi(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-qi(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function Xi(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function Zi(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function Qi(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a<o;++a){s=e[a],c=s.box,c.update(s.width||t.w,s.height||t.h,Zi(s.horizontal,t));let{same:o,other:d}=Yi(t,n,s,r);l|=o&&i.length,u||=d,c.fullSize||i.push(s)}return l&&Qi(i,t,n,r)||u}function $i(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function ea(e,t,n,r){let i=n.padding,{x:a,y:o}=t;for(let s of e){let e=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},l=s.stackWeight/c.weight||1;if(s.horizontal){let r=t.w*l,a=c.size||e.height;Le(c.start)&&(o=c.start),e.fullSize?$i(e,i.left,o,n.outerWidth-i.right-i.left,a):$i(e,t.left+c.placed,o,r,a),c.start=o,c.placed+=r,o=e.bottom}else{let r=t.h*l,o=c.size||e.width;Le(c.start)&&(a=c.start),e.fullSize?$i(e,a,i.top,o,n.outerHeight-i.bottom-i.top):$i(e,a,t.top+c.placed,o,r),c.start=a,c.placed+=r,a=e.right}}t.x=a,t.y=o}var ta={addBox(e,t){e.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)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;let i=U(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=Ki(e.boxes),c=s.vertical,l=s.horizontal;F(e.boxes,e=>{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Ji(f,U(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Gi(c.concat(l),d);Qi(s.fullSize,p,d,m),Qi(c,p,d,m),Qi(l,p,d,m)&&Qi(c,p,d,m),Xi(p),ea(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,ea(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},F(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},na=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},ra=class extends na{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},ia=`$chartjs`,aa={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},oa=e=>e===null||e===``;function sa(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[ia]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,oa(i)){let t=ur(e,`width`);t!==void 0&&(e.width=t)}if(oa(r))if(e.style.height===``)e.height=e.width/(t||2);else{let t=ur(e,`height`);t!==void 0&&(e.height=t)}return e}var ca=lr?{passive:!0}:!1;function la(e,t,n){e&&e.addEventListener(t,n,ca)}function ua(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ca)}function da(e,t){let n=aa[e.type]||e.type,{x:r,y:i}=ir(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function fa(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function pa(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=fa(n.addedNodes,r),t&&=!fa(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function ma(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=fa(n.removedNodes,r),t&&=!fa(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var ha=new Map,ga=0;function _a(){let e=window.devicePixelRatio;e!==ga&&(ga=e,ha.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function va(e,t){ha.size||window.addEventListener(`resize`,_a),ha.set(e,t)}function ya(e){ha.delete(e),ha.size||window.removeEventListener(`resize`,_a)}function ba(e,t,n){let r=e.canvas,i=r&&Xn(r);if(!i)return;let a=yt((e,t)=>{let r=i.clientWidth;n(e,t),r<i.clientWidth&&n()},window),o=new ResizeObserver(e=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0&&r===0||a(n,r)});return o.observe(i),va(e,a),o}function xa(e,t,n){n&&n.disconnect(),t===`resize`&&ya(e)}function Sa(e,t,n){let r=e.canvas,i=yt(t=>{e.ctx!==null&&n(da(t,e))},e);return la(r,t,i),i}var Ca=class extends na{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(sa(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[ia])return!1;let n=t[ia].initial;[`height`,`width`].forEach(e=>{let r=n[e];k(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[ia],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:pa,detach:ma,resize:ba}[t]||Sa)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:xa,detach:xa,resize:xa}[t]||ua)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return sr(e,t,n,r)}isAttached(e){let t=e&&Xn(e);return!!(t&&t.isConnected)}};function wa(e){return!Yn()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?ra:Ca}var Ta=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return Qe(this.x)&&Qe(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function Ea(e,t){let n=e.options.ticks,r=Da(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?ka(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Aa(t,l,a,o/i),l;let u=Oa(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(ja(t,l,u,k(r)?0:s-r,s),e=0,n=o-1;e<n;e++)ja(t,l,u,a[e],a[e+1]);return ja(t,l,u,c,k(r)?t.length:c+r),l}return ja(t,l,u),l}function Da(e){let t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function Oa(e,t,n){let r=Ma(e),i=t.length/n;if(!r)return Math.max(i,1);let a=Xe(r);for(let e=0,t=a.length-1;e<t;e++){let t=a[e];if(t>i)return t}return Math.max(i,1)}function ka(e){let t=[],n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Aa(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function ja(e,t,n,r,i){let a=N(r,0),o=Math.min(N(i,e.length),e.length),s=0,c,l,u;for(n=Math.ceil(n),i&&(c=i-r,n=c/Math.floor(c/n)),u=a;u<0;)s++,u=Math.round(a+s*n);for(l=Math.max(a,0);l<o;l++)l===u&&(t.push(e[l]),s++,u=Math.round(a+s*n))}function Ma(e){let t=e.length,n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}var Na=e=>e===`left`?`right`:e===`right`?`left`:e,Pa=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Fa=(e,t)=>Math.min(t||e,e);function Ia(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function La(e,t,n){let r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6,c=e.getPixelForTick(i),l;if(!(n&&(l=r===1?Math.max(c-a,o-c):t===0?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<a-s||c>o+s)))return c}function Ra(e,t){F(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;i<r;++i)delete e.data[n[i]];n.splice(0,r)}})}function za(e){return e.drawTicks?e.tickLength:0}function Ba(e,t){if(!e.display)return 0;let n=W(e.font,t),r=U(e.padding);return(A(e.text)?e.text.length:1)*n.lineHeight+r.height}function Va(e,t){return yn(e,{scale:t,type:`scale`})}function Ha(e,t,n){return yn(e,{tick:n,index:t,type:`tick`})}function Ua(e,t,n){let r=xt(e);return(n&&t!==`right`||!n&&t===`right`)&&(r=Na(r)),r}function Wa(e,t,n,r){let{top:i,left:a,bottom:o,right:s,chart:c}=e,{chartArea:l,scales:u}=c,d=0,f,p,m,h=o-i,g=s-a;if(e.isHorizontal()){if(p=V(r,a,s),j(n)){let e=Object.keys(n)[0],r=n[e];m=u[e].getPixelForValue(r)+h-t}else m=n===`center`?(l.bottom+l.top)/2+h-t:Pa(e,n,t);f=s-a}else{if(j(n)){let e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-g+t}else p=n===`center`?(l.left+l.right)/2-g+t:Pa(e,n,t);m=V(r,o,i),d=n===`left`?-R:R}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}var Ga=class e extends Ta{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=Se(e,1/0),t=Se(t,-1/0),n=Se(n,1/0),r=Se(r,-1/0),{min:Se(e,n),max:Se(t,r),minDefined:M(e),maxDefined:M(t)}}getMinMax(e){let{min:t,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),a;if(r&&i)return{min:t,max:n};let o=this.getMatchingVisibleMetas();for(let s=0,c=o.length;s<c;++s)a=o[s].controller.getMinMax(this,e),r||(t=Math.min(t,a.min)),i||(n=Math.max(n,a.max));return t=i&&t>n?n:t,n=r&&t>n?t:n,{min:Se(t,Se(n,t)),max:Se(n,Se(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){P(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=vn(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o<this.ticks.length;this._convertTicksToLabels(s?Ia(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source===`auto`)&&(this.ticks=Ea(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,e=!e),this._startPixel=t,this._endPixel=n,this._reversePixels=e,this._length=n-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){P(this.options.afterUpdate,[this])}beforeSetDimensions(){P(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(){P(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),P(this.options[e],[this])}beforeDataLimits(){this._callHooks(`beforeDataLimits`)}determineDataLimits(){}afterDataLimits(){this._callHooks(`afterDataLimits`)}beforeBuildTicks(){this._callHooks(`beforeBuildTicks`)}buildTicks(){return[]}afterBuildTicks(){this._callHooks(`afterBuildTicks`)}beforeTickToLabelConversion(){P(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=P(t.callback,[i.value,n,e],this)}afterTickToLabelConversion(){P(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){P(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,n=Fa(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,i=t.maxRotation,a=r,o,s,c;if(!this._isVisible()||!t.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=B(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-za(e.grid)-t.padding-Ba(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=nt(Math.min(Math.asin(B((l.highest.height+6)/o,-1,1)),Math.asin(B(s/c,-1,1))-Math.asin(B(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){P(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){P(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Ba(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=za(i)+a):(e.height=this.maxHeight,e.width=za(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=tt(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+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(){P(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t<n;t++)k(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=Ia(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){let{ctx:r,_longestTextCache:i}=this,a=[],o=[],s=Math.floor(t/Fa(t,n)),c=0,l=0,u,d,f,p,m,h,g,_,v,y,b;for(u=0;u<t;u+=s){if(p=e[u].label,m=this._resolveTickFontOptions(u),r.font=h=m.string,g=i[h]=i[h]||{data:{},gc:[]},_=m.lineHeight,v=y=0,!k(p)&&!A(p))v=Jt(r,g.data,g.gc,v,p),y=_;else if(A(p))for(d=0,f=p.length;d<f;++d)b=p[d],!k(b)&&!A(b)&&(v=Jt(r,g.data,g.gc,v,b),y+=_);a.push(v),o.push(y),c=Math.max(v,c),l=Math.max(y,l)}Ra(i,t);let x=a.indexOf(c),S=o.indexOf(l),C=e=>({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ct(this._alignToPixels?Xt(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let n=t[e];return n.$context||=Ha(this.getContext(),e,n)}return this.$context||=Va(this.chart.getContext(),this)}_tickSize(){let e=this.options.ticks,t=tt(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=this._getLabelSizes(),a=e.autoSkipPadding||0,o=i?i.widest.width+a:0,s=i?i.highest.height+a:0;return this.isHorizontal()?s*n>o*r?o/n:s/r:s*r<o*n?s/n:o/r}_isVisible(){let e=this.options.display;return e===`auto`?this.getMatchingVisibleMetas().length>0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+(s?1:0),u=za(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Xt(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(j(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(j(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=N(r.ticks.maxTicksLimit,l),te=Math.max(1,Math.ceil(l/ee));for(_=0;_<l;_+=te){let e=this.getContext(_),t=i.setContext(e),r=o.setContext(e),a=t.lineWidth,l=t.color,u=r.dash||[],f=r.dashOffset,p=t.tickWidth,m=t.tickColor,h=t.tickBorderDash||[],g=t.tickBorderDashOffset;v=La(this,_,s),v!==void 0&&(y=Xt(n,v,a),c?b=S=w=E=y:x=C=T=D=y,d.push({tx1:b,ty1:x,tx2:S,ty2:C,x1:w,y1:T,x2:E,y2:D,width:a,color:l,borderDash:u,borderDashOffset:f,tickWidth:p,tickColor:m,tickBorderDash:h,tickBorderDashOffset:g}))}return this._ticksLength=l,this._borderValue=g,d}_computeLabelItems(e){let t=this.axis,n=this.options,{position:r,ticks:i}=n,a=this.isHorizontal(),o=this.ticks,{align:s,crossAlign:c,padding:l,mirror:u}=i,d=za(n.grid),f=d+l,p=u?-l:f,m=-tt(this.labelRotation),h=[],g,_,v,y,b,x,S,C,w,T,E,D,ee=`middle`;if(r===`top`)x=this.bottom-p,S=this._getXAxisLabelAlignment();else if(r===`bottom`)x=this.top+p,S=this._getXAxisLabelAlignment();else if(r===`left`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(r===`right`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(t===`x`){if(r===`center`)x=(e.top+e.bottom)/2+f;else if(j(r)){let e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+f}S=this._getXAxisLabelAlignment()}else if(t===`y`){if(r===`center`)b=(e.left+e.right)/2-f;else if(j(r)){let e=Object.keys(r)[0],t=r[e];b=this.chart.scales[e].getPixelForValue(t)}S=this._getYAxisLabelAlignment(d).textAlign}t===`y`&&(s===`start`?ee=`top`:s===`end`&&(ee=`bottom`));let te=this._getLabelSizes();for(g=0,_=o.length;g<_;++g){v=o[g],y=v.label;let e=i.setContext(this.getContext(g));C=this.getPixelForTick(g)+i.labelOffset,w=this._resolveTickFontOptions(g),T=w.lineHeight,E=A(y)?y.length:1;let t=E/2,n=e.color,s=e.textStrokeColor,l=e.textStrokeWidth,d=S;a?(b=C,S===`inner`&&(d=g===_-1?this.options.reverse?`left`:`right`:g===0?this.options.reverse?`right`:`left`:`center`),D=r===`top`?c===`near`||m!==0?-E*T+T/2:c===`center`?-te.highest.height/2-t*T+T:-te.highest.height+T/2:c===`near`||m!==0?T/2:c===`center`?te.highest.height/2-t*T:te.highest.height-E*T,u&&(D*=-1),m!==0&&!e.showLabelBackdrop&&(b+=T/2*Math.sin(m))):(x=C,D=(1-E)*T/2);let f;if(e.showLabelBackdrop){let t=U(e.backdropPadding),n=te.heights[g],r=te.widths[g],i=D-t.top,a=0-t.left;switch(ee){case`middle`:i-=n/2;break;case`bottom`:i-=n;break}switch(S){case`center`:a-=r/2;break;case`right`:a-=r;break;case`inner`:g===_-1?a-=r:g>0&&(a-=r/2);break}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-tt(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i<a;++i){let e=r[i];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),a=n.display?i.width:0;if(!a)return;let o=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue,c,l,u,d;this.isHorizontal()?(c=Xt(e,this.left,a)-a/2,l=Xt(e,this.right,o)+o/2,u=d=s):(u=Xt(e,this.top,a)-a/2,d=Xt(e,this.bottom,o)+o/2,c=l=s),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(c,u),t.lineTo(l,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let t=this.ctx,n=this._computeLabelArea();n&&tn(t,n);let r=this.getLabelItems(e);for(let e of r){let n=e.options,r=e.font,i=e.label,a=e.textOffset;ln(t,i,0,a,r,n)}n&&nn(t)}drawTitle(){let{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;let i=W(n.font),a=U(n.padding),o=n.align,s=i.lineHeight/2;t===`bottom`||t===`center`||j(t)?(s+=a.bottom,A(n.text)&&(s+=i.lineHeight*(n.text.length-1))):s+=a.top;let{titleX:c,titleY:l,maxWidth:u,rotation:d}=Wa(this,s,t,o);ln(e,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:Ua(o,t,r),textBaseline:`middle`,translation:[c,l]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,r=N(t.grid&&t.grid.z,-1),i=N(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:e=>{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i<a;++i){let a=t[i];a[n]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){return W(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},Ka=class{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),n;Ya(t)&&(n=this.register(t));let r=this.items,i=e.id,a=this.scope+`.`+i;if(!i)throw Error(`class does not have id: `+e);return i in r?a:(r[i]=e,qa(e,a,n),this.override&&H.override(e.id,e.overrides),a)}get(e){return this.items[e]}unregister(e){let t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in H[r]&&(delete H[r][n],this.override&&delete Ut[n])}};function qa(e,t,n){let r=ke(Object.create(null),[n?H.get(n):{},H.get(t),e.defaults]);H.set(t,r),e.defaultRoutes&&Ja(t,e.defaultRoutes),e.descriptors&&H.describe(t,e.descriptors)}function Ja(e,t){Object.keys(t).forEach(n=>{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);H.route(a,i,c,s)})}function Ya(e){return`id`in e&&`defaults`in e}var Xa=new class{constructor(){this.controllers=new Ka(oi,`datasets`,!0),this.elements=new Ka(Ta,`elements`),this.plugins=new Ka(Object,`plugins`),this.scales=new Ka(Ga,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):F(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Ie(e);P(n[`before`+r],[],n),t[e](n),P(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){let r=t.get(e);if(r===void 0)throw Error(`"`+e+`" is not a registered `+n+`.`);return r}},Za=class{constructor(){this._init=void 0}notify(e,t,n,r){if(t===`beforeInit`&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,`install`)),this._init===void 0)return;let i=r?this._descriptors(e).filter(r):this._descriptors(e),a=this._notify(i,e,t,n);return t===`afterDestroy`&&(this._notify(i,e,`stop`),this._notify(this._init,e,`uninstall`),this._init=void 0),a}_notify(e,t,n,r){r||={};for(let i of e){let e=i.plugin,a=e[n];if(P(a,[t,r,i.options],e)===!1&&r.cancelable)return!1}return!0}invalidate(){k(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let n=e&&e.config,r=N(n.options&&n.options.plugins,{}),i=Qa(n);return r===!1&&!t?[]:eo(e,i,r,t)}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function Qa(e){let t={},n=[],r=Object.keys(Xa.plugins.items);for(let e=0;e<r.length;e++)n.push(Xa.getPlugin(r[e]));let i=e.plugins||[];for(let e=0;e<i.length;e++){let r=i[e];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function $a(e,t){return!t&&e===!1?null:e===!0?{}:e}function eo(e,{plugins:t,localIds:n},r,i){let a=[],o=e.getContext();for(let s of t){let t=s.id,c=$a(r[t],i);c!==null&&a.push({plugin:s,options:to(e.config,{plugin:s,local:n[t]},c,o)})}return a}function to(e,{plugin:t,local:n},r,i){let a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[``],{scriptable:!1,indexable:!1,allKeys:!0})}function no(e,t){let n=H.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||`x`}function ro(e,t){let n=e;return e===`_index_`?n=t:e===`_value_`&&(n=t===`x`?`y`:`x`),n}function io(e,t){return e===t?`_index_`:`_value_`}function ao(e){if(e===`x`||e===`y`||e===`r`)return e}function oo(e){if(e===`top`||e===`bottom`)return`x`;if(e===`left`||e===`right`)return`y`}function so(e,...t){if(ao(e))return e;for(let n of t){let t=n.axis||oo(n.position)||e.length>1&&ao(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function co(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function lo(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return co(e,`x`,n[0])||co(e,`y`,n[0])}return{}}function uo(e,t){let n=Ut[e.type]||{scales:{}},r=t.scales||{},i=no(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!j(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=so(t,o,lo(t,e),H.scales[o.type]),c=io(s,i),l=n.scales||{};a[t]=Ae(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||no(i,t),s=(Ut[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=ro(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),Ae(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];Ae(t,[H.scales[t.type],H.scale])}),a}function fo(e){let t=e.options||={};t.plugins=N(t.plugins,{}),t.scales=uo(e,t)}function po(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function mo(e){return e||={},e.data=po(e.data),fo(e),e}var ho=new Map,go=new Set;function _o(e,t){let n=ho.get(e);return n||(n=t(),ho.set(e,n),go.add(n)),n}var vo=(e,t,n)=>{let r=Fe(t,n);r!==void 0&&e.add(r)},yo=class{constructor(e){this._config=mo(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=po(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),fo(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return _o(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return _o(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return _o(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return _o(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>vo(s,e,t))),t.forEach(e=>vo(s,r,e)),t.forEach(e=>vo(s,Ut[i]||{},e)),t.forEach(e=>vo(s,H,e)),t.forEach(e=>vo(s,Wt,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),go.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Ut[t]||{},H.datasets[t]||{},{type:t},H,Wt]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=bo(this._resolverCache,e,r),s=a;if(So(a,t)){i.$shared=!1,n=Re(n)?n():n;let t=this.createResolver(e,n,o);s=xn(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=bo(this._resolverCache,e,n);return j(t)?xn(i,t,void 0,r):i}};function bo(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:bn(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var xo=e=>j(e)&&Object.getOwnPropertyNames(e).some(t=>Re(e[t]));function So(e,t){let{isScriptable:n,isIndexable:r}=Sn(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Re(o)||xo(o))||a&&A(o))return!0}return!1}var Co=`4.5.1`,wo=[`top`,`bottom`,`left`,`right`,`chartArea`];function To(e,t){return e===`top`||e===`bottom`||wo.indexOf(e)===-1&&t===`x`}function Eo(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Do(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),P(n&&n.onComplete,[e],t)}function Oo(e){let t=e.chart,n=t.options.animation;P(n&&n.onProgress,[e],t)}function ko(e){return Yn()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Ao={},jo=e=>{let t=ko(e);return Object.values(Ao).filter(e=>e.canvas===t).pop()};function Mo(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function No(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var Po=class{static defaults=H;static instances=Ao;static overrides=Ut;static registry=Xa;static version=Co;static getChart=jo;static register(...e){Xa.add(...e),Fo()}static unregister(...e){Xa.remove(...e),Fo()}constructor(e,t){let n=this.config=new yo(t),r=ko(e),i=jo(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(wa(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=xe(),this.ctx=o,this.canvas=s,this.width=l,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 Za,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=bt(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],Ao[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}Pr.listen(this,`complete`,Do),Pr.listen(this,`progress`,Oo),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return k(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Xa}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():cr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Zt(this.canvas,this.ctx),this}stop(){return Pr.stop(this),this}resize(e,t){Pr.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,cr(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),P(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){F(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=so(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),F(i,t=>{let i=t.options,a=i.id,o=so(a,i),s=N(i.type,t.dtype);(i.position===void 0||To(i.position,o)!==To(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(Xa.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),F(r,(e,t)=>{e||delete n[t]}),F(n,e=>{ta.configure(this,e,e.options),ta.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(Eo(`order`,`index`))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){let r=t[n],i=this.getDatasetMeta(n),a=r.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=a,i.indexAxis=r.indexAxis||no(a,this.options),i.order=r.order||0,i.index=n,i.label=``+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{let t=Xa.getController(a),{datasetElementType:r,dataElementType:o}=H.datasets[a];Object.assign(t,{dataElementType:Xa.getElement(o),datasetElementType:r&&Xa.getElement(r)}),i.controller=new t(this,n),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){F(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e<t;e++){let{controller:t}=this.getDatasetMeta(e),n=!r&&i.indexOf(t)===-1;t.buildOrUpdateElements(n),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),r||F(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(Eo(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){F(this.scales,e=>{ta.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!ze(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)Mo(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;e<t;e++)if(!ze(r,n(e)))return;return Array.from(r).map(e=>e.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;ta.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],F(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,Re(e)?e({datasetIndex:t}):e);this.notifyPlugins(`afterDatasetsUpdate`,{mode:e})}}_updateDataset(e,t){let n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins(`beforeDatasetUpdate`,r)!==!1&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins(`afterDatasetUpdate`,r))}render(){this.notifyPlugins(`beforeRender`,{cancelable:!0})!==!1&&(Pr.has(this)?this.attached&&!Pr.running(this)&&Pr.start(this):(this.draw(),Do({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins(`beforeDraw`,{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins(`afterDraw`)}_getSortedDatasetMetas(e){let t=this._sortedMetasets,n=[],r,i;for(r=0,i=t.length;r<i;++r){let i=t[r];(!e||i.visible)&&n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins(`beforeDatasetsDraw`,{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Nr(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&tn(t,r),e.controller.draw(),r&&nn(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return en(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Ri.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=yn(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);Le(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Pr.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins(`beforeDestroy`);let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Zt(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Ao[this.id],this.notifyPlugins(`afterDestroy`)}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};F(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){F(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},F(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o<s;++o){a=e[o];let t=a&&this.getDatasetMeta(a.datasetIndex).controller;t&&t[r+`HoverStyle`](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});Te(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=Be(e),c=No(e,this._lastEvent,n,s);n&&(this._lastEvent=null,P(i.onHover,[e,o,this],this),s&&P(i.onClick,[e,o,this],this));let l=!Te(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Fo(){return F(Po.instances,e=>e._plugins.invalidate())}function Io(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,z(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,z(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*z(r-n));if(u===`round`)e.arc(i,a,t,n-I/2,r+I/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+I/2)+i,c=-o*Math.sin(n+I/2)+a,l=o*Math.cos(r+I/2)+i,u=o*Math.sin(r+I/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function Lo(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+R,r-R),e.closePath(),e.clip()}function Ro(e){return hn(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function zo(e,t,n,r){let i=Ro(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return B(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:B(i.innerStart,0,o),innerEnd:B(i.innerEnd,0,o)}}function Bo(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Vo(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/I)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=zo(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,ee=g+b/E,te=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=Bo(C,T,o,s);e.arc(t.x,t.y,y,T,_+R)}let n=Bo(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=Bo(D,te,o,s);e.arc(t.x,t.y,x,_+R,te+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=Bo(E,ee,o,s);e.arc(t.x,t.y,b,ee+Math.PI,g-R)}let i=Bo(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=Bo(S,w,o,s);e.arc(t.x,t.y,v,g-R,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function Ho(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Vo(e,t,n,r,c,i);for(let t=0;t<a;++t)e.fill();isNaN(s)||(c=o+(s%L||L))}return Vo(e,t,n,r,c,i),e.fill(),c}function Uo(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=c,m=c.borderAlign===`inner`;if(!l)return;e.setLineDash(d||[]),e.lineDashOffset=f,m?(e.lineWidth=l*2,e.lineJoin=u||`round`):(e.lineWidth=l,e.lineJoin=u||`bevel`);let h=t.endAngle;if(a){Vo(e,t,n,r,h,i);for(let t=0;t<a;++t)e.stroke();isNaN(s)||(h=o+(s%L||L))}m&&Lo(e,t,h),c.selfJoin&&h-o>=I&&p===0&&u!==`miter`&&Io(e,t,h),a||(Vo(e,t,n,r,h,i),e.stroke())}var Wo=class extends Ta{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=it(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=N(l,o-a),f=st(r,a,o)&&a!==o,p=d>=L||f,m=lt(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>L?Math.floor(n/L):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(I,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Ho(e,this,s,i,a),Uo(e,this,s,i,a),e.restore()}};function Go(e,t,n=t){e.lineCap=N(n.borderCapStyle,t.borderCapStyle),e.setLineDash(N(n.borderDash,t.borderDash)),e.lineDashOffset=N(n.borderDashOffset,t.borderDashOffset),e.lineJoin=N(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=N(n.borderWidth,t.borderWidth),e.strokeStyle=N(n.borderColor,t.borderColor)}function Ko(e,t,n){e.lineTo(n.x,n.y)}function qo(e){return e.stepped?rn:e.tension||e.cubicInterpolationMode===`monotone`?an:Ko}function Jo(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=i<o&&a<o||i>s&&a>s;return{count:r,start:c,loop:t.loop,ilen:l<c&&!u?r+l-c:l-c}}function Yo(e,t,n,r){let{points:i,options:a}=t,{count:o,start:s,loop:c,ilen:l}=Jo(i,n,r),u=qo(a),{move:d=!0,reverse:f}=r||{},p,m,h;for(p=0;p<=l;++p)m=i[(s+(f?l-p:p))%o],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,h,m,f,a.stepped),h=m);return c&&(m=i[(s+(f?l:0))%o],u(e,h,m,f,a.stepped)),!!c}function Xo(e,t,n,r){let i=t.points,{count:a,start:o,ilen:s}=Jo(i,n,r),{move:c=!0,reverse:l}=r||{},u=0,d=0,f,p,m,h,g,_,v=e=>(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(n<h?h=n:n>g&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function Zo(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?Xo:Yo}function Qo(e){return e.stepped?fr:e.tension||e.cubicInterpolationMode===`monotone`?pr:dr}function $o(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Go(e,t.options),e.stroke(i)}function es(e,t,n,r){let{segments:i,options:a}=t,o=Zo(t);for(let s of i)Go(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var ts=typeof Path2D==`function`;function ns(e,t,n,r){ts&&!t.options.segment?$o(e,t,n,r):es(e,t,n,r)}var rs=class extends Ta{static id=`line`;static defaults={borderCapStyle:`butt`,borderDash:[],borderDashOffset:0,borderJoinStyle:`miter`,borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:`default`,fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`&&e!==`fill`};constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Jn(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=Er(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=Cr(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=Qo(n),c,l;for(c=0,l=a.length;c<l;++c){let{start:l,end:u}=a[c],d=i[l],f=i[u];if(d===f){o.push(d);continue}let p=s(d,f,Math.abs((r-d[t])/(f[t]-d[t])),n.stepped);p[t]=e[t],o.push(p)}return o.length===1?o[0]:o}pathSegment(e,t,n){return Zo(this)(e,this,t,n)}path(e,t,n){let r=this.segments,i=Zo(this),a=this._loop;t||=0,n||=this.points.length-t;for(let o of r)a&=i(e,this,o,{start:t,end:t+n-1});return!!a}draw(e,t,n,r){let i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),ns(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function is(e,t,n,r){let i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}var as=class extends Ta{static id=`point`;parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:`circle`,radius:3,rotation:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){let r=this.options,{x:i,y:a}=this.getProps([`x`,`y`],n);return(e-i)**2+(t-a)**2<(r.hitRadius+r.radius)**2}inXRange(e,t){return is(this,e,`x`,t)}inYRange(e,t){return is(this,e,`y`,t)}getCenterPoint(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);let n=t&&e.borderWidth||0;return(t+n)*2}draw(e,t){let n=this.options;this.skip||n.radius<.1||!en(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Qt(e,n,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};function os(e,t){let{x:n,y:r,base:i,width:a,height:o}=e.getProps([`x`,`y`,`base`,`width`,`height`],t),s,c,l,u,d;return e.horizontal?(d=o/2,s=Math.min(n,i),c=Math.max(n,i),l=r-d,u=r+d):(d=a/2,s=n-d,c=n+d,l=Math.min(r,i),u=Math.max(r,i)),{left:s,top:l,right:c,bottom:u}}function ss(e,t,n,r){return e?0:B(t,n,r)}function cs(e,t,n){let r=e.options.borderWidth,i=e.borderSkipped,a=gn(r);return{t:ss(i.top,a.top,0,n),r:ss(i.right,a.right,0,t),b:ss(i.bottom,a.bottom,0,n),l:ss(i.left,a.left,0,t)}}function ls(e,t,n){let{enableBorderRadius:r}=e.getProps([`enableBorderRadius`]),i=e.options.borderRadius,a=_n(i),o=Math.min(t,n),s=e.borderSkipped,c=r||j(i);return{topLeft:ss(!c||s.top||s.left,a.topLeft,0,o),topRight:ss(!c||s.top||s.right,a.topRight,0,o),bottomLeft:ss(!c||s.bottom||s.left,a.bottomLeft,0,o),bottomRight:ss(!c||s.bottom||s.right,a.bottomRight,0,o)}}function us(e){let t=os(e),n=t.right-t.left,r=t.bottom-t.top,i=cs(e,n/2,r/2),a=ls(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function ds(e,t,n,r){let i=t===null,a=n===null,o=e&&!(i&&a)&&os(e,r);return o&&(i||lt(t,o.left,o.right))&&(a||lt(n,o.top,o.bottom))}function fs(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function ps(e,t){e.rect(t.x,t.y,t.w,t.h)}function ms(e,t,n={}){let r=e.x===n.x?0:-t,i=e.y===n.y?0:-t,a=(e.x+e.w===n.x+n.w?0:t)-r,o=(e.y+e.h===n.y+n.h?0:t)-i;return{x:e.x+r,y:e.y+i,w:e.w+a,h:e.h+o,radius:e.radius}}var hs=class extends Ta{static id=`bar`;static defaults={borderSkipped:`start`,borderWidth:0,borderRadius:0,inflateAmount:`auto`,pointStyle:void 0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};constructor(e){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,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:i,outer:a}=us(this),o=fs(a.radius)?un:ps;e.save(),(a.w!==i.w||a.h!==i.h)&&(e.beginPath(),o(e,ms(a,t,i)),e.clip(),o(e,ms(i,-t,a)),e.fillStyle=n,e.fill(`evenodd`)),e.beginPath(),o(e,ms(i,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return ds(this,e,t,n)}inXRange(e,t){return ds(this,e,null,t)}inYRange(e,t){return ds(this,null,e,t)}getCenterPoint(e){let{x:t,y:n,base:r,horizontal:i}=this.getProps([`x`,`y`,`base`,`horizontal`],e);return{x:i?(t+r)/2:t,y:i?n:(n+r)/2}}getRange(e){return e===`x`?this.width/2:this.height/2}};function gs(e,t,n){let r=e.segments,i=e.points,a=t.points,o=[];for(let e of r){let{start:r,end:s}=e;s=ys(r,s,i);let c=_s(n,i[r],i[s],e.loop);if(!t.segments){o.push({source:e,target:c,start:i[r],end:i[s]});continue}let l=Cr(t,c);for(let t of l){let r=_s(n,a[t.start],a[t.end],t.loop),s=Sr(e,i,r);for(let e of s)o.push({source:e,target:t,start:{[n]:bs(c,r,`start`,Math.max)},end:{[n]:bs(c,r,`end`,Math.min)}})}}return o}function _s(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e===`angle`&&(i=z(i),a=z(a)),{property:e,start:i,end:a}}function vs(e,t){let{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:e,end:t})=>{t=ys(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function ys(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function bs(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function xs(e,t){let n=[],r=!1;return A(e)?(r=!0,n=e):n=vs(e,t),n.length?new rs({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Ss(e){return e&&e.fill!==!1}function Cs(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!M(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function ws(e,t,n){let r=Os(e);if(j(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return M(i)&&Math.floor(i)===i?Ts(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function Ts(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function Es(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:j(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Ds(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:j(e)?e.value:t.getBaseValue(),r}function Os(e){let t=e.options,n=t.fill,r=N(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function ks(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=As(t,n);s.push(xs({x:null,y:t.bottom},r));for(let e=0;e<a.length;e++){let t=a[e];for(let e=t.start;e<=t.end;e++)js(i,o[e],s)}return new rs({points:i,options:{}})}function As(e,t){let n=[],r=e.getMatchingVisibleMetas(`line`);for(let e=0;e<r.length;e++){let i=r[e];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function js(e,t,n){let r=[];for(let i=0;i<n.length;i++){let a=n[i],{first:o,last:s,point:c}=Ms(a,t,`x`);if(!(!c||o&&s)){if(o)r.unshift(c);else if(e.push(c),!s)break}}e.push(...r)}function Ms(e,t,n){let r=e.interpolate(t,n);if(!r)return{};let i=r[n],a=e.segments,o=e.points,s=!1,c=!1;for(let e=0;e<a.length;e++){let t=a[e],r=o[t.start][n],l=o[t.end][n];if(lt(i,r,l)){s=i===r,c=i===l;break}}return{first:s,last:c,point:r}}var Ns=class{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){let{x:r,y:i,radius:a}=this;return t||={start:0,end:L},e.arc(r,i,a,t.end,t.start,!0),!n.bounds}interpolate(e){let{x:t,y:n,radius:r}=this,i=e.angle;return{x:t+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}};function Ps(e){let{chart:t,fill:n,line:r}=e;if(M(n))return Fs(t,n);if(n===`stack`)return ks(e);if(n===`shape`)return!0;let i=Is(e);return i instanceof Ns?i:xs(i,r)}function Fs(e,t){let n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Is(e){return(e.scale||{}).getPointPositionForValue?Rs(e):Ls(e)}function Ls(e){let{scale:t={},fill:n}=e,r=Es(n,t);if(M(r)){let e=t.isHorizontal();return{x:e?r:null,y:e?null:r}}return null}function Rs(e){let{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,o=Ds(n,t,a),s=[];if(r.grid.circular){let e=t.getPointPositionForValue(0,a);return new Ns({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(o)})}for(let e=0;e<i;++e)s.push(t.getPointPositionForValue(e,o));return s}function zs(e,t,n){let r=Ps(t),{chart:i,index:a,line:o,scale:s,axis:c}=t,l=o.options,u=l.fill,d=l.backgroundColor,{above:f=d,below:p=d}=u||{},m=Nr(i,i.getDatasetMeta(a));r&&o.points.length&&(tn(e,n),Bs(e,{line:o,target:r,above:f,below:p,area:n,scale:s,axis:c,clip:m}),nn(e))}function Bs(e,t){let{line:n,target:r,above:i,below:a,area:o,scale:s,clip:c}=t,l=n._loop?`angle`:t.axis;e.save();let u=a;a!==i&&(l===`x`?(Vs(e,r,o.top),Us(e,{line:n,target:r,color:i,scale:s,property:l,clip:c}),e.restore(),e.save(),Vs(e,r,o.bottom)):l===`y`&&(Hs(e,r,o.left),Us(e,{line:n,target:r,color:a,scale:s,property:l,clip:c}),e.restore(),e.save(),Hs(e,r,o.right),u=i)),Us(e,{line:n,target:r,color:u,scale:s,property:l,clip:c}),e.restore()}function Vs(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[ys(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(l.x,n),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(u.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Hs(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[ys(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(n,l.y),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(n,u.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Us(e,t){let{line:n,target:r,property:i,color:a,scale:o,clip:s}=t,c=gs(n,r,i);for(let{source:t,target:l,start:u,end:d}of c){let{style:{backgroundColor:c=a}={}}=t,f=r!==!0;e.save(),e.fillStyle=c,Ws(e,o,s,f&&_s(i,u,d)),e.beginPath();let p=!!n.pathSegment(e,t),m;if(f){p?e.closePath():Gs(e,r,d,i);let t=!!r.pathSegment(e,l,{move:p,reverse:!0});m=p&&t,m||Gs(e,r,u,i)}e.closePath(),e.fill(m?`evenodd`:`nonzero`),e.restore()}}function Ws(e,t,n,r){let i=t.chart.chartArea,{property:a,start:o,end:s}=r||{};if(a===`x`||a===`y`){let t,r,c,l;a===`x`?(t=o,r=i.top,c=s,l=i.bottom):(t=i.left,r=o,c=i.right,l=s),e.beginPath(),n&&(t=Math.max(t,n.left),c=Math.min(c,n.right),r=Math.max(r,n.top),l=Math.min(l,n.bottom)),e.rect(t,r,c-t,l-r),e.clip()}}function Gs(e,t,n,r){let i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Ks={id:`filler`,afterDatasetsUpdate(e,t,n){let r=(e.data.datasets||[]).length,i=[],a,o,s,c;for(o=0;o<r;++o)a=e.getDatasetMeta(o),s=a.dataset,c=null,s&&s.options&&s instanceof rs&&(c={visible:e.isDatasetVisible(o),index:o,fill:ws(s,o,r),chart:e,axis:a.controller.options.indexAxis,scale:a.vScale,line:s}),a.$filler=c,i.push(c);for(o=0;o<r;++o)c=i[o],!(!c||c.fill===!1)&&(c.fill=Cs(i,o,n.propagate))},beforeDraw(e,t,n){let r=n.drawTime===`beforeDraw`,i=e.getSortedVisibleDatasetMetas(),a=e.chartArea;for(let t=i.length-1;t>=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&zs(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;Ss(n)&&zs(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;!Ss(r)||n.drawTime!==`beforeDatasetDraw`||zs(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},qs=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Js=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Ys=class extends Ta{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=P(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=W(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=qs(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=Xs(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=gr(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=V(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=V(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=V(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=V(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;tn(e,this),this._draw(),nn(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=H.color,s=gr(e.rtl,this.left,this.width),c=W(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=qs(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=N(n.lineWidth,1);if(r.fillStyle=N(n.fillStyle,o),r.lineCap=N(n.lineCap,`butt`),r.lineDashOffset=N(n.lineDashOffset,0),r.lineJoin=N(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=N(n.strokeStyle,o),r.setLineDash(N(n.lineDash,[])),a.usePointStyle)$t(r,{radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},s.xPlus(e,p/2),t+d,a.pointStyleWidth&&p);else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=_n(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?un(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){ln(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:V(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:V(i,this.top+y+l,this.bottom-t[0].height),line:0},_r(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;if(s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=V(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=V(i,this.top+y+l,this.bottom-t[f.line].height)),g(s.x(S),C,o),S=St(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=$s(o,e)+l}else f.y+=b}),vr(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=W(t.font),r=U(t.padding);if(!t.display)return;let i=gr(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=V(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+V(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=V(o,u,u+d);a.textAlign=i.textAlign(xt(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,ln(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=W(e.font),n=U(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(lt(e,this.left,this.right)&<(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],lt(e,r.left,r.left+r.width)&<(t,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){let t=this.options;if(!ec(e.type,t))return;let n=this._getLegendItemAt(e.x,e.y);if(e.type===`mousemove`||e.type===`mouseout`){let r=this._hoveredItem,i=Js(r,n);r&&!i&&P(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!i&&P(t.onHover,[e,n,this],this)}else n&&P(t.onClick,[e,n,this],this)}};function Xs(e,t,n,r,i){return{itemWidth:Zs(r,e,t,n),itemHeight:Qs(i,r,t.lineHeight)}}function Zs(e,t,n,r){let i=e.text;return i&&typeof i!=`string`&&(i=i.reduce((e,t)=>e.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function Qs(e,t,n){let r=e;return typeof t.text!=`string`&&(r=$s(t,n)),r}function $s(e,t){return t*(e.text?e.text.length:0)}function ec(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var tc={id:`legend`,_element:Ys,start(e,t,n){let r=e.legend=new Ys({ctx:e.ctx,options:n,chart:e});ta.configure(e,r,n),ta.addBox(e,r)},stop(e){ta.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;ta.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=U(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},nc=class extends Ta{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let r=A(n.text)?n.text.length:1;this._padding=U(n.padding);let i=r*W(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){let e=this.options.position;return e===`top`||e===`bottom`}_drawArgs(e){let{top:t,left:n,bottom:r,right:i,options:a}=this,o=a.align,s=0,c,l,u;return this.isHorizontal()?(l=V(o,n,i),u=t+e,c=i-n):(a.position===`left`?(l=n+e,u=V(o,r,t),s=I*-.5):(l=i-e,u=V(o,t,r),s=I*.5),c=r-t),{titleX:l,titleY:u,maxWidth:c,rotation:s}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let n=W(t.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:o,rotation:s}=this._drawArgs(r);ln(e,t.text,0,0,n,{color:t.color,maxWidth:o,rotation:s,textAlign:xt(t.align),textBaseline:`middle`,translation:[i,a]})}};function rc(e,t){let n=new nc({ctx:e.ctx,options:t,chart:e});ta.configure(e,n,t),ta.addBox(e,n),e.titleBlock=n}var ic={id:`title`,_element:nc,start(e,t,n){rc(e,n)},stop(e){let t=e.titleBlock;ta.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let r=e.titleBlock;ta.configure(e,r,n),r.options=n},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}},ac={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){let n=e[t].element;if(n&&n.hasValue()){let e=n.tooltipPosition();r.add(e.x),i+=e.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((e,t)=>e+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a<o;++a){let n=e[a].element;if(n&&n.hasValue()){let e=at(t,n.getCenterPoint());e<i&&(i=e,s=n)}}if(s){let e=s.tooltipPosition();n=e.x,r=e.y}return{x:n,y:r}}};function oc(e,t){return t&&(A(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function sc(e){return(typeof e==`string`||e instanceof String)&&e.indexOf(`
|
|
2
2
|
`)>-1?e.split(`
|
|
3
|
-
`):e}function cc(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function lc(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=W(t.bodyFont),l=W(t.titleFont),u=W(t.footerFont),d=a.length,f=i.length,p=r.length,m=U(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,F(e.title,y),n.font=c.string,F(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,F(r,e=>{F(e.before,y),F(e.lines,y),F(e.after,y)}),v=0,n.font=u.string,F(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function uc(e,t){let{y:n,height:r}=t;return n<r/2?`top`:n>e.height-r/2?`bottom`:`center`}function dc(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function fc(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),dc(l,e,t,n)&&(l=`center`),l}function pc(e,t,n){let r=n.yAlign||t.yAlign||uc(e,n);return{xAlign:n.xAlign||t.xAlign||fc(e,t,n,r),yAlign:r}}function mc(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function hc(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:t===`bottom`?r-=i+n:r-=i/2,r}function gc(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=_n(o),m=mc(t,s),h=hc(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:B(m,0,r.width-t.width),y:B(h,0,r.height-t.height)}}function _c(e,t,n){let r=U(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function vc(e){return oc([],sc(e))}function yc(e,t,n){return yn(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function bc(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var xc={beforeTitle:be,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return``},afterTitle:be,beforeBody:be,beforeLabel:be,label(e){if(this&&this.options&&this.options.mode===`dataset`)return e.label+`: `+e.formattedValue||e.formattedValue;let t=e.dataset.label||``;t&&(t+=`: `);let n=e.formattedValue;return k(n)||(t+=n),t},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:be,afterBody:be,beforeFooter:be,footer:be,afterFooter:be};function Sc(e,t,n,r){let i=e[t].call(n,r);return i===void 0?xc[t].call(n,r):i}var Cc=class extends Ta{static positioners=ac;constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,i=new Rr(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||=yc(this.chart.getContext(),this,this._tooltipItems)}getTitle(e,t){let{callbacks:n}=t,r=Sc(n,`beforeTitle`,this,e),i=Sc(n,`title`,this,e),a=Sc(n,`afterTitle`,this,e),o=[];return o=oc(o,sc(r)),o=oc(o,sc(i)),o=oc(o,sc(a)),o}getBeforeBody(e,t){return vc(Sc(t.callbacks,`beforeBody`,this,e))}getBody(e,t){let{callbacks:n}=t,r=[];return F(e,e=>{let t={before:[],lines:[],after:[]},i=bc(n,e);oc(t.before,sc(Sc(i,`beforeLabel`,this,e))),oc(t.lines,Sc(i,`label`,this,e)),oc(t.after,sc(Sc(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return vc(Sc(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=Sc(n,`beforeFooter`,this,e),i=Sc(n,`footer`,this,e),a=Sc(n,`afterFooter`,this,e),o=[];return o=oc(o,sc(r)),o=oc(o,sc(i)),o=oc(o,sc(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;s<c;++s)o.push(cc(this.chart,t[s]));return e.filter&&(o=o.filter((t,r,i)=>e.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),F(o,t=>{let n=bc(e.callbacks,t);r.push(Sc(n,`labelColor`,this,t)),i.push(Sc(n,`labelPointStyle`,this,t)),a.push(Sc(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=ac[n.position].call(this,r,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);let t=this._size=lc(this,n),o=Object.assign({},e,t),s=pc(this.chart,n,o),c=gc(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=_n(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=gr(n.rtl,this.x,this.width);for(e.x=_c(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=W(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;s<i;++s)t.fillText(r[s],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+o,s+1===i&&(e.y+=n.titleMarginBottom-o)}}_drawColorBox(e,t,n,r,i){let a=this.labelColors[n],o=this.labelPointStyles[n],{boxHeight:s,boxWidth:c}=i,l=W(i.bodyFont),u=_c(this,`left`,i),d=r.x(u),f=s<l.lineHeight?(l.lineHeight-s)/2:0,p=t.y+f;if(i.usePointStyle){let t={radius:Math.min(c,s)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},n=r.leftForLtr(d,c)+c/2,l=p+s/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Qt(e,t,n,l),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,Qt(e,t,n,l)}else{e.lineWidth=j(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;let t=r.leftForLtr(d,c),n=r.leftForLtr(r.xPlus(d,1),c-2),o=_n(a.borderRadius);Object.values(o).some(e=>e!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,un(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),un(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=W(n.bodyFont),d=u.lineHeight,f=0,p=gr(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=_c(this,h,n),t.fillStyle=n.bodyColor,F(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y<x;++y){for(g=r[y],_=this.labelTextColors[y],t.fillStyle=_,F(g.before,m),v=g.lines,o&&v.length&&(this._drawColorBox(t,e,y,p,n),d=Math.max(u.lineHeight,s)),b=0,S=v.length;b<S;++b)m(v[b]),d=u.lineHeight;F(g.after,m)}f=0,d=u.lineHeight,F(this.afterBody,m),e.y-=i}drawFooter(e,t,n){let r=this.footer,i=r.length,a,o;if(i){let s=gr(n.rtl,this.x,this.width);for(e.x=_c(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline=`middle`,a=W(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,o=0;o<i;++o)t.fillText(r[o],s.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){let{xAlign:i,yAlign:a}=this,{x:o,y:s}=e,{width:c,height:l}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=_n(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(o+u,s),a===`top`&&this.drawCaret(e,t,n,r),t.lineTo(o+c-d,s),t.quadraticCurveTo(o+c,s,o+c,s+d),a===`center`&&i===`right`&&this.drawCaret(e,t,n,r),t.lineTo(o+c,s+l-p),t.quadraticCurveTo(o+c,s+l,o+c-p,s+l),a===`bottom`&&this.drawCaret(e,t,n,r),t.lineTo(o+f,s+l),t.quadraticCurveTo(o,s+l,o,s+l-f),a===`center`&&i===`left`&&this.drawCaret(e,t,n,r),t.lineTo(o,s+u),t.quadraticCurveTo(o,s,o+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=ac[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=lc(this,e),o=Object.assign({},n,this._size),s=pc(t,e,o),c=gc(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=U(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),_r(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),vr(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!Te(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!Te(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=ac[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},wc={id:`tooltip`,_element:Cc,positioners:ac,afterInit(e,t,n){n&&(e.tooltip=new Cc({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:xc},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},Tc=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Ec(e,t,n,r){let i=e.indexOf(t);return i===-1?Tc(e,t,n,r):i===e.lastIndexOf(t)?i:n}var Dc=(e,t)=>e===null?null:B(Math.round(e),0,t);function Oc(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var kc=class extends Ga{static id=`category`;static defaults={ticks:{callback:Oc}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let t=this._addedLabels;if(t.length){let e=this.getLabels();for(let{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(k(e))return null;let n=this.getLabels();return t=isFinite(t)&&n[t]===e?t:Ec(n,e,N(t,e),this._addedLabels),Dc(t,n.length-1)}determineDataLimits(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),{min:n,max:r}=this.getMinMax(!0);this.options.bounds===`ticks`&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){let e=this.min,t=this.max,n=this.options.offset,r=[],i=this.getLabels();i=e===0&&t===i.length-1?i:i.slice(e,t+1),this._valueRange=Math.max(i.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)r.push({value:n});return r}getLabelForValue(e){return Oc.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!=`number`&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function Ac(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!k(a),_=!k(o),v=!k(c),y=(h-m)/(u+1),b=Ye((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=Ye(w*b/p/f)*f),k(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&$e((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Je(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(rt(b),rt(S));x=10**(k(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),S<a&&E++,Je(Math.round((S+E*b)*x)/x,a,jc(a,y,e))&&E++):S<a&&E++);E<w;++E){let e=Math.round((S+E*b)*x)/x;if(_&&e>o)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Je(n[n.length-1].value,o,jc(o,y,e))?n[n.length-1].value=o:n.push({value:o}):(!_||C===o)&&n.push({value:C}),n}function jc(e,t,{horizontal:n,minRotation:r}){let i=tt(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var Mc=class extends Ga{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return k(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=qe(r),t=qe(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=Ac({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&et(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return Rt(e,this.chart.options.locale,this.options.ticks.format)}},Nc=class extends Mc{static id=`linear`;static defaults={ticks:{callback:Vt.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=M(e)?e:0,this.max=M(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=tt(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},Pc=e=>Math.floor(Ke(e)),Fc=(e,t)=>10**(Pc(e)+t);function Ic(e){return e/10**Pc(e)==1}function Lc(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function Rc(e,t){let n=Pc(t-e);for(;Lc(e,t,n)>10;)n++;for(;Lc(e,t,n)<10;)n--;return Math.min(n,Pc(e))}function zc(e,{min:t,max:n}){t=Se(e.min,t);let r=[],i=Pc(t),a=Rc(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=Se(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f<n;)r.push({value:f,major:Ic(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=Se(e.max,f);return r.push({value:p,major:Ic(p),significand:d}),r}var Bc=class extends Ga{static id=`logarithmic`;static defaults={ticks:{callback:Vt.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=Mc.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return M(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=M(e)?Math.max(0,e):null,this.max=M(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!M(this._userMin)&&(this.min=e===Fc(this.min,0)?Fc(this.min,-1):Fc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(Fc(n,-1)),a(Fc(r,1)))),n<=0&&i(Fc(r,-1)),r<=0&&a(Fc(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=zc({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&et(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:Rt(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Ke(e),this._valueRange=Ke(this.max)-Ke(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ke(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}};function Vc(e){let t=e.ticks;if(t.display&&e.display){let e=U(t.backdropPadding);return N(t.font&&t.font.size,H.font.size)+e.height}return 0}function Hc(e,t,n){return n=A(n)?n:[n],{w:Yt(e,t.string,n),h:n.length*t.lineHeight}}function Uc(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Wc(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?I/a:0;for(let c=0;c<a;c++){let a=o.setContext(e.getPointLabelContext(c));i[c]=a.padding;let l=e.getPointPosition(c,e.drawingArea+i[c],s),u=W(a.font),d=Hc(e.ctx,u,e._pointLabels[c]);r[c]=d;let f=z(e.getIndexAngle(c)+s),p=Math.round(nt(f));Gc(n,t,f,Uc(p,l.x,d.w,0,180),Uc(p,l.y,d.h,90,270))}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Jc(e,r,i)}function Gc(e,t,n,r,i){let a=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),s=0,c=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(c=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function Kc(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(nt(z(c.angle+R))),u=Zc(c.y,s.h,l),d=Yc(l),f=Xc(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function qc(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(en({x:n,y:r},t)||en({x:n,y:a},t)||en({x:i,y:r},t)||en({x:i,y:a},t))}function Jc(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:Vc(a)/2,additionalAngle:o?I/i:0},l;for(let a=0;a<i;a++){c.padding=n[a],c.size=t[a];let i=Kc(e,a,c);r.push(i),s===`auto`&&(i.visible=qc(i,l),i.visible&&(l=i))}return r}function Yc(e){return e===0||e===180?`center`:e<180?`left`:`right`}function Xc(e,t,n){return n===`right`?e-=t:n===`center`&&(e-=t/2),e}function Zc(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Qc(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!k(s)){let n=_n(t.borderRadius),c=U(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),un(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function $c(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));Qc(n,a,t);let o=W(a.font),{x:s,y:c,textAlign:l}=t;ln(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function el(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,L);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a<r;a++)n=e.getPointPosition(a,t),i.lineTo(n.x,n.y)}}function tl(e,t,n,r,i){let a=e.ctx,o=t.circular,{color:s,lineWidth:c}=t;!o&&!r||!s||!c||n<0||(a.save(),a.strokeStyle=s,a.lineWidth=c,a.setLineDash(i.dash||[]),a.lineDashOffset=i.dashOffset,a.beginPath(),el(e,n,o,r),a.closePath(),a.stroke(),a.restore())}function nl(e,t,n){return yn(e,{label:n,index:t,type:`pointLabel`})}(class extends Mc{static id=`radialLinear`;static defaults={display:!0,animate:!0,position:`chartArea`,angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Vt.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":`borderColor`,"pointLabels.color":`color`,"ticks.color":`color`};static descriptors={angleLines:{_fallback:`grid`}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=U(Vc(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=M(e)&&!isNaN(e)?e:0,this.max=M(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Vc(this.options))}generateTickLabels(e){Mc.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{let n=P(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?Wc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=L/(this._pointLabels.length||1),n=this.options.startAngle||0;return z(e*t+tt(n))}getDistanceFromCenterForValue(e){if(k(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(k(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let n=t[e];return nl(this.getContext(),e,n)}}getPointPosition(e,t,n=0){let r=this.getIndexAngle(e)-R+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:n,right:r,bottom:i}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:i}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let n=this.ctx;n.save(),n.beginPath(),el(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:n,grid:r,border:i}=t,a=this._pointLabels.length,o,s,c;if(t.pointLabels.display&&$c(this,a),r.display&&this.ticks.forEach((e,t)=>{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);tl(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;!a||!i||(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=W(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=U(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}ln(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}});var rl={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}},il=Object.keys(rl);function al(e,t){return e-t}function ol(e,t){if(k(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),M(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(Qe(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function sl(e,t,n,r){let i=il.length;for(let a=il.indexOf(e);a<i-1;++a){let e=rl[il[a]],i=e.steps?e.steps:2**53-1;if(e.common&&Math.ceil((n-t)/(i*e.size))<=r)return il[a]}return il[i-1]}function cl(e,t,n,r,i){for(let a=il.length-1;a>=il.indexOf(n);a--){let n=il[a];if(rl[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return il[n?il.indexOf(n):0]}function ll(e){for(let t=il.indexOf(e)+1,n=il.length;t<n;++t)if(rl[il[t]].common)return il[t]}function ul(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:r,hi:i}=ut(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function dl(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function fl(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:dl(e,r,i,n)}var pl=class extends Ga{static id=`time`;static defaults={bounds:`data`,adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:`millisecond`,displayFormats:{}},ticks:{source:`auto`,callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit=`day`,this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){let n=e.time||={},r=this._adapter=new ki._date(e.adapters.date);r.init(t),Ae(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:ol(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,n=e.time.unit||`day`,{min:r,max:i,minDefined:a,maxDefined:o}=this.getUserBounds();function s(e){!a&&!isNaN(e.min)&&(r=Math.min(r,e.min)),!o&&!isNaN(e.max)&&(i=Math.max(i,e.max))}(!a||!o)&&(s(this._getLabelBounds()),(e.bounds!==`ticks`||e.ticks.source!==`labels`)&&s(this.getMinMax(!1))),r=M(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),i=M(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=1/0,n=-1/0;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){let e=this.options,t=e.time,n=e.ticks,r=n.source===`labels`?this.getLabelTimestamps():this._generate();e.bounds===`ticks`&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let i=this.min,a=this.max,o=pt(r,i,a);return this._unit=t.unit||(n.autoSkip?sl(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):cl(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit===`year`?void 0:ll(this._unit),this.initOffsets(r),e.reverse&&o.reverse(),fl(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=B(t,0,a),n=B(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||sl(i.minUnit,t,n,this._getLabelCapacity(t)),o=N(r.ticks.stepSize,1),s=a===`week`?i.isoWeekday:!1,c=Qe(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+e.add(d,o,a),f++)ul(l,d,p);return(d===n||r.bounds===`ticks`||f===1)&&ul(l,d,p),Object.keys(l).sort(al).map(e=>+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return P(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,n=this.ctx.measureText(e).width,r=tt(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:n*i+o*a,h:n*a+o*i}}_getLabelCapacity(e){let t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,i=this._tickFormatFunction(e,0,fl(this,[e],this._majorUnit),r),a=this._getLabelSize(i),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t<n;++t)e=e.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],t,n;if(e.length)return e;let r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(ol(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return _t(e.sort(al))}};function ml(e,t,n){let r=0,i=e.length-1,a,o,s,c;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=dt(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=dt(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}(class extends pl{static id=`timeseries`;static defaults=pl.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=ml(t,this.min),this._tableRange=ml(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a<o;++a)c=e[a],c>=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;a<o;++a)l=r[a+1],s=r[a-1],c=r[a],Math.round((l+s)/2)!==c&&i.push({time:c,pos:a/(o-1)});return i}_generate(){let e=this.min,t=this.max,n=super.getDataTimestamps();return(!n.includes(e)||!n.length)&&n.splice(0,0,e),(!n.includes(t)||n.length===1)&&n.push(t),n.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(ml(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return ml(this._table,n*this._tableRange+this._minPos,!0)}});var hl=n(),gl=e(r(),1),_l=`label`;function vl(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function yl(e,t){let n=e.options;n&&t&&Object.assign(n,t)}function bl(e,t){e.labels=t}function xl(e,t,n=_l){let r=[];e.datasets=t.map(t=>{let i=e.datasets.find(e=>e[n]===t[n]);return!i||!t.data||r.includes(i)?{...t}:(r.push(i),Object.assign(i,t),i)})}function Sl(e,t=_l){let n={labels:[],datasets:[]};return bl(n,e.labels),xl(n,e.datasets,t),n}function Cl(e,t){let{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:a,type:o,data:s,options:c,plugins:l=[],fallbackContent:u,updateMode:d,...f}=e,p=(0,gl.useRef)(null),m=(0,gl.useRef)(null),h=()=>{p.current&&(m.current=new Po(p.current,{type:o,data:Sl(s,a),options:c&&{...c},plugins:l}),vl(t,m.current))},g=()=>{vl(t,null),m.current&&=(m.current.destroy(),null)};return(0,gl.useEffect)(()=>{!i&&m.current&&c&&yl(m.current,c)},[i,c]),(0,gl.useEffect)(()=>{!i&&m.current&&bl(m.current.config.data,s.labels)},[i,s.labels]),(0,gl.useEffect)(()=>{!i&&m.current&&s.datasets&&xl(m.current.config.data,s.datasets,a)},[i,s.datasets]),(0,gl.useEffect)(()=>{m.current&&(i?(g(),setTimeout(h)):m.current.update(d))},[i,c,s.labels,s.datasets,d]),(0,gl.useEffect)(()=>{m.current&&(g(),setTimeout(h))},[o]),(0,gl.useEffect)(()=>(h(),()=>g()),[]),(0,hl.jsx)(`canvas`,{ref:p,role:`img`,height:n,width:r,...f,children:u})}var wl=(0,gl.forwardRef)(Cl);function Tl(e,t){return Po.register(t),(0,gl.forwardRef)((t,n)=>(0,hl.jsx)(wl,{...t,ref:n,type:e}))}var El=Tl(`line`,Ti),Dl=Tl(`bar`,Si),Ol=Tl(`pie`,Ei),kl=Tl(`scatter`,Di),Al=e(t(((e,t)=>{(function(e,n,r,i){var a=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],o=n.createElement(`div`),s=`function`,c=Math.round,l=Math.abs,u=Date.now;function d(e,t,n){return setTimeout(y(e,n),t)}function f(e,t,n){return Array.isArray(e)?(p(e,n[t],n),!0):!1}function p(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function m(t,n,r){var i=`DEPRECATED METHOD: `+n+`
|
|
3
|
+
`):e}function cc(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function lc(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=W(t.bodyFont),l=W(t.titleFont),u=W(t.footerFont),d=a.length,f=i.length,p=r.length,m=U(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,F(e.title,y),n.font=c.string,F(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,F(r,e=>{F(e.before,y),F(e.lines,y),F(e.after,y)}),v=0,n.font=u.string,F(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function uc(e,t){let{y:n,height:r}=t;return n<r/2?`top`:n>e.height-r/2?`bottom`:`center`}function dc(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function fc(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),dc(l,e,t,n)&&(l=`center`),l}function pc(e,t,n){let r=n.yAlign||t.yAlign||uc(e,n);return{xAlign:n.xAlign||t.xAlign||fc(e,t,n,r),yAlign:r}}function mc(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function hc(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:t===`bottom`?r-=i+n:r-=i/2,r}function gc(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=_n(o),m=mc(t,s),h=hc(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:B(m,0,r.width-t.width),y:B(h,0,r.height-t.height)}}function _c(e,t,n){let r=U(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function vc(e){return oc([],sc(e))}function yc(e,t,n){return yn(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function bc(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var xc={beforeTitle:be,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return``},afterTitle:be,beforeBody:be,beforeLabel:be,label(e){if(this&&this.options&&this.options.mode===`dataset`)return e.label+`: `+e.formattedValue||e.formattedValue;let t=e.dataset.label||``;t&&(t+=`: `);let n=e.formattedValue;return k(n)||(t+=n),t},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:be,afterBody:be,beforeFooter:be,footer:be,afterFooter:be};function Sc(e,t,n,r){let i=e[t].call(n,r);return i===void 0?xc[t].call(n,r):i}var Cc=class extends Ta{static positioners=ac;constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,i=new Rr(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||=yc(this.chart.getContext(),this,this._tooltipItems)}getTitle(e,t){let{callbacks:n}=t,r=Sc(n,`beforeTitle`,this,e),i=Sc(n,`title`,this,e),a=Sc(n,`afterTitle`,this,e),o=[];return o=oc(o,sc(r)),o=oc(o,sc(i)),o=oc(o,sc(a)),o}getBeforeBody(e,t){return vc(Sc(t.callbacks,`beforeBody`,this,e))}getBody(e,t){let{callbacks:n}=t,r=[];return F(e,e=>{let t={before:[],lines:[],after:[]},i=bc(n,e);oc(t.before,sc(Sc(i,`beforeLabel`,this,e))),oc(t.lines,Sc(i,`label`,this,e)),oc(t.after,sc(Sc(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return vc(Sc(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=Sc(n,`beforeFooter`,this,e),i=Sc(n,`footer`,this,e),a=Sc(n,`afterFooter`,this,e),o=[];return o=oc(o,sc(r)),o=oc(o,sc(i)),o=oc(o,sc(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;s<c;++s)o.push(cc(this.chart,t[s]));return e.filter&&(o=o.filter((t,r,i)=>e.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),F(o,t=>{let n=bc(e.callbacks,t);r.push(Sc(n,`labelColor`,this,t)),i.push(Sc(n,`labelPointStyle`,this,t)),a.push(Sc(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=ac[n.position].call(this,r,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);let t=this._size=lc(this,n),o=Object.assign({},e,t),s=pc(this.chart,n,o),c=gc(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=_n(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=gr(n.rtl,this.x,this.width);for(e.x=_c(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=W(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;s<i;++s)t.fillText(r[s],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+o,s+1===i&&(e.y+=n.titleMarginBottom-o)}}_drawColorBox(e,t,n,r,i){let a=this.labelColors[n],o=this.labelPointStyles[n],{boxHeight:s,boxWidth:c}=i,l=W(i.bodyFont),u=_c(this,`left`,i),d=r.x(u),f=s<l.lineHeight?(l.lineHeight-s)/2:0,p=t.y+f;if(i.usePointStyle){let t={radius:Math.min(c,s)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},n=r.leftForLtr(d,c)+c/2,l=p+s/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Qt(e,t,n,l),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,Qt(e,t,n,l)}else{e.lineWidth=j(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;let t=r.leftForLtr(d,c),n=r.leftForLtr(r.xPlus(d,1),c-2),o=_n(a.borderRadius);Object.values(o).some(e=>e!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,un(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),un(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=W(n.bodyFont),d=u.lineHeight,f=0,p=gr(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=_c(this,h,n),t.fillStyle=n.bodyColor,F(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y<x;++y){for(g=r[y],_=this.labelTextColors[y],t.fillStyle=_,F(g.before,m),v=g.lines,o&&v.length&&(this._drawColorBox(t,e,y,p,n),d=Math.max(u.lineHeight,s)),b=0,S=v.length;b<S;++b)m(v[b]),d=u.lineHeight;F(g.after,m)}f=0,d=u.lineHeight,F(this.afterBody,m),e.y-=i}drawFooter(e,t,n){let r=this.footer,i=r.length,a,o;if(i){let s=gr(n.rtl,this.x,this.width);for(e.x=_c(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline=`middle`,a=W(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,o=0;o<i;++o)t.fillText(r[o],s.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){let{xAlign:i,yAlign:a}=this,{x:o,y:s}=e,{width:c,height:l}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=_n(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(o+u,s),a===`top`&&this.drawCaret(e,t,n,r),t.lineTo(o+c-d,s),t.quadraticCurveTo(o+c,s,o+c,s+d),a===`center`&&i===`right`&&this.drawCaret(e,t,n,r),t.lineTo(o+c,s+l-p),t.quadraticCurveTo(o+c,s+l,o+c-p,s+l),a===`bottom`&&this.drawCaret(e,t,n,r),t.lineTo(o+f,s+l),t.quadraticCurveTo(o,s+l,o,s+l-f),a===`center`&&i===`left`&&this.drawCaret(e,t,n,r),t.lineTo(o,s+u),t.quadraticCurveTo(o,s,o+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=ac[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=lc(this,e),o=Object.assign({},n,this._size),s=pc(t,e,o),c=gc(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=U(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),_r(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),vr(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!Te(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!Te(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=ac[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},wc={id:`tooltip`,_element:Cc,positioners:ac,afterInit(e,t,n){n&&(e.tooltip=new Cc({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:xc},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},Tc=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Ec(e,t,n,r){let i=e.indexOf(t);return i===-1?Tc(e,t,n,r):i===e.lastIndexOf(t)?i:n}var Dc=(e,t)=>e===null?null:B(Math.round(e),0,t);function Oc(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var kc=class extends Ga{static id=`category`;static defaults={ticks:{callback:Oc}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let t=this._addedLabels;if(t.length){let e=this.getLabels();for(let{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(k(e))return null;let n=this.getLabels();return t=isFinite(t)&&n[t]===e?t:Ec(n,e,N(t,e),this._addedLabels),Dc(t,n.length-1)}determineDataLimits(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),{min:n,max:r}=this.getMinMax(!0);this.options.bounds===`ticks`&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){let e=this.min,t=this.max,n=this.options.offset,r=[],i=this.getLabels();i=e===0&&t===i.length-1?i:i.slice(e,t+1),this._valueRange=Math.max(i.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)r.push({value:n});return r}getLabelForValue(e){return Oc.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!=`number`&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function Ac(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!k(a),_=!k(o),v=!k(c),y=(h-m)/(u+1),b=Ye((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=Ye(w*b/p/f)*f),k(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&$e((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Je(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(rt(b),rt(S));x=10**(k(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),S<a&&E++,Je(Math.round((S+E*b)*x)/x,a,jc(a,y,e))&&E++):S<a&&E++);E<w;++E){let e=Math.round((S+E*b)*x)/x;if(_&&e>o)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Je(n[n.length-1].value,o,jc(o,y,e))?n[n.length-1].value=o:n.push({value:o}):(!_||C===o)&&n.push({value:C}),n}function jc(e,t,{horizontal:n,minRotation:r}){let i=tt(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var Mc=class extends Ga{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return k(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=qe(r),t=qe(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=Ac({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&et(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return Rt(e,this.chart.options.locale,this.options.ticks.format)}},Nc=class extends Mc{static id=`linear`;static defaults={ticks:{callback:Vt.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=M(e)?e:0,this.max=M(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=tt(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},Pc=e=>Math.floor(Ke(e)),Fc=(e,t)=>10**(Pc(e)+t);function Ic(e){return e/10**Pc(e)==1}function Lc(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function Rc(e,t){let n=Pc(t-e);for(;Lc(e,t,n)>10;)n++;for(;Lc(e,t,n)<10;)n--;return Math.min(n,Pc(e))}function zc(e,{min:t,max:n}){t=Se(e.min,t);let r=[],i=Pc(t),a=Rc(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=Se(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f<n;)r.push({value:f,major:Ic(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=Se(e.max,f);return r.push({value:p,major:Ic(p),significand:d}),r}var Bc=class extends Ga{static id=`logarithmic`;static defaults={ticks:{callback:Vt.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=Mc.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return M(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=M(e)?Math.max(0,e):null,this.max=M(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!M(this._userMin)&&(this.min=e===Fc(this.min,0)?Fc(this.min,-1):Fc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(Fc(n,-1)),a(Fc(r,1)))),n<=0&&i(Fc(r,-1)),r<=0&&a(Fc(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=zc({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&et(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:Rt(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Ke(e),this._valueRange=Ke(this.max)-Ke(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ke(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}};function Vc(e){let t=e.ticks;if(t.display&&e.display){let e=U(t.backdropPadding);return N(t.font&&t.font.size,H.font.size)+e.height}return 0}function Hc(e,t,n){return n=A(n)?n:[n],{w:Yt(e,t.string,n),h:n.length*t.lineHeight}}function Uc(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Wc(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?I/a:0;for(let c=0;c<a;c++){let a=o.setContext(e.getPointLabelContext(c));i[c]=a.padding;let l=e.getPointPosition(c,e.drawingArea+i[c],s),u=W(a.font),d=Hc(e.ctx,u,e._pointLabels[c]);r[c]=d;let f=z(e.getIndexAngle(c)+s),p=Math.round(nt(f));Gc(n,t,f,Uc(p,l.x,d.w,0,180),Uc(p,l.y,d.h,90,270))}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Jc(e,r,i)}function Gc(e,t,n,r,i){let a=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),s=0,c=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(c=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function Kc(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(nt(z(c.angle+R))),u=Zc(c.y,s.h,l),d=Yc(l),f=Xc(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function qc(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(en({x:n,y:r},t)||en({x:n,y:a},t)||en({x:i,y:r},t)||en({x:i,y:a},t))}function Jc(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:Vc(a)/2,additionalAngle:o?I/i:0},l;for(let a=0;a<i;a++){c.padding=n[a],c.size=t[a];let i=Kc(e,a,c);r.push(i),s===`auto`&&(i.visible=qc(i,l),i.visible&&(l=i))}return r}function Yc(e){return e===0||e===180?`center`:e<180?`left`:`right`}function Xc(e,t,n){return n===`right`?e-=t:n===`center`&&(e-=t/2),e}function Zc(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Qc(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!k(s)){let n=_n(t.borderRadius),c=U(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),un(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function $c(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));Qc(n,a,t);let o=W(a.font),{x:s,y:c,textAlign:l}=t;ln(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function el(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,L);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a<r;a++)n=e.getPointPosition(a,t),i.lineTo(n.x,n.y)}}function tl(e,t,n,r,i){let a=e.ctx,o=t.circular,{color:s,lineWidth:c}=t;!o&&!r||!s||!c||n<0||(a.save(),a.strokeStyle=s,a.lineWidth=c,a.setLineDash(i.dash||[]),a.lineDashOffset=i.dashOffset,a.beginPath(),el(e,n,o,r),a.closePath(),a.stroke(),a.restore())}function nl(e,t,n){return yn(e,{label:n,index:t,type:`pointLabel`})}(class extends Mc{static id=`radialLinear`;static defaults={display:!0,animate:!0,position:`chartArea`,angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Vt.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":`borderColor`,"pointLabels.color":`color`,"ticks.color":`color`};static descriptors={angleLines:{_fallback:`grid`}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=U(Vc(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=M(e)&&!isNaN(e)?e:0,this.max=M(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Vc(this.options))}generateTickLabels(e){Mc.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{let n=P(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?Wc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=L/(this._pointLabels.length||1),n=this.options.startAngle||0;return z(e*t+tt(n))}getDistanceFromCenterForValue(e){if(k(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(k(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let n=t[e];return nl(this.getContext(),e,n)}}getPointPosition(e,t,n=0){let r=this.getIndexAngle(e)-R+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:n,right:r,bottom:i}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:i}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let n=this.ctx;n.save(),n.beginPath(),el(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:n,grid:r,border:i}=t,a=this._pointLabels.length,o,s,c;if(t.pointLabels.display&&$c(this,a),r.display&&this.ticks.forEach((e,t)=>{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);tl(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;!a||!i||(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=W(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=U(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}ln(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}});var rl={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}},il=Object.keys(rl);function al(e,t){return e-t}function ol(e,t){if(k(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),M(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(Qe(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function sl(e,t,n,r){let i=il.length;for(let a=il.indexOf(e);a<i-1;++a){let e=rl[il[a]],i=e.steps?e.steps:2**53-1;if(e.common&&Math.ceil((n-t)/(i*e.size))<=r)return il[a]}return il[i-1]}function cl(e,t,n,r,i){for(let a=il.length-1;a>=il.indexOf(n);a--){let n=il[a];if(rl[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return il[n?il.indexOf(n):0]}function ll(e){for(let t=il.indexOf(e)+1,n=il.length;t<n;++t)if(rl[il[t]].common)return il[t]}function ul(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:r,hi:i}=ut(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function dl(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function fl(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:dl(e,r,i,n)}var pl=class extends Ga{static id=`time`;static defaults={bounds:`data`,adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:`millisecond`,displayFormats:{}},ticks:{source:`auto`,callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit=`day`,this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){let n=e.time||={},r=this._adapter=new ki._date(e.adapters.date);r.init(t),Ae(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:ol(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,n=e.time.unit||`day`,{min:r,max:i,minDefined:a,maxDefined:o}=this.getUserBounds();function s(e){!a&&!isNaN(e.min)&&(r=Math.min(r,e.min)),!o&&!isNaN(e.max)&&(i=Math.max(i,e.max))}(!a||!o)&&(s(this._getLabelBounds()),(e.bounds!==`ticks`||e.ticks.source!==`labels`)&&s(this.getMinMax(!1))),r=M(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),i=M(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=1/0,n=-1/0;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){let e=this.options,t=e.time,n=e.ticks,r=n.source===`labels`?this.getLabelTimestamps():this._generate();e.bounds===`ticks`&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let i=this.min,a=this.max,o=pt(r,i,a);return this._unit=t.unit||(n.autoSkip?sl(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):cl(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit===`year`?void 0:ll(this._unit),this.initOffsets(r),e.reverse&&o.reverse(),fl(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=B(t,0,a),n=B(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||sl(i.minUnit,t,n,this._getLabelCapacity(t)),o=N(r.ticks.stepSize,1),s=a===`week`?i.isoWeekday:!1,c=Qe(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+e.add(d,o,a),f++)ul(l,d,p);return(d===n||r.bounds===`ticks`||f===1)&&ul(l,d,p),Object.keys(l).sort(al).map(e=>+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return P(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,n=this.ctx.measureText(e).width,r=tt(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:n*i+o*a,h:n*a+o*i}}_getLabelCapacity(e){let t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,i=this._tickFormatFunction(e,0,fl(this,[e],this._majorUnit),r),a=this._getLabelSize(i),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t<n;++t)e=e.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],t,n;if(e.length)return e;let r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(ol(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return _t(e.sort(al))}};function ml(e,t,n){let r=0,i=e.length-1,a,o,s,c;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=dt(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=dt(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}(class extends pl{static id=`timeseries`;static defaults=pl.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=ml(t,this.min),this._tableRange=ml(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a<o;++a)c=e[a],c>=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;a<o;++a)l=r[a+1],s=r[a-1],c=r[a],Math.round((l+s)/2)!==c&&i.push({time:c,pos:a/(o-1)});return i}_generate(){let e=this.min,t=this.max,n=super.getDataTimestamps();return(!n.includes(e)||!n.length)&&n.splice(0,0,e),(!n.includes(t)||n.length===1)&&n.push(t),n.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(ml(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return ml(this._table,n*this._tableRange+this._minPos,!0)}});var hl=r(),gl=e(n(),1),_l=`label`;function vl(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function yl(e,t){let n=e.options;n&&t&&Object.assign(n,t)}function bl(e,t){e.labels=t}function xl(e,t,n=_l){let r=[];e.datasets=t.map(t=>{let i=e.datasets.find(e=>e[n]===t[n]);return!i||!t.data||r.includes(i)?{...t}:(r.push(i),Object.assign(i,t),i)})}function Sl(e,t=_l){let n={labels:[],datasets:[]};return bl(n,e.labels),xl(n,e.datasets,t),n}function Cl(e,t){let{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:a,type:o,data:s,options:c,plugins:l=[],fallbackContent:u,updateMode:d,...f}=e,p=(0,gl.useRef)(null),m=(0,gl.useRef)(null),h=()=>{p.current&&(m.current=new Po(p.current,{type:o,data:Sl(s,a),options:c&&{...c},plugins:l}),vl(t,m.current))},g=()=>{vl(t,null),m.current&&=(m.current.destroy(),null)};return(0,gl.useEffect)(()=>{!i&&m.current&&c&&yl(m.current,c)},[i,c]),(0,gl.useEffect)(()=>{!i&&m.current&&bl(m.current.config.data,s.labels)},[i,s.labels]),(0,gl.useEffect)(()=>{!i&&m.current&&s.datasets&&xl(m.current.config.data,s.datasets,a)},[i,s.datasets]),(0,gl.useEffect)(()=>{m.current&&(i?(g(),setTimeout(h)):m.current.update(d))},[i,c,s.labels,s.datasets,d]),(0,gl.useEffect)(()=>{m.current&&(g(),setTimeout(h))},[o]),(0,gl.useEffect)(()=>(h(),()=>g()),[]),(0,hl.jsx)(`canvas`,{ref:p,role:`img`,height:n,width:r,...f,children:u})}var wl=(0,gl.forwardRef)(Cl);function Tl(e,t){return Po.register(t),(0,gl.forwardRef)((t,n)=>(0,hl.jsx)(wl,{...t,ref:n,type:e}))}var El=Tl(`line`,Ti),Dl=Tl(`bar`,Si),Ol=Tl(`pie`,Ei),kl=Tl(`scatter`,Di),Al=e(t(((e,t)=>{(function(e,n,r,i){var a=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],o=n.createElement(`div`),s=`function`,c=Math.round,l=Math.abs,u=Date.now;function d(e,t,n){return setTimeout(y(e,n),t)}function f(e,t,n){return Array.isArray(e)?(p(e,n[t],n),!0):!1}function p(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function m(t,n,r){var i=`DEPRECATED METHOD: `+n+`
|
|
4
4
|
`+r+` AT
|
|
5
5
|
`;return function(){var n=Error(`get-stack-trace`),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,``).replace(/^\s+at\s+/gm,``).replace(/^Object.<anonymous>\s*\(/gm,`{anonymous}()@`):`Unknown Stack Trace`,a=e.console&&(e.console.warn||e.console.log);return a&&a.call(e.console,i,r),t.apply(this,arguments)}}var h=typeof Object.assign==`function`?Object.assign:function(e){if(e===i||e===null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&r!==null)for(var a in r)r.hasOwnProperty(a)&&(t[a]=r[a])}return t},g=m(function(e,t,n){for(var r=Object.keys(t),a=0;a<r.length;)(!n||n&&e[r[a]]===i)&&(e[r[a]]=t[r[a]]),a++;return e},`extend`,"Use `assign`."),_=m(function(e,t){return g(e,t,!0)},`merge`,"Use `assign`.");function v(e,t,n){var r=t.prototype,i=e.prototype=Object.create(r);i.constructor=e,i._super=r,n&&h(i,n)}function y(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return typeof e==s?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function S(e,t,n){p(E(t),function(t){e.addEventListener(t,n,!1)})}function C(e,t,n){p(E(t),function(t){e.removeEventListener(t,n,!1)})}function w(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function T(e,t){return e.indexOf(t)>-1}function E(e){return e.trim().split(/\s+/g)}function D(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function ee(e){return Array.prototype.slice.call(e,0)}function te(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];D(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}function ne(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if(n=a[s],r=n?n+o:t,r in e)return r;s++}return i}var re=1;function ie(){return re++}function ae(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}var oe=/mobile|tablet|ip(ad|hone|od)|android/i,se=`ontouchstart`in e,ce=ne(e,`PointerEvent`)!==i,le=se&&oe.test(navigator.userAgent),ue=`touch`,de=`pen`,fe=`mouse`,pe=`kinect`,me=25,he=1,ge=2,O=4,_e=8,ve=1,ye=2,be=4,xe=8,k=16,A=ye|be,j=xe|k,M=A|j,Se=[`x`,`y`],N=[`clientX`,`clientY`];function Ce(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}Ce.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(ae(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(ae(this.element),this.evWin,this.domHandler)}};function we(e){var t;return t=e.options.inputClass||(ce?Ve:le?Je:se?Qe:Re),new t(e,P)}function P(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&he&&r-i===0,o=t&(O|_e)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,F(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function F(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=De(t),i>1&&!n.firstMultiple?n.firstMultiple=De(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=Oe(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Me(s,c),t.distance=je(s,c),Te(n,t),t.offsetDirection=Ae(t.deltaX,t.deltaY);var d=ke(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=l(d.x)>l(d.y)?d.x:d.y,t.scale=o?Pe(o.pointers,r):1,t.rotation=o?Ne(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,Ee(n,t);var f=e.element;w(t.srcEvent.target,f)&&(f=t.srcEvent.target),t.target=f}function Te(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===he||a.eventType===O)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function Ee(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,a,o,s,c;if(t.eventType!=_e&&(r>me||n.velocity===i)){var u=t.deltaX-n.deltaX,d=t.deltaY-n.deltaY,f=ke(r,u,d);o=f.x,s=f.y,a=l(f.x)>l(f.y)?f.x:f.y,c=Ae(u,d),e.lastInterval=t}else a=n.velocity,o=n.velocityX,s=n.velocityY,c=n.direction;t.velocity=a,t.velocityX=o,t.velocityY=s,t.direction=c}function De(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:c(e.pointers[n].clientX),clientY:c(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:Oe(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Oe(e){var t=e.length;if(t===1)return{x:c(e[0].clientX),y:c(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:c(n/t),y:c(r/t)}}function ke(e,t,n){return{x:t/e||0,y:n/e||0}}function Ae(e,t){return e===t?ve:l(e)>=l(t)?e<0?ye:be:t<0?xe:k}function je(e,t,n){n||=Se;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Me(e,t,n){n||=Se;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function Ne(e,t){return Me(t[1],t[0],N)+Me(e[1],e[0],N)}function Pe(e,t){return je(t[0],t[1],N)/je(e[0],e[1],N)}var Fe={mousedown:he,mousemove:ge,mouseup:O},Ie=`mousedown`,Le=`mousemove mouseup`;function Re(){this.evEl=Ie,this.evWin=Le,this.pressed=!1,Ce.apply(this,arguments)}v(Re,Ce,{handler:function(e){var t=Fe[e.type];t&he&&e.button===0&&(this.pressed=!0),t&ge&&e.which!==1&&(t=O),this.pressed&&(t&O&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:fe,srcEvent:e}))}});var ze={pointerdown:he,pointermove:ge,pointerup:O,pointercancel:_e,pointerout:_e},Be={2:ue,3:de,4:fe,5:pe},I=`pointerdown`,L=`pointermove pointerup pointercancel`;e.MSPointerEvent&&!e.PointerEvent&&(I=`MSPointerDown`,L=`MSPointerMove MSPointerUp MSPointerCancel`);function Ve(){this.evEl=I,this.evWin=L,Ce.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}v(Ve,Ce,{handler:function(e){var t=this.store,n=!1,r=ze[e.type.toLowerCase().replace(`ms`,``)],i=Be[e.pointerType]||e.pointerType,a=i==ue,o=D(t,e.pointerId,`pointerId`);r&he&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(O|_e)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))}});var He={touchstart:he,touchmove:ge,touchend:O,touchcancel:_e},Ue=`touchstart`,R=`touchstart touchmove touchend touchcancel`;function We(){this.evTarget=Ue,this.evWin=R,this.started=!1,Ce.apply(this,arguments)}v(We,Ce,{handler:function(e){var t=He[e.type];if(t===he&&(this.started=!0),this.started){var n=Ge.call(this,e,t);t&(O|_e)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:ue,srcEvent:e})}}});function Ge(e,t){var n=ee(e.touches),r=ee(e.changedTouches);return t&(O|_e)&&(n=te(n.concat(r),`identifier`,!0)),[n,r]}var Ke={touchstart:he,touchmove:ge,touchend:O,touchcancel:_e},qe=`touchstart touchmove touchend touchcancel`;function Je(){this.evTarget=qe,this.targetIds={},Ce.apply(this,arguments)}v(Je,Ce,{handler:function(e){var t=Ke[e.type],n=Ye.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:ue,srcEvent:e})}});function Ye(e,t){var n=ee(e.touches),r=this.targetIds;if(t&(he|ge)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=ee(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return w(e.target,c)}),t===he)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&(O|_e)&&delete r[o[i].identifier],i++;if(s.length)return[te(a.concat(s),`identifier`,!0),s]}var Xe=2500,Ze=25;function Qe(){Ce.apply(this,arguments);var e=y(this.handler,this);this.touch=new Je(this.manager,e),this.mouse=new Re(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}v(Qe,Ce,{handler:function(e,t,n){var r=n.pointerType==ue,i=n.pointerType==fe;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)$e.call(this,t,n);else if(i&&tt.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function $e(e,t){e&he?(this.primaryTouch=t.changedPointers[0].identifier,et.call(this,t)):e&(O|_e)&&et.call(this,t)}function et(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},Xe)}}function tt(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=Ze&&o<=Ze)return!0}return!1}var nt=ne(o.style,`touchAction`),rt=nt!==i,it=`compute`,at=`auto`,ot=`manipulation`,z=`none`,st=`pan-x`,B=`pan-y`,ct=dt();function lt(e,t){this.manager=e,this.set(t)}lt.prototype={set:function(e){e==it&&(e=this.compute()),rt&&this.manager.element.style&&ct[e]&&(this.manager.element.style[nt]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),ut(e.join(` `))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=T(r,z)&&!ct[z],a=T(r,B)&&!ct[B],o=T(r,st)&&!ct[st];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&A||o&&n&j))return this.preventSrc(t)},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};function ut(e){if(T(e,z))return z;var t=T(e,st),n=T(e,B);return t&&n?z:t||n?t?st:B:T(e,ot)?ot:at}function dt(){if(!rt)return!1;var t={},n=e.CSS&&e.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(r){t[r]=n?e.CSS.supports(`touch-action`,r):!0}),t}var ft=1,pt=2,mt=4,ht=8,gt=ht,_t=16,vt=32;function yt(e){this.options=h({},this.defaults,e||{}),this.id=ie(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=ft,this.simultaneous={},this.requireFail=[]}yt.prototype={defaults:{},set:function(e){return h(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=V(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,`dropRecognizeWith`,this)?this:(e=V(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(f(e,`requireFailure`,this))return this;var t=this.requireFail;return e=V(e,this),D(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,`dropRequireFailure`,this))return this;e=V(e,this);var t=D(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<ht&&r(t.options.event+bt(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=ht&&r(t.options.event+bt(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=vt},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(vt|ft)))return!1;e++}return!0},recognize:function(e){var t=h({},e);if(!b(this.options.enable,[this,t])){this.reset(),this.state=vt;return}this.state&(gt|_t|vt)&&(this.state=ft),this.state=this.process(t),this.state&(pt|mt|ht|_t)&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}};function bt(e){return e&_t?`cancel`:e&ht?`end`:e&mt?`move`:e&pt?`start`:``}function xt(e){return e==k?`down`:e==xe?`up`:e==ye?`left`:e==be?`right`:``}function V(e,t){var n=t.manager;return n?n.get(e):e}function St(){yt.apply(this,arguments)}v(St,yt,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=t&(pt|mt),i=this.attrTest(e);return r&&(n&_e||!i)?t|_t:r||i?n&O?t|ht:t&pt?t|mt:pt:vt}});function Ct(){St.apply(this,arguments),this.pX=null,this.pY=null}v(Ct,St,{defaults:{event:`pan`,threshold:10,pointers:1,direction:M},getTouchAction:function(){var e=this.options.direction,t=[];return e&A&&t.push(B),e&j&&t.push(st),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&A?(i=a===0?ve:a<0?ye:be,n=a!=this.pX,r=Math.abs(e.deltaX)):(i=o===0?ve:o<0?xe:k,n=o!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return St.prototype.attrTest.call(this,e)&&(this.state&pt||!(this.state&pt)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=xt(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}});function wt(){St.apply(this,arguments)}v(wt,St,{defaults:{event:`pinch`,threshold:0,pointers:2},getTouchAction:function(){return[z]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&pt)},emit:function(e){if(e.scale!==1){var t=e.scale<1?`in`:`out`;e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}});function Tt(){yt.apply(this,arguments),this._timer=null,this._input=null}v(Tt,yt,{defaults:{event:`press`,pointers:1,time:251,threshold:9},getTouchAction:function(){return[at]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(O|_e)&&!i)this.reset();else if(e.eventType&he)this.reset(),this._timer=d(function(){this.state=gt,this.tryEmit()},t.time,this);else if(e.eventType&O)return gt;return vt},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===gt&&(e&&e.eventType&O?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function Et(){St.apply(this,arguments)}v(Et,St,{defaults:{event:`rotate`,threshold:0,pointers:2},getTouchAction:function(){return[z]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&pt)}});function Dt(){St.apply(this,arguments)}v(Dt,St,{defaults:{event:`swipe`,threshold:10,velocity:.3,direction:A|j,pointers:1},getTouchAction:function(){return Ct.prototype.getTouchAction.call(this)},attrTest:function(e){var t=this.options.direction,n;return t&(A|j)?n=e.overallVelocity:t&A?n=e.overallVelocityX:t&j&&(n=e.overallVelocityY),this._super.attrTest.call(this,e)&&t&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&l(n)>this.options.velocity&&e.eventType&O},emit:function(e){var t=xt(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}});function Ot(){yt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}v(Ot,yt,{defaults:{event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ot]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&he&&this.count===0)return this.failTimeout();if(r&&i&&n){if(e.eventType!=O)return this.failTimeout();var a=this.pTime?e.timeStamp-this.pTime<t.interval:!0,o=!this.pCenter||je(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!o||!a?this.count=1:this.count+=1,this._input=e,this.count%t.taps===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=gt,this.tryEmit()},t.interval,this),pt):gt}return vt},failTimeout:function(){return this._timer=d(function(){this.state=vt},this.options.interval,this),vt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==gt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function kt(e,t){return t||={},t.recognizers=x(t.recognizers,kt.defaults.preset),new Mt(e,t)}kt.VERSION=`2.0.7`,kt.defaults={domEvents:!1,touchAction:it,enable:!0,inputTarget:null,inputClass:null,preset:[[Et,{enable:!1}],[wt,{enable:!1},[`rotate`]],[Dt,{direction:A}],[Ct,{direction:A},[`swipe`]],[Ot],[Ot,{event:`doubletap`,taps:2},[`tap`]],[Tt]],cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}};var At=1,jt=2;function Mt(e,t){this.options=h({},kt.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=we(this),this.touchAction=new lt(this,this.options.touchAction),Nt(this,!0),p(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}Mt.prototype={set:function(e){return h(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?jt:At},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state>)&&(i=t.curRecognizer=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==jt&&(!i||n==i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(pt|mt|ht)&&(i=t.curRecognizer=n),a++}},get:function(e){if(e instanceof yt)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,`remove`,this))return this;if(e=this.get(e),e){var t=this.recognizers,n=D(t,e);n!==-1&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return p(E(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==i){var n=this.handlers;return p(E(e),function(e){t?n[e]&&n[e].splice(D(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&Pt(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(!(!n||!n.length)){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&Nt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Nt(e,t){var n=e.element;if(n.style){var r;p(e.options.cssProps,function(i,a){r=ne(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function Pt(e,t){var r=n.createEvent(`Event`);r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}h(kt,{INPUT_START:he,INPUT_MOVE:ge,INPUT_END:O,INPUT_CANCEL:_e,STATE_POSSIBLE:ft,STATE_BEGAN:pt,STATE_CHANGED:mt,STATE_ENDED:ht,STATE_RECOGNIZED:gt,STATE_CANCELLED:_t,STATE_FAILED:vt,DIRECTION_NONE:ve,DIRECTION_LEFT:ye,DIRECTION_RIGHT:be,DIRECTION_UP:xe,DIRECTION_DOWN:k,DIRECTION_HORIZONTAL:A,DIRECTION_VERTICAL:j,DIRECTION_ALL:M,Manager:Mt,Input:Ce,TouchAction:lt,TouchInput:Je,MouseInput:Re,PointerEventInput:Ve,TouchMouseInput:Qe,SingleTouchInput:We,Recognizer:yt,AttrRecognizer:St,Tap:Ot,Pan:Ct,Swipe:Dt,Pinch:wt,Rotate:Et,Press:Tt,on:S,off:C,each:p,merge:_,extend:g,assign:h,inherit:v,bindFn:y,prefixed:ne});var Ft=e===void 0?typeof self<`u`?self:{}:e;Ft.Hammer=kt,typeof define==`function`&&define.amd?define(function(){return kt}):t!==void 0&&t.exports?t.exports=kt:e[r]=kt})(window,document,`Hammer`)}))()),jl=e=>e&&e.enabled&&e.modifierKey,Ml=(e,t)=>e&&t[e+`Key`],Nl=(e,t)=>e&&!t[e+`Key`];function Pl(e,t,n){return e===void 0?!0:typeof e==`string`?e.indexOf(t)!==-1:typeof e==`function`?e({chart:n}).indexOf(t)!==-1:!1}function Fl(e,t){return typeof e==`function`&&(e=e({chart:t})),typeof e==`string`?{x:e.indexOf(`x`)!==-1,y:e.indexOf(`y`)!==-1}:{x:!1,y:!1}}function Il(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function Ll({x:e,y:t},n){let r=n.scales,i=Object.keys(r);for(let n=0;n<i.length;n++){let a=r[i[n]];if(t>=a.top&&t<=a.bottom&&e>=a.left&&e<=a.right)return a}return null}function Rl(e,t,n){let{mode:r=`xy`,scaleMode:i,overScaleMode:a}=e||{},o=Ll(t,n),s=Fl(r,n),c=Fl(i,n);if(a){let e=Fl(a,n);for(let t of[`x`,`y`])e[t]&&(c[t]=s[t],s[t]=!1)}if(o&&c[o.axis])return[o];let l=[];return F(n.scales,function(e){s[e.axis]&&l.push(e)}),l}var zl=new WeakMap;function K(e){let t=zl.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},zl.set(e,t)),t}function Bl(e){zl.delete(e)}function Vl(e,t,n,r){let i=Math.max(0,Math.min(1,(e-t)/n||0)),a=1-i;return{min:r*i,max:r*a}}function Hl(e,t){let n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function Ul(e,t,n){let r=e.max-e.min,i=r*(t-1);return Vl(Hl(e,n),e.min,r,i)}function Wl(e,t,n){let r=Hl(e,n);if(r===void 0)return{min:e.min,max:e.max};let i=Math.log10(e.min),a=Math.log10(e.max),o=Math.log10(r),s=a-i,c=Vl(o,i,s,s*(t-1));return{min:10**(i+c.min),max:10**(a-c.max)}}function Gl(e,t){return t&&(t[e.id]||t[e.axis])||{}}function Kl(e,t,n,r,i){let a=n[r];if(a===`original`){let n=e.originalScaleLimits[t.id][r];a=N(n.options,n.scale)}return N(a,i)}function ql(e,t,n){let r=e.getValueForPixel(t),i=e.getValueForPixel(n);return{min:Math.min(r,i),max:Math.max(r,i)}}function Jl(e,{min:t,max:n,minLimit:r,maxLimit:i},a){let o=(e-n+t)/2;t-=o,n+=o;let s=a.min.options??a.min.scale,c=a.max.options??a.max.scale,l=e/1e6;return Je(t,s,l)&&(t=s),Je(n,c,l)&&(n=c),t<r?(t=r,n=Math.min(r+e,i)):n>i&&(n=i,t=Math.max(i-e,r)),{min:t,max:n}}function Yl(e,{min:t,max:n},r,i=!1){let a=K(e.chart),{options:o}=e,s=Gl(e,r),{minRange:c=0}=s,l=Kl(a,e,s,`min`,-1/0),u=Kl(a,e,s,`max`,1/0);if(i===`pan`&&(t<l||n>u))return!0;let d=e.max-e.min,f=i?Math.max(n-t,c):d;if(i&&f===c&&d<=c)return!0;let p=Jl(f,{min:t,max:n,minLimit:l,maxLimit:u},a.originalScaleLimits[e.id]);return o.min=p.min,o.max=p.max,a.updatedScaleLimits[e.id]=p,e.parse(p.min)!==e.min||e.parse(p.max)!==e.max}function Xl(e,t,n,r){let i=Ul(e,t,n);return Yl(e,{min:e.min+i.min,max:e.max-i.max},r,!0)}function Zl(e,t,n,r){return Yl(e,Wl(e,t,n),r,!0)}function Ql(e,t,n,r){Yl(e,ql(e,t,n),r,!0)}var $l=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);function eu(e){let t=e.getLabels().length-1;e.min>0&&--e.min,e.max<t&&(e.max+=1)}function tu(e,t,n,r){let i=Ul(e,t,n);return e.min===e.max&&t<1&&eu(e),Yl(e,{min:e.min+$l(i.min),max:e.max-$l(i.max)},r,!0)}function nu(e){return e.isHorizontal()?e.width:e.height}function ru(e,t,n){let r=e.getLabels().length-1,{min:i,max:a}=e,o=Math.max(a-i,1),s=Math.round(nu(e)/Math.max(o,10)),c=Math.round(Math.abs(t/s)),l;return t<-s?(a=Math.min(a+c,r),i=o===1?a:a-o,l=a===r):t>s&&(i=Math.max(0,i-c),a=o===1?i:i+o,l=i===0),Yl(e,{min:i,max:a},n)||l}var iu={second:500,minute:30*1e3,hour:1800*1e3,day:720*60*1e3,week:3.5*24*60*60*1e3,month:360*60*60*1e3,quarter:1440*60*60*1e3,year:4368*60*60*1e3};function au(e,t,n,r=!1){let{min:i,max:a,options:o}=e,s=iu[o.time&&o.time.round]||0,c=e.getValueForPixel(e.getPixelForValue(i+s)-t),l=e.getValueForPixel(e.getPixelForValue(a+s)-t);return isNaN(c)||isNaN(l)?!0:Yl(e,{min:c,max:l},n,r?`pan`:!1)}function ou(e,t,n){return au(e,t,n,!0)}var su={category:tu,default:Xl,logarithmic:Zl},cu={default:Ql},lu={category:ru,default:au,logarithmic:ou,timeseries:ou};function uu(e,t,n){let{id:r,options:{min:i,max:a}}=e;if(!t[r]||!n[r])return!0;let o=n[r];return o.min!==i||o.max!==a}function du(e,t){F(e,(n,r)=>{t[r]||delete e[r]})}function fu(e,t){let{scales:n}=e,{originalScaleLimits:r,updatedScaleLimits:i}=t;return F(n,function(e){uu(e,r,i)&&(r[e.id]={min:{scale:e.min,options:e.options.min},max:{scale:e.max,options:e.options.max}})}),du(r,n),du(i,n),r}function pu(e,t,n,r){P(su[e.type]||su.default,[e,t,n,r])}function mu(e,t,n,r){P(cu[e.type]||cu.default,[e,t,n,r])}function hu(e){let t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function gu(e,t,n=`none`,r=`api`){let{x:i=1,y:a=1,focalPoint:o=hu(e)}=typeof t==`number`?{x:t,y:t}:t,s=K(e),{options:{limits:c,zoom:l}}=s;fu(e,s);let u=i!==1,d=a!==1;F(Rl(l,o,e)||e.scales,function(e){e.isHorizontal()&&u?pu(e,i,o,c):!e.isHorizontal()&&d&&pu(e,a,o,c)}),e.update(n),P(l.onZoom,[{chart:e,trigger:r}])}function _u(e,t,n,r=`none`,i=`api`){let a=K(e),{options:{limits:o,zoom:s}}=a,{mode:c=`xy`}=s;fu(e,a);let l=Pl(c,`x`,e),u=Pl(c,`y`,e);F(e.scales,function(e){e.isHorizontal()&&l?mu(e,t.x,n.x,o):!e.isHorizontal()&&u&&mu(e,t.y,n.y,o)}),e.update(r),P(s.onZoom,[{chart:e,trigger:i}])}function vu(e,t,n,r=`none`,i=`api`){let a=K(e);fu(e,a);let o=e.scales[t];Yl(o,n,void 0,!0),e.update(r),P(a.options.zoom?.onZoom,[{chart:e,trigger:i}])}function yu(e,t=`default`){let n=K(e),r=fu(e,n);F(e.scales,function(e){let t=e.options;r[e.id]?(t.min=r[e.id].min.options,t.max=r[e.id].max.options):(delete t.min,delete t.max),delete n.updatedScaleLimits[e.id]}),e.update(t),P(n.options.zoom.onZoomComplete,[{chart:e}])}function bu(e,t){let n=e.originalScaleLimits[t];if(!n)return;let{min:r,max:i}=n;return N(i.options,i.scale)-N(r.options,r.scale)}function xu(e){let t=K(e),n=1,r=1;return F(e.scales,function(e){let i=bu(t,e.id);if(i){let t=Math.round(i/(e.max-e.min)*100)/100;n=Math.min(n,t),r=Math.max(r,t)}}),n<1?n:r}function Su(e,t,n,r){let{panDelta:i}=r,a=i[e.id]||0;qe(a)===qe(t)&&(t+=a),P(lu[e.type]||lu.default,[e,t,n])?i[e.id]=0:i[e.id]=t}function Cu(e,t,n,r=`none`){let{x:i=0,y:a=0}=typeof t==`number`?{x:t,y:t}:t,o=K(e),{options:{pan:s,limits:c}}=o,{onPan:l}=s||{};fu(e,o);let u=i!==0,d=a!==0;F(n||e.scales,function(e){e.isHorizontal()&&u?Su(e,i,c,o):!e.isHorizontal()&&d&&Su(e,a,c,o)}),e.update(r),P(l,[{chart:e}])}function wu(e){let t=K(e);fu(e,t);let n={};for(let r of Object.keys(e.scales)){let{min:e,max:i}=t.originalScaleLimits[r]||{min:{},max:{}};n[r]={min:e.scale,max:i.scale}}return n}function Tu(e){let t=K(e),n={};for(let r of Object.keys(e.scales))n[r]=t.updatedScaleLimits[r];return n}function Eu(e){let t=wu(e);for(let n of Object.keys(e.scales)){let{min:r,max:i}=t[n];if(r!==void 0&&e.scales[n].min!==r||i!==void 0&&e.scales[n].max!==i)return!0}return!1}function Du(e){let t=K(e);return t.panning||t.dragging}var Ou=(e,t,n)=>Math.min(n,Math.max(t,e));function ku(e,t){let{handlers:n}=K(e),r=n[t];r&&r.target&&(r.target.removeEventListener(t,r),delete n[t])}function Au(e,t,n,r){let{handlers:i,options:a}=K(e),o=i[n];if(o&&o.target===t)return;ku(e,n),i[n]=t=>r(e,t,a),i[n].target=t;let s=n===`wheel`?!1:void 0;t.addEventListener(n,i[n],{passive:s})}function ju(e,t){let n=K(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update(`none`))}function Mu(e,t){let n=K(e);!n.dragStart||t.key!==`Escape`||(ku(e,`keydown`),n.dragging=!1,n.dragStart=n.dragEnd=null,e.update(`none`))}function Nu(e,t){if(e.target!==t.canvas){let n=t.canvas.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}return ir(e,t)}function Pu(e,t,n){let{onZoomStart:r,onZoomRejected:i}=n;if(r&&P(r,[{chart:e,event:t,point:Nu(t,e)}])===!1)return P(i,[{chart:e,event:t}]),!1}function Fu(e,t){if(e.legend&&en(ir(t,e),e.legend))return;let n=K(e),{pan:r,zoom:i={}}=n.options;if(t.button!==0||Ml(jl(r),t)||Nl(jl(i.drag),t))return P(i.onZoomRejected,[{chart:e,event:t}]);Pu(e,t,i)!==!1&&(n.dragStart=t,Au(e,e.canvas.ownerDocument,`mousemove`,ju),Au(e,window.document,`keydown`,Mu))}function Iu({begin:e,end:t},n){let r=t.x-e.x,i=t.y-e.y,a=Math.abs(r/i);a>n?r=Math.sign(r)*Math.abs(i*n):a<n&&(i=Math.sign(i)*Math.abs(r/n)),t.x=e.x+r,t.y=e.y+i}function Lu(e,t,n,{min:r,max:i,prop:a}){e[r]=Ou(Math.min(n.begin[a],n.end[a]),t[r],t[i]),e[i]=Ou(Math.max(n.begin[a],n.end[a]),t[r],t[i])}function Ru(e,t,n){let r={begin:Nu(t.dragStart,e),end:Nu(t.dragEnd,e)};return n&&Iu(r,e.chartArea.width/e.chartArea.height),r}function zu(e,t,n,r){let i=Pl(t,`x`,e),a=Pl(t,`y`,e),{top:o,left:s,right:c,bottom:l,width:u,height:d}=e.chartArea,f={top:o,left:s,right:c,bottom:l},p=Ru(e,n,r&&i&&a);i&&Lu(f,e.chartArea,p,{min:`left`,max:`right`,prop:`x`}),a&&Lu(f,e.chartArea,p,{min:`top`,max:`bottom`,prop:`y`});let m=f.right-f.left,h=f.bottom-f.top;return{...f,width:m,height:h,zoomX:i&&m?1+(u-m)/u:1,zoomY:a&&h?1+(d-h)/d:1}}function Bu(e,t){let n=K(e);if(!n.dragStart)return;ku(e,`mousemove`);let{mode:r,onZoomComplete:i,drag:{threshold:a=0,maintainAspectRatio:o}}=n.options.zoom,s=zu(e,r,{dragStart:n.dragStart,dragEnd:t},o),c=Pl(r,`x`,e)?s.width:0,l=Pl(r,`y`,e)?s.height:0,u=Math.sqrt(c*c+l*l);if(n.dragStart=n.dragEnd=null,u<=a){n.dragging=!1,e.update(`none`);return}_u(e,{x:s.left,y:s.top},{x:s.right,y:s.bottom},`zoom`,`drag`),n.dragging=!1,n.filterNextClick=!0,P(i,[{chart:e}])}function Vu(e,t,n){if(Nl(jl(n.wheel),t)){P(n.onZoomRejected,[{chart:e,event:t}]);return}if(Pu(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function Hu(e,t){let{handlers:{onZoomComplete:n},options:{zoom:r}}=K(e);if(!Vu(e,t,r))return;let i=t.target.getBoundingClientRect(),a=r.wheel.speed,o=t.deltaY>=0?2-1/(1-a):1+a;gu(e,{x:o,y:o,focalPoint:{x:t.clientX-i.left,y:t.clientY-i.top}},`zoom`,`wheel`),P(n,[{chart:e}])}function Uu(e,t,n,r){n&&(K(e).handlers[t]=Il(()=>P(n,[{chart:e}]),r))}function Wu(e,t){let n=e.canvas,{wheel:r,drag:i,onZoomComplete:a}=t.zoom;r.enabled?(Au(e,n,`wheel`,Hu),Uu(e,`onZoomComplete`,a,250)):ku(e,`wheel`),i.enabled?(Au(e,n,`mousedown`,Fu),Au(e,n.ownerDocument,`mouseup`,Bu)):(ku(e,`mousedown`),ku(e,`mousemove`),ku(e,`mouseup`),ku(e,`keydown`))}function Gu(e){ku(e,`mousedown`),ku(e,`mousemove`),ku(e,`mouseup`),ku(e,`wheel`),ku(e,`click`),ku(e,`keydown`)}function Ku(e,t){return function(n,r){let{pan:i,zoom:a={}}=t.options;if(!i||!i.enabled)return!1;let o=r&&r.srcEvent;return o&&!t.panning&&r.pointerType===`mouse`&&(Nl(jl(i),o)||Ml(jl(a.drag),o))?(P(i.onPanRejected,[{chart:e,event:r}]),!1):!0}}function qu(e,t){let n=Math.abs(e.clientX-t.clientX),r=Math.abs(e.clientY-t.clientY),i=n/r,a,o;return i>.3&&i<1.7?a=o=!0:n>r?a=!0:o=!0,{x:a,y:o}}function Ju(e,t,n){if(t.scale){let{center:r,pointers:i}=n,a=1/t.scale*n.scale,o=n.target.getBoundingClientRect(),s=qu(i[0],i[1]),c=t.options.zoom.mode;gu(e,{x:s.x&&Pl(c,`x`,e)?a:1,y:s.y&&Pl(c,`y`,e)?a:1,focalPoint:{x:r.x-o.left,y:r.y-o.top}},`zoom`,`pinch`),t.scale=n.scale}}function Yu(e,t,n){if(t.options.zoom.pinch.enabled){let r=ir(n,e);P(t.options.zoom.onZoomStart,[{chart:e,event:n,point:r}])===!1?(t.scale=null,P(t.options.zoom.onZoomRejected,[{chart:e,event:n}])):t.scale=1}}function Xu(e,t,n){t.scale&&(Ju(e,t,n),t.scale=null,P(t.options.zoom.onZoomComplete,[{chart:e}]))}function Zu(e,t,n){let r=t.delta;r&&(t.panning=!0,Cu(e,{x:n.deltaX-r.x,y:n.deltaY-r.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function Qu(e,t,n){let{enabled:r,onPanStart:i,onPanRejected:a}=t.options.pan;if(!r)return;let o=n.target.getBoundingClientRect(),s={x:n.center.x-o.left,y:n.center.y-o.top};if(P(i,[{chart:e,event:n,point:s}])===!1)return P(a,[{chart:e,event:n}]);t.panScales=Rl(t.options.pan,s,e),t.delta={x:0,y:0},Zu(e,t,n)}function $u(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,P(t.options.pan.onPanComplete,[{chart:e}]))}var ed=new WeakMap;function td(e,t){let n=K(e),r=e.canvas,{pan:i,zoom:a}=t,o=new Al.default.Manager(r);a&&a.pinch.enabled&&(o.add(new Al.default.Pinch),o.on(`pinchstart`,t=>Yu(e,n,t)),o.on(`pinch`,t=>Ju(e,n,t)),o.on(`pinchend`,t=>Xu(e,n,t))),i&&i.enabled&&(o.add(new Al.default.Pan({threshold:i.threshold,enable:Ku(e,n)})),o.on(`panstart`,t=>Qu(e,n,t)),o.on(`panmove`,t=>Zu(e,n,t)),o.on(`panend`,()=>$u(e,n))),ed.set(e,o)}function nd(e){let t=ed.get(e);t&&(t.remove(`pinchstart`),t.remove(`pinch`),t.remove(`pinchend`),t.remove(`panstart`),t.remove(`pan`),t.remove(`panend`),t.destroy(),ed.delete(e))}function rd(e,t){let{pan:n,zoom:r}=e,{pan:i,zoom:a}=t;return r?.zoom?.pinch?.enabled!==a?.zoom?.pinch?.enabled||n?.enabled!==i?.enabled||n?.threshold!==i?.threshold}var id=`2.2.0`;function ad(e,t,n){let r=n.zoom.drag,{dragStart:i,dragEnd:a}=K(e);if(r.drawTime!==t||!a)return;let{left:o,top:s,width:c,height:l}=zu(e,n.zoom.mode,{dragStart:i,dragEnd:a},r.maintainAspectRatio),u=e.ctx;u.save(),u.beginPath(),u.fillStyle=r.backgroundColor||`rgba(225,225,225,0.3)`,u.fillRect(o,s,c,l),r.borderWidth>0&&(u.lineWidth=r.borderWidth,u.strokeStyle=r.borderColor||`rgba(225,225,225)`,u.strokeRect(o,s,c,l)),u.restore()}var od={id:`zoom`,version:id,defaults:{pan:{enabled:!1,mode:`xy`,threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:`beforeDatasetsDraw`,modifierKey:null},pinch:{enabled:!1},mode:`xy`}},start:function(e,t,n){let r=K(e);r.options=n,Object.prototype.hasOwnProperty.call(n.zoom,`enabled`)&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(n.zoom,`overScaleMode`)||Object.prototype.hasOwnProperty.call(n.pan,`overScaleMode`))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),Al.default&&td(e,n),e.pan=(t,n,r)=>Cu(e,t,n,r),e.zoom=(t,n)=>gu(e,t,n),e.zoomRect=(t,n,r)=>_u(e,t,n,r),e.zoomScale=(t,n,r)=>vu(e,t,n,r),e.resetZoom=t=>yu(e,t),e.getZoomLevel=()=>xu(e),e.getInitialScaleBounds=()=>wu(e),e.getZoomedScaleBounds=()=>Tu(e),e.isZoomedOrPanned=()=>Eu(e),e.isZoomingOrPanning=()=>Du(e)},beforeEvent(e,{event:t}){if(Du(e))return!1;if(t.type===`click`||t.type===`mouseup`){let t=K(e);if(t.filterNextClick)return t.filterNextClick=!1,!1}},beforeUpdate:function(e,t,n){let r=K(e),i=r.options;r.options=n,rd(i,n)&&(nd(e),td(e,n)),Wu(e,n)},beforeDatasetsDraw(e,t,n){ad(e,`beforeDatasetsDraw`,n)},afterDatasetsDraw(e,t,n){ad(e,`afterDatasetsDraw`,n)},beforeDraw(e,t,n){ad(e,`beforeDraw`,n)},afterDraw(e,t,n){ad(e,`afterDraw`,n)},stop:function(e){Gu(e),Al.default&&nd(e),Bl(e)},panFunctions:lu,zoomFunctions:su,zoomRectFunctions:cu},sd=function(){if(typeof window<`u`){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),cd={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n==`string`?t.unshift.apply(t,n.split(`
|
|
6
6
|
`)):Array.isArray(n)?e.push.apply(e,n):k(e)||t.unshift(``+n);return t},textSize:function(e,t,n){var r=[].concat(t),i=r.length,a=e.font,o=0,s;for(e.font=n.string,s=0;s<i;++s)o=Math.max(e.measureText(r[s]).width,o);return e.font=a,{height:i*n.lineHeight,width:o}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],i,a,o,s;for(i=0,o=t.length;i<o;++i)s=t[i],a=n.indexOf(s),a===-1?r.push([s,1]):n.splice(a,1);for(i=0,o=n.length;i<o;++i)r.push([n[i],-1]);return r},rasterize:function(e){return Math.round(e*sd)/sd}};function ld(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var i=e.x-n,a=e.y-r,o=Math.sqrt(i*i+a*a);return{x:o?i/o:0,y:o?a/o:-1}}function ud(e,t,n,r,i){switch(i){case`center`:n=r=0;break;case`bottom`:n=0,r=1;break;case`right`:n=1,r=0;break;case`left`:n=-1,r=0;break;case`top`:n=0,r=-1;break;case`start`:n=-n,r=-r;break;case`end`:break;default:i*=Math.PI/180,n=Math.cos(i),r=Math.sin(i);break}return{x:e,y:t,vx:n,vy:r}}var dd=0,fd=1,pd=2,md=4,hd=8;function gd(e,t,n){var r=dd;return e<n.left?r|=fd:e>n.right&&(r|=pd),t<n.top?r|=hd:t>n.bottom&&(r|=md),r}function _d(e,t){for(var n=e.x0,r=e.y0,i=e.x1,a=e.y1,o=gd(n,r,t),s=gd(i,a,t),c,l,u;!(!(o|s)||o&s);)c=o||s,c&hd?(l=n+(i-n)*(t.top-r)/(a-r),u=t.top):c&md?(l=n+(i-n)*(t.bottom-r)/(a-r),u=t.bottom):c&pd?(u=r+(a-r)*(t.right-n)/(i-n),l=t.right):c&fd&&(u=r+(a-r)*(t.left-n)/(i-n),l=t.left),c===o?(n=l,r=u,o=gd(n,r,t)):(i=l,a=u,s=gd(i,a,t));return{x0:n,x1:i,y0:r,y1:a}}function vd(e,t){var n=t.anchor,r=e,i,a;return t.clamp&&(r=_d(r,t.area)),n===`start`?(i=r.x0,a=r.y0):n===`end`?(i=r.x1,a=r.y1):(i=(r.x0+r.x1)/2,a=(r.y0+r.y1)/2),ud(i,a,e.vx,e.vy,t.align)}var yd={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),i=Math.sin(n),a=e.innerRadius,o=e.outerRadius;return vd({x0:e.x+r*a,y0:e.y+i*a,x1:e.x+r*o,y1:e.y+i*o,vx:r,vy:i},t)},point:function(e,t){var n=ld(e,t.origin),r=n.x*e.options.radius,i=n.y*e.options.radius;return vd({x0:e.x-r,y0:e.y-i,x1:e.x+r,y1:e.y+i,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=ld(e,t.origin),r=e.x,i=e.y,a=0,o=0;return e.horizontal?(r=Math.min(e.x,e.base),a=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),o=Math.abs(e.base-e.y)),vd({x0:r,y0:i+o,x1:r+a,y1:i,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=ld(e,t.origin);return vd({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},bd=cd.rasterize;function xd(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,i=e.size.width,a=-i/2,o=-r/2;return{frame:{x:a-n.left-t,y:o-n.top-t,w:i+n.width+t*2,h:r+n.height+t*2},text:{x:a,y:o,w:i,h:r}}}function Sd(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return e.horizontal?{x:r,y:null}:{x:null,y:r}}function Cd(e){return e instanceof Wo?yd.arc:e instanceof as?yd.point:e instanceof hs?yd.bar:yd.fallback}function wd(e,t,n,r,i,a){var o=Math.PI/2;if(a){var s=Math.min(a,i/2,r/2),c=t+s,l=n+s,u=t+r-s,d=n+i-s;e.moveTo(t,l),c<u&&l<d?(e.arc(c,l,s,-Math.PI,-o),e.arc(u,l,s,-o,0),e.arc(u,d,s,0,o),e.arc(c,d,s,o,Math.PI)):c<u?(e.moveTo(c,n),e.arc(u,l,s,-o,o),e.arc(c,l,s,o,Math.PI+o)):l<d?(e.arc(c,l,s,-Math.PI,0),e.arc(c,d,s,0,Math.PI)):e.arc(c,l,s,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,i)}function Td(e,t,n){var r=n.backgroundColor,i=n.borderColor,a=n.borderWidth;!r&&(!i||!a)||(e.beginPath(),wd(e,bd(t.x)+a/2,bd(t.y)+a/2,bd(t.w)-a,bd(t.h)-a,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),i&&a&&(e.strokeStyle=i,e.lineWidth=a,e.lineJoin=`miter`,e.stroke()))}function Ed(e,t,n){var r=n.lineHeight,i=e.w,a=e.x,o=e.y+r/2;return t===`center`?a+=i/2:(t===`end`||t===`right`)&&(a+=i),{h:r,w:i,x:a,y:o}}function Dd(e,t,n){var r=e.shadowBlur,i=n.stroked,a=bd(n.x),o=bd(n.y),s=bd(n.w);i&&e.strokeText(t,a,o,s),n.filled&&(r&&i&&(e.shadowBlur=0),e.fillText(t,a,o,s),r&&i&&(e.shadowBlur=r))}function Od(e,t,n,r){var i=r.textAlign,a=r.color,o=!!a,s=r.font,c=t.length,l=r.textStrokeColor,u=r.textStrokeWidth,d=l&&u,f;if(!(!c||!o&&!d))for(n=Ed(n,i,s),e.font=s.string,e.textAlign=i,e.textBaseline=`middle`,e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,o&&(e.fillStyle=a),d&&(e.lineJoin=`round`,e.lineWidth=u,e.strokeStyle=l),f=0,c=t.length;f<c;++f)Dd(e,t[f],{stroked:d,filled:o,w:n.w,x:n.x,y:n.y+n.h*f})}var kd=function(e,t,n,r){var i=this;i._config=e,i._index=r,i._model=null,i._rects=null,i._ctx=t,i._el=n};ke(kd.prototype,{_modelize:function(e,t,n,r){var i=this,a=i._index,o=W(G([n.font,{}],r,a)),s=G([n.color,H.color],r,a);return{align:G([n.align,`center`],r,a),anchor:G([n.anchor,`center`],r,a),area:r.chart.chartArea,backgroundColor:G([n.backgroundColor,null],r,a),borderColor:G([n.borderColor,null],r,a),borderRadius:G([n.borderRadius,0],r,a),borderWidth:G([n.borderWidth,0],r,a),clamp:G([n.clamp,!1],r,a),clip:G([n.clip,!1],r,a),color:s,display:e,font:o,lines:t,offset:G([n.offset,4],r,a),opacity:G([n.opacity,1],r,a),origin:Sd(i._el,r),padding:U(G([n.padding,4],r,a)),positioner:Cd(i._el),rotation:G([n.rotation,0],r,a)*(Math.PI/180),size:cd.textSize(i._ctx,t,o),textAlign:G([n.textAlign,`start`],r,a),textShadowBlur:G([n.textShadowBlur,0],r,a),textShadowColor:G([n.textShadowColor,s],r,a),textStrokeColor:G([n.textStrokeColor,s],r,a),textStrokeWidth:G([n.textStrokeWidth,0],r,a)}},update:function(e){var t=this,n=null,r=null,i=t._index,a=t._config,o,s,c,l=G([a.display,!0],e,i);l&&(o=e.dataset.data[i],s=N(P(a.formatter,[o,e]),o),c=k(s)?[]:cd.toTextLines(s),c.length&&(n=t._modelize(l,c,a,e),r=xd(n))),t._model=n,t._rects=r},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(e,t){var n=this,r=e.ctx,i=n._model,a=n._rects,o;this.visible()&&(r.save(),i.clip&&(o=i.area,r.beginPath(),r.rect(o.left,o.top,o.right-o.left,o.bottom-o.top),r.clip()),r.globalAlpha=cd.bound(0,i.opacity,1),r.translate(bd(t.x),bd(t.y)),r.rotate(i.rotation),Td(r,a.frame,i),Od(r,i.lines,a.text,i),r.restore())}});var Ad=-(2**53-1)||-9007199254740991,jd=2**53-1||9007199254740991;function Md(e,t,n){var r=Math.cos(n),i=Math.sin(n),a=t.x,o=t.y;return{x:a+r*(e.x-a)-i*(e.y-o),y:o+i*(e.x-a)+r*(e.y-o)}}function Nd(e,t){var n=jd,r=Ad,i=t.origin,a,o,s,c,l;for(a=0;a<e.length;++a)o=e[a],s=o.x-i.x,c=o.y-i.y,l=t.vx*s+t.vy*c,n=Math.min(n,l),r=Math.max(r,l);return{min:n,max:r}}function Pd(e,t){var n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var Fd=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};ke(Fd.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=Md(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[Pd(t[0],t[1]),Pd(t[0],t[3])],i,a,o;for(this._rotation!==e._rotation&&r.push(Pd(n[0],n[1]),Pd(n[0],n[3])),i=0;i<r.length;++i)if(a=Nd(t,r[i]),o=Nd(n,r[i]),a.max<o.min||o.max<a.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Md({x:t.x,y:t.y},r,n),Md({x:t.x+t.w,y:t.y},r,n),Md({x:t.x+t.w,y:t.y+t.h},r,n),Md({x:t.x,y:t.y+t.h},r,n)]}});function Id(e,t,n){var r=t.positioner(e,t),i=r.vx,a=r.vy;if(!i&&!a)return{x:r.x,y:r.y};var o=n.w,s=n.h,c=t.rotation,l=Math.abs(o/2*Math.cos(c))+Math.abs(s/2*Math.sin(c)),u=Math.abs(o/2*Math.sin(c))+Math.abs(s/2*Math.cos(c)),d=1/Math.max(Math.abs(i),Math.abs(a));return l*=i*d,u*=a*d,l+=t.offset*i,u+=t.offset*a,{x:r.x+l,y:r.y+u}}function Ld(e,t){var n,r,i,a;for(n=e.length-1;n>=0;--n)for(i=e[n].$layout,r=n-1;r>=0&&i._visible;--r)a=e[r].$layout,a._visible&&i._box.intersects(a._box)&&t(i,a);return e}function Rd(e){var t,n,r,i,a,o,s;for(t=0,n=e.length;t<n;++t)r=e[t],i=r.$layout,i._visible&&(s=new Proxy(r._el,{get:(e,t)=>e.getProps([t],!0)[t]}),a=r.geometry(),o=Id(s,r.model(),a),i._box.update(o,a,r.rotation()));return Ld(e,function(e,t){var n=e._hidable,r=t._hidable;n&&r||r?t._visible=!1:n&&(e._visible=!1)})}var zd={prepare:function(e){var t=[],n,r,i,a,o;for(n=0,i=e.length;n<i;++n)for(r=0,a=e[n].length;r<a;++r)o=e[n][r],t.push(o),o.$layout={_box:new Fd,_hidable:!1,_visible:!0,_set:n,_idx:o._index};return t.sort(function(e,t){var n=e.$layout,r=t.$layout;return n._idx===r._idx?r._set-n._set:r._idx-n._idx}),this.update(t),t},update:function(e){var t=!1,n,r,i,a,o;for(n=0,r=e.length;n<r;++n)i=e[n],a=i.model(),o=i.$layout,o._hidable=a&&a.display===`auto`,o._visible=i.visible(),t|=o._hidable;t&&Rd(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,i,a,o,s;for(n=0,r=t.length;n<r;++n)i=t[n],a=i.$layout,a._visible&&(o=i.geometry(),s=Id(i._el,i.model(),o),a._box.update(s,o,i.rotation()),i.draw(e,s))}},Bd={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:function(e){if(k(e))return null;var t=e,n,r,i;if(j(e))if(!k(e.label))t=e.label;else if(!k(e.r))t=e.r;else for(t=``,n=Object.keys(e),i=0,r=n.length;i<r;++i)t+=(i===0?``:`, `)+n[i]+`: `+e[n[i]];return``+t},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},Vd=`$datalabels`,Hd=`$default`;function Ud(e,t){var n=e.datalabels,r={},i=[],a,o;return n===!1?null:(n===!0&&(n={}),t=ke({},[t,n]),a=t.labels||{},o=Object.keys(a),delete t.labels,o.length?o.forEach(function(e){a[e]&&i.push(ke({},[t,a[e],{_key:e}]))}):i.push(t),r=i.reduce(function(e,t){return F(t.listeners||{},function(n,r){e[r]=e[r]||{},e[r][t._key||Hd]=n}),delete t.listeners,e},{}),{labels:i,listeners:r})}function Wd(e,t,n,r){if(t){var i=n.$context,a=n.$groups,o;t[a._set]&&(o=t[a._set][a._key],o&&P(o,[i,r])===!0&&(e[Vd]._dirty=!0,n.update(i)))}}function Gd(e,t,n,r,i){var a,o;!n&&!r||(n?r?n!==r&&(o=a=!0):o=!0:a=!0,o&&Wd(e,t.leave,n,i),a&&Wd(e,t.enter,r,i))}function Kd(e,t){var n=e[Vd],r=n._listeners,i,a;if(!(!r.enter&&!r.leave)){if(t.type===`mousemove`)a=zd.lookup(n._labels,t);else if(t.type!==`mouseout`)return;i=n._hovered,n._hovered=a,Gd(e,r,i,a,t)}}function qd(e,t){var n=e[Vd],r=n._listeners.click,i=r&&zd.lookup(n._labels,t);i&&Wd(e,r,i,t)}var Jd={id:`datalabels`,defaults:Bd,beforeInit:function(e){e[Vd]={_actives:[]}},beforeUpdate:function(e){var t=e[Vd];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,i=e[Vd],a=i._datasets[r]=[],o=e.isDatasetVisible(r),s=e.data.datasets[r],c=Ud(s,n),l=t.meta.data||[],u=e.ctx,d,f,p,m,h,g,_,v;for(u.save(),d=0,p=l.length;d<p;++d)if(_=l[d],_[Vd]=[],o&&_&&e.getDataVisibility(d)&&!_.skip)for(f=0,m=c.labels.length;f<m;++f)h=c.labels[f],g=h._key,v=new kd(h,u,_,d),v.$groups={_set:r,_key:g||Hd},v.$context={active:!1,chart:e,dataIndex:d,dataset:s,datasetIndex:r},v.update(v.$context),_[Vd].push(v),a.push(v);u.restore(),ke(i._listeners,c.listeners,{merger:function(e,n,r){n[e]=n[e]||{},n[e][t.index]=r[e],i._listened=!0}})},afterUpdate:function(e){e[Vd]._labels=zd.prepare(e[Vd]._datasets)},afterDatasetsDraw:function(e){zd.draw(e,e[Vd]._labels)},beforeEvent:function(e,t){if(e[Vd]._listened){var n=t.event;switch(n.type){case`mousemove`:case`mouseout`:Kd(e,n);break;case`click`:qd(e,n);break}}},afterEvent:function(e){var t=e[Vd],n=t._actives,r=t._actives=e.getActiveElements(),i=cd.arrayDiff(n,r),a,o,s,c,l,u,d;for(a=0,o=i.length;a<o;++a)if(l=i[a],l[1])for(d=l[0].element[Vd]||[],s=0,c=d.length;s<c;++s)u=d[s],u.$context.active=l[1]===1,u.update(u.$context);(t._dirty||i.length)&&(zd.update(t._labels),e.render()),delete t._dirty}},Yd=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),Xd=t(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}));function Zd(e){return Number.isSafeInteger(e)&&e>=0}function Qd(e){return e!=null&&typeof e!=`function`&&Zd(e.length)}function $d(e){return e===`__proto__`}function ef(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function tf(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function nf(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(nf).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function rf(e){if(Array.isArray(e))return e.map(tf);if(typeof e==`symbol`)return[e];e=nf(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1;for(e.charCodeAt(0)===46&&(t.push(``),r++);r<n;){let s=e[r];a?s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s:o?s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s:s===`[`?(o=!0,i&&=(t.push(i),``)):s===`.`?i&&=(t.push(i),``):i+=s,r++}return i&&t.push(i),t}function af(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if($d(t))return n;let r=e[t];return r===void 0?ef(t)?af(e,rf(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=tf(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return of(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),$d(t))return n;let r=e[t];return r===void 0?n:r}}}function of(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||$d(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function sf(e){return function(t){return af(t,e)}}function cf(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function lf(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function uf(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function df(e,t,n){return typeof n==`function`?ff(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?ff(t,r,e,s):!!c},new Map):df(e,t,()=>void 0)}function ff(e,t,n,r){if(t===e)return!0;switch(typeof t){case`object`:return pf(e,t,n,r);case`function`:return Object.keys(t).length>0?ff(e,{...t},n,r):uf(e,t);default:return cf(e)?typeof t==`string`?t===``:!0:uf(e,t)}}function pf(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return hf(e,t,n,r);if(t instanceof Map)return mf(e,t,n,r);if(t instanceof Set)return gf(e,t,n,r);let i=Object.keys(t);if(e==null||lf(e))return i.length===0;if(i.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let a=0;a<i.length;a++){let o=i[a];if(!lf(e)&&!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function mf(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function hf(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function gf(e,t,n,r){return t.size===0?!0:e instanceof Set?hf([...e],[...t],n,r):!1}function _f(e,t){return df(e,t,()=>void 0)}function vf(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function yf(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var bf=`[object RegExp]`,xf=`[object String]`,Sf=`[object Number]`,Cf=`[object Boolean]`,wf=`[object Arguments]`,Tf=`[object Symbol]`,Ef=`[object Date]`,Df=`[object Map]`,Of=`[object Set]`,kf=`[object Array]`,Af=`[object ArrayBuffer]`,jf=`[object Object]`,Mf=`[object DataView]`,Nf=`[object Uint8Array]`,Pf=`[object Uint8ClampedArray]`,Ff=`[object Uint16Array]`,If=`[object Uint32Array]`,Lf=`[object Int8Array]`,Rf=`[object Int16Array]`,zf=`[object Int32Array]`,Bf=`[object Float32Array]`,Vf=`[object Float64Array]`;function Hf(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Uf(e,t){return Wf(e,void 0,e,new Map,t)}function Wf(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(lf(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=Wf(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,Wf(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(Wf(a,void 0,n,r,i));return t}if(typeof Buffer<`u`&&Buffer.isBuffer(e))return e.subarray();if(Hf(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=Wf(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),Gf(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),Gf(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),Gf(t,e,n,r,i),t}if(e instanceof Error){let t=new e.constructor;return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,Gf(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),Gf(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),Gf(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),Gf(t,e,n,r,i),t}if(typeof e==`object`&&Kf(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),Gf(t,e,n,r,i),t}return e}function Gf(e,t,n=e,r,i){let a=[...Object.keys(t),...vf(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=Wf(t[s],s,n,r,i))}}function Kf(e){switch(yf(e)){case wf:case kf:case Af:case Mf:case Cf:case Ef:case Bf:case Vf:case Lf:case Rf:case zf:case Df:case Sf:case jf:case bf:case Of:case xf:case Tf:case Nf:case Pf:case Ff:case If:return!0;default:return!1}}function qf(e){return Wf(e,void 0,e,new Map,void 0)}function Jf(e){return e=qf(e),t=>_f(t,e)}function Yf(e,t){return Uf(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(yf(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),Gf(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case Sf:case xf:case Cf:{let t=new e.constructor(e?.valueOf());return Gf(t,e),t}case wf:{let t={};return Gf(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function Xf(e){return Yf(e)}var Zf=/^(?:0|[1-9]\d*)$/;function Qf(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return Zf.test(e)}}function $f(e){return typeof e==`object`&&!!e&&yf(e)===`[object Arguments]`}function ep(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&ef(t)&&e?.[t]==null?rf(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||$f(r))&&Qf(t)&&t<r.length))return!1;r=r[t]}return!0}function tp(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=tf(e);break}return t=Xf(t),function(n){let r=af(n,e);return r===void 0?ep(n,e):t===void 0?r===void 0:_f(r,t)}}function np(e){return typeof e==`symbol`||e instanceof Symbol}function rp(e,t,n=0){if(!e)return-1;n<0&&(n=Math.max(e.length+n,0));let r=Array.from(e).slice(n),i=-1;switch(typeof t){case`function`:i=r.findIndex(t);break;case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];i=r.findIndex(tp(e,n))}else i=r.findIndex(Jf(t));break;case`number`:case`symbol`:case`string`:i=r.findIndex(sf(t))}return i===-1?-1:i+n}var ip=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ap=/^\w*$/;function op(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||np(e)?!0:typeof e==`string`&&(ap.test(e)||!ip.test(e))||t!=null&&Object.hasOwn(t,e)}function sp(e){return e==null}var cp=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&uf(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function lp(e,t,n,r){if(e==null&&!cf(e))return e;let i;i=op(t,e)?[t]:Array.isArray(t)?t:rf(t);let a=n(af(e,i)),o=e;for(let t=0;t<i.length&&o!=null;t++){let n=tf(i[t]);if($d(n))continue;let s;if(t===i.length-1)s=a;else{let a=o[n],c=r?.(a,n,e);s=c===void 0?cf(a)?a:Qf(i[t+1])?[]:{}:c}cp(o,n,s),o=o[n]}return e}function up(e,t,n){return lp(e,t,()=>n,()=>void 0)}function dp(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function fp(e){return Hf(e)}function pp(e){if(e==null)return!0;if(Qd(e))return typeof e.splice!=`function`&&typeof e!=`string`&&(typeof Buffer>`u`||!Buffer.isBuffer(e))&&!fp(e)&&!$f(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return dp(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}function mp(e,t){return e==null||Number.isNaN(e)?t:e}typeof BigInt>`u`&&(BigInt=function(e){if(isNaN(e))throw Error(``);return e});var q=BigInt(0),J=BigInt(1),Y=BigInt(2),hp=BigInt(3),gp=BigInt(5),_p=BigInt(10);BigInt(2**53-1);var vp=2e3,X={s:J,n:q,d:J};function yp(e,t){try{e=BigInt(e)}catch{throw Ap()}return e*t}function bp(e){return typeof e==`bigint`?e:Math.floor(e)}function Z(e,t){if(t===q)throw kp();let n=Object.create(Op.prototype);n.s=e<q?-J:J,e=e<q?-e:e;let r=Dp(e,t);return n.n=e/r,n.d=t/r,n}var xp=[Y*Y,Y,Y*Y,Y,Y*Y,Y*hp,Y,Y*hp];function Sp(e){let t=Object.create(null);if(e<=J)return t[e]=J,t;let n=e=>{t[e]=(t[e]||q)+J};for(;e%Y===q;)n(Y),e/=Y;for(;e%hp===q;)n(hp),e/=hp;for(;e%gp===q;)n(gp),e/=gp;for(let t=0,r=Y+gp;r*r<=e;){for(;e%r===q;)n(r),e/=r;r+=xp[t],t=t+1&7}return e>J&&n(e),t}var Cp=function(e,t){let n=q,r=J,i=J;if(e!=null)if(t!==void 0){if(typeof e==`bigint`)n=e;else if(isNaN(e))throw Ap();else if(e%1!=0)throw jp();else n=BigInt(e);if(typeof t==`bigint`)r=t;else if(isNaN(t))throw Ap();else if(t%1!=0)throw jp();else r=BigInt(t);i=n*r}else if(typeof e==`object`){if(`d`in e&&`n`in e)n=BigInt(e.n),r=BigInt(e.d),`s`in e&&(n*=BigInt(e.s));else if(0 in e)n=BigInt(e[0]),1 in e&&(r=BigInt(e[1]));else if(typeof e==`bigint`)n=e;else throw Ap();i=n*r}else if(typeof e==`number`){if(isNaN(e))throw Ap();if(e<0&&(i=-J,e=-e),e%1==0)n=BigInt(e);else{let t=1,i=0,a=1,o=1,s=1,c=1e7;for(e>=1&&(t=10**Math.floor(1+Math.log10(e)),e/=t);a<=c&&s<=c;){let t=(i+o)/(a+s);if(e===t){a+s<=c?(n=i+o,r=a+s):s>a?(n=o,r=s):(n=i,r=a);break}else e>t?(i+=o,a+=s):(o+=i,s+=a),a>c?(n=o,r=s):(n=i,r=a)}n=BigInt(n)*BigInt(t),r=BigInt(r)}}else if(typeof e==`string`){let t=0,a=q,o=q,s=q,c=J,l=J,u=e.replace(/_/g,``).match(/\d+|./g);if(u===null)throw Ap();if(u[t]===`-`?(i=-J,t++):u[t]===`+`&&t++,u.length===t+1?o=yp(u[t++],i):u[t+1]===`.`||u[t]===`.`?(u[t]!==`.`&&(a=yp(u[t++],i)),t++,(t+1===u.length||u[t+1]===`(`&&u[t+3]===`)`||u[t+1]===`'`&&u[t+3]===`'`)&&(o=yp(u[t],i),c=_p**BigInt(u[t].length),t++),(u[t]===`(`&&u[t+2]===`)`||u[t]===`'`&&u[t+2]===`'`)&&(s=yp(u[t+1],i),l=_p**BigInt(u[t+1].length)-J,t+=3)):u[t+1]===`/`||u[t+1]===`:`?(o=yp(u[t],i),c=yp(u[t+2],J),t+=3):u[t+3]===`/`&&u[t+1]===` `&&(a=yp(u[t],i),o=yp(u[t+2],i),c=yp(u[t+4],J),t+=5),u.length<=t)r=c*l,i=n=s+r*a+l*o;else throw Ap()}else if(typeof e==`bigint`)n=e,i=e,r=J;else throw Ap();if(r===q)throw kp();X.s=i<q?-J:J,X.n=n<q?-n:n,X.d=r<q?-r:r};function wp(e,t,n){let r=J;for(;t>q;e=e*e%n,t>>=J)t&J&&(r=r*e%n);return r}function Tp(e,t){for(;t%Y===q;t/=Y);for(;t%gp===q;t/=gp);if(t===J)return q;let n=_p%t,r=1;for(;n!==J;r++)if(n=n*_p%t,r>vp)return q;return BigInt(r)}function Ep(e,t,n){let r=J,i=wp(_p,n,t);for(let e=0;e<300;e++){if(r===i)return BigInt(e);r=r*_p%t,i=i*_p%t}return 0}function Dp(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function Op(e,t){if(Cp(e,t),this instanceof Op)e=Dp(X.d,X.n),this.s=X.s,this.n=X.n/e,this.d=X.d/e;else return Z(X.s*X.n,X.d)}var kp=function(){return Error(`Division by Zero`)},Ap=function(){return Error(`Invalid argument`)},jp=function(){return Error(`Parameters must be integer`)};Op.prototype={s:J,n:q,d:J,abs:function(){return Z(this.n,this.d)},neg:function(){return Z(-this.s*this.n,this.d)},add:function(e,t){return Cp(e,t),Z(this.s*this.n*X.d+X.s*this.d*X.n,this.d*X.d)},sub:function(e,t){return Cp(e,t),Z(this.s*this.n*X.d-X.s*this.d*X.n,this.d*X.d)},mul:function(e,t){return Cp(e,t),Z(this.s*X.s*this.n*X.n,this.d*X.d)},div:function(e,t){return Cp(e,t),Z(this.s*X.s*this.n*X.d,this.d*X.n)},clone:function(){return Z(this.s*this.n,this.d)},mod:function(e,t){if(e===void 0)return Z(this.s*this.n%this.d,J);if(Cp(e,t),q===X.n*this.d)throw kp();return Z(this.s*(X.d*this.n)%(X.n*this.d),X.d*this.d)},gcd:function(e,t){return Cp(e,t),Z(Dp(X.n,this.n)*Dp(X.d,this.d),X.d*this.d)},lcm:function(e,t){return Cp(e,t),X.n===q&&this.n===q?Z(q,J):Z(X.n*this.n,Dp(X.n,this.n)*Dp(X.d,this.d))},inverse:function(){return Z(this.s*this.d,this.n)},pow:function(e,t){if(Cp(e,t),X.d===J)return X.s<q?Z((this.s*this.d)**X.n,this.n**X.n):Z((this.s*this.n)**X.n,this.d**X.n);if(this.s<q)return null;let n=Sp(this.n),r=Sp(this.d),i=J,a=J;for(let e in n)if(e!==`1`){if(e===`0`){i=q;break}if(n[e]*=X.n,n[e]%X.d===q)n[e]/=X.d;else return null;i*=BigInt(e)**n[e]}for(let e in r)if(e!==`1`){if(r[e]*=X.n,r[e]%X.d===q)r[e]/=X.d;else return null;a*=BigInt(e)**r[e]}return X.s<q?Z(a,i):Z(i,a)},log:function(e,t){if(Cp(e,t),this.s<=q||X.s<=q)return null;let n=Object.create(null),r=Sp(X.n),i=Sp(X.d),a=Sp(this.n),o=Sp(this.d);for(let e in i)r[e]=(r[e]||q)-i[e];for(let e in o)a[e]=(a[e]||q)-o[e];for(let e in r)e!==`1`&&(n[e]=!0);for(let e in a)e!==`1`&&(n[e]=!0);let s=null,c=null;for(let e in n){let t=r[e]||q,n=a[e]||q;if(t===q){if(n!==q)return null;continue}let i=n,o=t,l=Dp(i,o);if(i/=l,o/=l,s===null&&c===null)s=i,c=o;else if(i*c!==s*o)return null}return s!==null&&c!==null?Z(s,c):null},equals:function(e,t){return Cp(e,t),this.s*this.n*X.d===X.s*X.n*this.d},lt:function(e,t){return Cp(e,t),this.s*this.n*X.d<X.s*X.n*this.d},lte:function(e,t){return Cp(e,t),this.s*this.n*X.d<=X.s*X.n*this.d},gt:function(e,t){return Cp(e,t),this.s*this.n*X.d>X.s*X.n*this.d},gte:function(e,t){return Cp(e,t),this.s*this.n*X.d>=X.s*X.n*this.d},compare:function(e,t){Cp(e,t);let n=this.s*this.n*X.d-X.s*X.n*this.d;return(q<n)-(n<q)},ceil:function(e){return e=_p**BigInt(e||0),Z(bp(this.s*e*this.n/this.d)+(e*this.n%this.d>q&&this.s>=q?J:q),e)},floor:function(e){return e=_p**BigInt(e||0),Z(bp(this.s*e*this.n/this.d)-(e*this.n%this.d>q&&this.s<q?J:q),e)},round:function(e){return e=_p**BigInt(e||0),Z(bp(this.s*e*this.n/this.d)+this.s*((this.s>=q?J:q)+Y*(e*this.n%this.d)>this.d?J:q),e)},roundTo:function(e,t){Cp(e,t);let n=this.n*X.d,r=this.d*X.n,i=n%r,a=bp(n/r);return i+i>=r&&a++,Z(this.s*a*X.n,X.d)},divisible:function(e,t){return Cp(e,t),X.n===q?!1:this.n*X.d%(X.n*this.d)===q},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(e=15){let t=this.n,n=this.d,r=Tp(t,n),i=Ep(t,n,r),a=this.s<q?`-`:``;if(a+=bp(t/n),t%=n,t*=_p,t&&(a+=`.`),r){for(let e=i;e--;)a+=bp(t/n),t%=n,t*=_p;a+=`(`;for(let e=r;e--;)a+=bp(t/n),t%=n,t*=_p;a+=`)`}else for(let r=e;t&&r--;)a+=bp(t/n),t%=n,t*=_p;return a},toFraction:function(e=!1){let t=this.n,n=this.d,r=this.s<q?`-`:``;if(n===J)r+=t;else{let i=bp(t/n);e&&i>q&&(r+=i,r+=` `,t%=n),r+=t,r+=`/`,r+=n}return r},toLatex:function(e=!1){let t=this.n,n=this.d,r=this.s<q?`-`:``;if(n===J)r+=t;else{let i=bp(t/n);e&&i>q&&(r+=i,t%=n),r+=`\\frac{`,r+=t,r+=`}{`,r+=n,r+=`}`}return r},toContinued:function(){let e=this.n,t=this.d,n=[];for(;t;){n.push(bp(e/t));let r=e%t;e=t,t=r}return n},simplify:function(e=.001){let t=BigInt(Math.ceil(1/e)),n=this.abs(),r=n.toContinued();for(let e=1;e<r.length;e++){let i=Z(r[e-1],J);for(let t=e-2;t>=0;t--)i=i.inverse().add(r[t]);let a=i.sub(n);if(a.n*t<a.d)return i.mul(this.s)}return this}};var Mp={maximumFractionDigits:20};function Np(e,t){let n;try{t&&(n=new Intl.NumberFormat(t,Mp))}catch{n=new Intl.NumberFormat(void 0,Mp)}return n.format(e)}var Pp=e=>typeof e==`string`&&ph(e)?uh(e):e,Fp=e=>{let t=Pp(e);if(gm(t)||Number.isNaN(t)||t===1/0||t===-1/0)return!0;if(!(fm(t)||pm(t)||_m(t)||vm(t)||mm(t)||hm(t))){let e=Em(String(t));if(e.includes(`|`))return!1;let n=xm(e)?wm(e):Sm(e)?parseFloat(e):e;if(n===1/0||n===-1/0)return!0;if(!Sm(n))return!1;if(!Number.isNaN(n))return!0}return!1},Ip=e=>typeof e==`string`?Fp(e)&&e.toLowerCase().includes(`e`):!1,Lp=(e,t,n)=>{let r=t??e,i=Pp(e);if(Fp(i)){let e=Em(String(i)),t=xm(e)?wm(e):Sm(e)?parseFloat(e):e;return t===1/0||t===-1/0?t:Number.isNaN(t)||!Sm(t)?r:n&&t<n?n:t}else return r},Rp=e=>{if(Fp(e)){if(typeof e==`string`)return e;if(typeof e==`number`)return Number.isNaN(e)||!Number.isFinite(e)?String(e):cm(e,{noThousandsSeparator:!0})}return e},zp=(e,t=!1)=>{let n=t?/0+((?=[|eE])|$)/:/(0+|0+\.0+)((?=[|eE])|$)/;return typeof e==`string`&&(!t||e.includes(`.`)||e.includes(`,`))?e?.match(n)?.[0]?.replaceAll(/[.,]/g,``)?.length??0:0},Bp=e=>zp(e)>0,Vp=(e,t=!1)=>{let n=typeof e==`string`,r=n&&ph(e),i=r?dh(e):null,a=Em(r?uh(e):e);return{number:t&&Bp(e)?a:Lp(a),unit:i,isString:n}},Hp=(e,t)=>t?String(e):String(Rp(e)),Up=({value:e,unit:t,isString:n,isScientific:r})=>{let i=typeof e==`number`&&n?Hp(e,r):e;return t?hh(i,t):i},Wp=2**-52,Gp=(e,t)=>{let{number:n,unit:r}=Vp(e),{number:i,unit:a}=Vp(t);return{firstNumber:n,secondNumber:r&&a&&r!==a?mh(i,r,a):i}},Kp=e=>{if(e!=null){if(Sm(e)&&typeof e==`number`)return e;if(ym(e)){let t=Lp(e?.toString().replace(`%`,``));if(Sm(t))return t/100}}return null},qp=(e,t,n={relativeDiff:Wp})=>{let{relativeDiff:r,absoluteDiff:i}=n,a=Kp(r??i);if(e===null||t===null)return!1;let o=ph(e),s=ph(t);if(o&&!s||!o&&s)throw Error(`Parameters must either both have units or both not have units. Received "${e}" and "${t}"`);if(a===null)return console.warn(`Tolerance number is not defined!`),e===t;if(a<=0||a<2**-52)throw Error(`Unpredictable results - toleranceNumber should be bigger than zero or less then EPSILON`);let{firstNumber:c,secondNumber:l}=Gp(e,t);if((c===1/0||c===`Infinity`)&&(l===1/0||l===`Infinity`)||(c===-1/0||c===`-Infinity`)&&(l===-1/0||l===`-Infinity`))return!0;if(typeof c==`number`&&typeof l==`number`){if(c===l)return!0;if(i||c===0||l===0){let e=Math.abs(c-l);return qp(e,a,{relativeDiff:`1%`})||e<a}else return 2*Math.abs((c-l)/(c+l))<a}return!1},Jp=4,Yp=(e,t=Jp)=>{let n=10**t;return Math.round(e*n)/n},Xp=(e,t=Jp)=>{if(typeof e==`number`)return Yp(e,t);if(e===null||Number.isNaN(e)||e===1/0||e===-1/0||e===void 0)return e;let{number:n,unit:r,isString:i}=Vp(e);return Up({value:!Sm(n)||typeof n==`string`&&n.endsWith(`.`)?e:Yp(n,t),unit:r,isString:i,isScientific:Ip(e)})},Zp=(e,t=Jp)=>Number(e.toPrecision(t)),Qp=(e,t=Jp)=>{let[n,r]=Lp(e).toPrecision(t).split(`.`);if(r){let e=t-n.length;return`${n}.${r.padEnd(e,`0`)}`}else return n},$p=(e,t=Jp)=>{if(typeof e==`number`)return Zp(e,t);if(e===null||Number.isNaN(e)||e===1/0||e===-1/0||e===void 0)return e;let{number:n,unit:r,isString:i}=Vp(e);return Up({value:!Sm(n)||typeof n==`string`&&n.endsWith(`.`)?e:Zp(n,t),unit:r,isString:i,isScientific:Ip(e)})},em=(e,t=Jp,n=!1)=>{let r=10**t,i=r&&e>r?Yp(e,0):n?Qp(e,t):Zp(e,t);return n?String(i):i},tm=(e,t=Jp)=>{if(typeof e==`number`)return em(e,t);if(e===null||Number.isNaN(e)||e===1/0||e===-1/0||e===void 0)return e;let{number:n,unit:r,isString:i}=Vp(e);return Up({value:!Sm(n)||typeof n==`string`&&n.endsWith(`.`)?e:em(n,t),unit:r,isString:i,isScientific:Ip(e)})},nm=(e,t=Jp)=>{if(e===null||Number.isNaN(e)||e===1/0||e===-1/0||e===void 0)return e;if(typeof e==`number`)return e.toFixed(t);let{number:n,unit:r,isString:i}=Vp(e);return Up({value:!Sm(n)||typeof n==`string`&&n.endsWith(`.`)?e:n.toFixed(t),unit:r,isString:i,isScientific:Ip(e)})},rm=1e-4,im=1e7,am={0:`⁰`,1:`¹`,2:`²`,3:`³`,4:`⁴`,5:`⁵`,6:`⁶`,7:`⁷`,8:`⁸`,9:`⁹`,"+":`⁺`,"-":`⁻`},om=(e,t)=>{let n=`0`.repeat(t);return t>0&&e!==`0`?e.includes(`.`)?`${e}${n}`:`${e}.${n}`:e},sm=(e,t,n=!1)=>{let r=Np(Lp(e),`en-US`).replaceAll(`,`,t);return n?om(r,zp(e,!0)):r},cm=(e,t)=>{let{nonBreakingSpace:n}=t??{};return e===``?e:e==null?``:Fp(e)?sm(e,t?.noThousandsSeparator?``:n?` `:` `,t?.preserveTrailingZeros):Tm(e.toString())},lm=(e,t)=>{let{roundScientificCoefficient:n,eNotation:r}=t??{};if(Number.isNaN(e))return`Invalid`;if(e==null)return``;if(!Fp(e)||e===``)return Tm(e.toString());let i=Lp(e);if(!Number.isFinite(i))return Tm(e.toString());let a=r?`e`:`·10`,[o,s]=i.toExponential().split(`e`),c=typeof n==`number`?Xp(o,n):o,l=s===`+0`||s===`-0`,u=[...s.replaceAll(`+`,``)].map(e=>r?e:am[e]).join(``);return l?c:`${c}${a}${u}`},um=(e,t)=>{let n=Math.abs(Lp(e));return(t?.scientific===`auto`&&t?.autoScientificBelow&&t?.autoScientificAbove?n<t?.autoScientificBelow||n>t?.autoScientificAbove:t?.scientific)?lm(e,t):cm(e,t)},dm=(e,t)=>{let n={scientific:t?.scientific??`auto`,eNotation:t?.eNotation??!1,autoScientificBelow:t?.autoScientificBelow??rm,autoScientificAbove:t?.autoScientificAbove??im,withUnit:t?.withUnit??!1,nonBreakingSpace:t?.nonBreakingSpace??!1,roundScientificCoefficient:t?.roundScientificCoefficient},{withUnit:r}=n;if(e==null)return``;let{number:i,unit:a}=Vp(e),o=um(i,n),s=a?zm?.[a]:``;return r&&a?o===``?s:`${o} ${s}`:o},fm=e=>e===null,pm=e=>e===void 0,mm=e=>e&&e.constructor===Array,hm=e=>e&&e.constructor===Object,gm=e=>e===``,_m=e=>e&&e[e.length-1]===`.`,vm=e=>e&&e[e.length-1]===`,`,ym=e=>typeof e==`string`&&/^\d+(\.\d+)?%$/.test(e),bm=e=>e.trim().replace(/\s+/g,` `),xm=e=>{if(typeof e!=`string`||!e.includes(`/`))return!1;try{return new Op(bm(e)),!0}catch(e){return e.message===`Division by Zero`}};function Sm(e){if(e==null||Array.isArray(e)||typeof e==`object`||Number.isNaN(e)||e===`NaN`||e===1/0||e===-1/0||e===`Infinity`||e===`-Infinity`)return!1;if(xm(e))return!0;let t=parseFloat(e);return typeof e==`string`?!isNaN(t)&&(th.test(e)||isFinite(e)):isFinite(e)}function Cm(e,t){let n=(e+``)[0],r=0,i=t.indexOf(n,0)+1;for(;i>0;)i=t.indexOf(n,i)+1,r+=1;return r}function wm(e){if(e instanceof Array||e==null||e===``||e===1/0||e===-1/0||e===`Infinity`||e===`-Infinity`||Number.isNaN(e)||e===`NaN`)return e;typeof e==`string`&&(e=bm(e));let t=e;try{let n=new Op(e);n!==void 0&&(t=n.valueOf())}catch(t){if(t.message===`Division by Zero`)return e.charAt(0)===`-`?-1/0:1/0;console.warn(`Error in numFraction() method: `,e)}return t.valueOf()}var Tm=e=>e.trim().replace(/[\t\r\n]/g,``);function Em(e){let t=Tm(e+``),n=Cm(`/`,t),r=Cm(` `,t)+Cm(`\xA0`,t),i=Cm(`.`,t),a=Cm(`,`,t);return n===0&&r>0&&(t=t.replace(/\s/g,``)),a>1&&(t=t.replace(/,/g,``)),i>1&&(t=t.replace(/\./g,``)),a=Cm(`,`,t),i=Cm(`.`,t),i===1&&a===1?(t.indexOf(`,`)>t.indexOf(`.`)?(t=t.replace(`.`,``),t=t.replace(`,`,`.`)):t=t.replace(`,`,``),t.indexOf(`.`)===0&&(t=0+t),t):(!i&&a&&(t=t.replace(`,`,`.`)),t.indexOf(`.`)===0&&(t=0+t),t)}var Dm=e=>{let t=e?.[0]===`-`,n=e.replace(/^-/gm,``).replace(/^(?:0+(?=[1-9])|0+(?=0))/gm,``);return t?`-${n}`:n};function Om(e){return typeof e==`number`?e:parseFloat(Em(e))}var km=e=>!Sm(e),{abs:Am,exp:jm,sqrt:Mm}=Math;function Nm(e,t,n,r=1e-8,i=30){let a=n,o=0,s=1;for(;s>r&&o<i;){let n=a-e(a)/t(a);if(s=Am(e(n)-e(a)),s<r)return[n,!0,o];a=n,o++}return[n,!1,o]}function Pm(e){let t=1/(1+.5*Am(e)),n=1-t*jm(-(e**2)-1.26551223+t*(1.00002368+t*(.37409196+t*(.09678418+t*(-.18628806+t*(.27886807+t*(-1.13520398+t*(1.48851587+t*(-.82215223+t*.17087277)))))))));return e>=0?n:-n}function Fm(e){let[t]=Nm(t=>e-Pm(t/Mm(2)),e=>-Mm(2/Math.PI)*jm(-.5*e**2),1);return t}function Im(e){return Pm(e/Mm(2))}var Lm=e=>e.replace(/^([+-]?(?:\d+\.?\d*|\.\d+))[ ]*[eE][ ]*([+-]?[ ]*\d+)/,(e,t,n)=>{let r=t.endsWith(`.`)?t.slice(0,-1):t;r.startsWith(`.`)&&(r=`0`+r);let i=n.replace(/[ ]+/g,``);return`${r}e${i}`});function Rm(e){if(typeof e!=`string`)return e;let t=e.replace(/\u00A0|\u2007|\u202F/g,` `).trim();if(ph(t)){let[e,n]=lh(t);return`${Lm(e.trim())}|${n.trim()}`}let n=t.match(/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)\s*[eE]\s*[+-]?\s*\d+)\s+(.+)$/);return n?`${Lm(n[1])}|${n[2].trim()}`:Lm(t)}var zm=Object.freeze({in:`in`,mm:`mm`,cm:`cm`,m:`m`,microM:`μm`,km:`km`,ft:`ft`,usft:`usft`,in2:`in²`,cm2:`cm²`,m2:`m²`,kg:`kg`,tonnes:`t`,mt:`mt`,kip:`kip`,bbl:`bbl`,m3:`m³`,Mm3:`Mm³`,MMSCF:`MMSCF`,lbm:`lbm`,"kg/mol":`kg/mol`,"lbf/mol":`lbf/mol`,sg:`sg`,ppg:`ppg`,"kg/m3":`kg/m³`,"lbm/ft3":`lbm/ft³`,s:`s`,min:`min`,h:`h`,d:`d`,month:`month`,year:`year`,"bbl/ft":`bbl/ft`,lpm:`L/min`,lps:`L/s`,bpm:`bbl/min`,"m3/min":`m³/min`,"m3/s":`m³/s`,MMSCFD:`MMSCFD`,bar:`Bar`,Pa:`Pa`,kPa:`kPa`,MPa:`MPa`,GPa:`GPa`,kPsi:`Psi`,ksi:`ksi`,"lbf/100ft2":`lbf/100ft²`,"1/Pa":`Pa⁻¹`,"1/kPa":`kPa⁻¹`,"1/MPa":`MPa⁻¹`,"1/GPa":`GPa⁻¹`,"1/psi":`psi⁻¹`,"kPa/m":`kPa/m`,"1/bar":`bar⁻¹`,klbf:`klbf`,"psi/ft":`Psi/ft`,"bar/100m":`bar/100m`,"psi/100ft":`psi/100ft`,"kPa/100m":`kPa/100m`,C:`°C`,F:`°F`,K:`K`,"C/100m":`°C/100m`,"C/m":`°C/m`,"Pa/C":`Pa/°C`,"Bar/C":`Bar/°C`,"psi/F":`psi/°F`,"psi/C":`psi/°C`,"F/100ft":`°F/100ft`,"F/ft":`°F/ft`,"K/100m":`K/100m`,"K/m":`K/m`,"lbf/ft":`lbf/ft`,N:`N`,kN:`kN`,"N/m":`N/m`,"daN/m":`daN/m`,lbf:`lbf`,kgf:`kgf`,rad:`rad`,"BTU/lbm":`BTU/lbm`,ppf:`ppf`,"kg/m":`kg/m`,"E-06/degC":`10⁻⁶/°C`,"E-06/degF":`10⁻⁶/°F`,"1/K":`K⁻¹`,km2:`km²`,ft2:`ft²`,mm2:`mm²`,mile2:`mile²`,ft3:`ft³`,"g/cm3":`g/cm³`,Sm3:`Sm³`,"ft3/s":`ft³/s`,"ft3/d":`ft³/d`,"m3/d":`m³/d`,"1/m3/d":`1/m³/d`,"s/m3":`s/m³`,"1/MMSCFD":`1/MMSCFD`,"bbl/d":`bbl/d`,tonneForce:`tonne-force`,USGal:`US gal`,"g/mol":`g/mol`,Nm:`N⋅m`,kNm:`kN⋅m`,ftlbf:`ft⋅lbf`,"J/(kg*degC)":`J/(kg⋅°C)`,"J/(kg*degK)":`J/(kg⋅K)`,"J/(s*m*degK)":`J/(s⋅m⋅K)`,"BTU/(lbm*degF)":`BTU/(lbm⋅°F)`,"BTU/(h*ft*degF)":`BTU/(h⋅ft⋅°F)`,l:`L`,"l/m":`L/m`,"kJ/kg":`kJ/kg`,"J/kg":`J/kg`,deg:`°`,"W/(mK)":`W/(m⋅K)`,psi:`psi`,"deg/100ft":`°/100ft`,"deg/30m":`°/30m`,"deg/10m":`°/10m`,"%":`%`,Hz:`Hz`,"1/s":`1/s`,rpm:`rpm`,"Pa/m":`Pa/m`,"bar/m":`bar/m`,gpm:`gpm`,"kg/s":`kg/s`,"lbm/s":`lbm/s`,"tonnes/h":`tonnes/h`,"tons/h":`tons/h`,"deg/m":`°/m`,"deg/ft":`°/ft`,"rad/m":`rad/m`,"rad/ft":`rad/ft`,"dyn/cm":`dyn/cm`,"mN/m":`mN/m`,"m/s":`m/s`,"ft/s":`ft/s`,"m/min":`m/min`,"ft/min":`ft/min`,"m/h":`m/h`,"ft/h":`ft/h`,mph:`mph`,"km/h":`km/h`,"m/s2":`m/s²`,Gs:`Gs`,nT:`nT`,g:`g`,"ft/s2":`ft/s²`,"Pa*s":`Pa⋅s`,P:`P`,"mPa*s":`mPa⋅s`,cP:`cP`,W:`W`,hhp:`hhp`,hp:`hp`,kW:`kW`,MW:`MW`,"BTU/h":`BTU/h`,"W/m2":`W/m²`,"hhp/in2":`hhp/in²`,"hhp/ft2":`hhp/ft²`,"Mm3/d":`Mm³/d`,"STB/d":`STB/d`,"Sm3/d":`Sm³/d`,"MSm3/d":`MSm³/d`,"SCF/STB":`SCF / STB`,"Sm3/Sm3":`Sm³ / Sm³`,"SCF/d":`SCF/d`,STB:`STB`,SCF:`SCF`,MSm3:`MSm³`,Gsg:`sg`,Gppg:`ppg`,"Gkg/m3":`kg/m³`,"Glbm/ft3":`lbm/ft³`,"lb/ft3":`lb/ft³`,"°N":`°N`,"°S":`°S`,"°W":`°W`,"°E":`°E`,fr:` `,mD:`mD`,CI:`CI`,Sigma:`σ`,"Sm3/d/bar":`Sm³/d/bar`,"STB/d/psi":`STB/d/psi`,"m3/s/bar":`m³/s/bar`,"lb/ft":`lb/ft`,"E-09/bar":`10⁻⁹/bar`,"E-10/psi":`10⁻¹⁰/psi`,"E-14/pa":`10⁻¹⁴/pa`,"m3/m":` m³/m`,"cm3/m":`cm³/m`,"mm3/m":`mm³/m`,"ft3/ft":`ft³/ft`,"in3/ft":`in³/ft`,lk:`lk`,ftCla:`ftCla`,lkCla:`lkCla`,ftSe:`ftSe`,ydSe:`ydSe`,chSe:`chSe`,"chSe(T)":`chSe(T)`,ftGC:`ftGC`,ydInd:`ydInd`,"d/stand":`d/stand`,"h/stand":`h/stand`,"min/stand":`min/stand`,"s/stand":`s/stand`,"m3/t":`m3/t`,"L/100kg":`L/100kg`}),Bm=Object.freeze({acceleration:[`ft/s2`,`m/s2`],angleGradient:[`deg/30m`,`rad/m`,`deg/m`,`deg/ft`,`rad/ft`,`deg/100ft`,`deg/10m`],angles:[`deg`,`rad`],areaOther:[`in2`,`ft2`,`mm2`,`cm2`,`m2`,`mile2`,`km2`],areaTubular:[`in2`,`cm2`,`ft2`,`m2`],blowoutFlowRate:[`lpm`,`bpm`,`m3/min`,`ft3/s`,`m3/s`,`MMSCFD`,`ft3/d`,`m3/d`,`bbl/d`,`Mm3/d`,`STB/d`,`Sm3/d`,`MSm3/d`,`SCF/d`],blowoutGasFlowRate:[`MMSCFD`,`Sm3/d`,`MSm3/d`,`SCF/d`],blowoutOilFlowRate:[`Sm3/d`,`STB/d`],deg:[`deg`,`rad`],density:[`sg`,`ppg`,`kg/m3`,`lbm/ft3`,`g/cm3`,`lb/ft3`,`kPa/m`],densityGas:[`Gsg`,`Gppg`,`Gkg/m3`,`Glbm/ft3`],densityOil:[`sg`,`ppg`,`kg/m3`,`lbm/ft3`],densityOilGas:[`ppg`,`kg/m3`,`lbm/ft3`],densitySolid:[`sg`,`ppg`,`kg/m3`,`lbm/ft3`],depth:[`m`,`ft`],diameters:[`in`,`m`,`cm`,`ft`,`mm`],distance:[`m`,`ft`],dls:[`deg/10m`,`deg/30m`,`deg/100ft`],doglegSeverity:[`deg/10m`,`deg/30m`,`deg/100ft`],duration:[`s`,`h`,`d`,`min`],durationShort:[`s`,`min`,`h`,`d`],durationLong:[`min`,`h`,`d`,`month`,`year`],flowrate:[`lpm`,`gpm`,`bpm`,`ft3/d`,`ft3/s`,`m3/s`,`m3/d`,`m3/min`,`Mm3/d`,`bbl/d`,`MMSCFD`,`STB/d`,`Sm3/d`,`MSm3/d`,`SCF/d`],fluidCompressibility:[`1/bar`,`1/psi`,`1/Pa`,`1/kPa`,`1/MPa`,`1/GPa`],force:[`tonnes`,`lbf`,`kgf`,`N`,`kN`,`tonneForce`,`klbf`],forceGradient:[`lbf/ft`,`N/m`],frequency:[`Hz`],gasVolume:[`MMSCF`,`Sm3`,`MSm3`,`SCF`],gor:[`Sm3/Sm3`,`SCF/STB`],height:[`m`,`ft`],intensity:[`W/m2`,`hhp/in2`,`hhp/ft2`],interfacialTension:[`dyn/cm`,`N/m`,`lbf/ft`,`mN/m`],latitude:[`°N`,`°S`],length:[`m`,`cm`,`ft`,`km`,`in`,`mm`],linearCapacity:[`l/m`,`bbl/ft`],longitude:[`°E`,`°W`],massFlowRate:[`kg/s`,`lbm/s`,`tonnes/h`,`tons/h`],moleWeight:[`kg/mol`,`lbf/mol`,`g/mol`],oilVolume:[`STB`,`Sm3`],percentage:[`%`,`fr`],permeability:[`mD`,`m2`],power:[`hp`,`W`,`hhp`,`MW`,`kW`,`BTU/h`],pressure:[`bar`,`psi`,`Pa`,`kPa`,`MPa`,`ksi`,`GPa`,`lbf/100ft2`],pressureGradient:[`bar/100m`,`Pa/m`,`bar/m`,`psi/100ft`,`psi/ft`,`kPa/m`],pressurechange:[`bar`,`psi`,`Pa`,`MPa`,`kPa`],gasliftFlowRate:[`STB/d`,`Sm3/d`,`SCF/d`],productionFlowRate:[`MMSCFD`,`STB/d`,`Sm3/d`,`MSm3/d`,`SCF/d`],productionFlowRateOil:[`MMSCFD`,`STB/d`,`Sm3/d`,`MSm3/d`,`SCF/d`],productionFlowRateGas:[`MMSCFD`,`STB/d`,`Sm3/d`,`MSm3/d`,`SCF/d`],injectionFlowRate:[`lpm`,`lps`,`bpm`,`gpm`,`MMSCFD`,`STB/d`,`Sm3/d`,`MSm3/d`,`SCF/d`],pumpRate:[`lpm`,`lps`,`bpm`,`m3/s`,`ft3/s`,`gpm`],rotationalSpeed:[`rpm`,`Hz`],roughness:[`m`,`microM`,`in`],rpm:[`rpm`,`Hz`],sdstats:[`CI`,`Sigma`],specificHeatCapacity:[`J/(kg*degC)`,`J/(kg*degK)`,`BTU/(lbm*degF)`],speed:[`km/h`,`ft/min`,`mph`,`ft/h`,`ft/s`,`m/min`,`m/s`,`m/h`],inverseStandSpeed:[`d/stand`,`h/stand`,`min/stand`,`s/stand`],rop:[`ft/h`,`ft/min`,`ft/s`,`km/h`,`m/h`,`m/min`,`m/s`,`mph`],stress:[`MPa`,`kPa`,`psi`,`bar`,`Pa`,`ksi`,`lbf/100ft2`],temperature:[`C`,`F`,`K`],pressurePerTemperature:[`Pa/C`,`Bar/C`,`psi/F`,`psi/C`],tempgrad:[`C/100m`,`F/100ft`,`K/100m`,`C/m`,`F/ft`,`K/m`],thermalConductivity:[`BTU/(h*ft*degF)`,`W/(mK)`],thermalExpansionCoefficient:[`E-06/degC`,`E-06/degF`,`1/K`],torque:[`Nm`,`ftlbf`,`kNm`],torqueGradient:[`N`,`lbf`,`tonnes`],turbulentSkin:[`s/m3`,`1/m3/d`,`1/MMSCFD`],viscosity:[`Pa*s`,`P`,`mPa*s`,`cP`],inflowProductivityIndex:[`Sm3/d/bar`,`STB/d/psi`,`m3/s/bar`],volume:[`m3`,`bbl`,`Mm3`,`l`,`USGal`,`ft3`,`STB`,`Sm3`,`MMSCF`,`MSm3`,`SCF`],kickToleranceVolume:[`m3`,`bbl`,`USGal`,`ft3`,`STB`,`Sm3`,`SCF`],weight:[`tonnes`,`kg`,`lbf`,`mt`,`kip`,`N`],weightGradient:[`ppf`,`kg/m`],wgrad:[`sg`,`ppg`],wltubulars:[`ppf`,`kg/m`],youngsModulus:[`Pa`,`psi`],massPerLength:[`kg/m`,`lb/ft`],wearFactor:[`E-09/bar`,`E-10/psi`,`E-14/pa`],volumeGradient:[`m3/m`,`cm3/m`,`mm3/m`,`ft3/ft`,`in3/ft`],shearStress:[`Pa`,`lbf/100ft2`],sensorAccelerometer:[`g`,`m/s2`],sensorMagnetometer:[`nT`,`Gs`],location:[`lk`,`ftCla`,`lkCla`,`ftSe`,`ydSe`,`chSe`,`chSe(T)`,`ftGC`,`ydInd`,`ft`,`m`,`usft`],mixingRequirements:[`m3/t`,`L/100kg`],entalphy:[`J/kg`,`kJ/kg`,`BTU/lbm`]}),Vm=Object.freeze({density:`sg`,densityGas:`Gsg`,densityOil:`sg`,densityOilGas:`kg/m3`,densitySolid:`kg/m3`,length:`m`,roughness:`m`,speed:`m/s`,diameters:`in`,duration:`s`,durationShort:`h`,durationLong:`d`,pressurechange:`bar`,pressure:`bar`,temperature:`C`,tempgrad:`C/100m`,volume:`m3`,kickToleranceVolume:`m3`,weight:`kg`,force:`N`,wgrad:`sg`,wltubulars:`ppf`,flowrate:`lpm`,permeability:`mD`,interfacialTension:`dyn/cm`,deg:`deg`,dls:`deg/30m`,percentage:`%`,latitude:`°N`,longitude:`°E`,torque:`Nm`,rpm:`rpm`,testSingleUnit:`m`,turbulentSkin:`1/m3/d`,pressurePerTemperature:`Pa/C`,sdstats:`Sigma`,acceleration:`m/s2`,massFlowRate:`kg/s`,angleGradient:`deg/m`,viscosity:`Pa*s`,weightGradient:`kg/m`,intensity:`W/m2`,gor:`Sm3/Sm3`,inflowProductivityIndex:`Sm3/d/bar`,wearFactor:`E-09/psi`,location:`m`,inverseStandSpeed:`s/stand`,mixingRequirements:`m3/t`,entalphy:`J/kg`,shearStress:`Pa`,volumeGradient:`m3/m`,sensorAccelerometer:`g`,sensorMagnetometer:`Gs`}),Q=Object.freeze({g:.0980665175317196,ft_to_m:.3048,inch_to_m:.0254,lbf_to_kg:.45359237,kg_to_lbf:2.20462262184877,ppf_to_kgm:.45359237/.3048,kg_cm3:.0293984025938081,bar_to_psi:14.503773773022,bar_to_pascal:1e5,sg_to_ppg:8.345404265,bbl_to_m3:.158987294928,USGal_to_m3:.003785411784,kelvin_to_degrees:273.15,tonnes_to_pascal:9806.65,therm_exp_coeff:1242e-8,psi_to_pascal:6894.757293168361,ft3_to_m3:.028316846592,ft3_to_in3:1728,day_to_second:3600*24,m3_per_m_to_ft3_per_ft:10.763910416709722,in3_per_ft_to_m3_per_m:537633333333e-16,MSm3d_to_m3s:625/54}),Hm=Object.freeze({"m|mm":e=>e*1e3,"m|cm":e=>e*100,"m|km":e=>e/1e3,"m|ft":e=>e/Q.ft_to_m,"m|in":e=>e/Q.inch_to_m,"m|microM":e=>e*1e6,"mm|m":e=>e/1e3,"cm|m":e=>e/100,"km|m":e=>e*1e3,"ft|m":e=>e*Q.ft_to_m,"in|m":e=>e*Q.inch_to_m,"microM|m":e=>e/1e6,"m2|mm2":e=>e*1e6,"m2|cm2":e=>e*1e4,"m2|km2":e=>e/1e6,"m2|in2":e=>e*1550.0031,"m2|ft2":e=>e*10.76391,"m2|mile2":e=>e*3.861022e-7,"mm2|m2":e=>e/1e6,"cm2|m2":e=>e/1e4,"km2|m2":e=>e*1e6,"in2|m2":e=>e/1550.0031,"ft2|m2":e=>e/10.76391,"mile2|m2":e=>e/3.861022e-7,"m3|bbl":e=>e/Q.bbl_to_m3,"m3|ft3":e=>e/Q.ft3_to_m3,"m3|l":e=>e*1e3,"m3|Mm3":e=>e/1e6,"m3|USGal":e=>e/Q.USGal_to_m3,"bbl|m3":e=>e*Q.bbl_to_m3,"ft3|m3":e=>e*Q.ft3_to_m3,"Mm3|m3":e=>e*1e6,"l|m3":e=>e/1e3,"USGal|m3":e=>e*Q.USGal_to_m3,"m3|Sm3":e=>e*1,"m3|STB":e=>e*6.289512957422142,"Sm3|m3":e=>e*1,"STB|m3":e=>e*.1589948230919721,"m3|MMSCF":e=>e*1e6/Q.ft3_to_m3,"m3|MSm3":e=>e*1e-6,"m3|SCF":e=>e/Q.ft3_to_m3,"MMSCF|m3":e=>e*1e-6*Q.ft3_to_m3,"MSm3|m3":e=>e*1e6,"SCF|m3":e=>e*Q.ft3_to_m3,"kg/m3|sg":e=>e*.001,"kg/m3|g/cm3":e=>e*.001,"kg/m3|lbm/ft3":e=>e/16.01846337,"kg/m3|lb/ft3":e=>e/16.01846337,"kg/m3|ppg":e=>e*.008345404265,"sg|kg/m3":e=>e*1e3,"g/cm3|kg/m3":e=>e*1e3,"lbm/ft3|kg/m3":e=>e*16.01846337,"lb/ft3|kg/m3":e=>e*16.01846337,"ppg|kg/m3":e=>e/.008345404265,"sg|kPa/m":e=>e*9.81,"kPa/m|sg":e=>e/9.81,"Gkg/m3|Gsg":e=>e/1.225,"Gkg/m3|Glbm/ft3":e=>e/16.0176516725,"Gkg/m3|Gppg":e=>e/119.8659491193,"Gsg|Gkg/m3":e=>e*1.225,"Glbm/ft3|Gkg/m3":e=>e*16.0176516725,"Gppg|Gkg/m3":e=>e*119.8659491193,"ppf|kg/m":e=>e*.45359237/.3048,"kg/m|ppf":e=>e*1/(.45359237/.3048),"kg/m|lbf/ft":e=>e/.67196897675131,"lbf/ft|kg/m":e=>e*.67196897675131,"Pa|psi":e=>e/Q.psi_to_pascal,"psi|Pa":e=>e*Q.psi_to_pascal,"Pa|bar":e=>e*1e-5,"Pa|kPa":e=>e*.001,"Pa|MPa":e=>e*1e-6,"Pa|GPa":e=>e*1e-9,"bar|Pa":e=>e*1e5,"kPa|Pa":e=>e*1e3,"MPa|Pa":e=>e*1e6,"GPa|Pa":e=>e*1e9,"psi|ksi":e=>e/1e3,"ksi|psi":e=>e*1e3,"psi|lbf/100ft2":e=>e*14400,"lbf/100ft2|psi":e=>e/14400,"1/psi|1/Pa":e=>e/Q.psi_to_pascal,"1/bar|1/Pa":e=>e*1e-5,"1/kPa|1/Pa":e=>e*.001,"1/MPa|1/Pa":e=>e*1e-6,"1/GPa|1/Pa":e=>e*1e-9,"1/Pa|1/psi":e=>e*Q.psi_to_pascal,"1/Pa|1/bar":e=>e*1e5,"1/Pa|1/kPa":e=>e*1e3,"1/Pa|1/MPa":e=>e*1e6,"1/Pa|1/GPa":e=>e*1e9,"C|F":e=>e*1.8+32,"F|C":e=>(e-32)*5/9,"K|C":e=>e-Q.kelvin_to_degrees,"C|K":e=>e+Q.kelvin_to_degrees,"C/100m|F/100ft":e=>e*1.8*Q.ft_to_m,"F/100ft|C/100m":e=>e*5/9/Q.ft_to_m,"C/100m|C/m":e=>e/100,"C/m|C/100m":e=>e*100,"C/100m|F/ft":e=>e*1.8/100*Q.ft_to_m,"F/ft|C/100m":e=>e*5/9*100/Q.ft_to_m,"C/100m|K/m":e=>e/100,"K/m|C/100m":e=>e*100,"K/100m|C/100m":e=>e,"C/100m|K/100m":e=>e,"Pa/C|Bar/C":e=>e*1e-5,"Pa/C|psi/F":e=>e/1.8/Q.psi_to_pascal,"Pa/C|psi/C":e=>e/Q.psi_to_pascal,"Bar/C|Pa/C":e=>e*1e5,"psi/F|Pa/C":e=>e*1.8*Q.psi_to_pascal,"psi/C|Pa/C":e=>e*Q.psi_to_pascal,"psi/F|psi/C":e=>e*1.8,"psi/C|psi/F":e=>e/1.8,"kg|kgf":e=>e,"kg|lbf":e=>e*Q.kg_to_lbf,"kg|t":e=>e/1e3,"kg|tonnes":e=>e/1e3,"kg|mt":e=>e/1e3,"kg|kip":e=>e*Q.kg_to_lbf*.001,"kgf|kg":e=>e,"lbf|kg":e=>e*Q.lbf_to_kg,"t|kg":e=>e*1e3,"tonnes|kg":e=>e*1e3,"mt|kg":e=>e*1e3,"kip|kg":e=>e*1e3*Q.lbf_to_kg,"tonnes|lbf":e=>e*1e3*Q.kg_to_lbf,"lbf|tonnes":e=>e*Q.lbf_to_kg/1e3,"t|lbf":e=>e*1e3*Q.kg_to_lbf,"lbf|t":e=>e*Q.lbf_to_kg/1e3,"mt|lbf":e=>e*1e3*Q.kg_to_lbf,"lbf|mt":e=>e/(1e3*Q.kg_to_lbf),"kgf|lbf":e=>e*Q.kg_to_lbf,"lbf|kgf":e=>e*Q.lbf_to_kg,"kg|g":e=>e*1e3,"g|kg":e=>e/1e3,"kgf|t":e=>e/1e3,"t|kgf":e=>e*1e3,"kgf|tonnes":e=>e/1e3,"tonnes|kgf":e=>e*1e3,"kg/m|lb/ft":e=>e*1.4881639435695537,"lb/ft|kg/m":e=>e*.6719689751395069,"kg|N":e=>e*Q.g*100,"N|kg":e=>e/(Q.g*100),"m/s|km/h":e=>e*3.6,"km/h|m/s":e=>e/3.6,"m/s|ft/s":e=>e/Q.ft_to_m,"m/s|ft/min":e=>e*60/Q.ft_to_m,"m/s|ft/h":e=>e*3600/Q.ft_to_m,"m/s|m/min":e=>e*60,"m/s|m/h":e=>e*3600,"ft/s|m/s":e=>e*Q.ft_to_m,"ft/min|m/s":e=>e*Q.ft_to_m/60,"ft/h|m/s":e=>e*Q.ft_to_m/3600,"m/min|m/s":e=>e/60,"m/h|m/s":e=>e/3600,"m/s|mph":e=>e*2.2369362920544,"mph|m/s":e=>e/2.2369362920544,"ft/h|ft/d":e=>e*24,"ft/d|ft/h":e=>e/24,"ft/h|m/h":e=>e*Q.ft_to_m,"m/h|ft/h":e=>e/Q.ft_to_m,"ft/d|m/h":e=>e*Q.ft_to_m/24,"m/h|ft/d":e=>e*24/Q.ft_to_m,"ft/d|m/d":e=>e*Q.ft_to_m,"m/d|ft/d":e=>e/Q.ft_to_m,"m/h|m/d":e=>e*24,"m/d|m/h":e=>e/24,"l/m|bbl/ft":e=>e*.0019171343228277056,"bbl/ft|l/m":e=>e/.0019171343228277056,"m3/s|ft3/s":e=>e/Q.ft3_to_m3,"m3/s|lpm":e=>e*6e4,"m3/s|bpm":e=>e*377.388646,"m3/s|m3/min":e=>e*60,"m3/s|m3/d":e=>e*Q.day_to_second,"m3/s|bbl/d":e=>e*543439.6505653338,"m3/s|ft3/d":e=>e*Q.day_to_second/Q.ft3_to_m3,"m3/s|gpm":e=>e*25e11/157725491,"m3/s|MMSCFD":e=>e/.32774128,"m3/s|STB/d":e=>e*0x7a7f6097db00/247854343,"m3/s|Sm3/d":e=>e*Q.day_to_second,"m3/s|MSm3/d":e=>e/Q.MSm3d_to_m3s,"m3/s|SCF/d":e=>e*3051187.2047366146,"ft3/s|m3/s":e=>e*Q.ft3_to_m3,"lpm|m3/s":e=>e/6e4,"lps|lpm":e=>e*60,"lpm|lps":e=>e/60,"bpm|m3/s":e=>e/377.388646,"m3/d|m3/s":e=>e/Q.day_to_second,"m3/min|m3/s":e=>e/60,"bbl/d|m3/s":e=>e/Q.day_to_second*Q.bbl_to_m3,"ft3/d|m3/s":e=>e/Q.day_to_second*Q.ft3_to_m3,"ft3/d|m3/d":e=>e*Q.ft3_to_m3,"m3/d|ft3/d":e=>e/Q.ft3_to_m3,"m3/d|ft3/s":e=>e/Q.ft3_to_m3/Q.day_to_second,"gpm|m3/s":e=>e*157725491/25e11,"MMSCFD|m3/s":e=>e*.32774128,"Mm3/d|m3/d":e=>e*1e6,"m3/d|Mm3/d":e=>e*1e-6,"STB/d|m3/s":e=>e*184021785986e-17,"Sm3/d|m3/d":e=>e,"m3/d|Sm3/d":e=>e,"Sm3/d|m3/s":e=>e/Q.day_to_second,"MSm3/d|Sm3/d":e=>e*1e6,"Sm3/d|MSm3/d":e=>e*1e-6,"MSm3/d|m3/s":e=>e*Q.MSm3d_to_m3s,"SCF/d|m3/s":e=>e*3.2774128e-7,"1/m3/d|1/MMSCFD":e=>e*28316.85,"1/MMSCFD|1/m3/d":e=>e/28316.85,"s/m3|1/m3/d":e=>e/86400,"1/m3/d|s/m3":e=>e*86400,"kg/s|lbm/s":e=>e*2.20462262,"lbm/s|kg/s":e=>e/2.20462262,"kg/s|tonnes/h":e=>e*3.6,"tonnes/h|kg/s":e=>e/3.6,"kg/s|tons/h":e=>e*3.9683207193277967,"tons/h|kg/s":e=>e*.2519957611111111,"lbm/s|tonnes/h":e=>e*1.632932532,"tonnes/h|lbm/s":e=>e*.612395172735771,"lbm/s|tons/h":e=>e*1.8,"tons/h|lbm/s":e=>e/1.8,"tonnes/h|tons/h":e=>e*1.1023113109243878,"tons/h|tonnes/h":e=>e*.90718474,"mD|m2":e=>e*9869233e-19,"m2|mD":e=>e/9869233e-19,"N/m|lbf/ft":e=>e*.22480894387096*Q.ft_to_m,"lbf/ft|N/m":e=>e/.22480894387096/Q.ft_to_m,"dyn/cm|mN/m":e=>e,"mN/m|dyn/cm":e=>e,"dyn/cm|N/m":e=>e*.001,"N/m|dyn/cm":e=>e*1e3,"mN/m|N/m":e=>e*.001,"N/m|mN/m":e=>e*1e3,"Nm|ftlbf":e=>e*.737562058700684,"Nm|kNm":e=>e/1e3,"kNm|Nm":e=>e*1e3,"ftlbf|Nm":e=>e/.737562058700684,"N|kN":e=>e*.001,"N|kgf":e=>e*2e4/196133,"N|lbf":e=>e*2e12/8896443230521,"kN|lbf":e=>e*1e3*2e12/8896443230521,"N|tonneForce":e=>e*20/196133,"kN|N":e=>e/.001,"kgf|N":e=>e*196133/2e4,"lbf|N":e=>e*8896443230521/2e12,"lbf|kN":e=>e*8896443230521/(2e12*1e3),"lbf|tonneForce":e=>e*45359237/1e11,"klbf|tonneForce":e=>e*45359237/(1e11*.001),"tonneForce|N":e=>e*196133/20,"tonneForce|lbf":e=>e*1e11/45359237,"tonneForce|klbf":e=>e*1e11/(45359237*1e3),"klbf|lbf":e=>e*1e3,"lbf|klbf":e=>e/1e3,"s|min":e=>e/60,"s|h":e=>e/3600,"s|d":e=>e/(24*3600),"min|s":e=>e*60,"h|s":e=>e*3600,"d|s":e=>e*24*3600,"year|d":e=>e*365.25,"d|year":e=>e/365.25,"year|month":e=>e*12,"month|year":e=>e/12,"month|d":e=>e*30.4375,"d|month":e=>e/30.4375,"s/stand|min/stand":e=>e/60,"s/stand|h/stand":e=>e/3600,"s/stand|d/stand":e=>e/86400,"min/stand|s/stand":e=>e*60,"h/stand|s/stand":e=>e*3600,"d/stand|s/stand":e=>e*86400,"min/stand|h/stand":e=>e/60,"min/stand|d/stand":e=>e/1440,"h/stand|min/stand":e=>e*60,"h/stand|d/stand":e=>e/24,"d/stand|min/stand":e=>e*1440,"d/stand|h/stand":e=>e*24,"%|fr":e=>e*.01,"fr|%":e=>e/.01,"deg|rad":e=>e*Math.PI/180,"rad|deg":e=>e*180/Math.PI,"W|hp":e=>e/745.699872,"hp|W":e=>e*745.699872,"W|kW":e=>e/1e3,"W|MW":e=>e/1e6,"kW|W":e=>e*1e3,"MW|W":e=>e*1e6,"W|BTU/h":e=>e*3.4121416351331,"BTU/h|W":e=>e/3.4121416351331,"hhp|hp":e=>e,"hp|hhp":e=>e,"°N|°S":e=>e,"°S|°N":e=>e,"°W|°E":e=>e,"°E|°W":e=>e,"BTU/(Kg*K)|BTU/(lbm*degF)":e=>e/4186.798188,"BTU/(lbm*degF)|J/(kg*degC)":e=>e*4186.798188,"BTU/(lbm*degF)|BTU/(Kg*K)":e=>e*4186.798188,"J/(kg*degK)|J/(kg*degC)":e=>e,"J/(kg*degC)|BTU/(lbm*degF)":e=>e/4186.798188,"J/(kg*degC)|J/(kg*degK)":e=>e,"J/(kg*degC)|J/(s*m*degK)":e=>e,"BTU/(h*ft*degF)|W/(mK)":e=>e*1.7295772056,"BTU/(h*ft*degF)|J/(s*m*degK)":e=>e*1.7295772056,"W/(mK)|BTU/(h*ft*degF)":e=>e/1.7295772056,"W/(mK)|J/(s*m*degK)":e=>e,"W/(m*degK)|J/(s*m*degK)":e=>e,"W/(m*degK)|BTU/(h*ft*degF)":e=>e/1.7295772056,"J/(s*m*degK)|BTU/(h*ft*degF)":e=>e/1.7295772056,"J/(s*m*degK)|W/(m*degK)":e=>e,"J/(s*m*degK)|W/(mK)":e=>e,"J/(s*m*degK)|J/(kg*degC)":e=>e,"E-06/degF|E-06/degC":e=>e*1.8,"E-06/degC|E-06/degF":e=>e/1.8,"E-06/degC|1/K":e=>e/1e6,"1/K|E-06/degC":e=>e*1e6,"rpm|Hz":e=>e/60,"Hz|rpm":e=>e*60,"CI|Sigma":e=>Fm(e),"Sigma|CI":e=>Im(e),"g/mol|kg/mol":e=>e/1e3,"kg/mol|g/mol":e=>e*1e3,"lbf/mol|kg/mol":e=>e/Q.kg_to_lbf,"kg/mol|lbf/mol":e=>e*Q.kg_to_lbf,"m/s2|ft/s2":e=>e/Q.ft_to_m,"ft/s2|m/s2":e=>e*Q.ft_to_m,"Pa*s|P":e=>e*10,"P|Pa*s":e=>e/10,"mPa*s|Pa*s":e=>e/1e3,"Pa*s|mPa*s":e=>e*1e3,"cP|Pa*s":e=>e*.001,"Pa*s|cP":e=>e/.001,"Pa/m|bar/m":e=>e*1e-5,"bar/m|Pa/m":e=>e*1e5,"Pa/m|kPa/m":e=>e/1e3,"kPa/m|Pa/m":e=>e*1e3,"Pa/m|bar/100m":e=>e*.001,"bar/100m|Pa/m":e=>e*1e3,"bar/m|bar/100m":e=>e*100,"bar/100m|bar/m":e=>e/100,"psi/ft|Pa/m":e=>e*Q.psi_to_pascal/Q.ft_to_m,"Pa/m|psi/ft":e=>e/Q.psi_to_pascal*Q.ft_to_m,"psi/100ft|Pa/m":e=>e*68.9475729/Q.ft_to_m,"Pa/m|psi/100ft":e=>e/68.9475729*Q.ft_to_m,"deg/30m|deg/100ft":e=>e*(100*Q.ft_to_m/30),"deg/100ft|deg/30m":e=>e/(100*Q.ft_to_m/30),"deg/30m|deg/m":e=>e/30,"deg/m|deg/30m":e=>e*30,"deg/100ft|deg/ft":e=>e/100,"deg/ft|deg/100ft":e=>e*100,"deg/100ft|deg/m":e=>e/(100*Q.ft_to_m),"deg/m|deg/100ft":e=>e*(100*Q.ft_to_m),"deg/ft|deg/m":e=>e/Q.ft_to_m,"deg/m|deg/ft":e=>e*Q.ft_to_m,"deg/m|rad/m":e=>e*Math.PI/180,"rad/m|deg/m":e=>e*180/Math.PI,"rad/ft|deg/m":e=>e*180/Math.PI/Q.ft_to_m,"deg/m|rad/ft":e=>e*Math.PI/180*Q.ft_to_m,"deg/10m|deg/100ft":e=>e*(10*Q.ft_to_m),"deg/100ft|deg/10m":e=>e/(10*Q.ft_to_m),"deg/10m|deg/m":e=>e/10,"deg/m|deg/10m":e=>e*10,"deg/30m|deg/10m":e=>e/3,"deg/10m|deg/30m":e=>e*3,"deg/10m|rad/m":e=>e*Math.PI/180/10,"rad/m|deg/10m":e=>e*180/Math.PI*10,"W/m2|hhp/in2":e=>1/745.699872/1550.0031*e,"W/m2|hhp/ft2":e=>1/745.699872/10.76391*e,"hhp/in2|W/m2":e=>e/(1/745.699872/1550.0031),"hhp/ft2|W/m2":e=>e/(1/745.699872/10.76391),"SCF/STB|Sm3/Sm3":e=>e*.178099173553719,"Sm3/Sm3|SCF/STB":e=>e*5.614849187935035,"Sm3/d/bar|m3/s/bar":e=>e/86400,"STB/d/psi|m3/s/bar":e=>e/37468.77736,"m3/s/bar|Sm3/d/bar":e=>e*86400,"m3/s/bar|STB/d/psi":e=>e*37468.77736,"E-10/psi|E-09/bar":e=>e*1.450377378,"E-10/psi|E-14/pa":e=>e*1.450377378,"E-14/pa|E-10/psi":e=>e/1.450377378,"E-09/bar|E-10/psi":e=>e/1.450377378,"E-14/pa|1/Pa":e=>e/10**14,"E-09/bar|1/bar":e=>e/10**9,"E-10/psi|1/psi":e=>e/10**10,"1/Pa|E-14/pa":e=>e*10**14,"1/bar|E-09/bar":e=>e*10**9,"1/psi|E-10/psi":e=>e*10**10,"m3/m|cm3/m":e=>e*10**6,"m3/m|mm3/m":e=>e*10**9,"m3/m|ft3/ft":e=>e*Q.m3_per_m_to_ft3_per_ft,"m3/m|in3/ft":e=>e*Q.m3_per_m_to_ft3_per_ft*Q.ft3_to_in3,"cm3/m|m3/m":e=>e*1e-6,"cm3/m|mm3/m":e=>e*1e3,"cm3/m|ft3/ft":e=>e*Q.m3_per_m_to_ft3_per_ft*1e-6,"cm3/m|in3/ft":e=>e*Q.m3_per_m_to_ft3_per_ft*1e-6*Q.ft3_to_in3,"mm3/m|m3/m":e=>e*1e-9,"mm3/m|cm3/m":e=>e*.001,"mm3/m|ft3/ft":e=>e*Q.m3_per_m_to_ft3_per_ft*1e-9,"mm3/m|in3/ft":e=>e*Q.m3_per_m_to_ft3_per_ft*1e-9*Q.ft3_to_in3,"ft3/ft|m3/m":e=>e*.09290304,"ft3/ft|cm3/m":e=>e*92903.04,"ft3/ft|mm3/m":e=>e*92903040,"ft3/ft|in3/ft":e=>e*1728,"in3/ft|m3/m":e=>e*Q.in3_per_ft_to_m3_per_m,"in3/ft|cm3/m":e=>e*Q.in3_per_ft_to_m3_per_m*1e6,"in3/ft|mm3/m":e=>e*Q.in3_per_ft_to_m3_per_m*1e9,"in3/ft|ft3/ft":e=>e/Q.ft3_to_in3,"Pa|lbf/100ft2":e=>e*2.088543423315013,"lbf/100ft2|Pa":e=>e*.4788025898033584,"usft|m":e=>e*.30480060960121924,"lk|m":e=>e*.201168,"ftCla|m":e=>e*.3047972651151,"lkCla|m":e=>e*.2011057269733667,"ftGC|m":e=>e*.30479971018150875,"ydInd|m":e=>e*.9143985307444408,"ftSe|m":e=>12/39.370147*e,"ydSe|m":e=>e*.9143991154275526,"chSe|m":e=>e*20.11676512155263,"chSe(T)|m":e=>e*20.116756,"m|usft":e=>e/.30480060960121924,"m|lk":e=>e/.201168,"m|ftCla":e=>e/.3047972651151,"m|lkCla":e=>e/.2011057269733667,"m|ftGC":e=>e/.30479971018150875,"m|ydInd":e=>e/.9143985307444408,"m|ftSe":e=>e/(12/39.370147),"m|ydSe":e=>e/.9143991154275526,"m|chSe":e=>e/20.11676512155263,"m|chSe(T)":e=>e/20.116756,"m3/t|L/100kg":e=>e*100,"L/100kg|m3/t":e=>e*.01,"kJ/kg|J/kg":e=>e*1e3,"J/kg|kJ/kg":e=>e/1e3,"BTU/lbm|J/kg":e=>e*2326,"J/kg|BTU/lbm":e=>e/2326,"g|m/s2":e=>e*9.81,"m/s2|g":e=>e/9.81,"Gs|nT":e=>e*1e5,"nT|Gs":e=>e/1e5}),Um=Object.freeze({"N-m":`Nm`,"ft-lbf":`ftlbf`,"BTU/hr":`BTU/h`,"BTU/(htf*degF)":`BTU/(h*ft*degF)`,"BTU/(hft*degF)":`BTU/(h*ft*degF)`}),Wm=Object.freeze({"lbs/ft":`lb/ft`,"lbm/ft":`lb/ft`,ftUS:`usft`}),Gm=Object.freeze({mm:`m`,cm:`m`,km:`m`,ft:`m`,in:`m`,microM:`m`,lbf:`kg`,t:`kg`,tonnes:`kg`,mt:`kg`,kip:`kg`,kW:`W`,MW:`W`,hp:`W`,hhp:`hp`,mm2:`m2`,cm2:`m2`,km2:`m2`,in2:`m2`,ft2:`m2`,mile2:`m2`,bbl:`m3`,ft3:`m3`,Mm3:`m3`,l:`m3`,USGal:`m3`,Sm3:`m3`,STB:`m3`,MMSCF:`m3`,MSm3:`m3`,SCF:`m3`,kN:`N`,kgf:`N`,tonneForce:`N`,klbf:`lbf`,psi:`Pa`,bar:`Pa`,kPa:`Pa`,MPa:`Pa`,ksi:`psi`,"lbf/100ft2":`psi`,"psi/100ft":`Pa/m`,"psi/ft":`Pa/m`,"bar/100m":`Pa/m`,"bar/m":`Pa/m`,"Pa/m":`kPa/m`,sg:`kg/m3`,"g/cm3":`kg/m3`,"lbm/ft3":`kg/m3`,"lb/ft3":`kg/m3`,ppg:`kg/m3`,"kPa/m":`sg`,Gsg:`Gkg/m3`,Gppg:`Gkg/m3`,"Glbm/ft3":`Gkg/m3`,"1/psi":`1/Pa`,"1/bar":`1/Pa`,"1/kPa":`1/Pa`,"1/MPa":`1/Pa`,"1/GPa":`1/Pa`,"ft/s":`m/s`,"ft/min":`m/s`,"ft/h":`m/s`,"m/min":`m/s`,"m/h":`m/s`,mph:`m/s`,"ft3/s":`m3/s`,lpm:`m3/s`,lps:`lpm`,bpm:`m3/s`,"m3/d":`m3/s`,"bbl/d":`m3/s`,"ft3/d":`m3/s`,"STB/d":`m3/s`,"Sm3/d":`m3/s`,gpm:`m3/s`,MMSCFD:`m3/s`,"Mm3/d":`m3/d`,"m3/min":`m3/s`,"MSm3/d":`m3/s`,"lbf/ft":`N/m`,min:`s`,h:`s`,d:`s`,month:`d`,year:`d`,"J/(kg*degK)":`J/(kg*degC)`,"BTU/(lbm*degF)":`J/(kg*degC)`,"BTU/(Kg*K)":`J/(kg*degC)`,"BTU/(h*ft*degF)":`J/(s*m*degK)`,"W/(m*degK)":`J/(s*m*degK)`,"W/(mK)":`J/(s*m*degK)`,K:`C`,"C/m":`C/100m`,"F/ft":`C/100m`,"K/m":`C/100m`,"F/100ft":`C/100m`,"K/100m":`C/100m`,"Bar/C":`Pa/C`,"s/m3":`1/m3/d`,"1/MMSCFD":`1/m3/d`,P:`Pa*s`,"mPa*s":`Pa*s`,cP:`Pa*s`,"hhp/in2":`W/m2`,"hhp/ft2":`W/m2`,"Sm3/d/bar":`m3/s/bar`,"STB/d/psi":`m3/s/bar`,"deg/100ft":`deg/m`,"deg/30m":`deg/m`,"deg/10m":`deg/m`,"deg/ft":`deg/m`,"rad/ft":`deg/m`,"lbf/mol":`kg/mol`,"g/mol":`kg/mol`,"1/K":`E-06/degC`,"E-09/bar":`E-10/psi`,"E-14/pa":`E-10/psi`,"1/Pa":`E-14/pa`,kNm:`Nm`,ftlbf:`Nm`,lk:`m`,ftCla:`m`,lkCla:`m`,ftSe:`m`,ydSe:`m`,chSe:`m`,"chSe(T)":`m`,ftGC:`m`,ydInd:`m`,"BTU/lbm":`J/kg`}),Km=Object.freeze(Array.from(new Set(Object.values(Bm).flat()))),qm=[NaN,-1/0,1/0].map(e=>e.toString()),Jm={},Ym;function Xm(){if(Ym)return Jm;Ym=1,Object.defineProperty(Jm,`__esModule`,{value:!0});function e(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}return Jm.default=e,e.code=`require("ajv/dist/runtime/ucs2length").default`,Jm}var Zm=Qm;function Qm(e,{instancePath:t=``,parentData:n,parentDataProperty:r,rootData:i=e}={}){let a=null,o=0;if(!(typeof e==`number`&&isFinite(e))){let e={instancePath:t,schemaPath:`#/type`,keyword:`type`,params:{type:`number`},message:`must be number`};a===null?a=[e]:a.push(e),o++}if(o>0){let e=[];for(let n of a)n.keyword!==`errorMessage`&&!n.emUsed&&(n.instancePath===t||n.instancePath.indexOf(t)===0&&n.instancePath[t.length]===`/`)&&n.schemaPath.indexOf(`#`)===0&&n.schemaPath[1]===`/`&&(e.push(n),n.emUsed=!0);if(e.length){let n={instancePath:t,schemaPath:`#/errorMessage`,keyword:`errorMessage`,params:{errors:e},message:`Must be a numerical value`};a===null?a=[n]:a.push(n),o++}let n=[];for(let e of a)e.emUsed||n.push(e);a=n,o=n.length}return Qm.errors=a,o===0}Xm().default;var $m=e=>e?.map(({message:e})=>e),eh=/^(-?[0-9., /]*?(?:e[-+]?[0-9]+)?)([^0-9-., /].*)?$/,th=/^[-+]?[0-9]*\.?[0-9]+(?:\/[0-9]*\.?[0-9]+)?(?:[eE][-+]?[0-9]+)?$/;function nh(e){return Bm[e]}function rh(e){return zm[e]}function ih(e){return Vm[e]}function ah(e){return ih(e)}function oh(e){let t=nh(e);return t?t.map(e=>({unit:e,label:rh(e)})):void 0}function sh(e){let t=/\.{2,}/,n=/,/;if(typeof e==`string`)for(;t.test(e)||n.test(e);)e=e.replace(t,`.`),e=e.replace(n,`.`);return e}function ch(e,t,n){if(e=sh(e),e=Rm(e),n===`undefined`&&console.warn(`Inconsistent "to unit" - debug call to "Units.to()"`),t===`undefined`&&(t=n,console.warn(`Inconsistent "from unit" - debug call to "Units.to()"`)),t===n)return Lp(e);if(e===1/0||e===`Infinity`)return 1/0;if(e===-1/0||e===`-Infinity`)return-1/0;if(km(e)&&e!==``)return NaN;let r=Hm[t+`|`+n];if(r)return r(Lp(e));if(Um[t])return console.warn(`Unit '${t}' is deprecated - use '${Um[t]}' instead.`),ch(e,Um[t],n);if(Um[n])return console.warn(`Unit '${n}' is deprecated - use '${Um[n]}' instead.`),ch(e,t,Um[n]);if(Wm[n])return ch(e,t,Wm[n]);if(Wm[t])return ch(e,Wm[t],n);let i=Gm[t];if(i)return ch(ch(e,t,i),i,n);{let r=Gm[n];if(n&&r&&r!==n)return ch(ch(e,t,r),r,n)}throw console.error(`no conversions found`,e,t,`->`,n),Error(`No conversions found: `+e+` `+t+` -> `+n)}function lh(e){let t,n=e==null?``:String(e);return Cm(`|`,n)>1&&(t=n.split(`|`),n=t.slice(0,-1).join(``)+`|`+t.slice(-1)),n.indexOf(`|`)>=0?t=n.split(`|`):qm.includes(n)?t=[n,``]:(t=Em(n).match(eh),t&&=t.slice(1)),t||=[`0`,``],t[1]??=``,[t[0],t[1]]}function uh(e){return lh(e)[0]}function dh(e){return lh(e)[1]}function fh(e,t,n){if(e==null||e===``)return 0;if(typeof e==`string`&&e.startsWith(`NaN`)||typeof e==`number`&&isNaN(e))return NaN;let r=lh(Em(Rm(e)).replaceAll(`+`,``));if(!r){if(t&&n)return fh(e+n,t);throw Error(`unum: invalid number: `+e)}if(r[0]??=`0`,r[1]&&(n=r[1]),!n&&t!==n)throw Error(`unum: unable to figure out unit: ${e} fromUnit ${n}`);if(t===n){let e=r[0]?Lp(r[0]):0;if(e===1/0||e===`Infinity`)return 1/0;if(e===-1/0||e===`-Infinity`)return-1/0;if(typeof e==`string`&&th.test(e))return parseFloat(e);if(!Sm(e)&&e!==1/0&&e!==-1/0)throw Error(`unum: invalid number: `+e+`, `+typeof e);return Om(e)}return ch(r[0],n,t)}function ph(e){if(!e)return!1;let t=String(e).split(`|`);return t.length===2&&Km.includes(t[1])}function mh(e,t,n){return fh(e,t,n)}function hh(e,t,n=``){if((e===null||e===``||e===void 0)&&(e=n),t===null)return String(e);let[r,i]=String(e).includes(`|`)?lh(String(e)):[e,t];return i||=t,[r,i].join(`|`)}function gh(e,t,n){let r=String(e),i=lh(r),a=!i[1]||i[1]==t?Number(i[0]):ch(i[0],String(i[1]),t),o=`0`,s=n;if(a!==0){if(!s){if(i[1]===t)return r;let e=String(i[0]).match(/^[-+.,0]*(\d*)[.,]?(\d*)/);s=e?Math.max(3,e[1].length+e[2].length):3}let e=10**--s,n=Math.abs(a);if(n>=1e5*e||n*1e4*(1+e)<e)o=a.toExponential(s);else if(n>=e)o=a.toFixed();else{let e=Math.floor(Math.log10(n));o=a.toFixed(s-e);let t=o.length;if(o[--t]==`0`){for(;o[--t]==`0`;);o=o.slice(0,t+(o[t]==`.`?0:1))}}}return hh(o,t)}function _h(e,t){let n=e;return dh(e)||(n=hh(e,ah(t)??``)),(Bm[t]??[]).map(e=>[...lh(gh(n,e)),rh(e)])}function vh(e){let[t,n]=lh(e);return`${t} ${zm[n]??``}`}function yh(e){let t=e;return typeof e==`string`&&ph(e)&&(t=uh(e)),t=sh(t),Sm(t)?{valid:Zm(Lp(t)),errors:$m(Zm.errors)}:{valid:Zm(t),errors:$m(Zm.errors)}}var bh=10;const xh=e=>e?.reduce((t,n,r)=>{if(r===0)return t;let i=Math.abs(n-e?.[r-1]);return Math.max(i,t)},0),Sh=(e,t,n)=>{let{axis:r,left:i,top:a,right:o,bottom:s}=n??{},c=r===`x`,l=c?i:a,u=c?o:s,d=e>l,f=e<u,p=t.indexOf(e)!==-1;return d&&f&&!p},Ch=(e,t)=>{let n=e?.sort((e,t)=>e-t),r=xh(e)/10,i=e[0],a=(e.length+1)*bh;return[...Array(a)]?.map((e,t)=>{let n=i+(t-bh+1)*r;return parseFloat(n?.toFixed(1))})?.filter(e=>Sh(e,n,t))};var wh=e=>{let{chart:t,ctx:n}=e??{};if(!n||n?.canvas===null)return;let r=t?.config;if(!r?.options?.scales?.[e?.id]?.grid?.drawOnChartArea||r?.options?.indexAxis===e?.axis)return;let i=e?.axis===`x`,a=e?.ticks?.map((t,n)=>e?.getPixelForTick(n))?.sort((e,t)=>e-t),o=Ch(a,e);n?.save?.(),n.strokeStyle=r?._config?.options?.scales?.[e.id]?.grid?.color||`rgba(0,0,0,0.06)`,n.lineWidth=.5,o?.forEach(e=>{if(n.beginPath(),i){let{top:r,bottom:i}=t?.chartArea??{};n?.moveTo?.(e,r),n?.lineTo?.(e,i)}else{let{left:r,right:i}=t?.chartArea??{};n?.moveTo?.(r,e),n?.lineTo?.(i,e)}n?.stroke?.()}),n?.restore?.()};const Th={id:`minorGridlines`,beforeDatasetsDraw:e=>{let{scales:t}=e??{};Object.keys(t)?.forEach(e=>wh(t?.[e]))}},Eh={ZERO:0,INITIAL:2,HOVERED:6,POINT_HOVERED:8},Dh=`rgba(0,0,0,0.1)`,Oh=[10,2],kh=`"Roobert", "Noto Sans", sans-serif`,Ah=`hsl(60, 10.34482759%, 12.5%)`,jh=[1,10,100,1e3,1e4],Mh=[`#3366cc`,`#dc3912`,`#ff9900`,`#109618`,`#990099`,`#0099c6`,`#dd4477`,`#66aa00`,`#b82e2e`,`#316395`,`#994499`,`#22aa99`,`#aaaa11`,`#6633cc`,`#e67300`,`#8b0707`,`#651067`,`#329262`,`#5574a6`,`#3b3eac`],Nh=`auto`,Ph={NO:0,SLOW:400,FAST:1e3},Fh=`htmlLegend`,Ih=1/10**9,Lh=[{offset:0,color:`rgba(144,238,144,0.8)`},{offset:.6,color:`rgba(255,255,224,0.8)`},{offset:.8,color:`rgba(255,255,224,0.8)`},{offset:.92,color:`rgba(255,182,193,0.5)`},{offset:.99,color:`rgba(255,182,193,0.8)`}];let Rh=function(e){return e.X=`x`,e.Y=`y`,e}({}),zh=function(e){return e.Bottom=`bottom`,e.Top=`top`,e.Left=`left`,e.Right=`right`,e.TopRight=`top-right`,e.TopLeft=`top-left`,e.BottomLeft=`bottom-left`,e.BottomRight=`bottom-right`,e}({}),Bh=function(e){return e.Line=`line`,e.Bar=`bar`,e}({}),Vh=function(e){return e.Pointer=`pointer`,e.Initial=`initial`,e.Grab=`grab`,e.Grabbing=`grabbing`,e.Crosshair=`crosshair`,e.Move=`move`,e}({}),Hh=function(e){return e.Category=`category`,e.Linear=`linear`,e.Logarithmic=`logarithmic`,e}({}),Uh=function(e){return e.Vertical=`vertical`,e}({}),Wh=function(e){return e.Y=`yLabel`,e.X=`xLabel`,e}({}),Gh=function(e){return e.End=`end`,e.Start=`start`,e.Center=`center`,e.Right=`right`,e.Left=`left`,e}({}),Kh=function(e){return e.Box=`box`,e.Ellipse=`ellipse`,e.Line=`line`,e.Text=`text`,e.Label=`label`,e}({}),qh=function(e){return e.Circle=`circle`,e.Square=`rect`,e.Diamond=`rectRot`,e.Triangle=`triangle`,e}({}),Jh=function(e){return e.Nearest=`nearest`,e}({}),Yh=function(e){return e.X=`x`,e.Y=`y`,e.XY=`xy`,e.Z=`z`,e}({}),Xh=function(e){return e.Shift=`Shift`,e}({}),Zh=function(e){return e.Mousemove=`mousemove`,e.Mouseout=`mouseout`,e.Click=`click`,e.Touchstart=`touchstart`,e.Touchmove=`touchmove`,e.Dblclick=`dblclick`,e}({});const Qh={id:`chartAreaBorder`,beforeDraw(e,t,n){if(!e?.ctx||!e.chartArea)return;let{ctx:r,chartArea:i}=e??{},{left:a,top:o,width:s,height:c}=i??{};r?.save?.(),r.strokeStyle=n?.borderColor,r.lineWidth=n?.borderWidth,r?.setLineDash?.(n?.borderDash||[]),r.lineDashOffset=n?.borderDashOffset??0,r?.strokeRect?.(a,o,s,c),r?.restore?.()}};var $h=e(Xd(),1);const eg=(e,t)=>{let n=[];e?.showMinorGridlines&&n.push(Th);let r=t?.customLegend;return r?.customLegendPlugin&&r?.customLegendContainerID&&n.push({id:Fh,...t?.customLegend?.customLegendPlugin}),n.push(Qh),n},tg=e=>{let t=`#${Math.floor(Math.random()*16777215).toString(16)}`;return e.includes(t)?tg(e):(e.push(t),e)},ng=e=>e.title===``?{}:{display:!0,text:e?.title??``},rg=e=>e===Uh.Vertical,ig=(e,t)=>{let[n,r]=e===Rh.Y?[zh.Left,zh.Right]:[zh.Top,zh.Bottom];return t%2==0?n:r},ag=(e,t)=>{let{width:n,height:r,staticChartHeight:i=!1,squareAspectRatio:a=0}=e,o=a?t?.squareAspectRatio:``,s=``;return s=n||r?``:i?t?.fixedHeight:t?.stretchHeight,(0,$h.default)(t?.chart,s,o)},og=(e,t)=>{let{legend:n}=e||{};return{position:n?.position||zh.Top,display:n?.display,align:n?.align,labels:{boxHeight:12,boxWidth:n?.usePointStyle?12:void 0,usePointStyle:n?.usePointStyle},onClick:t}},sg=e=>{let{error:t=null}=e?.dataset?.data?.[e?.dataIndex]??{};return t?`Error: ${Xp(t,4)}`:``},cg=(e,t)=>{let n=e?.dataset?.data?.[e?.dataIndex]?.label,r=Array.isArray(n)?n?.join(` , `):n??``;return t&&r?.length?` (${r})`:``},lg=e=>e.toLowerCase().replace(/[^\w\s-]/g,``).replace(/\s+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``),ug=e=>pp(e)||sp(e)?`new_chart`:e.map((e,t)=>lg(e.label??`${t}`)).join(`_`)||`new_chart`,dg=()=>{H.font.size=12,H.font.family=kh,H.color=Ah,H.borderColor=Dh},fg=e=>e===``,pg=`TOGGLE_DATA_VISIBILITY`,mg=`SET_ANNOTATION`,hg={datasets:[],annotation:[]},gg=(e,t)=>{switch(t.type){case mg:return{...e,annotation:t.payload};case`RESET_STATE`:return t.payload;case pg:{let{chartInstance:n,dsConfig:r,annotationConfig:i}=t.payload,{datasetIndex:a,datasets:o,dataset:s}=r,{annotationIndex:c}=i,l=Xf(e),u=mp(n?.isDatasetVisible(a),!0);if(a>=0&&(n?.setDatasetVisibility(a,!u),up(l,[`datasets`,a,`hidden`],u),s?.displayGroup)){let e=s.displayGroup;o.forEach((t,r)=>{t.displayGroup===e&&(n?.setDatasetVisibility(Number(r),!u),up(l,[`datasets`,r,`hidden`],u))})}if(c>=0){let e=rp(l.annotation,{annotationIndex:c});if(e>=0){let t=mp(l.annotation[e]?.display,!1);up(l,[`annotation`,e,`display`],!t)}}return l}default:return e}};let _g=function(e){return e.DEFAULT=`14px Arial`,e.CUSTOM=`16px Arial`,e}({}),vg=function(e){return e.MOUSEDOWN=`mousedown`,e.MOUSEMOVE=`mousemove`,e.MOUSEUP=`mouseup`,e}({}),$=function(e){return e.POINT=`point`,e.BOX=`box`,e.LINE=`line`,e.ELLIPSE=`ellipse`,e.LABEL=`label`,e}({}),yg=function(e){return e.X=`x`,e.Y=`y`,e.Both=`both`,e}({});var bg={grad:.9,turn:360,rad:360/(2*Math.PI)},xg=function(e){return typeof e==`string`?e.length>0:typeof e==`number`},Sg=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n+0},Cg=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},wg=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Tg=function(e){return{r:Cg(e.r,0,255),g:Cg(e.g,0,255),b:Cg(e.b,0,255),a:Cg(e.a)}},Eg=function(e){return{r:Sg(e.r),g:Sg(e.g),b:Sg(e.b),a:Sg(e.a,3)}},Dg=/^#([0-9a-f]{3,8})$/i,Og=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},kg=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:60*(s<0?s+6:s),s:a?o/a*100:0,v:a/255*100,a:i}},Ag=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:255*[r,s,o,o,c,r][l],g:255*[c,r,r,s,o,o][l],b:255*[o,o,c,r,r,s][l],a:i}},jg=function(e){return{h:wg(e.h),s:Cg(e.s,0,100),l:Cg(e.l,0,100),a:Cg(e.a)}},Mg=function(e){return{h:Sg(e.h),s:Sg(e.s),l:Sg(e.l),a:Sg(e.a,3)}},Ng=function(e){return Ag((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},Pg=function(e){return{h:(t=kg(e)).h,s:(i=(200-(n=t.s))*(r=t.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,r,i},Fg=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ig=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Lg=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Rg=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zg={string:[[function(e){var t=Dg.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Sg(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Sg(parseInt(e.substr(6,2),16)/255,2):1}:null:null},`hex`],[function(e){var t=Lg.exec(e)||Rg.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Tg({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},`rgb`],[function(e){var t=Fg.exec(e)||Ig.exec(e);if(!t)return null;var n,r;return Ng(jg({h:(n=t[1],r=t[2],r===void 0&&(r=`deg`),Number(n)*(bg[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}))},`hsl`]],object:[[function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i===void 0?1:i;return xg(t)&&xg(n)&&xg(r)?Tg({r:Number(t),g:Number(n),b:Number(r),a:Number(a)}):null},`rgb`],[function(e){var t=e.h,n=e.s,r=e.l,i=e.a,a=i===void 0?1:i;return!xg(t)||!xg(n)||!xg(r)?null:Ng(jg({h:Number(t),s:Number(n),l:Number(r),a:Number(a)}))},`hsl`],[function(e){var t=e.h,n=e.s,r=e.v,i=e.a,a=i===void 0?1:i;return!xg(t)||!xg(n)||!xg(r)?null:Ag(function(e){return{h:wg(e.h),s:Cg(e.s,0,100),v:Cg(e.v,0,100),a:Cg(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(a)}))},`hsv`]]},Bg=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},Vg=function(e){return typeof e==`string`?Bg(e.trim(),zg.string):typeof e==`object`&&e?Bg(e,zg.object):[null,void 0]},Hg=function(e,t){var n=Pg(e);return{h:n.h,s:Cg(n.s+100*t,0,100),l:n.l,a:n.a}},Ug=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Wg=function(e,t){var n=Pg(e);return{h:n.h,s:n.s,l:Cg(n.l+100*t,0,100),a:n.a}},Gg=function(){function e(e){this.parsed=Vg(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return Sg(Ug(this.rgba),2)},e.prototype.isDark=function(){return Ug(this.rgba)<.5},e.prototype.isLight=function(){return Ug(this.rgba)>=.5},e.prototype.toHex=function(){return e=Eg(this.rgba),t=e.r,n=e.g,r=e.b,a=(i=e.a)<1?Og(Sg(255*i)):``,`#`+Og(t)+Og(n)+Og(r)+a;var e,t,n,r,i,a},e.prototype.toRgb=function(){return Eg(this.rgba)},e.prototype.toRgbString=function(){return e=Eg(this.rgba),t=e.r,n=e.g,r=e.b,(i=e.a)<1?`rgba(`+t+`, `+n+`, `+r+`, `+i+`)`:`rgb(`+t+`, `+n+`, `+r+`)`;var e,t,n,r,i},e.prototype.toHsl=function(){return Mg(Pg(this.rgba))},e.prototype.toHslString=function(){return e=Mg(Pg(this.rgba)),t=e.h,n=e.s,r=e.l,(i=e.a)<1?`hsla(`+t+`, `+n+`%, `+r+`%, `+i+`)`:`hsl(`+t+`, `+n+`%, `+r+`%)`;var e,t,n,r,i},e.prototype.toHsv=function(){return e=kg(this.rgba),{h:Sg(e.h),s:Sg(e.s),v:Sg(e.v),a:Sg(e.a,3)};var e},e.prototype.invert=function(){return Kg({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return e===void 0&&(e=.1),Kg(Hg(this.rgba,e))},e.prototype.desaturate=function(e){return e===void 0&&(e=.1),Kg(Hg(this.rgba,-e))},e.prototype.grayscale=function(){return Kg(Hg(this.rgba,-1))},e.prototype.lighten=function(e){return e===void 0&&(e=.1),Kg(Wg(this.rgba,e))},e.prototype.darken=function(e){return e===void 0&&(e=.1),Kg(Wg(this.rgba,-e))},e.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return typeof e==`number`?Kg({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Sg(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Pg(this.rgba);return typeof e==`number`?Kg({h:e,s:t.s,l:t.l,a:t.a}):Sg(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Kg(e).toHex()},e}(),Kg=function(e){return e instanceof Gg?e:new Gg(e)},qg=[],Jg=function(e){e.forEach(function(e){qg.indexOf(e)<0&&(e(Gg,zg),qg.push(e))})};function Yg(e,t){var n={white:`#ffffff`,bisque:`#ffe4c4`,blue:`#0000ff`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,antiquewhite:`#faebd7`,aqua:`#00ffff`,azure:`#f0ffff`,whitesmoke:`#f5f5f5`,papayawhip:`#ffefd5`,plum:`#dda0dd`,blanchedalmond:`#ffebcd`,black:`#000000`,gold:`#ffd700`,goldenrod:`#daa520`,gainsboro:`#dcdcdc`,cornsilk:`#fff8dc`,cornflowerblue:`#6495ed`,burlywood:`#deb887`,aquamarine:`#7fffd4`,beige:`#f5f5dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkkhaki:`#bdb76b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,peachpuff:`#ffdab9`,darkmagenta:`#8b008b`,darkred:`#8b0000`,darkorchid:`#9932cc`,darkorange:`#ff8c00`,darkslateblue:`#483d8b`,gray:`#808080`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,wheat:`#f5deb3`,firebrick:`#b22222`,floralwhite:`#fffaf0`,ghostwhite:`#f8f8ff`,darkviolet:`#9400d3`,magenta:`#ff00ff`,green:`#008000`,dodgerblue:`#1e90ff`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,blueviolet:`#8a2be2`,forestgreen:`#228b22`,lawngreen:`#7cfc00`,indianred:`#cd5c5c`,indigo:`#4b0082`,fuchsia:`#ff00ff`,brown:`#a52a2a`,maroon:`#800000`,mediumblue:`#0000cd`,lightcoral:`#f08080`,darkturquoise:`#00ced1`,lightcyan:`#e0ffff`,ivory:`#fffff0`,lightyellow:`#ffffe0`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,linen:`#faf0e6`,mediumaquamarine:`#66cdaa`,lemonchiffon:`#fffacd`,lime:`#00ff00`,khaki:`#f0e68c`,mediumseagreen:`#3cb371`,limegreen:`#32cd32`,mediumspringgreen:`#00fa9a`,lightskyblue:`#87cefa`,lightblue:`#add8e6`,midnightblue:`#191970`,lightpink:`#ffb6c1`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,mintcream:`#f5fffa`,lightslategray:`#778899`,lightslategrey:`#778899`,navajowhite:`#ffdead`,navy:`#000080`,mediumvioletred:`#c71585`,powderblue:`#b0e0e6`,palegoldenrod:`#eee8aa`,oldlace:`#fdf5e6`,paleturquoise:`#afeeee`,mediumturquoise:`#48d1cc`,mediumorchid:`#ba55d3`,rebeccapurple:`#663399`,lightsteelblue:`#b0c4de`,mediumslateblue:`#7b68ee`,thistle:`#d8bfd8`,tan:`#d2b48c`,orchid:`#da70d6`,mediumpurple:`#9370db`,purple:`#800080`,pink:`#ffc0cb`,skyblue:`#87ceeb`,springgreen:`#00ff7f`,palegreen:`#98fb98`,red:`#ff0000`,yellow:`#ffff00`,slateblue:`#6a5acd`,lavenderblush:`#fff0f5`,peru:`#cd853f`,palevioletred:`#db7093`,violet:`#ee82ee`,teal:`#008080`,slategray:`#708090`,slategrey:`#708090`,aliceblue:`#f0f8ff`,darkseagreen:`#8fbc8f`,darkolivegreen:`#556b2f`,greenyellow:`#adff2f`,seagreen:`#2e8b57`,seashell:`#fff5ee`,tomato:`#ff6347`,silver:`#c0c0c0`,sienna:`#a0522d`,lavender:`#e6e6fa`,lightgreen:`#90ee90`,orange:`#ffa500`,orangered:`#ff4500`,steelblue:`#4682b4`,royalblue:`#4169e1`,turquoise:`#40e0d0`,yellowgreen:`#9acd32`,salmon:`#fa8072`,saddlebrown:`#8b4513`,sandybrown:`#f4a460`,rosybrown:`#bc8f8f`,darksalmon:`#e9967a`,lightgoldenrodyellow:`#fafad2`,snow:`#fffafa`,lightgrey:`#d3d3d3`,lightgray:`#d3d3d3`,dimgray:`#696969`,dimgrey:`#696969`,olivedrab:`#6b8e23`,olive:`#808000`},r={};for(var i in n)r[n[i]]=i;var a={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return`transparent`;var i,o,s=r[this.toHex()];if(s)return s;if(t?.closest){var c=this.toRgb(),l=1/0,u=`black`;if(!a.length)for(var d in n)a[d]=new e(n[d]).toRgb();for(var f in n){var p=(i=c,o=a[f],(i.r-o.r)**2+(i.g-o.g)**2+(i.b-o.b)**2);p<l&&(l=p,u=f)}return u}},t.string.push([function(t){var r=t.toLowerCase(),i=r===`transparent`?`#0000`:n[r];return i?new e(i).toRgb():null},`name`])}Jg([Yg]);function Xg(e,t,n=`rgb`){let r=Kg(e);if(r.alpha()<1)return n===`hex`?r.toHex():r.toRgbString();let i=Math.max(0,Math.min(1,t)),a=r.alpha(i);return n===`hex`?a.toHex():a.toRgbString()}var Zg=(e,t)=>{if(t&&e?.scales?.[t])return e.scales[t];if(e?.scales?.x)return e.scales.x;let n=Object.keys(e?.scales??{})?.find(e=>e?.toLowerCase()?.includes(`x`));return n?e?.scales?.[n]:void 0},Qg=(e,t)=>{if(t&&e?.scales?.[t])return e.scales[t];if(e?.scales?.y)return e.scales.y;let n=Object.keys(e?.scales??{})?.find(e=>e?.toLowerCase()?.includes(`y`));return n?e?.scales?.[n]:void 0};const $g=(e,t,n,r)=>{let i=e?.chart,a=t?.xValue;if(typeof a!=`number`)return 0;if(!i)return a;let o=Zg(i,t?.annotationAxis);if(!o)return a;let s=typeof n?.xAdjust==`number`,c=r%2==0?1:-1,l=s?n?.xAdjust:c*60,u=o.getPixelForValue(a),d=u+l,f=i.chartArea,p=e?.element;if(!f||!p)return o.getValueForPixel(d);let m=n?.margin??8,h=(p?.width??0)/2,g=d,_=l;return g-h<f.left+m?(_+=f.left+m+h-g,g=u+_):g+h>f.right-m&&(_+=f.right-m-h-g,g=u+_),o.getValueForPixel(g)},e_=(e,t,n,r)=>{let i=e?.chart,a=t.yValue;if(typeof a!=`number`)return 0;if(!i)return a;let o=Qg(i,t?.annotationAxis);if(!o)return a;let s=typeof n?.yAdjust==`number`,c=Math.floor(r/2),l=s?n?.yAdjust:-40-c*22,u=o.getPixelForValue(a),d=u+l,f=i.chartArea,p=e?.element;if(!f||!p)return o.getValueForPixel(d);let m=n?.margin??8,h=(p?.height??0)/2,g=d,_=l;return g-h<f.top+m?(_+=f.top+m+h-g,g=u+_):g+h>f.bottom-m&&(_+=f.bottom-m-h-g,g=u+_),o.getValueForPixel(g)};var t_=(e,t,n)=>e>=t&&e<=n;const n_=(e,t,n=0)=>{let r=e?.chart,i=r?.chartArea;if(!r||!i)return!0;let a=Zg(r,t.annotationAxis),o=Qg(r,t.annotationAxis),s=t.xValue,c=t.yValue;if(!a||!o||typeof s!=`number`||typeof c!=`number`)return!1;let l=a.getPixelForValue(s),u=o.getPixelForValue(c);return t_(l,i.left+n,i.right-n)&&t_(u,i.top+n,i.bottom-n)};var r_=`chart_annotations`,i_=e=>`${r_}:${e}`,a_=e=>{try{let t=window.localStorage.getItem(i_(e));if(!t)return{};let n=JSON.parse(t);return typeof n==`object`&&n?n:{}}catch{return{}}},o_=(e,t)=>{try{window.localStorage.setItem(i_(e),JSON.stringify(t))}catch{}};const s_=(e,t,n)=>{if(!e)return;let r=a_(e);o_(e,{...r,[t]:{...r[t]??{},...n}})},c_=(e,t)=>{if(e)return a_(e)[t]},l_=e=>{if(e)return e.chart?.persistenceId===void 0?e.chart?.chart?.persistenceId===void 0?e.$context?.chart?.persistenceId===void 0?e.chart?.chart??e.chart??e.$context?.chart:e.$context.chart:e.chart.chart:e.chart};var u_=(e,t,n)=>{t.canvas.style.cursor=Vh.Pointer,e.options.scaleID?.includes(Rh.X)&&e.options.label&&(e.options.label.xAdjust=t.chartArea.left),e.options.borderWidth=Eh.HOVERED,e.options.label&&(e.label.options.display=!0,e.options.label.enabled=!0),n?.enableDrag&&(t.hoveredAnnotationId=e.options.id||null,t.update(`none`)),t.draw()},d_=(e,t,n)=>{e.options.borderWidth=Eh.INITIAL,t.canvas.style.cursor=Vh.Initial,t.hoveredAnnotationId=null,e.options.label&&(e.label.options.display=!1,e.options.label.enabled=!1),n?.enableDrag&&(t.hoveredAnnotationId=null,t.update(`none`)),t.draw()},f_=(e,t,n)=>{n?.enableDrag&&(t.hoveredAnnotationId=e.options.id||null,t.update(`none`),e.options.borderWidth=Eh.HOVERED,t.canvas.style.cursor=Vh.Pointer),t.draw()},p_=(e,t,n)=>{n?.enableDrag&&(t.hoveredAnnotationId=null,e.options.borderWidth=Eh.INITIAL,t.canvas.style.cursor=Vh.Initial,t.update(`none`)),t.draw()},m_=(e,t,n)=>{n?.enableDrag&&(t.hoveredAnnotationId=e.options.id||null,t.update(`none`),e.options.borderWidth=Eh.POINT_HOVERED,t.canvas.style.cursor=Vh.Pointer),t.draw()},h_=(e,t,n)=>{n?.enableDrag&&(t.hoveredAnnotationId=null,e.options.borderWidth=Eh.INITIAL,t.canvas.style.cursor=Vh.Initial,t.update(`none`)),t.draw()},g_=(e,t,n)=>{n?.enableDrag&&(t.hoveredAnnotationId=e.options.id||null,t.update(`none`),t.canvas.style.cursor=Vh.Pointer),t.draw()},__=(e,t,n)=>{n?.enableDrag&&(t.hoveredAnnotationId=null,t.canvas.style.cursor=Vh.Initial,t.update(`none`)),t.draw()};const v_=(e,t)=>{let n=e?.annotationAxis??void 0,r=e?.color??Mh[t],i=e?.opacity?Xg(r,e?.opacity):r,a=e?.type??$.LINE,o=e?.adjustScaleRange,s={[$.LINE]:i,[$.POINT]:i,[$.LABEL]:i,[$.BOX]:i,[$.ELLIPSE]:`transparent`}[a]||`transparent`,c={[$.LINE]:Eh.INITIAL,[$.BOX]:Eh.ZERO,[$.POINT]:Eh.ZERO,[$.LABEL]:Eh.ZERO,[$.ELLIPSE]:e?.borderWidth??0}[a]??0,l=a===$.LINE?Oh:void 0,u={content:e?.label,display:!0,font:{weight:`normal`}},d={[$.LINE]:{backgroundColor:i,content:e?.label,display:!1,position:zh.Top},[$.POINT]:{backgroundColor:e?.labelConfig?.backgroundColor??`transparent`,content:e?.label,display:e?.labelConfig?.display??!!e?.label,position:e?.labelConfig?.position??zh.Bottom,color:e?.labelConfig?.color??`hsl(60, 10.34482759%, 12.5%)`,font:e?.labelConfig?.font??`12px "Roobert", "Noto Sans", sans-serif`,borderWidth:Eh.INITIAL,padding:5,borderRadius:3,borderColor:e?.labelConfig?.borderColor??`transparent`},[$.LABEL]:u,[$.BOX]:u,[$.ELLIPSE]:u}[a]||u,f=({element:t},{chart:n})=>{switch(a){case $.LINE:u_(t,n,e);break;case $.BOX:f_(t,n,e);break;case $.LABEL:g_(t,n,e);break;case $.POINT:m_(t,n,e);break;default:break}},p=({element:t},{chart:n})=>{switch(a){case $.LINE:d_(t,n,e);break;case $.BOX:p_(t,n,e);break;case $.LABEL:__(t,n,e);break;case $.POINT:h_(t,n,e);break;default:break}},m=()=>(t,n)=>e?.onDragStart?e?.onDragStart(t,n):void 0,h=()=>(t,n)=>e?.onDrag?e?.onDrag(t,n):void 0,g=()=>(t,n)=>e?.onDragEnd?e?.onDragEnd(t,n):void 0;return{...e,display:e?.display,annotationIndex:t,id:e?.id??`${e?.label}-${t}`,scaleID:n,label:d,backgroundColor:i,borderColor:s,borderWidth:c,borderDash:l,type:a,adjustScaleRange:o,enter:f,leave:p,onDragStart:m,onDrag:h,onDragEnd:g,pointStyle:e?.pointStyle??qh.Circle,resizable:e?.resizable??!0,displayDragCoordinates:e?.displayDragCoordinates??!0}};var y_=(e,t)=>{let n=v_(e,t);if(!n)return[];let{label:r,...i}=n,a=i.id,o=e?.labelConfig?.callout??{},s={...i,label:{display:!1}},c=o?.color??`hsl(60, 10.34482759%, 12.5%)`,l=o?.font??`12px "Roobert", "Noto Sans", sans-serif`,u=o?.borderColor??`transparent`,d=o.strokeStyle??s.borderColor,f=typeof o.lineWidth==`number`?o.lineWidth:1,p=typeof o.startOffset==`number`?o.startOffset:6,m=typeof o.endOffset==`number`?o.endOffset:1,h=`callout-annotation-${t}`;return[s,{id:h,type:`label`,backgroundColor:`transparent`,content:`${r?.content??e?.label??``}`,color:e=>{let t=l_(e);return t&&t.hoveredAnnotationId===h?`#DB5B00`:c},font:l,borderColor:u,borderWidth:Eh.INITIAL,padding:5,display:t=>(e.display??!0)&&n_(t,e,o.margin??0),xValue:n=>{let r=l_(n)?.options?.persistenceId,i=c_(r,`callout-annotation-${t}`),a=typeof o.xValue==`number`?o.xValue:void 0;return i?.x??a??$g(n,e,o,t)},yValue:n=>{let r=l_(n)?.options?.persistenceId,i=c_(r,`callout-annotation-${t}`),a=typeof o.yValue==`number`?o.yValue:void 0;return i?.y??a??e_(n,e,o,t)},resizable:!1,displayDragCoordinates:!1,enableDrag:!0,enter:({element:e},{chart:t})=>g_(e,t,{enableDrag:!0}),leave:({element:e},{chart:t})=>__(e,t,{enableDrag:!0}),onDragStart:o?.onDragStart?()=>t=>o.onDragStart?.(t,e):void 0,onDrag:o?.onDrag?()=>t=>o.onDrag?.(t,e):void 0,onDragEnd:o?.onDragEnd?()=>t=>o.onDragEnd?.(t,e):void 0,calloutConnector:{enabled:!0,fromId:a,strokeStyle:d,lineWidth:f,startOffset:p,endOffset:m}}]},b_=e=>e?.flatMap((e,t)=>e?.labelConfig?.callout?.enabled??!1?y_(e,t):v_(e,t));const x_=({showAnnotations:e,annotationsData:t})=>e&&t&&t?.length?b_(t)??[]:[];var S_=e(Yd(),1);const C_=(e,t)=>{let n=(0,gl.useRef)(null);(0,gl.useEffect)(()=>{if(!e?.annotations?.controlAnnotation)return;let{showAnnotations:r=!0,annotationsData:i=[]}=e?.annotations??{},a=n.current;(!a||a.showAnnotations!==r||!(0,S_.default)(a.annotationsData,i))&&(t({type:mg,payload:x_({showAnnotations:r,annotationsData:i})}),n.current={showAnnotations:r,annotationsData:i})},[t,e?.annotations?.controlAnnotation,e?.annotations?.showAnnotations,e?.annotations?.annotationsData])},w_=(0,gl.createContext)(void 0),T_=({children:e,options:t,datasets:n})=>{let{showAnnotations:r=!0,annotationsData:i=[]}=t?.annotations??{},a=n?.map((e,t)=>({[t]:{...e,hidden:!1}}))??[],o=x_({showAnnotations:r,annotationsData:i}),[s,c]=(0,gl.useReducer)(gg,{...hg,annotation:o,datasets:a}),l=(0,gl.useMemo)(()=>({state:s,dispatch:c}),[s,t,c]);return C_(t,c),(0,hl.jsx)(w_.Provider,{value:l,children:e})};T_.__docgenInfo={description:``,methods:[],displayName:`LegendProvider`,props:{children:{required:!0,tsType:{name:`ReactNode`},description:``},options:{required:!0,tsType:{name:`union`,raw:`| ILineChartOptions
|