FitTrackee/fittrackee/dist/static/charts-_RwsDDkL.js
2023-12-16 14:36:38 +01:00

25 lines
184 KiB
JavaScript

var lo=Object.defineProperty;var co=(i,t,e)=>t in i?lo(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var S=(i,t,e)=>(co(i,typeof t!="symbol"?t+"":t,e),e);/*!
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/function me(i){return i+.5|0}const bt=(i,t,e)=>Math.max(Math.min(i,e),t);function te(i){return bt(me(i*2.55),0,255)}function xt(i){return bt(me(i*255),0,255)}function gt(i){return bt(me(i/2.55)/100,0,1)}function Wi(i){return bt(me(i*100),0,100)}const et={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},ui=[..."0123456789ABCDEF"],ho=i=>ui[i&15],fo=i=>ui[(i&240)>>4]+ui[i&15],xe=i=>(i&240)>>4===(i&15),uo=i=>xe(i.r)&&xe(i.g)&&xe(i.b)&&xe(i.a);function go(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&et[i[1]]*17,g:255&et[i[2]]*17,b:255&et[i[3]]*17,a:t===5?et[i[4]]*17:255}:(t===7||t===9)&&(e={r:et[i[1]]<<4|et[i[2]],g:et[i[3]]<<4|et[i[4]],b:et[i[5]]<<4|et[i[6]],a:t===9?et[i[7]]<<4|et[i[8]]:255})),e}const po=(i,t)=>i<255?t(i):"";function mo(i){var t=uo(i)?ho:fo;return i?"#"+t(i.r)+t(i.g)+t(i.b)+po(i.a,t):void 0}const bo=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hn(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function _o(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function xo(i,t,e){const s=hn(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function yo(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function Mi(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),r=Math.min(e,s,n),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=yo(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function Si(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(xt)}function Pi(i,t,e){return Si(hn,i,t,e)}function vo(i,t,e){return Si(xo,i,t,e)}function ko(i,t,e){return Si(_o,i,t,e)}function dn(i){return(i%360+360)%360}function wo(i){const t=bo.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?te(+t[5]):xt(+t[5]));const n=dn(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=vo(n,o,r):t[1]==="hsv"?s=ko(n,o,r):s=Pi(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function Mo(i,t){var e=Mi(i);e[0]=dn(e[0]+t),e=Pi(e),i.r=e[0],i.g=e[1],i.b=e[2]}function So(i){if(!i)return;const t=Mi(i),e=t[0],s=Wi(t[1]),n=Wi(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${gt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Ni={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"},Vi={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 Po(){const i={},t=Object.keys(Vi),e=Object.keys(Ni);let s,n,o,r,a;for(s=0;s<t.length;s++){for(r=a=t[s],n=0;n<e.length;n++)o=e[n],a=a.replace(o,Ni[o]);o=parseInt(Vi[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let ye;function Co(i){ye||(ye=Po(),ye.transparent=[0,0,0,0]);const t=ye[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Do=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Oo(i){const t=Do.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?te(r):bt(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?te(s):bt(s,0,255)),n=255&(t[4]?te(n):bt(n,0,255)),o=255&(t[6]?te(o):bt(o,0,255)),{r:s,g:n,b:o,a:e}}}function To(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${gt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Je=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,zt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Ao(i,t,e){const s=zt(gt(i.r)),n=zt(gt(i.g)),o=zt(gt(i.b));return{r:xt(Je(s+e*(zt(gt(t.r))-s))),g:xt(Je(n+e*(zt(gt(t.g))-n))),b:xt(Je(o+e*(zt(gt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ve(i,t,e){if(i){let s=Mi(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Pi(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function fn(i,t){return i&&Object.assign(t||{},i)}function ji(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=xt(i[3]))):(t=fn(i,{r:0,g:0,b:0,a:1}),t.a=xt(t.a)),t}function Ro(i){return i.charAt(0)==="r"?Oo(i):wo(i)}class he{constructor(t){if(t instanceof he)return t;const e=typeof t;let s;e==="object"?s=ji(t):e==="string"&&(s=go(t)||Co(t)||Ro(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=fn(this._rgb);return t&&(t.a=gt(t.a)),t}set rgb(t){this._rgb=ji(t)}rgbString(){return this._valid?To(this._rgb):void 0}hexString(){return this._valid?mo(this._rgb):void 0}hslString(){return this._valid?So(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Ao(this._rgb,t._rgb,e)),this}clone(){return new he(this.rgb)}alpha(t){return this._rgb.a=xt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=me(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ve(this._rgb,2,t),this}darken(t){return ve(this._rgb,2,-t),this}saturate(t){return ve(this._rgb,1,t),this}desaturate(t){return ve(this._rgb,1,-t),this}rotate(t){return Mo(this._rgb,t),this}}/*!
* Chart.js v4.4.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/function dt(){}const Lo=(()=>{let i=0;return()=>i++})();function R(i){return i===null||typeof i>"u"}function W(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function T(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function q(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function ot(i,t){return q(i)?i:t}function D(i,t){return typeof i>"u"?t:i}const Io=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function F(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function L(i,t,e,s){let n,o,r;if(W(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;n<o;n++)t.call(e,i[n],n);else if(T(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function We(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Ne(i){if(W(i))return i.map(Ne);if(T(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=Ne(i[e[n]]);return t}return i}function un(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Fo(i,t,e,s){if(!un(i))return;const n=t[i],o=e[i];T(n)&&T(o)?ht(n,o,s):t[i]=Ne(o)}function ht(i,t,e){const s=W(t)?t:[t],n=s.length;if(!T(i))return i;e=e||{};const o=e.merger||Fo;let r;for(let a=0;a<n;++a){if(r=s[a],!T(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function ne(i,t){return ht(i,t,{merger:Eo})}function Eo(i,t,e){if(!un(i))return;const s=t[i],n=e[i];T(s)&&T(n)?ne(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=Ne(n))}const $i={"":i=>i,x:i=>i.x,y:i=>i.y};function zo(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Bo(i){const t=zo(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Vt(i,t){return($i[t]||($i[t]=Bo(t)))(i)}function Ci(i){return i.charAt(0).toUpperCase()+i.slice(1)}const de=i=>typeof i<"u",yt=i=>typeof i=="function",Yi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Ho(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const N=Math.PI,V=2*N,Wo=V+N,Ve=Number.POSITIVE_INFINITY,No=N/180,$=N/2,wt=N/4,Ui=N*2/3,gi=Math.log10,ct=Math.sign;function oe(i,t,e){return Math.abs(i-t)<e}function Xi(i){const t=Math.round(i);i=oe(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(gi(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Vo(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function fe(i){return!isNaN(parseFloat(i))&&isFinite(i)}function jo(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function $o(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Ot(i){return i*(N/180)}function Yo(i){return i*(180/N)}function Ki(i){if(!q(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function gn(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*N&&(o+=V),{angle:o,distance:n}}function pi(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Uo(i,t){return(i-t+Wo)%V-N}function lt(i){return(i%V+V)%V}function Di(i,t,e,s){const n=lt(i),o=lt(t),r=lt(e),a=lt(o-n),l=lt(r-n),c=lt(n-o),h=lt(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function K(i,t,e){return Math.max(t,Math.min(e,i))}function Xo(i){return K(i,-32768,32767)}function pt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Oi(i,t,e){e=e||(r=>i[r]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const Tt=(i,t,e,s)=>Oi(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),Ko=(i,t,e)=>Oi(i,e,s=>i[s][t]>=e);function qo(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const pn=["push","pop","shift","splice","unshift"];function Go(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),pn.forEach(e=>{const s="_onData"+Ci(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function qi(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(pn.forEach(o=>{delete i[o]}),delete i._chartjs)}function mn(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const bn=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function _n(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,bn.call(window,()=>{s=!1,i.apply(t,e)}))}}function Zo(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Ti=i=>i==="start"?"left":i==="end"?"right":"center",X=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Jo=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function Qo(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,_parsed:a}=i,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:f}=r.getUserBounds();d&&(n=K(Math.min(Tt(a,l,c).lo,e?s:Tt(t,l,r.getPixelForValue(c)).lo),0,s-1)),f?o=K(Math.max(Tt(a,r.axis,h,!0).hi+1,e?0:Tt(t,l,r.getPixelForValue(h),!0).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function tr(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const ke=i=>i===0||i===1,Gi=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*V/e)),Zi=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*V/e)+1,re={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*$)+1,easeOutSine:i=>Math.sin(i*$),easeInOutSine:i=>-.5*(Math.cos(N*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>ke(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>ke(i)?i:Gi(i,.075,.3),easeOutElastic:i=>ke(i)?i:Zi(i,.075,.3),easeInOutElastic(i){return ke(i)?i:i<.5?.5*Gi(i*2,.1125,.45):.5+.5*Zi(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-re.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?re.easeInBounce(i*2)*.5:re.easeOutBounce(i*2-1)*.5+.5};function Ai(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ji(i){return Ai(i)?i:new he(i)}function Qe(i){return Ai(i)?i:new he(i).saturate(.5).darken(.1).hexString()}const er=["x","y","borderWidth","radius","tension"],ir=["color","borderColor","backgroundColor"];function sr(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:ir},numbers:{type:"number",properties:er}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function nr(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Qi=new Map;function or(i,t){t=t||{};const e=i+JSON.stringify(t);let s=Qi.get(e);return s||(s=new Intl.NumberFormat(i,t),Qi.set(e,s)),s}function xn(i,t,e){return or(t,e).format(i)}const yn={values(i){return W(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=rr(i,e)}const r=gi(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),xn(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(gi(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?yn.numeric.call(this,i,t,e):""}};function rr(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var vn={formatters:yn};function ar(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:vn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Lt=Object.create(null),mi=Object.create(null);function ae(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function ti(i,t,e){return typeof t=="string"?ht(ae(i,t),e):ht(ae(i,""),t)}class lr{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>Qe(n.backgroundColor),this.hoverBorderColor=(s,n)=>Qe(n.borderColor),this.hoverColor=(s,n)=>Qe(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return ti(this,t,e)}get(t){return ae(this,t)}describe(t,e){return ti(mi,t,e)}override(t,e){return ti(Lt,t,e)}route(t,e,s,n){const o=ae(this,t),r=ae(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return T(l)?Object.assign({},c,l):D(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var B=new lr({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[sr,nr,ar]);function cr(i){return!i||R(i.size)||R(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ts(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Mt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function es(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function bi(i,t,e,s){kn(i,t,e,s,null)}function kn(i,t,e,s,n){let o,r,a,l,c,h,d,f;const u=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*No;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(m),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),u){default:n?i.ellipse(e,s,n/2,g,0,0,V):i.arc(e,s,g,0,V),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Ui,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Ui,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(m+wt)*l,d=Math.cos(m+wt)*(n?n/2-c:l),a=Math.sin(m+wt)*l,f=Math.sin(m+wt)*(n?n/2-c:l),i.arc(e-d,s-a,c,m-N,m-$),i.arc(e+f,s-r,c,m-$,m),i.arc(e+d,s+a,c,m,m+$),i.arc(e-f,s+r,c,m+$,m+N),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}m+=wt;case"rectRot":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+f,s-r),i.lineTo(e+d,s+a),i.lineTo(e-f,s+r),i.closePath();break;case"crossRot":m+=wt;case"cross":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"star":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r),m+=wt,d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"line":r=n?n/2:Math.cos(m)*g,a=Math.sin(m)*g,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function ue(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function Ke(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function qe(i){i.restore()}function hr(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function dr(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function fr(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),R(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function ur(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function gr(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function ge(i,t,e,s,n,o={}){const r=W(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,fr(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&gr(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),R(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),ur(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function je(i,t){const{x:e,y:s,w:n,h:o,radius:r}=t;i.arc(e+r.topLeft,s+r.topLeft,r.topLeft,1.5*N,N,!0),i.lineTo(e,s+o-r.bottomLeft),i.arc(e+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,N,$,!0),i.lineTo(e+n-r.bottomRight,s+o),i.arc(e+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,$,0,!0),i.lineTo(e+n,s+r.topRight),i.arc(e+n-r.topRight,s+r.topRight,r.topRight,0,-$,!0),i.lineTo(e+r.topLeft,s)}const pr=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,mr=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function br(i,t){const e=(""+i).match(pr);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const _r=i=>+i||0;function Ri(i,t){const e={},s=T(t),n=s?Object.keys(t):t,o=T(i)?s?r=>D(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=_r(o(r));return e}function wn(i){return Ri(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Ht(i){return Ri(i,["topLeft","topRight","bottomLeft","bottomRight"])}function tt(i){const t=wn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Y(i,t){i=i||{},t=t||B.font;let e=D(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=D(i.style,t.style);s&&!(""+s).match(mr)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:D(i.family,t.family),lineHeight:br(D(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:D(i.weight,t.weight),string:""};return n.string=cr(n),n}function z(i,t,e,s){let n=!0,o,r,a;for(o=0,r=i.length;o<r;++o)if(a=i[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),n=!1),e!==void 0&&W(a)&&(a=a[e%a.length],n=!1),a!==void 0))return s&&!n&&(s.cacheable=!1),a}function xr(i,t,e){const{min:s,max:n}=i,o=Io(t,(n-s)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function It(i,t){return Object.assign(Object.create(i),t)}function Li(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=Cn("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>Li([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return Sn(a,l,()=>Cr(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return ss(a).includes(l)},ownKeys(a){return ss(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function jt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Mn(i,s),setContext:o=>jt(i,o,e,s),override:o=>jt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return Sn(o,r,()=>vr(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function Mn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:yt(e)?e:()=>e,isIndexable:yt(s)?s:()=>s}}const yr=(i,t)=>i?i+Ci(t):t,Ii=(i,t)=>T(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Sn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const s=e();return i[t]=s,s}function vr(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return yt(a)&&r.isScriptable(t)&&(a=kr(t,a,i,e)),W(a)&&a.length&&(a=wr(t,a,i,r.isIndexable)),Ii(t,a)&&(a=jt(a,n,o&&o[t],r)),a}function kr(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),Ii(i,l)&&(l=Fi(n._scopes,n,i,l)),l}function wr(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(T(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Fi(c,n,i,h);t.push(jt(d,o,r&&r[i],a))}}return t}function Pn(i,t,e){return yt(i)?i(t,e):i}const Mr=(i,t)=>i===!0?t:typeof i=="string"?Vt(t,i):void 0;function Sr(i,t,e,s,n){for(const o of t){const r=Mr(e,o);if(r){i.add(r);const a=Pn(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function Fi(i,t,e,s){const n=t._rootScopes,o=Pn(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=is(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=is(a,r,o,l,s),l===null)?!1:Li(Array.from(a),[""],n,o,()=>Pr(t,e,s))}function is(i,t,e,s,n){for(;e;)e=Sr(i,t,e,s,n);return e}function Pr(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return W(n)&&T(e)?e:n||{}}function Cr(i,t,e,s){let n;for(const o of t)if(n=Cn(yr(o,i),e),typeof n<"u")return Ii(i,n)?Fi(e,s,i,n):n}function Cn(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function ss(i){let t=i._keys;return t||(t=i._keys=Dr(i._scopes)),t}function Dr(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const Or=Number.EPSILON||1e-14,$t=(i,t)=>t<i.length&&!i[t].skip&&i[t],Dn=i=>i==="x"?"y":"x";function Tr(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=pi(o,n),l=pi(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,f=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+f*(r.x-n.x),y:o.y+f*(r.y-n.y)}}}function Ar(i,t,e){const s=i.length;let n,o,r,a,l,c=$t(i,0);for(let h=0;h<s-1;++h)if(l=c,c=$t(i,h+1),!(!l||!c)){if(oe(t[h],0,Or)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=n*r*t[h],e[h+1]=o*r*t[h])}}function Rr(i,t,e="x"){const s=Dn(e),n=i.length;let o,r,a,l=$t(i,0);for(let c=0;c<n;++c){if(r=a,a=l,l=$t(i,c+1),!a)continue;const h=a[e],d=a[s];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${s}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${s}`]=d+o*t[c])}}function Lr(i,t="x"){const e=Dn(t),s=i.length,n=Array(s).fill(0),o=Array(s);let r,a,l,c=$t(i,0);for(r=0;r<s;++r)if(a=l,l=c,c=$t(i,r+1),!!l){if(c){const h=c[t]-l[t];n[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?ct(n[r-1])!==ct(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}Ar(i,n,o),Rr(i,o,t)}function we(i,t,e){return Math.max(Math.min(i,e),t)}function Ir(i,t){let e,s,n,o,r,a=ue(i[0],t);for(e=0,s=i.length;e<s;++e)r=o,o=a,a=e<s-1&&ue(i[e+1],t),o&&(n=i[e],r&&(n.cp1x=we(n.cp1x,t.left,t.right),n.cp1y=we(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=we(n.cp2x,t.left,t.right),n.cp2y=we(n.cp2y,t.top,t.bottom)))}function Fr(i,t,e,s,n){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Lr(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)a=i[o],l=Tr(c,a,i[Math.min(o+1,r-(s?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Ir(i,e)}function Ei(){return typeof window<"u"&&typeof document<"u"}function zi(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function $e(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const Ge=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Er(i,t){return Ge(i).getPropertyValue(t)}const zr=["top","right","bottom","left"];function Rt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=zr[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Br=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Hr(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(Br(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Pt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Ge(e),o=n.boxSizing==="border-box",r=Rt(n,"padding"),a=Rt(n,"border","width"),{x:l,y:c,box:h}=Hr(i,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:u,height:p}=t;return o&&(u-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/u*e.width/s),y:Math.round((c-f)/p*e.height/s)}}function Wr(i,t,e){let s,n;if(t===void 0||e===void 0){const o=zi(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Ge(o),l=Rt(a,"border","width"),c=Rt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=$e(a.maxWidth,o,"clientWidth"),n=$e(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Ve,maxHeight:n||Ve}}const Me=i=>Math.round(i*10)/10;function Nr(i,t,e,s){const n=Ge(i),o=Rt(n,"margin"),r=$e(n.maxWidth,i,"clientWidth")||Ve,a=$e(n.maxHeight,i,"clientHeight")||Ve,l=Wr(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const f=Rt(n,"border","width"),u=Rt(n,"padding");c-=u.width+f.width,h-=u.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=Me(Math.min(c,r,l.maxWidth)),h=Me(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Me(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=Me(Math.floor(h*s))),{width:c,height:h}}function ns(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Vr=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Ei()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function os(i,t){const e=Er(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Ct(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function jr(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function $r(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=Ct(i,n,e),a=Ct(n,o,e),l=Ct(o,t,e),c=Ct(r,a,e),h=Ct(a,l,e);return Ct(c,h,e)}const Yr=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Ur=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Wt(i,t,e){return i?Yr(t,e):Ur()}function On(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Tn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function An(i){return i==="angle"?{between:Di,compare:Uo,normalize:lt}:{between:pt,compare:(t,e)=>t-e,normalize:t=>t}}function rs({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Xr(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=An(s),l=t.length;let{start:c,end:h,loop:d}=i,f,u;if(d){for(c+=l,h+=l,f=0,u=l;f<u&&r(a(t[c%l][s]),n,o);++f)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function Rn(i,t,e){if(!e)return[i];const{property:s,start:n,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=An(s),{start:h,end:d,loop:f,style:u}=Xr(i,t,e),p=[];let g=!1,m=null,b,_,y;const v=()=>l(n,y,b)&&a(n,y)!==0,x=()=>a(o,b)===0||l(o,y,b),w=()=>g||v(),M=()=>!g||x();for(let k=h,P=h;k<=d;++k)_=t[k%r],!_.skip&&(b=c(_[s]),b!==y&&(g=l(b,n,o),m===null&&w()&&(m=a(b,n)===0?k:P),m!==null&&M()&&(p.push(rs({start:m,end:k,loop:f,count:r,style:u})),m=null),P=k,y=b));return m!==null&&p.push(rs({start:m,end:d,loop:f,count:r,style:u})),p}function Ln(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const o=Rn(s[n],i.points,t);o.length&&e.push(...o)}return e}function Kr(i,t,e,s){let n=0,o=t-1;if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function qr(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function Gr(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=Kr(e,n,o,s);if(s===!0)return as(i,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+n:a,c=!!i._fullLoop&&r===0&&a===n-1;return as(i,qr(e,r,l,c),e,t)}function as(i,t,e,s){return!s||!s.setContext||!e?t:Zr(i,t,e,s)}function Zr(i,t,e,s){const n=i._chart.getContext(),o=ls(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[];let h=o,d=t[0].start,f=d;function u(p,g,m,b){const _=a?-1:1;if(p!==g){for(p+=l;e[p%l].skip;)p-=_;for(;e[g%l].skip;)g+=_;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:m,style:b}),h=b,d=g%l)}}for(const p of t){d=a?d:p.start;let g=e[d%l],m;for(f=d+1;f<=p.end;f++){const b=e[f%l];m=ls(s.setContext(It(n,{type:"segment",p0:g,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),Jr(m,h)&&u(d,f-1,p.loop,h),g=b,h=m}d<f-1&&u(d,f-1,p.loop,h)}return c}function ls(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Jr(i,t){if(!t)return!1;const e=[],s=function(n,o){return Ai(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(t,s)}/*!
* Chart.js v4.4.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/class Qr{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=bn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ft=new Qr;const cs="transparent",ta={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Ji(i||cs),n=s.valid&&Ji(t||cs);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class ea{constructor(t,e,s,n){const o=e[s];n=z([t.to,n,o,t.from]);const r=z([t.from,o,n]);this._active=!0,this._fn=t.fn||ta[t.type||typeof r],this._easing=re[t.easing]||re.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=z([t.to,e,n,t.from]),this._from=z([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<s),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class In{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!T(t))return;const e=Object.keys(B.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!T(o))return;const r={};for(const a of e)r[a]=o[a];(W(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=sa(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&ia(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const f=s.get(c);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new ea(f,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return ft.add(this._chart,s),!0}}function ia(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function sa(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function hs(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function na(i,t,e){if(e===!1)return!1;const s=hs(i,e),n=hs(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function oa(i){let t,e,s,n;return T(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function Fn(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function ds(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let r,a,l,c;if(t!==null){for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===e){if(s.all)continue;break}c=i.values[l],q(c)&&(o||t===0||ct(t)===ct(c))&&(t+=c)}return t}}function ra(i){const t=Object.keys(i),e=new Array(t.length);let s,n,o;for(s=0,n=t.length;s<n;++s)o=t[s],e[s]={x:o,y:i[o]};return e}function fs(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function aa(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function la(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function ca(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function us(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function gs(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=aa(o,r,s),d=t.length;let f;for(let u=0;u<d;++u){const p=t[u],{[l]:g,[c]:m}=p,b=p._stacks||(p._stacks={});f=b[c]=ca(n,h,g),f[a]=m,f._top=us(f,r,!0,s.type),f._bottom=us(f,r,!1,s.type);const _=f._visualValues||(f._visualValues={});_[a]=m}}function ei(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function ha(i,t){return It(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function da(i,t,e){return It(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Kt(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const ii=i=>i==="reset"||i==="none",ps=(i,t)=>t?i:Object.assign({},i),fa=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Fn(e,!0),values:null};class Nt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=fs(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Kt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,f,u,p)=>d==="x"?f:d==="r"?p:u,o=e.xAxisID=D(s.xAxisID,ei(t,"x")),r=e.yAxisID=D(s.yAxisID,ei(t,"y")),a=e.rAxisID=D(s.rAxisID,ei(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&qi(this._data,this),t._stacked&&Kt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(T(e))this._data=ra(e);else if(s!==e){if(s){qi(s,this);const n=this._cachedMeta;Kt(n),n._parsed=[]}e&&Object.isExtensible(e)&&Go(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=fs(e.vScale,e),e.stack!==s.stack&&(n=!0,Kt(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&gs(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,f;if(this._parsing===!1)s._parsed=n,s._sorted=!0,f=n;else{W(n[t])?f=this.parseArrayData(s,n,t,e):T(n[t])?f=this.parseObjectData(s,n,t,e):f=this.parsePrimitiveData(s,n,t,e);const u=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)s._parsed[h+t]=d=f[h],l&&(u()&&(l=!1),c=d);s._sorted=l}r&&gs(this,f)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let f,u,p;for(f=0,u=n;f<u;++f)p=f+s,d[f]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,f,u;for(h=0,d=n;h<d;++h)f=h+s,u=e[f],c[h]={x:o.parse(Vt(u,a),f),y:r.parse(Vt(u,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Fn(n,!0),values:e._stacks[t.axis]._visualValues};return ds(a,r,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let r=o===null?NaN:o;const a=n&&s._stacks[e.axis];n&&a&&(n.values=a,r=ds(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,r=n.length,a=this._getOtherScale(t),l=fa(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=la(a);let f,u;function p(){u=n[f];const g=u[a.axis];return!q(u[t.axis])||h>g||d<g}for(f=0;f<r&&!(!p()&&(this.updateRangeFromParsed(c,t,u,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],q(r)&&s.push(r);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=oa(D(this.options.clip,na(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=n[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=da(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=ha(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&de(s);if(a)return ps(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),u=Object.keys(B.elements[t]),p=()=>this.getContext(s,n,e),g=c.resolveNamedOptions(f,u,p,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(ps(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,s,e))}const c=new In(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ii(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){ii(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!ii(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&Kt(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}S(Nt,"defaults",{}),S(Nt,"datasetElementType",null),S(Nt,"dataElementType",null);function ua(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let s=[];for(let n=0,o=e.length;n<o;n++)s=s.concat(e[n].controller.getAllParsedValues(i));i._cache.$bar=mn(s.sort((n,o)=>n-o))}return i._cache.$bar}function ga(i){const t=i.iScale,e=ua(t,i.type);let s=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(de(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(n=0,o=e.length;n<o;++n)r=t.getPixelForValue(e[n]),l();for(a=void 0,n=0,o=t.ticks.length;n<o;++n)r=t.getPixelForTick(n),l();return s}function pa(i,t,e,s){const n=e.barThickness;let o,r;return R(n)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=n*s,r=1),{chunk:o/s,ratio:r,start:t.pixels[i]-o/2}}function ma(i,t,e,s){const n=t.pixels,o=n[i];let r=i>0?n[i-1]:null,a=i<n.length-1?n[i+1]:null;const l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/s,ratio:e.barPercentage,start:c}}function ba(i,t,e,s){const n=e.parse(i[0],s),o=e.parse(i[1],s),r=Math.min(n,o),a=Math.max(n,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function En(i,t,e,s){return W(i)?ba(i,t,e,s):t[e.axis]=e.parse(i,s),t}function ms(i,t,e,s){const n=i.iScale,o=i.vScale,r=n.getLabels(),a=n===o,l=[];let c,h,d,f;for(c=e,h=e+s;c<h;++c)f=t[c],d={},d[n.axis]=a||n.parse(r[c],c),l.push(En(f,d,o,c));return l}function si(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function _a(i,t,e){return i!==0?ct(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function xa(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.base<i.y,e="bottom",s="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:s,reverse:t,top:n,bottom:o}}function ya(i,t,e,s){let n=t.borderSkipped;const o={};if(!n){i.borderSkipped=o;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:h}=xa(i);n==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=h:(o[bs(h,r,a,l)]=!0,n=c)),o[bs(n,r,a,l)]=!0,i.borderSkipped=o}function bs(i,t,e,s){return s?(i=va(i,t,e),i=_s(i,e,t)):i=_s(i,t,e),i}function va(i,t,e){return i===t?e:i===e?t:i}function _s(i,t,e){return i==="start"?t:i==="end"?e:i}function ka(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class ni extends Nt{parsePrimitiveData(t,e,s,n){return ms(t,e,s,n)}parseArrayData(t,e,s,n){return ms(t,e,s,n)}parseObjectData(t,e,s,n){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,h=r.axis==="x"?a:l,d=[];let f,u,p,g;for(f=s,u=s+n;f<u;++f)g=e[f],p={},p[o.axis]=o.parse(Vt(g,c),f),d.push(En(Vt(g,h),p,r,f));return d}updateRangeFromParsed(t,e,s,n){super.updateRangeFromParsed(t,e,s,n);const o=s._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:n}=e,o=this.getParsed(t),r=o._custom,a=si(r)?"["+r.start+", "+r.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,n){const o=n==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,n);for(let u=e;u<e+s;u++){const p=this.getParsed(u),g=o||R(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(u),m=this._calculateBarIndexPixels(u,h),b=(p._stacks||{})[a.axis],_={horizontal:c,base:g.base,enableBorderRadius:!b||si(p._custom)||r===b._top||r===b._bottom,x:c?g.head:m.center,y:c?m.center:g.head,height:c?m.size:Math.abs(g.size),width:c?Math.abs(g.size):m.size};f&&(_.options=d||this.resolveDataElementOptions(u,t[u].active?"active":n));const y=_.options||t[u].options;ya(_,y,b,r),ka(_,y,h.ratio),this.updateElement(t[u],u,_,n)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=s.options.stacked,r=[],a=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(R(h)||isNaN(h))return!0};for(const l of n)if(!(e!==void 0&&a(l))&&((o===!1||r.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&r.push(l.stack),l.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;o<r;++o)n.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const a=t.barThickness;return{min:a||ga(e),pixels:n,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:n},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,h=si(c);let d=l[e.axis],f=0,u=s?this.applyStack(e,l,s):d,p,g;u!==d&&(f=u-d,u=d),h&&(d=c.barStart,u=c.barEnd-c.barStart,d!==0&&ct(d)!==ct(c.barEnd)&&(f=0),f+=d);const m=!R(o)&&!h?o:f;let b=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+u):p=b,g=p-b,Math.abs(g)<r){g=_a(g,e,a)*r,d===a&&(b-=g/2);const _=e.getPixelForDecimal(0),y=e.getPixelForDecimal(1),v=Math.min(_,y),x=Math.max(_,y);b=Math.max(Math.min(b,x),v),p=b+g,s&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(p)-e.getValueForPixel(b))}if(b===e.getPixelForValue(a)){const _=ct(g)*e.getLineWidthForValue(a)/2;b+=_,g-=_}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(t,e){const s=e.scale,n=this.options,o=n.skipNull,r=D(n.maxBarThickness,1/0);let a,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=n.barThickness==="flex"?ma(t,e,n,c):pa(t,e,n,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=h.start+h.chunk*d+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=s.getPixelForValue(this.getParsed(t)[s.axis],t),l=Math.min(r,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,s=t.data,n=s.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&s[o].draw(this._ctx)}}S(ni,"id","bar"),S(ni,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),S(ni,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class oi extends Nt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=Qo(e,n,r);this._drawStart=a,this._drawCount=l,tr(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),f=r.axis,u=a.axis,{spanGaps:p,segment:g}=this.options,m=fe(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||n==="none",_=e+s,y=t.length;let v=e>0&&this.getParsed(e-1);for(let x=0;x<y;++x){const w=t[x],M=b?w:{};if(x<e||x>=_){M.skip=!0;continue}const k=this.getParsed(x),P=R(k[u]),O=M[f]=r.getPixelForValue(k[f],x),C=M[u]=o||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[u],x);M.skip=isNaN(O)||isNaN(C)||P,M.stop=x>0&&Math.abs(k[f]-v[f])>m,g&&(M.parsed=k,M.raw=c.data[x]),d&&(M.options=h||this.resolveDataElementOptions(x,w.active?"active":n)),b||this.updateElement(w,x,M,n),v=k}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}S(oi,"id","line"),S(oi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),S(oi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function St(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Bi{constructor(t){S(this,"options");this.options=t||{}}static override(t){Object.assign(Bi.prototype,t)}init(){}formats(){return St()}parse(){return St()}format(){return St()}add(){return St()}diff(){return St()}startOf(){return St()}endOf(){return St()}}var wa={_date:Bi};function Ma(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Ko:Tt;if(s){if(n._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),f=l(o,t,e+h);return{lo:d.lo,hi:f.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function be(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:f}=Ma(o[a],t,r,n);for(let u=d;u<=f;++u){const p=h[u];p.skip||s(p,c,u)}}}function Sa(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,r=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function ri(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||be(i,e,t,function(a,l,c){!n&&!ue(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Pa(i,t,e,s){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=gn(r,{x:t.x,y:t.y});Di(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return be(i,e,t,o),n}function Ca(i,t,e,s,n,o){let r=[];const a=Sa(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const u=h.inRange(t.x,t.y,n);if(s&&!u)return;const p=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(p))&&!u)return;const m=a(t,p);m<l?(r=[{element:h,datasetIndex:d,index:f}],l=m):m===l&&r.push({element:h,datasetIndex:d,index:f})}return be(i,e,t,c),r}function ai(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?Pa(i,t,e,n):Ca(i,t,e,s,n,o)}function xs(i,t,e,s,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return be(i,e,t,(l,c,h)=>{l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var Da={evaluateInteractionItems:be,modes:{index(i,t,e,s){const n=Pt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?ri(i,n,o,s,r):ai(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=Pt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?ri(i,n,o,s,r):ai(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,s){const n=Pt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return ri(i,n,o,s,r)},nearest(i,t,e,s){const n=Pt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return ai(i,n,o,e.intersect,s,r)},x(i,t,e,s){const n=Pt(t,i);return xs(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=Pt(t,i);return xs(i,n,"y",e.intersect,s)}}};const zn=["left","top","right","bottom"];function qt(i,t){return i.filter(e=>e.pos===t)}function ys(i,t){return i.filter(e=>zn.indexOf(e.pos)===-1&&e.box.axis===t)}function Gt(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Oa(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function Ta(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!zn.includes(n))continue;const r=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Aa(i,t){const e=Ta(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&t.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:l&&t.availableHeight)}return e}function Ra(i){const t=Oa(i),e=Gt(t.filter(c=>c.box.fullSize),!0),s=Gt(qt(t,"left"),!0),n=Gt(qt(t,"right")),o=Gt(qt(t,"top"),!0),r=Gt(qt(t,"bottom")),a=ys(t,"x"),l=ys(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:qt(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function vs(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Bn(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function La(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!T(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&Bn(r,o.getPadding());const a=Math.max(0,t.outerWidth-vs(r,i,"left","right")),l=Math.max(0,t.outerHeight-vs(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Ia(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Fa(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function ee(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Fa(a.horizontal,t));const{same:d,other:f}=La(t,e,a,s);c|=d&&n.length,h=h||f,l.fullSize||n.push(a)}return c&&ee(n,t,e,s)||h}function Se(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function ks(i,t,e,s){const n=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=s[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,f=c.size||l.height;de(c.start)&&(r=c.start),l.fullSize?Se(l,n.left,r,e.outerWidth-n.right-n.left,f):Se(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,f=c.size||l.width;de(c.start)&&(o=c.start),l.fullSize?Se(l,o,n.top,f,e.outerHeight-n.bottom-n.top):Se(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var it={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=tt(i.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=Ra(i.boxes),l=a.vertical,c=a.horizontal;L(i.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},n);Bn(f,tt(s));const u=Object.assign({maxPadding:f,w:o,h:r,x:n.left,y:n.top},n),p=Aa(l.concat(c),d);ee(a.fullSize,u,d,p),ee(l,u,d,p),ee(c,u,d,p)&&ee(l,u,d,p),Ia(u),ks(a.leftAndTop,u,d,p),u.x+=u.w,u.y+=u.h,ks(a.rightAndBottom,u,d,p),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},L(a.chartArea,g=>{const m=g.box;Object.assign(m,i.chartArea),m.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class Hn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class Ea extends Hn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ee="$chartjs",za={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ws=i=>i===null||i==="";function Ba(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[Ee]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",ws(n)){const o=os(i,"width");o!==void 0&&(i.width=o)}if(ws(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=os(i,"height");o!==void 0&&(i.height=o)}return i}const Wn=Vr?{passive:!0}:!1;function Ha(i,t,e){i.addEventListener(t,e,Wn)}function Wa(i,t,e){i.canvas.removeEventListener(t,e,Wn)}function Na(i,t){const e=za[i.type]||i.type,{x:s,y:n}=Pt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Ye(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Va(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ye(a.addedNodes,s),r=r&&!Ye(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function ja(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ye(a.removedNodes,s),r=r&&!Ye(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const pe=new Map;let Ms=0;function Nn(){const i=window.devicePixelRatio;i!==Ms&&(Ms=i,pe.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function $a(i,t){pe.size||window.addEventListener("resize",Nn),pe.set(i,t)}function Ya(i){pe.delete(i),pe.size||window.removeEventListener("resize",Nn)}function Ua(i,t,e){const s=i.canvas,n=s&&zi(s);if(!n)return;const o=_n((a,l)=>{const c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),$a(i,o),r}function li(i,t,e){e&&e.disconnect(),t==="resize"&&Ya(i)}function Xa(i,t,e){const s=i.canvas,n=_n(o=>{i.ctx!==null&&e(Na(o,i))},i);return Ha(s,t,n),n}class Ka extends Hn{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Ba(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[Ee])return!1;const s=e[Ee].initial;["height","width"].forEach(o=>{const r=s[o];R(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Ee],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Va,detach:ja,resize:Ua}[e]||Xa;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:li,detach:li,resize:li}[e]||Wa)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Nr(t,e,s,n)}isAttached(t){const e=zi(t);return!!(e&&e.isConnected)}}function qa(i){return!Ei()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Ea:Ka}class nt{constructor(){S(this,"x");S(this,"y");S(this,"active",!1);S(this,"options");S(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return fe(this.x)&&fe(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}S(nt,"defaults",{}),S(nt,"defaultRoutes");function Ga(i,t){const e=i.options.ticks,s=Za(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Qa(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return tl(t,c,o,r/n),c;const h=Ja(o,t,n);if(r>0){let d,f;const u=r>1?Math.round((l-a)/(r-1)):null;for(Pe(t,c,h,R(u)?0:a-u,a),d=0,f=r-1;d<f;d++)Pe(t,c,h,o[d],o[d+1]);return Pe(t,c,h,l,R(u)?t.length:l+u),c}return Pe(t,c,h),c}function Za(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Ja(i,t,e){const s=el(i),n=t.length/e;if(!s)return Math.max(n,1);const o=Vo(s);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function Qa(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function tl(i,t,e,s){let n=0,o=e[0],r;for(s=Math.ceil(s),r=0;r<i.length;r++)r===o&&(t.push(i[r]),n++,o=e[n*s])}function Pe(i,t,e,s,n){const o=D(s,0),r=Math.min(D(n,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function el(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const il=i=>i==="left"?"right":i==="right"?"left":i,Ss=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Ps=(i,t)=>Math.min(t||i,i);function Cs(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function sl(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function nl(i,t){L(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Zt(i){return i.drawTicks?i.tickLength:0}function Ds(i,t){if(!i.display)return 0;const e=Y(i.font,t),s=tt(i.padding);return(W(i.text)?i.text.length:1)*e.lineHeight+s.height}function ol(i,t){return It(i,{scale:t,type:"scale"})}function rl(i,t,e){return It(i,{tick:e,index:t,type:"tick"})}function al(i,t,e){let s=Ti(i);return(e&&t!=="right"||!e&&t==="right")&&(s=il(s)),s}function ll(i,t,e,s){const{top:n,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,u,p;const g=r-n,m=a-o;if(i.isHorizontal()){if(u=X(s,o,a),T(e)){const b=Object.keys(e)[0],_=e[b];p=h[b].getPixelForValue(_)+g-t}else e==="center"?p=(c.bottom+c.top)/2+g-t:p=Ss(i,e,t);f=a-o}else{if(T(e)){const b=Object.keys(e)[0],_=e[b];u=h[b].getPixelForValue(_)-m+t}else e==="center"?u=(c.left+c.right)/2-m+t:u=Ss(i,e,t);p=X(s,r,n),d=e==="left"?-$:$}return{titleX:u,titleY:p,maxWidth:f,rotation:d}}class Yt extends nt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=ot(t,Number.POSITIVE_INFINITY),e=ot(e,Number.NEGATIVE_INFINITY),s=ot(s,Number.POSITIVE_INFINITY),n=ot(n,Number.NEGATIVE_INFINITY),{min:ot(t,s),max:ot(e,n),minDefined:q(t),maxDefined:q(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(s=Math.max(s,r.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:ot(e,ot(s,e)),max:ot(s,ot(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){F(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=xr(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Cs(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Ga(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){F(this.options.afterUpdate,[this])}beforeSetDimensions(){F(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(){F(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),F(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){F(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=F(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){F(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){F(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Ps(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r=n,a,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,u=K(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:u/(s-1),d+6>a&&(a=u/(s-(t.offset?.5:1)),l=this.maxHeight-Zt(t.grid)-e.padding-Ds(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=Yo(Math.min(Math.asin(K((h.highest.height+6)/a,-1,1)),Math.asin(K(l/c,-1,1))-Math.asin(K(f/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){F(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){F(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Ds(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Zt(o)+l):(t.height=this.maxHeight,t.width=Zt(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=s.padding*2,p=Ot(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){const b=s.mirror?0:m*d.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+b+u)}else{const b=s.mirror?0:g*d.width+m*f.height;t.width=Math.min(this.maxWidth,t.width+b+u)}this._calculatePadding(c,h,m,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,u=0;l?c?(f=n*t.width,u=s*e.height):(f=s*t.height,u=n*e.width):o==="start"?u=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,u=e.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){F(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)R(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=Cs(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Ps(e,s));let c=0,h=0,d,f,u,p,g,m,b,_,y,v,x;for(d=0;d<e;d+=l){if(p=t[d].label,g=this._resolveTickFontOptions(d),n.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},_=g.lineHeight,y=v=0,!R(p)&&!W(p))y=ts(n,b.data,b.gc,y,p),v=_;else if(W(p))for(f=0,u=p.length;f<u;++f)x=p[f],!R(x)&&!W(x)&&(y=ts(n,b.data,b.gc,y,x),v+=_);r.push(y),a.push(v),c=Math.max(y,c),h=Math.max(v,h)}nl(o,e);const w=r.indexOf(c),M=a.indexOf(h),k=P=>({width:r[P]||0,height:a[P]||0});return{first:k(0),last:k(e-1),widest:k(w),highest:k(M),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Xo(this._alignToPixels?Mt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=rl(this.getContext(),t,s))}return this.$context||(this.$context=ol(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ot(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Zt(o),u=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(E){return Mt(s,E,g)};let _,y,v,x,w,M,k,P,O,C,A,j;if(r==="top")_=b(this.bottom),M=this.bottom-f,P=_-m,C=b(t.top)+m,j=t.bottom;else if(r==="bottom")_=b(this.top),C=t.top,j=b(t.bottom)-m,M=_+m,P=this.top+f;else if(r==="left")_=b(this.right),w=this.right-f,k=_-m,O=b(t.left)+m,A=t.right;else if(r==="right")_=b(this.left),O=t.left,A=b(t.right)-m,w=_+m,k=this.left+f;else if(e==="x"){if(r==="center")_=b((t.top+t.bottom)/2+.5);else if(T(r)){const E=Object.keys(r)[0],H=r[E];_=b(this.chart.scales[E].getPixelForValue(H))}C=t.top,j=t.bottom,M=_+m,P=M+f}else if(e==="y"){if(r==="center")_=b((t.left+t.right)/2);else if(T(r)){const E=Object.keys(r)[0],H=r[E];_=b(this.chart.scales[E].getPixelForValue(H))}w=_-m,k=w-f,O=t.left,A=t.right}const Q=D(n.ticks.maxTicksLimit,d),I=Math.max(1,Math.ceil(d/Q));for(y=0;y<d;y+=I){const E=this.getContext(y),H=o.setContext(E),st=a.setContext(E),U=H.lineWidth,Ft=H.color,_e=st.dash||[],Et=st.dashOffset,Ut=H.tickWidth,vt=H.tickColor,Xt=H.tickBorderDash||[],kt=H.tickBorderDashOffset;v=sl(this,y,l),v!==void 0&&(x=Mt(s,v,U),c?w=k=O=A=x:M=P=C=j=x,u.push({tx1:w,ty1:M,tx2:k,ty2:P,x1:O,y1:C,x2:A,y2:j,width:U,color:Ft,borderDash:_e,borderDashOffset:Et,tickWidth:Ut,tickColor:vt,tickBorderDash:Xt,tickBorderDashOffset:kt}))}return this._ticksLength=d,this._borderValue=_,u}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=Zt(s.grid),u=f+h,p=d?-h:u,g=-Ot(this.labelRotation),m=[];let b,_,y,v,x,w,M,k,P,O,C,A,j="middle";if(n==="top")w=this.bottom-p,M=this._getXAxisLabelAlignment();else if(n==="bottom")w=this.top+p,M=this._getXAxisLabelAlignment();else if(n==="left"){const I=this._getYAxisLabelAlignment(f);M=I.textAlign,x=I.x}else if(n==="right"){const I=this._getYAxisLabelAlignment(f);M=I.textAlign,x=I.x}else if(e==="x"){if(n==="center")w=(t.top+t.bottom)/2+u;else if(T(n)){const I=Object.keys(n)[0],E=n[I];w=this.chart.scales[I].getPixelForValue(E)+u}M=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")x=(t.left+t.right)/2-u;else if(T(n)){const I=Object.keys(n)[0],E=n[I];x=this.chart.scales[I].getPixelForValue(E)}M=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?j="top":l==="end"&&(j="bottom"));const Q=this._getLabelSizes();for(b=0,_=a.length;b<_;++b){y=a[b],v=y.label;const I=o.setContext(this.getContext(b));k=this.getPixelForTick(b)+o.labelOffset,P=this._resolveTickFontOptions(b),O=P.lineHeight,C=W(v)?v.length:1;const E=C/2,H=I.color,st=I.textStrokeColor,U=I.textStrokeWidth;let Ft=M;r?(x=k,M==="inner"&&(b===_-1?Ft=this.options.reverse?"left":"right":b===0?Ft=this.options.reverse?"right":"left":Ft="center"),n==="top"?c==="near"||g!==0?A=-C*O+O/2:c==="center"?A=-Q.highest.height/2-E*O+O:A=-Q.highest.height+O/2:c==="near"||g!==0?A=O/2:c==="center"?A=Q.highest.height/2-E*O:A=Q.highest.height-C*O,d&&(A*=-1),g!==0&&!I.showLabelBackdrop&&(x+=O/2*Math.sin(g))):(w=k,A=(1-C)*O/2);let _e;if(I.showLabelBackdrop){const Et=tt(I.backdropPadding),Ut=Q.heights[b],vt=Q.widths[b];let Xt=A-Et.top,kt=0-Et.left;switch(j){case"middle":Xt-=Ut/2;break;case"bottom":Xt-=Ut;break}switch(M){case"center":kt-=vt/2;break;case"right":kt-=vt;break;case"inner":b===_-1?kt-=vt:b>0&&(kt-=vt/2);break}_e={left:kt,top:Xt,width:vt+Et.width,height:Ut+Et.height,color:I.backdropColor}}m.push({label:v,font:P,textOffset:A,options:{rotation:g,color:H,strokeColor:st,strokeWidth:U,textAlign:Ft,textBaseline:j,translation:[x,w],backdrop:_e}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ot(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const l=n[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),r=s.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,f;this.isHorizontal()?(c=Mt(t,this.left,r)-r/2,h=Mt(t,this.right,a)+a/2,d=f=l):(d=Mt(t,this.top,r)-r/2,f=Mt(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&Ke(s,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;ge(s,c,0,h,l,a)}n&&qe(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=Y(s.font),r=tt(s.padding),a=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||T(e)?(l+=r.bottom,W(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=ll(this,l,e,a);ge(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:f,textAlign:al(a,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=D(t.grid&&t.grid.z,-1),n=D(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Yt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Y(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ce{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;dl(e)&&(s=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,cl(t,r,s),this.override&&B.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in B[n]&&(delete B[n][s],this.override&&delete Lt[s])}}function cl(i,t,e){const s=ht(Object.create(null),[e?B.get(e):{},B.get(t),i.defaults]);B.set(t,s),i.defaultRoutes&&hl(t,i.defaultRoutes),i.descriptors&&B.describe(t,i.descriptors)}function hl(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");B.route(o,n,l,a)})}function dl(i){return"id"in i&&"defaults"in i}class fl{constructor(){this.controllers=new Ce(Nt,"datasets",!0),this.elements=new Ce(nt,"elements"),this.plugins=new Ce(Object,"plugins"),this.scales=new Ce(Yt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):L(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=Ci(t);F(s["before"+n],[],s),e[t](s),F(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var at=new fl;class ul{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(F(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){R(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=D(s.options&&s.options.plugins,{}),o=gl(s);return n===!1&&!e?[]:ml(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function gl(i){const t={},e=[],s=Object.keys(at.plugins.items);for(let o=0;o<s.length;o++)e.push(at.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function pl(i,t){return!t&&i===!1?null:i===!0?{}:i}function ml(i,{plugins:t,localIds:e},s,n){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=pl(s[l],n);c!==null&&o.push({plugin:a,options:bl(i.config,{plugin:a,local:e[l]},c,r)})}return o}function bl(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(s,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function _i(i,t){const e=B.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function _l(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function xl(i,t){return i===t?"_index_":"_value_"}function Os(i){if(i==="x"||i==="y"||i==="r")return i}function yl(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function xi(i,...t){if(Os(i))return i;for(const e of t){const s=e.axis||yl(e.position)||i.length>1&&Os(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Ts(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function vl(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return Ts(i,"x",e[0])||Ts(i,"y",e[0])}return{}}function kl(i,t){const e=Lt[i.type]||{scales:{}},s=t.scales||{},n=_i(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!T(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=xi(r,a,vl(r,i),B.scales[a.type]),c=xl(l,n),h=e.scales||{};o[r]=ne(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||_i(a,t),h=(Lt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=_l(d,l),u=r[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),ne(o[u],[{axis:f},s[u],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];ne(a,[B.scales[a.type],B.scale])}),o}function Vn(i){const t=i.options||(i.options={});t.plugins=D(t.plugins,{}),t.scales=kl(i,t)}function jn(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function wl(i){return i=i||{},i.data=jn(i.data),Vn(i),i}const As=new Map,$n=new Set;function De(i,t){let e=As.get(i);return e||(e=t(),As.set(i,e),$n.add(e)),e}const Jt=(i,t,e)=>{const s=Vt(t,e);s!==void 0&&i.add(s)};class Ml{constructor(t){this._config=wl(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=jn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Vn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return De(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return De(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return De(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return De(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Jt(l,t,d))),h.forEach(d=>Jt(l,n,d)),h.forEach(d=>Jt(l,Lt[o]||{},d)),h.forEach(d=>Jt(l,B,d)),h.forEach(d=>Jt(l,mi,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),$n.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Lt[e]||{},B.datasets[e]||{},{type:e},B,mi]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Rs(this._resolverCache,t,n);let l=r;if(Pl(r,e)){o.$shared=!1,s=yt(s)?s():s;const c=this.createResolver(t,s,a);l=jt(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=Rs(this._resolverCache,t,s);return T(e)?jt(o,e,void 0,n):o}}function Rs(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Li(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const Sl=i=>T(i)&&Object.getOwnPropertyNames(i).some(t=>yt(i[t]));function Pl(i,t){const{isScriptable:e,isIndexable:s}=Mn(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(yt(a)||Sl(a))||r&&W(a))return!0}return!1}var Cl="4.4.1";const Dl=["top","bottom","left","right","chartArea"];function Ls(i,t){return i==="top"||i==="bottom"||Dl.indexOf(i)===-1&&t==="x"}function Is(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Fs(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),F(e&&e.onComplete,[i],t)}function Ol(i){const t=i.chart,e=t.options.animation;F(e&&e.onProgress,[i],t)}function Yn(i){return Ei()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const ze={},Es=i=>{const t=Yn(i);return Object.values(ze).filter(e=>e.canvas===t).pop()};function Tl(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function Al(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function Oe(i,t,e){return i.options.clip?i[e]:t[e]}function Rl(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:Oe(e,t,"left"),right:Oe(e,t,"right"),top:Oe(s,t,"top"),bottom:Oe(s,t,"bottom")}:t}class Dt{static register(...t){at.add(...t),zs()}static unregister(...t){at.remove(...t),zs()}constructor(t,e){const s=this.config=new Ml(e),n=Yn(t),o=Es(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||qa(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Lo(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new ul,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Zo(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],ze[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ft.listen(this,"complete",Fs),ft.listen(this,"progress",Ol),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return R(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return at}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ns(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return es(this.canvas,this.ctx),this}stop(){return ft.stop(this),this}resize(t,e){ft.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ns(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),F(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};L(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=xi(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),L(o,r=>{const a=r.options,l=a.id,c=xi(l,a),h=D(a.type,r.dtype);(a.position===void 0||Ls(a.position,c)!==Ls(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const f=at.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),L(n,(r,a)=>{r||delete s[a]}),L(s,r=>{it.configure(this,r,r.options),it.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Is("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let r=this.getDatasetMeta(s);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=a,r.indexAxis=o.indexAxis||_i(a,this.options),r.order=o.order||0,r.index=s,r.label=""+o.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{const l=at.getController(a),{datasetElementType:c,dataElementType:h}=B.datasets[a];Object.assign(l,{dataElementType:at.getElement(h),datasetElementType:c&&at.getElement(c)}),r.controller=new l(this,s),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){L(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),f=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),n||L(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Is("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){L(this.scales,t=>{it.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Yi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;Tl(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!Yi(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;it.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],L(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,yt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ft.has(this)?this.attached&&!ft.running(this)&&ft.start(this):(this.draw(),Fs({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resize(s,n),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&s.push(r)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=Rl(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Ke(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&qe(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ue(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Da.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=It(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);de(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ft.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),es(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ze[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};L(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){L(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},L(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!We(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=Ho(t),c=Al(t,this._lastEvent,s,l);s&&(this._lastEvent=null,F(o.onHover,[t,a,this],this),l&&F(o.onClick,[t,a,this],this));const h=!We(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}S(Dt,"defaults",B),S(Dt,"instances",ze),S(Dt,"overrides",Lt),S(Dt,"registry",at),S(Dt,"version",Cl),S(Dt,"getChart",Es);function zs(){return L(Dt.instances,i=>i._plugins.invalidate())}function Ll(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=n/a;i.beginPath(),i.arc(o,r,a,s-c,e+c),l>n?(c=n/l,i.arc(o,r,l,e+c,s-c,!0)):i.arc(o,r,n,e+$,s-$),i.closePath(),i.clip()}function Il(i){return Ri(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Fl(i,t,e,s){const n=Il(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,s*t/2),a=l=>{const c=(e-Math.min(o,l))*s/2;return K(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:K(n.innerStart,0,r),innerEnd:K(n.innerEnd,0,r)}}function Bt(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function Ue(i,t,e,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),f=h>0?h+s+e+c:0;let u=0;const p=n-l;if(s){const I=h>0?h-s:0,E=d>0?d-s:0,H=(I+E)/2,st=H!==0?p*H/(H+s):p;u=(p-st)/2}const g=Math.max(.001,p*d-e/N)/d,m=(p-g)/2,b=l+m+u,_=n-m-u,{outerStart:y,outerEnd:v,innerStart:x,innerEnd:w}=Fl(t,f,d,_-b),M=d-y,k=d-v,P=b+y/M,O=_-v/k,C=f+x,A=f+w,j=b+x/C,Q=_-w/A;if(i.beginPath(),o){const I=(P+O)/2;if(i.arc(r,a,d,P,I),i.arc(r,a,d,I,O),v>0){const U=Bt(k,O,r,a);i.arc(U.x,U.y,v,O,_+$)}const E=Bt(A,_,r,a);if(i.lineTo(E.x,E.y),w>0){const U=Bt(A,Q,r,a);i.arc(U.x,U.y,w,_+$,Q+Math.PI)}const H=(_-w/f+(b+x/f))/2;if(i.arc(r,a,f,_-w/f,H,!0),i.arc(r,a,f,H,b+x/f,!0),x>0){const U=Bt(C,j,r,a);i.arc(U.x,U.y,x,j+Math.PI,b-$)}const st=Bt(M,b,r,a);if(i.lineTo(st.x,st.y),y>0){const U=Bt(M,P,r,a);i.arc(U.x,U.y,y,b-$,P)}}else{i.moveTo(r,a);const I=Math.cos(P)*d+r,E=Math.sin(P)*d+a;i.lineTo(I,E);const H=Math.cos(O)*d+r,st=Math.sin(O)*d+a;i.lineTo(H,st)}i.closePath()}function El(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Ue(i,t,e,s,l,n);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%V||V))}return Ue(i,t,e,s,l,n),i.fill(),l}function zl(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:f}=l,u=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=f,u?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let p=t.endAngle;if(o){Ue(i,t,e,s,p,n);for(let g=0;g<o;++g)i.stroke();isNaN(a)||(p=r+(a%V||V))}u&&Ll(i,t,p),o||(Ue(i,t,e,s,p,n),i.stroke())}class ie extends nt{constructor(e){super();S(this,"circumference");S(this,"endAngle");S(this,"fullCircles");S(this,"innerRadius");S(this,"outerRadius");S(this,"pixelMargin");S(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,s,n){const o=this.getProps(["x","y"],n),{angle:r,distance:a}=gn(o,{x:e,y:s}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),u=(this.options.spacing+this.options.borderWidth)/2,g=D(f,c-l)>=V||Di(r,l,c),m=pt(a,h+u,d+u);return g&&m}getCenterPoint(e){const{x:s,y:n,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,d=(o+r)/2,f=(a+l+h+c)/2;return{x:s+Math.cos(d)*f,y:n+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:s,circumference:n}=this,o=(s.offset||0)/4,r=(s.spacing||0)/2,a=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=n>V?Math.floor(n/V):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(N,n||0)),h=o*c;e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,El(e,this,h,r,a),zl(e,this,h,r,a),e.restore()}}S(ie,"id","arc"),S(ie,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),S(ie,"defaultRoutes",{backgroundColor:"backgroundColor"}),S(ie,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Un(i,t,e=t){i.lineCap=D(e.borderCapStyle,t.borderCapStyle),i.setLineDash(D(e.borderDash,t.borderDash)),i.lineDashOffset=D(e.borderDashOffset,t.borderDashOffset),i.lineJoin=D(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=D(e.borderWidth,t.borderWidth),i.strokeStyle=D(e.borderColor,t.borderColor)}function Bl(i,t,e){i.lineTo(e.x,e.y)}function Hl(i){return i.stepped?hr:i.tension||i.cubicInterpolationMode==="monotone"?dr:Bl}function Xn(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=n<r&&o<r||n>a&&o>a;return{count:s,start:l,loop:t.loop,ilen:c<l&&!h?s+c-l:c-l}}function Wl(i,t,e,s){const{points:n,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Xn(n,e,s),h=Hl(o);let{move:d=!0,reverse:f}=s||{},u,p,g;for(u=0;u<=c;++u)p=n[(a+(f?c-u:u))%r],!p.skip&&(d?(i.moveTo(p.x,p.y),d=!1):h(i,g,p,f,o.stepped),g=p);return l&&(p=n[(a+(f?c:0))%r],h(i,g,p,f,o.stepped)),!!l}function Nl(i,t,e,s){const n=t.points,{count:o,start:r,ilen:a}=Xn(n,e,s),{move:l=!0,reverse:c}=s||{};let h=0,d=0,f,u,p,g,m,b;const _=v=>(r+(c?a-v:v))%o,y=()=>{g!==m&&(i.lineTo(h,m),i.lineTo(h,g),i.lineTo(h,b))};for(l&&(u=n[_(0)],i.moveTo(u.x,u.y)),f=0;f<=a;++f){if(u=n[_(f)],u.skip)continue;const v=u.x,x=u.y,w=v|0;w===p?(x<g?g=x:x>m&&(m=x),h=(d*h+v)/++d):(y(),i.lineTo(v,x),p=w,d=0,g=m=x),b=x}y()}function yi(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Nl:Wl}function Vl(i){return i.stepped?jr:i.tension||i.cubicInterpolationMode==="monotone"?$r:Ct}function jl(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Un(i,t.options),i.stroke(n)}function $l(i,t,e,s){const{segments:n,options:o}=t,r=yi(t);for(const a of n)Un(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Yl=typeof Path2D=="function";function Ul(i,t,e,s){Yl&&!t.options.segment?jl(i,t,e,s):$l(i,t,e,s)}class At extends nt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;Fr(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Gr(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=Ln(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=Vl(s);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:f}=r[c],u=o[d],p=o[f];if(u===p){a.push(u);continue}const g=Math.abs((n-u[e])/(p[e]-u[e])),m=l(u,p,g,s.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,s){return yi(this)(t,this,e,s)}path(t,e,s){const n=this.segments,o=yi(this);let r=this._loop;e=e||0,s=s||this.points.length-e;for(const a of n)r&=o(t,this,a,{start:e,end:e+s-1});return!!r}draw(t,e,s,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Ul(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}S(At,"id","line"),S(At,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),S(At,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),S(At,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Bs(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class Be extends nt{constructor(e){super();S(this,"parsed");S(this,"skip");S(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,s,n){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],n);return Math.pow(e-r,2)+Math.pow(s-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,s){return Bs(this,e,"x",s)}inYRange(e,s){return Bs(this,e,"y",s)}getCenterPoint(e){const{x:s,y:n}=this.getProps(["x","y"],e);return{x:s,y:n}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);const n=s&&e.borderWidth||0;return(s+n)*2}draw(e,s){const n=this.options;this.skip||n.radius<.1||!ue(this,s,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,bi(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}S(Be,"id","point"),S(Be,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),S(Be,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Kn(i,t){const{x:e,y:s,base:n,width:o,height:r}=i.getProps(["x","y","base","width","height"],t);let a,l,c,h,d;return i.horizontal?(d=r/2,a=Math.min(e,n),l=Math.max(e,n),c=s-d,h=s+d):(d=o/2,a=e-d,l=e+d,c=Math.min(s,n),h=Math.max(s,n)),{left:a,top:c,right:l,bottom:h}}function _t(i,t,e,s){return i?0:K(t,e,s)}function Xl(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,o=wn(s);return{t:_t(n.top,o.top,0,e),r:_t(n.right,o.right,0,t),b:_t(n.bottom,o.bottom,0,e),l:_t(n.left,o.left,0,t)}}function Kl(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=Ht(n),r=Math.min(t,e),a=i.borderSkipped,l=s||T(n);return{topLeft:_t(!l||a.top||a.left,o.topLeft,0,r),topRight:_t(!l||a.top||a.right,o.topRight,0,r),bottomLeft:_t(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:_t(!l||a.bottom||a.right,o.bottomRight,0,r)}}function ql(i){const t=Kn(i),e=t.right-t.left,s=t.bottom-t.top,n=Xl(i,e/2,s/2),o=Kl(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function ci(i,t,e,s){const n=t===null,o=e===null,a=i&&!(n&&o)&&Kn(i,s);return a&&(n||pt(t,a.left,a.right))&&(o||pt(e,a.top,a.bottom))}function Gl(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Zl(i,t){i.rect(t.x,t.y,t.w,t.h)}function hi(i,t,e={}){const s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,r=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+r,radius:i.radius}}class He extends nt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:r}=ql(this),a=Gl(r.radius)?je:Zl;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,hi(r,e,o)),t.clip(),a(t,hi(o,-e,r)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),a(t,hi(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return ci(this,t,e,s)}inXRange(t,e){return ci(this,t,null,e)}inYRange(t,e){return ci(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}S(He,"id","bar"),S(He,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),S(He,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Jl(i,t,e){const s=i.segments,n=i.points,o=t.points,r=[];for(const a of s){let{start:l,end:c}=a;c=Hi(l,c,n);const h=vi(e,n[l],n[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:n[l],end:n[c]});continue}const d=Ln(t,h);for(const f of d){const u=vi(e,o[f.start],o[f.end],f.loop),p=Rn(a,n,u);for(const g of p)r.push({source:g,target:f,start:{[e]:Hs(h,u,"start",Math.max)},end:{[e]:Hs(h,u,"end",Math.min)}})}}return r}function vi(i,t,e,s){if(s)return;let n=t[i],o=e[i];return i==="angle"&&(n=lt(n),o=lt(o)),{property:i,start:n,end:o}}function Ql(i,t){const{x:e=null,y:s=null}=i||{},n=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=Hi(r,a,n);const l=n[r],c=n[a];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Hi(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function Hs(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function qn(i,t){let e=[],s=!1;return W(i)?(s=!0,e=i):e=Ql(i,t),e.length?new At({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Ws(i){return i&&i.fill!==!1}function tc(i,t,e){let n=i[t].fill;const o=[t];let r;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!q(n))return n;if(r=i[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function ec(i,t,e){const s=oc(i);if(T(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return q(n)&&Math.floor(n)===n?ic(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function ic(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function sc(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:T(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function nc(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:T(i)?s=i.value:s=t.getBaseValue(),s}function oc(i){const t=i.options,e=t.fill;let s=D(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function rc(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,r=s.points,a=ac(t,e);a.push(qn({x:null,y:t.bottom},s));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)lc(n,r[h],a)}return new At({points:n,options:{}})}function ac(i,t){const e=[],s=i.getMatchingVisibleMetas("line");for(let n=0;n<s.length;n++){const o=s[n];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function lc(i,t,e){const s=[];for(let n=0;n<e.length;n++){const o=e[n],{first:r,last:a,point:l}=cc(o,t,"x");if(!(!l||r&&a)){if(r)s.unshift(l);else if(i.push(l),!a)break}}i.push(...s)}function cc(i,t,e){const s=i.interpolate(t,e);if(!s)return{};const n=s[e],o=i.segments,r=i.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],d=r[h.start][e],f=r[h.end][e];if(pt(n,d,f)){a=n===d,l=n===f;break}}return{first:a,last:l,point:s}}class Gn{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:n,y:o,radius:r}=this;return e=e||{start:0,end:V},t.arc(n,o,r,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:s+Math.sin(o)*n,angle:o}}}function hc(i){const{chart:t,fill:e,line:s}=i;if(q(e))return dc(t,e);if(e==="stack")return rc(i);if(e==="shape")return!0;const n=fc(i);return n instanceof Gn?n:qn(n,s)}function dc(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function fc(i){return(i.scale||{}).getPointPositionForValue?gc(i):uc(i)}function uc(i){const{scale:t={},fill:e}=i,s=sc(e,t);if(q(s)){const n=t.isHorizontal();return{x:n?s:null,y:n?null:s}}return null}function gc(i){const{scale:t,fill:e}=i,s=t.options,n=t.getLabels().length,o=s.reverse?t.max:t.min,r=nc(e,t,o),a=[];if(s.grid.circular){const l=t.getPointPositionForValue(0,o);return new Gn({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<n;++l)a.push(t.getPointPositionForValue(l,r));return a}function di(i,t,e){const s=hc(t),{line:n,scale:o,axis:r}=t,a=n.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:d=c}=l||{};s&&n.points.length&&(Ke(i,e),pc(i,{line:n,target:s,above:h,below:d,area:e,scale:o,axis:r}),qe(i))}function pc(i,t){const{line:e,target:s,above:n,below:o,area:r,scale:a}=t,l=e._loop?"angle":t.axis;i.save(),l==="x"&&o!==n&&(Ns(i,s,r.top),Vs(i,{line:e,target:s,color:n,scale:a,property:l}),i.restore(),i.save(),Ns(i,s,r.bottom)),Vs(i,{line:e,target:s,color:o,scale:a,property:l}),i.restore()}function Ns(i,t,e){const{segments:s,points:n}=t;let o=!0,r=!1;i.beginPath();for(const a of s){const{start:l,end:c}=a,h=n[l],d=n[Hi(l,c,n)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(d.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function Vs(i,t){const{line:e,target:s,property:n,color:o,scale:r}=t,a=Jl(e,s,n);for(const{source:l,target:c,start:h,end:d}of a){const{style:{backgroundColor:f=o}={}}=l,u=s!==!0;i.save(),i.fillStyle=f,mc(i,r,u&&vi(n,h,d)),i.beginPath();const p=!!e.pathSegment(i,l);let g;if(u){p?i.closePath():js(i,s,d,n);const m=!!s.pathSegment(i,c,{move:p,reverse:!0});g=p&&m,g||js(i,s,h,n)}i.closePath(),i.fill(g?"evenodd":"nonzero"),i.restore()}}function mc(i,t,e){const{top:s,bottom:n}=t.chart.chartArea,{property:o,start:r,end:a}=e||{};o==="x"&&(i.beginPath(),i.rect(r,s,a-r,n-s),i.clip())}function js(i,t,e,s){const n=t.interpolate(e,s);n&&i.lineTo(n.x,n.y)}var rh={id:"filler",afterDatasetsUpdate(i,t,e){const s=(i.data.datasets||[]).length,n=[];let o,r,a,l;for(r=0;r<s;++r)o=i.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof At&&(l={visible:i.isDatasetVisible(r),index:r,fill:ec(a,r,s),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,n.push(l);for(r=0;r<s;++r)l=n[r],!(!l||l.fill===!1)&&(l.fill=tc(n,r,e.propagate))},beforeDraw(i,t,e){const s=e.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let r=n.length-1;r>=0;--r){const a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),s&&a.fill&&di(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const o=s[n].$filler;Ws(o)&&di(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!Ws(s)||e.drawTime!=="beforeDatasetDraw"||di(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const $s=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},bc=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Ys extends nt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=F(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=Y(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=$s(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,u=-h;return this.legendItems.forEach((p,g)=>{const m=s+e/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,u+=h,f++),l[g]={left:0,top:u,row:f,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,f=0,u=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:_,itemHeight:y}=_c(s,e,o,m,n);b>0&&u+y+2*a>h&&(d+=f+a,c.push({width:f,height:u}),p+=f+a,g++,f=u=0),l[b]={left:p,top:u,col:g,width:_,height:y},f=Math.max(f,_),u+=y+a}),d+=f,c.push({width:f,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=Wt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=X(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=X(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=X(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=X(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ke(t,this),this._draw(),qe(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=B.color,l=Wt(t.rtl,this.left,this.width),c=Y(r.font),{padding:h}=r,d=c.size,f=d/2;let u;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=$s(r,d),b=function(w,M,k){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();const P=D(k.lineWidth,1);if(n.fillStyle=D(k.fillStyle,a),n.lineCap=D(k.lineCap,"butt"),n.lineDashOffset=D(k.lineDashOffset,0),n.lineJoin=D(k.lineJoin,"miter"),n.lineWidth=P,n.strokeStyle=D(k.strokeStyle,a),n.setLineDash(D(k.lineDash,[])),r.usePointStyle){const O={radius:g*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:P},C=l.xPlus(w,p/2),A=M+f;kn(n,O,C,A,r.pointStyleWidth&&p)}else{const O=M+Math.max((d-g)/2,0),C=l.leftForLtr(w,p),A=Ht(k.borderRadius);n.beginPath(),Object.values(A).some(j=>j!==0)?je(n,{x:C,y:O,w:p,h:g,radius:A}):n.rect(C,O,p,g),n.fill(),P!==0&&n.stroke()}n.restore()},_=function(w,M,k){ge(n,k.text,w,M+m/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},y=this.isHorizontal(),v=this._computeTitleHeight();y?u={x:X(o,this.left+h,this.right-s[0]),y:this.top+h+v,line:0}:u={x:this.left+h,y:X(o,this.top+v+h,this.bottom-e[0].height),line:0},On(this.ctx,t.textDirection);const x=m+h;this.legendItems.forEach((w,M)=>{n.strokeStyle=w.fontColor,n.fillStyle=w.fontColor;const k=n.measureText(w.text).width,P=l.textAlign(w.textAlign||(w.textAlign=r.textAlign)),O=p+f+k;let C=u.x,A=u.y;l.setWidth(this.width),y?M>0&&C+O+h>this.right&&(A=u.y+=x,u.line++,C=u.x=X(o,this.left+h,this.right-s[u.line])):M>0&&A+x>this.bottom&&(C=u.x=C+e[u.line].width+h,u.line++,A=u.y=X(o,this.top+v+h,this.bottom-e[u.line].height));const j=l.x(C);if(b(j,A,w),C=Jo(P,C+p+f,y?C+O:this.right,t.rtl),_(l.x(C),A,w),y)u.x+=O+h;else if(typeof w.text!="string"){const Q=c.lineHeight;u.y+=Zn(w,Q)+h}else u.y+=x}),Tn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=Y(e.font),n=tt(e.padding);if(!e.display)return;const o=Wt(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=X(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+X(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const u=X(a,d,d+f);r.textAlign=o.textAlign(Ti(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,ge(r,e.text,u,h,s)}_computeTitleHeight(){const t=this.options.title,e=Y(t.font),s=tt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(pt(t,this.left,this.right)&&pt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],pt(t,n.left,n.left+n.width)&&pt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!vc(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=bc(n,s);n&&!o&&F(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&F(e.onHover,[t,s,this],this)}else s&&F(e.onClick,[t,s,this],this)}}function _c(i,t,e,s,n){const o=xc(s,i,t,e),r=yc(n,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function xc(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function yc(i,t,e){let s=i;return typeof t.text!="string"&&(s=Zn(t,e)),s}function Zn(i,t){const e=i.text?i.text.length:0;return t*e}function vc(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var ah={id:"legend",_element:Ys,start(i,t,e){const s=i.legend=new Ys({ctx:i.ctx,options:e,chart:i});it.configure(i,s,e),it.addBox(i,s)},stop(i){it.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;it.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=tt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Jn extends nt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=W(s.text)?s.text.length:1;this._padding=tt(s.padding);const o=n*Y(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=X(a,s,o),d=e+t,c=o-s):(r.position==="left"?(h=s+t,d=X(a,n,e),l=N*-.5):(h=o-t,d=X(a,e,n),l=N*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=Y(e.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);ge(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:Ti(e.align),textBaseline:"middle",translation:[r,a]})}}function kc(i,t){const e=new Jn({ctx:i.ctx,options:t,chart:i});it.configure(i,e,t),it.addBox(i,e),i.titleBlock=e}var lh={id:"title",_element:Jn,start(i,t,e){kc(i,e)},stop(i){const t=i.titleBlock;it.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;it.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const se={average(i){if(!i.length)return!1;let t,e,s=0,n=0,o=0;for(t=0,e=i.length;t<e;++t){const r=i[t].element;if(r&&r.hasValue()){const a=r.tooltipPosition();s+=a.x,n+=a.y,++o}}return{x:s/o,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=pi(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function rt(i,t){return t&&(W(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function ut(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
`)>-1?i.split(`
`):i}function wc(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Us(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=Y(t.bodyFont),c=Y(t.titleFont),h=Y(t.footerFont),d=o.length,f=n.length,u=s.length,p=tt(t.padding);let g=p.height,m=0,b=s.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=u*v+(b-u)*l.lineHeight+(b-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let _=0;const y=function(v){m=Math.max(m,e.measureText(v).width+_)};return e.save(),e.font=c.string,L(i.title,y),e.font=l.string,L(i.beforeBody.concat(i.afterBody),y),_=t.displayColors?r+2+t.boxPadding:0,L(s,v=>{L(v.before,y),L(v.lines,y),L(v.after,y)}),_=0,e.font=h.string,L(i.footer,y),e.restore(),m+=p.width,{width:m,height:g}}function Mc(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Sc(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function Pc(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Sc(c,i,t,e)&&(c="center"),c}function Xs(i,t,e){const s=e.yAlign||t.yAlign||Mc(i,e);return{xAlign:e.xAlign||t.xAlign||Pc(i,t,e,s),yAlign:s}}function Cc(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Dc(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Ks(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:u}=Ht(r);let p=Cc(t,a);const g=Dc(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,f)+n:a==="right"&&(p+=Math.max(d,u)+n),{x:K(p,0,s.width-t.width),y:K(g,0,s.height-t.height)}}function Te(i,t,e){const s=tt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function qs(i){return rt([],ut(i))}function Oc(i,t,e){return It(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Gs(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Qn={beforeTitle:dt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:dt,beforeBody:dt,beforeLabel:dt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return R(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:dt,afterBody:dt,beforeFooter:dt,footer:dt,afterFooter:dt};function G(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?Qn[t].call(e,s):n}class ki extends nt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new In(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Oc(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=G(s,"beforeTitle",this,t),o=G(s,"title",this,t),r=G(s,"afterTitle",this,t);let a=[];return a=rt(a,ut(n)),a=rt(a,ut(o)),a=rt(a,ut(r)),a}getBeforeBody(t,e){return qs(G(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return L(t,o=>{const r={before:[],lines:[],after:[]},a=Gs(s,o);rt(r.before,ut(G(a,"beforeLabel",this,o))),rt(r.lines,G(a,"label",this,o)),rt(r.after,ut(G(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return qs(G(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=G(s,"beforeFooter",this,t),o=G(s,"footer",this,t),r=G(s,"afterFooter",this,t);let a=[];return a=rt(a,ut(n)),a=rt(a,ut(o)),a=rt(a,ut(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(wc(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,f)=>t.filter(h,d,f,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),L(a,h=>{const d=Gs(t.callbacks,h);n.push(G(d,"labelColor",this,h)),o.push(G(d,"labelPointStyle",this,h)),r.push(G(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=se[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=Us(this,s),c=Object.assign({},a,l),h=Xs(this.chart,s,c),d=Ks(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Ht(a),{x:f,y:u}=t,{width:p,height:g}=e;let m,b,_,y,v,x;return o==="center"?(v=u+g/2,n==="left"?(m=f,b=m-r,y=v+r,x=v-r):(m=f+p,b=m+r,y=v-r,x=v+r),_=m):(n==="left"?b=f+Math.max(l,h)+r:n==="right"?b=f+p-Math.max(c,d)-r:b=this.caretX,o==="top"?(y=u,v=y-r,m=b-r,_=b+r):(y=u+g,v=y+r,m=b+r,_=b-r),x=y),{x1:m,x2:b,x3:_,y1:y,y2:v,y3:x}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Wt(s.rtl,this.x,this.width);for(t.x=Te(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=Y(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=Y(o.bodyFont),d=Te(this,"left",o),f=n.x(d),u=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+u;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=n.leftForLtr(f,c)+c/2,b=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,bi(t,g,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,bi(t,g,m,b)}else{t.lineWidth=T(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const g=n.leftForLtr(f,c),m=n.leftForLtr(n.xPlus(f,1),c-2),b=Ht(r.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,je(t,{x:g,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),je(t,{x:m,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=Y(s.bodyFont);let f=d.lineHeight,u=0;const p=Wt(s.rtl,this.x,this.width),g=function(k){e.fillText(k,p.x(t.x+u),t.y+f/2),t.y+=f+o},m=p.textAlign(r);let b,_,y,v,x,w,M;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Te(this,m,s),e.fillStyle=s.bodyColor,L(this.beforeBody,g),u=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,v=0,w=n.length;v<w;++v){for(b=n[v],_=this.labelTextColors[v],e.fillStyle=_,L(b.before,g),y=b.lines,a&&y.length&&(this._drawColorBox(e,t,v,p,s),f=Math.max(d.lineHeight,l)),x=0,M=y.length;x<M;++x)g(y[x]),f=d.lineHeight;L(b.after,g)}u=0,f=d.lineHeight,L(this.afterBody,g),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let r,a;if(o){const l=Wt(s.rtl,this.x,this.width);for(t.x=Te(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",r=Y(s.footerFont),e.fillStyle=s.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:f,bottomLeft:u,bottomRight:p}=Ht(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,s,n),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(a+c,l+h-p),e.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+u,l+h),e.quadraticCurveTo(a,l+h,a,l+h-u),r==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=se[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Us(this,t),l=Object.assign({},r,this._size),c=Xs(e,t,l),h=Ks(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=tt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),On(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Tn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!We(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!We(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=se[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}S(ki,"positioners",se);var ch={id:"tooltip",_element:ki,positioners:se,afterInit(i,t,e){e&&(i.tooltip=new ki({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Qn},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Tc=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Ac(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Tc(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Rc=(i,t)=>i===null?null:K(Math.round(i),0,t);function Zs(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class Js extends Yt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(R(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Ac(s,t,D(e,t),this._addedLabels),Rc(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return Zs.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}S(Js,"id","category"),S(Js,"defaults",{ticks:{callback:Zs}});function Lc(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=i,u=o||1,p=h-1,{min:g,max:m}=t,b=!R(r),_=!R(a),y=!R(c),v=(m-g)/(d+1);let x=Xi((m-g)/p/u)*u,w,M,k,P;if(x<1e-14&&!b&&!_)return[{value:g},{value:m}];P=Math.ceil(m/x)-Math.floor(g/x),P>p&&(x=Xi(P*x/p/u)*u),R(l)||(w=Math.pow(10,l),x=Math.ceil(x*w)/w),n==="ticks"?(M=Math.floor(g/x)*x,k=Math.ceil(m/x)*x):(M=g,k=m),b&&_&&o&&jo((a-r)/o,x/1e3)?(P=Math.round(Math.min((a-r)/x,h)),x=(a-r)/P,M=r,k=a):y?(M=b?r:M,k=_?a:k,P=c-1,x=(k-M)/P):(P=(k-M)/x,oe(P,Math.round(P),x/1e3)?P=Math.round(P):P=Math.ceil(P));const O=Math.max(Ki(x),Ki(M));w=Math.pow(10,R(l)?O:l),M=Math.round(M*w)/w,k=Math.round(k*w)/w;let C=0;for(b&&(f&&M!==r?(e.push({value:r}),M<r&&C++,oe(Math.round((M+C*x)*w)/w,r,Qs(r,v,i))&&C++):M<r&&C++);C<P;++C){const A=Math.round((M+C*x)*w)/w;if(_&&A>a)break;e.push({value:A})}return _&&f&&k!==a?e.length&&oe(e[e.length-1].value,a,Qs(a,v,i))?e[e.length-1].value=a:e.push({value:a}):(!_||k===a)&&e.push({value:k}),e}function Qs(i,t,{horizontal:e,minRotation:s}){const n=Ot(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Ic extends Yt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return R(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=ct(n),c=ct(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=Lc(n,o);return t.bounds==="ticks"&&$o(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return xn(t,this.chart.options.locale,this.options.ticks.format)}}class tn extends Ic{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=q(t)?t:0,this.max=q(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=Ot(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}S(tn,"id","linear"),S(tn,"defaults",{ticks:{callback:vn.formatters.numeric}});const Ze={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}},J=Object.keys(Ze);function en(i,t){return i-t}function sn(i,t){if(R(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),q(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(fe(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function nn(i,t,e,s){const n=J.length;for(let o=J.indexOf(i);o<n-1;++o){const r=Ze[J[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=s)return J[o]}return J[n-1]}function Fc(i,t,e,s,n){for(let o=J.length-1;o>=J.indexOf(e);o--){const r=J[o];if(Ze[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return J[e?J.indexOf(e):0]}function Ec(i){for(let t=J.indexOf(i)+1,e=J.length;t<e;++t)if(Ze[J[t]].common)return J[t]}function on(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=Oi(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function zc(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function rn(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,s.push({value:a,major:!1});return o===0||!e?s:zc(i,s,n,e)}class Xe extends Yt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),n=this._adapter=new wa._date(t.adapters.date);n.init(e),ne(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:sn(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=q(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=q(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=qo(n,o,r);return this._unit=e.unit||(s.autoSkip?nn(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Fc(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Ec(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),rn(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=K(e,0,r),s=K(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||nn(o.minUnit,e,s,this._getLabelCapacity(e)),a=D(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=fe(l)||l===!0,h={};let d=e,f,u;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f<s;f=+t.add(f,a,r),u++)on(h,f,p);return(f===s||n.bounds==="ticks"||u===1)&&on(h,f,p),Object.keys(h).sort(en).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return F(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],f=s[e],u=c&&d&&f&&f.major;return this._adapter.format(t,n||(u?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=Ot(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:s*o+a*r,h:s*r+a*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,rn(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(sn(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return mn(t.sort(en))}}S(Xe,"id","time"),S(Xe,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ae(i,t,e){let s=0,n=i.length-1,o,r,a,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Tt(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Tt(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class an extends Xe{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ae(e,this.min),this._tableRange=Ae(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],c=n[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Ae(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Ae(this._table,s*this._tableRange+this._minPos,!0)}}S(an,"id","timeseries"),S(an,"defaults",Xe.defaults);/*!
* chartjs-plugin-datalabels v2.2.0
* https://chartjs-plugin-datalabels.netlify.app
* (c) 2017-2022 chartjs-plugin-datalabels contributors
* Released under the MIT license
*/var ln=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var i=window.screen;if(i)return(i.deviceXDPI||1)/(i.logicalXDPI||1)}return 1}(),le={toTextLines:function(i){var t=[],e;for(i=[].concat(i);i.length;)e=i.pop(),typeof e=="string"?t.unshift.apply(t,e.split(`
`)):Array.isArray(e)?i.push.apply(i,e):R(i)||t.unshift(""+e);return t},textSize:function(i,t,e){var s=[].concat(t),n=s.length,o=i.font,r=0,a;for(i.font=e.string,a=0;a<n;++a)r=Math.max(i.measureText(s[a]).width,r);return i.font=o,{height:n*e.lineHeight,width:r}},bound:function(i,t,e){return Math.max(i,Math.min(t,e))},arrayDiff:function(i,t){var e=i.slice(),s=[],n,o,r,a;for(n=0,r=t.length;n<r;++n)a=t[n],o=e.indexOf(a),o===-1?s.push([a,1]):e.splice(o,1);for(n=0,r=e.length;n<r;++n)s.push([e[n],-1]);return s},rasterize:function(i){return Math.round(i*ln)/ln}};function fi(i,t){var e=t.x,s=t.y;if(e===null)return{x:0,y:-1};if(s===null)return{x:1,y:0};var n=i.x-e,o=i.y-s,r=Math.sqrt(n*n+o*o);return{x:r?n/r:0,y:r?o/r:-1}}function Bc(i,t,e,s,n){switch(n){case"center":e=s=0;break;case"bottom":e=0,s=1;break;case"right":e=1,s=0;break;case"left":e=-1,s=0;break;case"top":e=0,s=-1;break;case"start":e=-e,s=-s;break;case"end":break;default:n*=Math.PI/180,e=Math.cos(n),s=Math.sin(n);break}return{x:i,y:t,vx:e,vy:s}}var Hc=0,to=1,eo=2,io=4,so=8;function Re(i,t,e){var s=Hc;return i<e.left?s|=to:i>e.right&&(s|=eo),t<e.top?s|=so:t>e.bottom&&(s|=io),s}function Wc(i,t){for(var e=i.x0,s=i.y0,n=i.x1,o=i.y1,r=Re(e,s,t),a=Re(n,o,t),l,c,h;!(!(r|a)||r&a);)l=r||a,l&so?(c=e+(n-e)*(t.top-s)/(o-s),h=t.top):l&io?(c=e+(n-e)*(t.bottom-s)/(o-s),h=t.bottom):l&eo?(h=s+(o-s)*(t.right-e)/(n-e),c=t.right):l&to&&(h=s+(o-s)*(t.left-e)/(n-e),c=t.left),l===r?(e=c,s=h,r=Re(e,s,t)):(n=c,o=h,a=Re(n,o,t));return{x0:e,x1:n,y0:s,y1:o}}function Le(i,t){var e=t.anchor,s=i,n,o;return t.clamp&&(s=Wc(s,t.area)),e==="start"?(n=s.x0,o=s.y0):e==="end"?(n=s.x1,o=s.y1):(n=(s.x0+s.x1)/2,o=(s.y0+s.y1)/2),Bc(n,o,i.vx,i.vy,t.align)}var Ie={arc:function(i,t){var e=(i.startAngle+i.endAngle)/2,s=Math.cos(e),n=Math.sin(e),o=i.innerRadius,r=i.outerRadius;return Le({x0:i.x+s*o,y0:i.y+n*o,x1:i.x+s*r,y1:i.y+n*r,vx:s,vy:n},t)},point:function(i,t){var e=fi(i,t.origin),s=e.x*i.options.radius,n=e.y*i.options.radius;return Le({x0:i.x-s,y0:i.y-n,x1:i.x+s,y1:i.y+n,vx:e.x,vy:e.y},t)},bar:function(i,t){var e=fi(i,t.origin),s=i.x,n=i.y,o=0,r=0;return i.horizontal?(s=Math.min(i.x,i.base),o=Math.abs(i.base-i.x)):(n=Math.min(i.y,i.base),r=Math.abs(i.base-i.y)),Le({x0:s,y0:n+r,x1:s+o,y1:n,vx:e.x,vy:e.y},t)},fallback:function(i,t){var e=fi(i,t.origin);return Le({x0:i.x,y0:i.y,x1:i.x+(i.width||0),y1:i.y+(i.height||0),vx:e.x,vy:e.y},t)}},mt=le.rasterize;function Nc(i){var t=i.borderWidth||0,e=i.padding,s=i.size.height,n=i.size.width,o=-n/2,r=-s/2;return{frame:{x:o-e.left-t,y:r-e.top-t,w:n+e.width+t*2,h:s+e.height+t*2},text:{x:o,y:r,w:n,h:s}}}function Vc(i,t){var e=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!e)return null;if(e.xCenter!==void 0&&e.yCenter!==void 0)return{x:e.xCenter,y:e.yCenter};var s=e.getBasePixel();return i.horizontal?{x:s,y:null}:{x:null,y:s}}function jc(i){return i instanceof ie?Ie.arc:i instanceof Be?Ie.point:i instanceof He?Ie.bar:Ie.fallback}function $c(i,t,e,s,n,o){var r=Math.PI/2;if(o){var a=Math.min(o,n/2,s/2),l=t+a,c=e+a,h=t+s-a,d=e+n-a;i.moveTo(t,c),l<h&&c<d?(i.arc(l,c,a,-Math.PI,-r),i.arc(h,c,a,-r,0),i.arc(h,d,a,0,r),i.arc(l,d,a,r,Math.PI)):l<h?(i.moveTo(l,e),i.arc(h,c,a,-r,r),i.arc(l,c,a,r,Math.PI+r)):c<d?(i.arc(l,c,a,-Math.PI,0),i.arc(l,d,a,0,Math.PI)):i.arc(l,c,a,-Math.PI,Math.PI),i.closePath(),i.moveTo(t,e)}else i.rect(t,e,s,n)}function Yc(i,t,e){var s=e.backgroundColor,n=e.borderColor,o=e.borderWidth;!s&&(!n||!o)||(i.beginPath(),$c(i,mt(t.x)+o/2,mt(t.y)+o/2,mt(t.w)-o,mt(t.h)-o,e.borderRadius),i.closePath(),s&&(i.fillStyle=s,i.fill()),n&&o&&(i.strokeStyle=n,i.lineWidth=o,i.lineJoin="miter",i.stroke()))}function Uc(i,t,e){var s=e.lineHeight,n=i.w,o=i.x,r=i.y+s/2;return t==="center"?o+=n/2:(t==="end"||t==="right")&&(o+=n),{h:s,w:n,x:o,y:r}}function Xc(i,t,e){var s=i.shadowBlur,n=e.stroked,o=mt(e.x),r=mt(e.y),a=mt(e.w);n&&i.strokeText(t,o,r,a),e.filled&&(s&&n&&(i.shadowBlur=0),i.fillText(t,o,r,a),s&&n&&(i.shadowBlur=s))}function Kc(i,t,e,s){var n=s.textAlign,o=s.color,r=!!o,a=s.font,l=t.length,c=s.textStrokeColor,h=s.textStrokeWidth,d=c&&h,f;if(!(!l||!r&&!d))for(e=Uc(e,n,a),i.font=a.string,i.textAlign=n,i.textBaseline="middle",i.shadowBlur=s.textShadowBlur,i.shadowColor=s.textShadowColor,r&&(i.fillStyle=o),d&&(i.lineJoin="round",i.lineWidth=h,i.strokeStyle=c),f=0,l=t.length;f<l;++f)Xc(i,t[f],{stroked:d,filled:r,w:e.w,x:e.x,y:e.y+e.h*f})}var no=function(i,t,e,s){var n=this;n._config=i,n._index=s,n._model=null,n._rects=null,n._ctx=t,n._el=e};ht(no.prototype,{_modelize:function(i,t,e,s){var n=this,o=n._index,r=Y(z([e.font,{}],s,o)),a=z([e.color,B.color],s,o);return{align:z([e.align,"center"],s,o),anchor:z([e.anchor,"center"],s,o),area:s.chart.chartArea,backgroundColor:z([e.backgroundColor,null],s,o),borderColor:z([e.borderColor,null],s,o),borderRadius:z([e.borderRadius,0],s,o),borderWidth:z([e.borderWidth,0],s,o),clamp:z([e.clamp,!1],s,o),clip:z([e.clip,!1],s,o),color:a,display:i,font:r,lines:t,offset:z([e.offset,4],s,o),opacity:z([e.opacity,1],s,o),origin:Vc(n._el,s),padding:tt(z([e.padding,4],s,o)),positioner:jc(n._el),rotation:z([e.rotation,0],s,o)*(Math.PI/180),size:le.textSize(n._ctx,t,r),textAlign:z([e.textAlign,"start"],s,o),textShadowBlur:z([e.textShadowBlur,0],s,o),textShadowColor:z([e.textShadowColor,a],s,o),textStrokeColor:z([e.textStrokeColor,a],s,o),textStrokeWidth:z([e.textStrokeWidth,0],s,o)}},update:function(i){var t=this,e=null,s=null,n=t._index,o=t._config,r,a,l,c=z([o.display,!0],i,n);c&&(r=i.dataset.data[n],a=D(F(o.formatter,[r,i]),r),l=R(a)?[]:le.toTextLines(a),l.length&&(e=t._modelize(c,l,o,i),s=Nc(e))),t._model=e,t._rects=s},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(i,t){var e=this,s=i.ctx,n=e._model,o=e._rects,r;this.visible()&&(s.save(),n.clip&&(r=n.area,s.beginPath(),s.rect(r.left,r.top,r.right-r.left,r.bottom-r.top),s.clip()),s.globalAlpha=le.bound(0,n.opacity,1),s.translate(mt(t.x),mt(t.y)),s.rotate(n.rotation),Yc(s,o.frame,n),Kc(s,n.lines,o.text,n),s.restore())}});var qc=Number.MIN_SAFE_INTEGER||-9007199254740991,Gc=Number.MAX_SAFE_INTEGER||9007199254740991;function Qt(i,t,e){var s=Math.cos(e),n=Math.sin(e),o=t.x,r=t.y;return{x:o+s*(i.x-o)-n*(i.y-r),y:r+n*(i.x-o)+s*(i.y-r)}}function cn(i,t){var e=Gc,s=qc,n=t.origin,o,r,a,l,c;for(o=0;o<i.length;++o)r=i[o],a=r.x-n.x,l=r.y-n.y,c=t.vx*a+t.vy*l,e=Math.min(e,c),s=Math.max(s,c);return{min:e,max:s}}function Fe(i,t){var e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);return{vx:(t.x-i.x)/n,vy:(t.y-i.y)/n,origin:i,ln:n}}var oo=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};ht(oo.prototype,{center:function(){var i=this._rect;return{x:i.x+i.w/2,y:i.y+i.h/2}},update:function(i,t,e){this._rotation=e,this._rect={x:t.x+i.x,y:t.y+i.y,w:t.w,h:t.h}},contains:function(i){var t=this,e=1,s=t._rect;return i=Qt(i,t.center(),-t._rotation),!(i.x<s.x-e||i.y<s.y-e||i.x>s.x+s.w+e*2||i.y>s.y+s.h+e*2)},intersects:function(i){var t=this._points(),e=i._points(),s=[Fe(t[0],t[1]),Fe(t[0],t[3])],n,o,r;for(this._rotation!==i._rotation&&s.push(Fe(e[0],e[1]),Fe(e[0],e[3])),n=0;n<s.length;++n)if(o=cn(t,s[n]),r=cn(e,s[n]),o.max<r.min||r.max<o.min)return!1;return!0},_points:function(){var i=this,t=i._rect,e=i._rotation,s=i.center();return[Qt({x:t.x,y:t.y},s,e),Qt({x:t.x+t.w,y:t.y},s,e),Qt({x:t.x+t.w,y:t.y+t.h},s,e),Qt({x:t.x,y:t.y+t.h},s,e)]}});function ro(i,t,e){var s=t.positioner(i,t),n=s.vx,o=s.vy;if(!n&&!o)return{x:s.x,y:s.y};var r=e.w,a=e.h,l=t.rotation,c=Math.abs(r/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),h=Math.abs(r/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),d=1/Math.max(Math.abs(n),Math.abs(o));return c*=n*d,h*=o*d,c+=t.offset*n,h+=t.offset*o,{x:s.x+c,y:s.y+h}}function Zc(i,t){var e,s,n,o;for(e=i.length-1;e>=0;--e)for(n=i[e].$layout,s=e-1;s>=0&&n._visible;--s)o=i[s].$layout,o._visible&&n._box.intersects(o._box)&&t(n,o);return i}function Jc(i){var t,e,s,n,o,r,a;for(t=0,e=i.length;t<e;++t)s=i[t],n=s.$layout,n._visible&&(a=new Proxy(s._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=s.geometry(),r=ro(a,s.model(),o),n._box.update(r,o,s.rotation()));return Zc(i,function(l,c){var h=l._hidable,d=c._hidable;h&&d||d?c._visible=!1:h&&(l._visible=!1)})}var ce={prepare:function(i){var t=[],e,s,n,o,r;for(e=0,n=i.length;e<n;++e)for(s=0,o=i[e].length;s<o;++s)r=i[e][s],t.push(r),r.$layout={_box:new oo,_hidable:!1,_visible:!0,_set:e,_idx:r._index};return t.sort(function(a,l){var c=a.$layout,h=l.$layout;return c._idx===h._idx?h._set-c._set:h._idx-c._idx}),this.update(t),t},update:function(i){var t=!1,e,s,n,o,r;for(e=0,s=i.length;e<s;++e)n=i[e],o=n.model(),r=n.$layout,r._hidable=o&&o.display==="auto",r._visible=n.visible(),t|=r._hidable;t&&Jc(i)},lookup:function(i,t){var e,s;for(e=i.length-1;e>=0;--e)if(s=i[e].$layout,s&&s._visible&&s._box.contains(t))return i[e];return null},draw:function(i,t){var e,s,n,o,r,a;for(e=0,s=t.length;e<s;++e)n=t[e],o=n.$layout,o._visible&&(r=n.geometry(),a=ro(n._el,n.model(),r),o._box.update(a,r,n.rotation()),n.draw(i,a))}},Qc=function(i){if(R(i))return null;var t=i,e,s,n;if(T(i))if(!R(i.label))t=i.label;else if(!R(i.r))t=i.r;else for(t="",e=Object.keys(i),n=0,s=e.length;n<s;++n)t+=(n!==0?", ":"")+e[n]+": "+i[e[n]];return""+t},th={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:Qc,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},Z="$datalabels",ao="$default";function eh(i,t){var e=i.datalabels,s={},n=[],o,r;return e===!1?null:(e===!0&&(e={}),t=ht({},[t,e]),o=t.labels||{},r=Object.keys(o),delete t.labels,r.length?r.forEach(function(a){o[a]&&n.push(ht({},[t,o[a],{_key:a}]))}):n.push(t),s=n.reduce(function(a,l){return L(l.listeners||{},function(c,h){a[h]=a[h]||{},a[h][l._key||ao]=c}),delete l.listeners,a},{}),{labels:n,listeners:s})}function wi(i,t,e,s){if(t){var n=e.$context,o=e.$groups,r;t[o._set]&&(r=t[o._set][o._key],r&&F(r,[n,s])===!0&&(i[Z]._dirty=!0,e.update(n)))}}function ih(i,t,e,s,n){var o,r;!e&&!s||(e?s?e!==s&&(r=o=!0):r=!0:o=!0,r&&wi(i,t.leave,e,n),o&&wi(i,t.enter,s,n))}function sh(i,t){var e=i[Z],s=e._listeners,n,o;if(!(!s.enter&&!s.leave)){if(t.type==="mousemove")o=ce.lookup(e._labels,t);else if(t.type!=="mouseout")return;n=e._hovered,e._hovered=o,ih(i,s,n,o,t)}}function nh(i,t){var e=i[Z],s=e._listeners.click,n=s&&ce.lookup(e._labels,t);n&&wi(i,s,n,t)}var hh={id:"datalabels",defaults:th,beforeInit:function(i){i[Z]={_actives:[]}},beforeUpdate:function(i){var t=i[Z];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(i,t,e){var s=t.index,n=i[Z],o=n._datasets[s]=[],r=i.isDatasetVisible(s),a=i.data.datasets[s],l=eh(a,e),c=t.meta.data||[],h=i.ctx,d,f,u,p,g,m,b,_;for(h.save(),d=0,u=c.length;d<u;++d)if(b=c[d],b[Z]=[],r&&b&&i.getDataVisibility(d)&&!b.skip)for(f=0,p=l.labels.length;f<p;++f)g=l.labels[f],m=g._key,_=new no(g,h,b,d),_.$groups={_set:s,_key:m||ao},_.$context={active:!1,chart:i,dataIndex:d,dataset:a,datasetIndex:s},_.update(_.$context),b[Z].push(_),o.push(_);h.restore(),ht(n._listeners,l.listeners,{merger:function(y,v,x){v[y]=v[y]||{},v[y][t.index]=x[y],n._listened=!0}})},afterUpdate:function(i){i[Z]._labels=ce.prepare(i[Z]._datasets)},afterDatasetsDraw:function(i){ce.draw(i,i[Z]._labels)},beforeEvent:function(i,t){if(i[Z]._listened){var e=t.event;switch(e.type){case"mousemove":case"mouseout":sh(i,e);break;case"click":nh(i,e);break}}},afterEvent:function(i){var t=i[Z],e=t._actives,s=t._actives=i.getActiveElements(),n=le.arrayDiff(e,s),o,r,a,l,c,h,d;for(o=0,r=n.length;o<r;++o)if(c=n[o],c[1])for(d=c[0].element[Z]||[],a=0,l=d.length;a<l;++a)h=d[a],h.$context.active=c[1]===1,h.update(h.$context);(t._dirty||n.length)&&(ce.update(t._labels),i.render()),delete t._dirty}};export{ni as B,Dt as C,oi as L,Be as P,He as a,At as b,lh as c,ch as d,Js as e,tn as f,hh as g,rh as i,ah as p};