@stigg/react-sdk 7.27.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,162 +0,0 @@
1
- import {e,i,b,a,c,v,u,I as I$1,K,w,q,f,o,k}from'./chunk-4YPINBLC.esm.js';import kl,{forwardRef,useRef,useEffect,useState,useMemo,useCallback}from'react';import {CreditUsageTimeRange}from'@stigg/js-client-sdk';import Bl from'lodash/isEmpty.js';import Qg from'@mui/material/Box/index.js';import tp from'lodash/debounce.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Pp from'react-loading-skeleton';import _p from'@mui/material/MenuItem/index.js';import vp from'@mui/material/OutlinedInput/index.js';import wp from'@mui/material/Select/index.js';function pt(){}var Ji=(function(){let n=0;return function(){return n++}})();function A(n){return n===null||typeof n=="undefined"}function E(n){if(Array.isArray&&Array.isArray(n))return true;let t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function P(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}var V=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function st(n,t){return V(n)?n:t}function C(n,t){return typeof n=="undefined"?t:n}var Zi=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/t,Wn=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function L(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function I(n,t,e,i){let s,o,r;if(E(n))if(o=n.length,i);else for(s=0;s<o;s++)t.call(e,n[s],s);else if(P(n))for(r=Object.keys(n),o=r.length,s=0;s<o;s++)t.call(e,n[r[s]],r[s]);}function Oe(n,t){let e,i,s,o;if(!n||!t||n.length!==t.length)return false;for(e=0,i=n.length;e<i;++e)if(s=n[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return false;return true}function en(n){if(E(n))return n.map(en);if(P(n)){let t=Object.create(null),e=Object.keys(n),i=e.length,s=0;for(;s<i;++s)t[e[s]]=en(n[e[s]]);return t}return n}function Vo(n){return ["__proto__","prototype","constructor"].indexOf(n)===-1}function $o(n,t,e,i){if(!Vo(n))return;let s=t[n],o=e[n];P(s)&&P(o)?lt(s,o,i):t[n]=en(o);}function lt(n,t,e){let i=E(t)?t:[t],s=i.length;if(!P(n))return n;e=e||{};let o=e.merger||$o;for(let r=0;r<s;++r){if(t=i[r],!P(t))continue;let a=Object.keys(t);for(let l=0,c=a.length;l<c;++l)o(a[l],n,t,e);}return n}function ae(n,t){return lt(n,t,{merger:Yo})}function Yo(n,t,e){if(!Vo(n))return;let i=t[n],s=e[n];P(i)&&P(s)?ae(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=en(s));}var Ao={"":n=>n,x:n=>n.x,y:n=>n.y};function _t(n,t){return (Ao[t]||(Ao[t]=Gl(t)))(n)}function Gl(n){let t=Uo(n);return e=>{for(let i of t){if(i==="")break;e=e&&e[i];}return e}}function Uo(n){let t=n.split("."),e=[],i="";for(let s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function sn(n){return n.charAt(0).toUpperCase()+n.slice(1)}var H=n=>typeof n!="undefined",tt=n=>typeof n=="function",Nn=(n,t)=>{if(n.size!==t.size)return false;for(let e of n)if(!t.has(e))return false;return true};function Qi(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}var O=Math.PI,z=2*O,Xo=z+O,nn=Number.POSITIVE_INFINITY,on=O/180,W=O/2,ut=O/4,Te=O*2/3,ot=Math.log10,ft=Math.sign;function jn(n){let t=Math.round(n);n=le(n,t,n/1e3)?t:n;let e=Math.pow(10,Math.floor(ot(n))),i=n/e;return (i<=1?1:i<=2?2:i<=5?5:10)*e}function ts(n){let t=[],e=Math.sqrt(n),i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function ct(n){return !isNaN(parseFloat(n))&&isFinite(n)}function le(n,t,e){return Math.abs(n-t)<e}function es(n,t){let e=Math.round(n);return e-t<=n&&e+t>=n}function Hn(n,t,e){let i,s,o;for(i=0,s=n.length;i<s;i++)o=n[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o));}function U(n){return n*(O/180)}function ce(n){return n*(180/O)}function Vn(n){if(!V(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function $n(n,t){let e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i),o=Math.atan2(i,e);return o<-0.5*O&&(o+=z),{angle:o,distance:s}}function Dt(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Ko(n,t){return (n-t+Xo)%z-O}function nt(n){return (n%z+z)%z}function he(n,t,e,i){let s=nt(n),o=nt(t),r=nt(e),a=nt(o-s),l=nt(r-s),c=nt(s-o),h=nt(s-r);return s===o||s===r||i&&o===r||a>l&&c<h}function Z(n,t,e){return Math.max(t,Math.min(e,n))}function ns(n){return Z(n,-32768,32767)}function mt(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function rn(n,t,e){e=e||(r=>n[r]<t);let i=n.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,e(o)?s=o:i=o;return {lo:s,hi:i}}var Tt=(n,t,e,i)=>rn(n,e,i?s=>n[s][t]<=e:s=>n[s][t]<e),is=(n,t,e)=>rn(n,e,i=>n[i][t]>=e);function ss(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}var Go=["push","pop","shift","splice","unshift"];function os(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:true,enumerable:false,value:{listeners:[t]}}),Go.forEach(e=>{let i="_onData"+sn(e),s=n[e];Object.defineProperty(n,e,{configurable:true,enumerable:false,value(...o){let r=s.apply(this,o);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o);}),r}});});}function Yn(n,t){let e=n._chartjs;if(!e)return;let i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Go.forEach(o=>{delete n[o];}),delete n._chartjs);}function Un(n){let t=new Set,e,i;for(e=0,i=n.length;e<i;++e)t.add(n[e]);return t.size===i?n:Array.from(t)}var Xn=(function(){return typeof window=="undefined"?function(n){return n()}:window.requestAnimationFrame})();function Kn(n,t,e){let i=e||(r=>Array.prototype.slice.call(r)),s=false,o=[];return function(...r){o=i(r),s||(s=true,Xn.call(window,()=>{s=false,n.apply(t,o);}));}}function rs(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}var an=n=>n==="start"?"left":n==="end"?"right":"center",Q=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,as=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Gn(n,t,e){let i=t.length,s=0,o=i;if(n._sorted){let{iScale:r,_parsed:a}=n,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(s=Z(Math.min(Tt(a,r.axis,c).lo,e?i:Tt(t,l,r.getPixelForValue(c)).lo),0,i-1)),u?o=Z(Math.max(Tt(a,r.axis,h,true).hi+1,e?0:Tt(t,l,r.getPixelForValue(h),true).hi+1),s,i)-s:o=i-s;}return {start:s,count:o}}function qn(n){let{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,true;let o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),o}var En=n=>n===0||n===1,Oo=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*z/e)),Eo=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*z/e)+1,se={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-0.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-0.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*W)+1,easeOutSine:n=>Math.sin(n*W),easeInOutSine:n=>-0.5*(Math.cos(O*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>En(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-0.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>En(n)?n:Oo(n,.075,.3),easeOutElastic:n=>En(n)?n:Eo(n,.075,.3),easeInOutElastic(n){return En(n)?n:n<.5?.5*Oo(n*2,.1125,.45):.5+.5*Eo(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return (n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return (n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-se.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?se.easeInBounce(n*2)*.5:se.easeOutBounce(n*2-1)*.5+.5};function ln(n){return n+.5|0}var jt=(n,t,e)=>Math.max(Math.min(n,e),t);function Qe(n){return jt(ln(n*2.55),0,255)}function Ht(n){return jt(ln(n*255),0,255)}function kt(n){return jt(ln(n/2.55)/100,0,1)}function Ro(n){return jt(ln(n*100),0,100)}var dt={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},Ki=[..."0123456789ABCDEF"],ql=n=>Ki[n&15],Jl=n=>Ki[(n&240)>>4]+Ki[n&15],Rn=n=>(n&240)>>4===(n&15),Zl=n=>Rn(n.r)&&Rn(n.g)&&Rn(n.b)&&Rn(n.a);function Ql(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&dt[n[1]]*17,g:255&dt[n[2]]*17,b:255&dt[n[3]]*17,a:t===5?dt[n[4]]*17:255}:(t===7||t===9)&&(e={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:t===9?dt[n[7]]<<4|dt[n[8]]:255})),e}var tc=(n,t)=>n<255?t(n):"";function ec(n){var t=Zl(n)?ql:Jl;return n?"#"+t(n.r)+t(n.g)+t(n.b)+tc(n.a,t):void 0}var nc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function qo(n,t,e){let i=t*Math.min(e,1-e),s=(o,r=(o+n/30)%12)=>e-i*Math.max(Math.min(r-3,9-r,1),-1);return [s(0),s(8),s(4)]}function ic(n,t,e){let i=(s,o=(s+n/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return [i(5),i(3),i(1)]}function sc(n,t,e){let i=qo(n,1,.5),s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function oc(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function ls(n){let e=n.r/255,i=n.g/255,s=n.b/255,o=Math.max(e,i,s),r=Math.min(e,i,s),a=(o+r)/2,l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=oc(e,i,s,h,o),l=l*60+.5),[l|0,c||0,a]}function cs(n,t,e,i){return (Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Ht)}function hs(n,t,e){return cs(qo,n,t,e)}function rc(n,t,e){return cs(sc,n,t,e)}function ac(n,t,e){return cs(ic,n,t,e)}function Jo(n){return (n%360+360)%360}function lc(n){let t=nc.exec(n),e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Qe(+t[5]):Ht(+t[5]));let s=Jo(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=rc(s,o,r):t[1]==="hsv"?i=ac(s,o,r):i=hs(s,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function cc(n,t){var e=ls(n);e[0]=Jo(e[0]+t),e=hs(e),n.r=e[0],n.g=e[1],n.b=e[2];}function hc(n){if(!n)return;let t=ls(n),e=t[0],i=Ro(t[1]),s=Ro(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${kt(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}var Lo={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"},Io={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 dc(){let n={},t=Object.keys(Io),e=Object.keys(Lo),i,s,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],s=0;s<e.length;s++)o=e[s],a=a.replace(o,Lo[o]);o=parseInt(Io[r],16),n[a]=[o>>16&255,o>>8&255,o&255];}return n}var Ln;function uc(n){Ln||(Ln=dc(),Ln.transparent=[0,0,0,0]);let t=Ln[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var fc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function gc(n){let t=fc.exec(n),e=255,i,s,o;if(t){if(t[7]!==i){let r=+t[7];e=t[8]?Qe(r):jt(r*255,0,255);}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?Qe(i):jt(i,0,255)),s=255&(t[4]?Qe(s):jt(s,0,255)),o=255&(t[6]?Qe(o):jt(o,0,255)),{r:i,g:s,b:o,a:e}}}function pc(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${kt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}var Yi=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Pe=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function mc(n,t,e){let i=Pe(kt(n.r)),s=Pe(kt(n.g)),o=Pe(kt(n.b));return {r:Ht(Yi(i+e*(Pe(kt(t.r))-i))),g:Ht(Yi(s+e*(Pe(kt(t.g))-s))),b:Ht(Yi(o+e*(Pe(kt(t.b))-o))),a:n.a+e*(t.a-n.a)}}function In(n,t,e){if(n){let i=ls(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=hs(i),n.r=i[0],n.g=i[1],n.b=i[2];}}function Zo(n,t){return n&&Object.assign(t||{},n)}function Fo(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Ht(n[3]))):(t=Zo(n,{r:0,g:0,b:0,a:1}),t.a=Ht(t.a)),t}function bc(n){return n.charAt(0)==="r"?gc(n):lc(n)}var Gi=class n{constructor(t){if(t instanceof n)return t;let e=typeof t,i;e==="object"?i=Fo(t):e==="string"&&(i=Ql(t)||uc(t)||bc(t)),this._rgb=i,this._valid=!!i;}get valid(){return this._valid}get rgb(){var t=Zo(this._rgb);return t&&(t.a=kt(t.a)),t}set rgb(t){this._rgb=Fo(t);}rgbString(){return this._valid?pc(this._rgb):void 0}hexString(){return this._valid?ec(this._rgb):void 0}hslString(){return this._valid?hc(this._rgb):void 0}mix(t,e){if(t){let i=this.rgb,s=t.rgb,o,r=e===o?.5:e,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i;}return this}interpolate(t,e){return t&&(this._rgb=mc(this._rgb,t._rgb,e)),this}clone(){return new n(this.rgb)}alpha(t){return this._rgb.a=Ht(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=ln(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return In(this._rgb,2,t),this}darken(t){return In(this._rgb,2,-t),this}saturate(t){return In(this._rgb,1,t),this}desaturate(t){return In(this._rgb,1,-t),this}rotate(t){return cc(this._rgb,t),this}};function Qo(n){return new Gi(n)}function ds(n){if(n&&typeof n=="object"){let t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return false}function de(n){return ds(n)?n:Qo(n)}function zn(n){return ds(n)?n:Qo(n).saturate(.5).darken(.1).hexString()}var $t=Object.create(null),Jn=Object.create(null);function tn(n,t){if(!t)return n;let e=t.split(".");for(let i=0,s=e.length;i<s;++i){let o=e[i];n=n[o]||(n[o]=Object.create(null));}return n}function Ui(n,t,e){return typeof t=="string"?lt(tn(n,t),e):lt(tn(n,""),t)}var qi=class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,i)=>zn(i.backgroundColor),this.hoverBorderColor=(e,i)=>zn(i.borderColor),this.hoverColor=(e,i)=>zn(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:true,includeInvisible:false},this.maintainAspectRatio=true,this.onHover=null,this.onClick=null,this.parsing=true,this.plugins={},this.responsive=true,this.scale=void 0,this.scales={},this.showLine=true,this.drawActiveElementsOnTop=true,this.describe(t);}set(t,e){return Ui(this,t,e)}get(t){return tn(this,t)}describe(t,e){return Ui(Jn,t,e)}override(t,e){return Ui($t,t,e)}route(t,e,i,s){let o=tn(this,t),r=tn(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:true},[e]:{enumerable:true,get(){let l=this[a],c=r[s];return P(l)?Object.assign({},c,l):C(l,c)},set(l){this[a]=l;}}});}},D=new qi({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:false,_indexable:false}});function tr(n){return !n||A(n.size)||A(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function De(n,t,e,i,s){let o=t[s];return o||(o=t[s]=n.measureText(s).width,e.push(s)),o>i&&(i=o),i}function us(n,t,e,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let r=0,a=e.length,l,c,h,d,u;for(l=0;l<a;l++)if(d=e[l],d!=null&&E(d)!==true)r=De(n,s,o,r,d);else if(E(d))for(c=0,h=d.length;c<h;c++)u=d[c],u!=null&&!E(u)&&(r=De(n,s,o,r,u));n.restore();let f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f);}return r}function At(n,t,e){let i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Zn(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore();}function cn(n,t,e,i){Qn(n,t,e,i,null);}function Qn(n,t,e,i,s){let o,r,a,l,c,h,d=t.pointStyle,u=t.rotation,f=t.radius,g=(u||0)*on;if(d&&typeof d=="object"&&(o=d.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(g),n.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),n.restore();return}if(!(isNaN(f)||f<=0)){switch(n.beginPath(),d){default:s?n.ellipse(e,i,s/2,f,0,0,z):n.arc(e,i,f,0,z),n.closePath();break;case "triangle":n.moveTo(e+Math.sin(g)*f,i-Math.cos(g)*f),g+=Te,n.lineTo(e+Math.sin(g)*f,i-Math.cos(g)*f),g+=Te,n.lineTo(e+Math.sin(g)*f,i-Math.cos(g)*f),n.closePath();break;case "rectRounded":c=f*.516,l=f-c,r=Math.cos(g+ut)*l,a=Math.sin(g+ut)*l,n.arc(e-r,i-a,c,g-O,g-W),n.arc(e+a,i-r,c,g-W,g),n.arc(e+r,i+a,c,g,g+W),n.arc(e-a,i+r,c,g+W,g+O),n.closePath();break;case "rect":if(!u){l=Math.SQRT1_2*f,h=s?s/2:l,n.rect(e-h,i-l,2*h,2*l);break}g+=ut;case "rectRot":r=Math.cos(g)*f,a=Math.sin(g)*f,n.moveTo(e-r,i-a),n.lineTo(e+a,i-r),n.lineTo(e+r,i+a),n.lineTo(e-a,i+r),n.closePath();break;case "crossRot":g+=ut;case "cross":r=Math.cos(g)*f,a=Math.sin(g)*f,n.moveTo(e-r,i-a),n.lineTo(e+r,i+a),n.moveTo(e+a,i-r),n.lineTo(e-a,i+r);break;case "star":r=Math.cos(g)*f,a=Math.sin(g)*f,n.moveTo(e-r,i-a),n.lineTo(e+r,i+a),n.moveTo(e+a,i-r),n.lineTo(e-a,i+r),g+=ut,r=Math.cos(g)*f,a=Math.sin(g)*f,n.moveTo(e-r,i-a),n.lineTo(e+r,i+a),n.moveTo(e+a,i-r),n.lineTo(e-a,i+r);break;case "line":r=s?s/2:Math.cos(g)*f,a=Math.sin(g)*f,n.moveTo(e-r,i-a),n.lineTo(e+r,i+a);break;case "dash":n.moveTo(e,i),n.lineTo(e+Math.cos(g)*f,i+Math.sin(g)*f);break}n.fill(),t.borderWidth>0&&n.stroke();}}function re(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Yt(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip();}function Ut(n){n.restore();}function fs(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){let o=(t.x+e.x)/2;n.lineTo(o,t.y),n.lineTo(o,e.y);}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y);}function gs(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y);}function Ot(n,t,e,i,s,o={}){let r=E(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(n.save(),n.font=s.string,yc(n,o),l=0;l<r.length;++l)c=r[l],a&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),A(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(c,e,i,o.maxWidth)),n.fillText(c,e,i,o.maxWidth),xc(n,e,i,c,o),i+=s.lineHeight;n.restore();}function yc(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),A(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline);}function xc(n,t,e,i,s){if(s.strikethrough||s.underline){let o=n.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(r,h),n.lineTo(a,h),n.stroke();}}function Et(n,t){let{x:e,y:i,w:s,h:o,radius:r}=t;n.arc(e+r.topLeft,i+r.topLeft,r.topLeft,-W,O,true),n.lineTo(e,i+o-r.bottomLeft),n.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,O,W,true),n.lineTo(e+s-r.bottomRight,i+o),n.arc(e+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,W,0,true),n.lineTo(e+s,i+r.topRight),n.arc(e+s-r.topRight,i+r.topRight,r.topRight,0,-W,true),n.lineTo(e+r.topLeft,i);}var _c=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),vc=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function er(n,t){let e=(""+n).match(_c);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case "px":return n;case "%":n/=100;break}return t*n}var wc=n=>+n||0;function hn(n,t){let e={},i=P(t),s=i?Object.keys(t):t,o=P(n)?i?r=>C(n[r],n[t[r]]):r=>n[r]:()=>n;for(let r of s)e[r]=wc(o(r));return e}function ti(n){return hn(n,{top:"y",right:"x",bottom:"y",left:"x"})}function bt(n){return hn(n,["topLeft","topRight","bottomLeft","bottomRight"])}function $(n){let t=ti(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function N(n,t){n=n||{},t=t||D.font;let e=C(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=C(n.style,t.style);i&&!(""+i).match(vc)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");let s={family:C(n.family,t.family),lineHeight:er(C(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:C(n.weight,t.weight),string:""};return s.string=tr(s),s}function j(n,t,e,i){let o,r,a;for(o=0,r=n.length;o<r;++o)if(a=n[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),false),e!==void 0&&E(a)&&(a=a[e%a.length],false),a!==void 0))return a}function ps(n,t,e){let{min:i,max:s}=n,o=Wn(t,(s-i)/2),r=(a,l)=>e&&a===0?0:a+l;return {min:r(i,-Math.abs(o)),max:r(s,o)}}function vt(n,t){return Object.assign(Object.create(n),t)}function dn(n,t=[""],e=n,i,s=()=>n[0]){H(i)||(i=sr("_fallback",n));let o={[Symbol.toStringTag]:"Object",_cacheable:true,_scopes:n,_rootScopes:e,_fallback:i,_getTarget:s,override:r=>dn([r,...n],t,e,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],true},get(r,a){return nr(r,a,()=>Ac(a,t,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return Bo(r).includes(a)},ownKeys(r){return Bo(r)},set(r,a,l){let c=r._storage||(r._storage=s());return r[a]=c[a]=l,delete r._keys,true}})}function Vt(n,t,e,i){let s={_cacheable:false,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:ei(n,i),setContext:o=>Vt(n,o,e,i),override:o=>Vt(n.override(o),t,e,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete n[r],true},get(o,r,a){return nr(o,r,()=>Sc(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(n,r)?{enumerable:true,configurable:true}:void 0:Reflect.getOwnPropertyDescriptor(n,r)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,r){return Reflect.has(n,r)},ownKeys(){return Reflect.ownKeys(n)},set(o,r,a){return n[r]=a,delete o[r],true}})}function ei(n,t={scriptable:true,indexable:true}){let{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return {allKeys:s,scriptable:e,indexable:i,isScriptable:tt(e)?e:()=>e,isIndexable:tt(i)?i:()=>i}}var Mc=(n,t)=>n?n+sn(t):t,ms=(n,t)=>P(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function nr(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];let i=e();return n[t]=i,i}function Sc(n,t,e){let{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=n,a=i[t];return tt(a)&&r.isScriptable(t)&&(a=Cc(t,a,n,e)),E(a)&&a.length&&(a=kc(t,a,n,r.isIndexable)),ms(t,a)&&(a=Vt(a,s,o&&o[t],r)),a}function Cc(n,t,e,i){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);return a.add(n),t=t(o,r||i),a.delete(n),ms(n,t)&&(t=bs(s._scopes,s,n,t)),t}function kc(n,t,e,i){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(H(o.index)&&i(n))t=t[o.index%t.length];else if(P(t[0])){let l=t,c=s._scopes.filter(h=>h!==l);t=[];for(let h of l){let d=bs(c,s,n,h);t.push(Vt(d,o,r&&r[n],a));}}return t}function ir(n,t,e){return tt(n)?n(t,e):n}var Pc=(n,t)=>n===true?t:typeof n=="string"?_t(t,n):void 0;function Tc(n,t,e,i,s){for(let o of t){let r=Pc(e,o);if(r){n.add(r);let a=ir(r._fallback,e,s);if(H(a)&&a!==e&&a!==i)return a}else if(r===false&&H(i)&&e!==i)return null}return false}function bs(n,t,e,i){let s=t._rootScopes,o=ir(t._fallback,e,i),r=[...n,...s],a=new Set;a.add(i);let l=zo(a,r,e,o||e,i);return l===null||H(o)&&o!==e&&(l=zo(a,r,o,l,i),l===null)?false:dn(Array.from(a),[""],s,o,()=>Dc(t,e,i))}function zo(n,t,e,i,s){for(;e;)e=Tc(n,t,e,i,s);return e}function Dc(n,t,e){let i=n._getTarget();t in i||(i[t]={});let s=i[t];return E(s)&&P(e)?e:s}function Ac(n,t,e,i){let s;for(let o of t)if(s=sr(Mc(o,n),e),H(s))return ms(n,s)?bs(e,i,n,s):s}function sr(n,t){for(let e of t){if(!e)continue;let i=e[n];if(H(i))return i}}function Bo(n){let t=n._keys;return t||(t=n._keys=Oc(n._scopes)),t}function Oc(n){let t=new Set;for(let e of n)for(let i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function ni(n,t,e,i){let{iScale:s}=n,{key:o="r"}=this._parsing,r=new Array(i),a,l,c,h;for(a=0,l=i;a<l;++a)c=a+e,h=t[c],r[a]={r:s.parse(_t(h,o),c)};return r}var Ec=Number.EPSILON||1e-14,Ae=(n,t)=>t<n.length&&!n[t].skip&&n[t],or=n=>n==="x"?"y":"x";function rr(n,t,e,i){let s=n.skip?t:n,o=t,r=e.skip?t:e,a=Dt(o,s),l=Dt(r,o),c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let d=i*c,u=i*h;return {previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Rc(n,t,e){let i=n.length,s,o,r,a,l,c=Ae(n,0);for(let h=0;h<i-1;++h)if(l=c,c=Ae(n,h+1),!(!l||!c)){if(le(t[h],0,Ec)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=s*r*t[h],e[h+1]=o*r*t[h]);}}function Lc(n,t,e="x"){let i=or(e),s=n.length,o,r,a,l=Ae(n,0);for(let c=0;c<s;++c){if(r=a,a=l,l=Ae(n,c+1),!a)continue;let h=a[e],d=a[i];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${i}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${i}`]=d+o*t[c]);}}function ar(n,t="x"){let e=or(t),i=n.length,s=Array(i).fill(0),o=Array(i),r,a,l,c=Ae(n,0);for(r=0;r<i;++r)if(a=l,l=c,c=Ae(n,r+1),!!l){if(c){let h=c[t]-l[t];s[r]=h!==0?(c[e]-l[e])/h:0;}o[r]=a?c?ft(s[r-1])!==ft(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r];}Rc(n,s,o),Lc(n,o,t);}function Fn(n,t,e){return Math.max(Math.min(n,e),t)}function Ic(n,t){let e,i,s,o,r,a=re(n[0],t);for(e=0,i=n.length;e<i;++e)r=o,o=a,a=e<i-1&&re(n[e+1],t),o&&(s=n[e],r&&(s.cp1x=Fn(s.cp1x,t.left,t.right),s.cp1y=Fn(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Fn(s.cp2x,t.left,t.right),s.cp2y=Fn(s.cp2y,t.top,t.bottom)));}function ys(n,t,e,i,s){let o,r,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")ar(n,s);else {let c=i?n[n.length-1]:n[0];for(o=0,r=n.length;o<r;++o)a=n[o],l=rr(c,a,n[Math.min(o+1,r-(i?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&&Ic(n,e);}function ii(){return typeof window!="undefined"&&typeof document!="undefined"}function un(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Bn(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}var si=n=>window.getComputedStyle(n,null);function lr(n,t){return si(n).getPropertyValue(t)}var Fc=["top","right","bottom","left"];function oe(n,t,e){let i={};e=e?"-"+e:"";for(let s=0;s<4;s++){let o=Fc[s];i[o]=parseFloat(n[t+"-"+o+e])||0;}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var zc=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Bc(n,t){let e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i,r=false,a,l;if(zc(s,o,n.target))a=s,l=o;else {let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=true;}return {x:a,y:l,box:r}}function Rt(n,t){if("native"in n)return n;let{canvas:e,currentDevicePixelRatio:i}=t,s=si(e),o=s.boxSizing==="border-box",r=oe(s,"padding"),a=oe(s,"border","width"),{x:l,y:c,box:h}=Bc(n,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top),{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/f*e.width/i),y:Math.round((c-u)/g*e.height/i)}}function Wc(n,t,e){let i,s;if(t===void 0||e===void 0){let o=un(n);if(!o)t=n.clientWidth,e=n.clientHeight;else {let r=o.getBoundingClientRect(),a=si(o),l=oe(a,"border","width"),c=oe(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,i=Bn(a.maxWidth,o,"clientWidth"),s=Bn(a.maxHeight,o,"clientHeight");}}return {width:t,height:e,maxWidth:i||nn,maxHeight:s||nn}}var Xi=n=>Math.round(n*10)/10;function xs(n,t,e,i){let s=si(n),o=oe(s,"margin"),r=Bn(s.maxWidth,n,"clientWidth")||nn,a=Bn(s.maxHeight,n,"clientHeight")||nn,l=Wc(n,t,e),{width:c,height:h}=l;if(s.boxSizing==="content-box"){let d=oe(s,"border","width"),u=oe(s,"padding");c-=u.width+d.width,h-=u.height+d.height;}return c=Math.max(0,c-o.width),h=Math.max(0,i?Math.floor(c/i):h-o.height),c=Xi(Math.min(c,r,l.maxWidth)),h=Xi(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Xi(c/2)),{width:c,height:h}}function oi(n,t,e){let i=t||1,s=Math.floor(n.height*i),o=Math.floor(n.width*i);n.height=s/i,n.width=o/i;let r=n.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${n.height}px`,r.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(n.currentDevicePixelRatio=i,r.height=s,r.width=o,n.ctx.setTransform(i,0,0,i,0,0),true):false}var _s=(function(){let n=false;try{let t={get passive(){return n=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t);}catch(t){}return n})();function ri(n,t){let e=lr(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Pt(n,t,e,i){return {x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function vs(n,t,e,i){return {x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function ws(n,t,e,i){let s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},r=Pt(n,s,e),a=Pt(s,o,e),l=Pt(o,t,e),c=Pt(r,a,e),h=Pt(a,l,e);return Pt(c,h,e)}var Wo=new Map;function Nc(n,t){t=t||{};let e=n+JSON.stringify(t),i=Wo.get(e);return i||(i=new Intl.NumberFormat(n,t),Wo.set(e,i)),i}function ue(n,t,e){return Nc(t,e).format(n)}var jc=function(n,t){return {x(e){return n+n+t-e},setWidth(e){t=e;},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Hc=function(){return {x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Xt(n,t,e){return n?jc(t,e):Hc()}function ai(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i);}function li(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]));}function cr(n){return n==="angle"?{between:he,compare:Ko,normalize:nt}:{between:mt,compare:(t,e)=>t-e,normalize:t=>t}}function No({start:n,end:t,count:e,loop:i,style:s}){return {start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function Vc(n,t,e){let{property:i,start:s,end:o}=e,{between:r,normalize:a}=cr(i),l=t.length,{start:c,end:h,loop:d}=n,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&r(a(t[c%l][i]),s,o);++u)c--,h--;c%=l,h%=l;}return h<c&&(h+=l),{start:c,end:h,loop:d,style:n.style}}function ci(n,t,e){if(!e)return [n];let{property:i,start:s,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=cr(i),{start:h,end:d,loop:u,style:f}=Vc(n,t,e),g=[],p=false,m=null,b,y,x,_=()=>l(s,x,b)&&a(s,x)!==0,v=()=>a(o,b)===0||l(o,x,b),M=()=>p||_(),w=()=>!p||v();for(let k=h,S=h;k<=d;++k)y=t[k%r],!y.skip&&(b=c(y[i]),b!==x&&(p=l(b,s,o),m===null&&M()&&(m=a(b,s)===0?k:S),m!==null&&w()&&(g.push(No({start:m,end:k,loop:u,count:r,style:f})),m=null),S=k,x=b));return m!==null&&g.push(No({start:m,end:d,loop:u,count:r,style:f})),g}function hi(n,t){let e=[],i=n.segments;for(let s=0;s<i.length;s++){let o=ci(i[s],n.points,t);o.length&&e.push(...o);}return e}function $c(n,t,e,i){let s=0,o=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&n[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Yc(n,t,e,i){let s=n.length,o=[],r=t,a=n[t],l;for(l=t+1;l<=e;++l){let c=n[l%s];c.skip||c.stop?a.skip||(i=false,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c;}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function Ms(n,t){let e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return [];let o=!!n._loop,{start:r,end:a}=$c(e,s,o,i);if(i===true)return jo(n,[{start:r,end:a,loop:o}],e,t);let l=a<r?a+s:a,c=!!n._fullLoop&&r===0&&a===s-1;return jo(n,Yc(e,r,l,c),e,t)}function jo(n,t,e,i){return !i||!i.setContext||!e?t:Uc(n,t,e,i)}function Uc(n,t,e,i){let s=n._chart.getContext(),o=Ho(n.options),{_datasetIndex:r,options:{spanGaps:a}}=n,l=e.length,c=[],h=o,d=t[0].start,u=d;function f(g,p,m,b){let y=a?-1:1;if(g!==p){for(g+=l;e[g%l].skip;)g-=y;for(;e[p%l].skip;)p+=y;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:m,style:b}),h=b,d=p%l);}}for(let g of t){d=a?d:g.start;let p=e[d%l],m;for(u=d+1;u<=g.end;u++){let b=e[u%l];m=Ho(i.setContext(vt(s,{type:"segment",p0:p,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),Xc(m,h)&&f(d,u-1,g.loop,h),p=b,h=m;}d<u-1&&f(d,u-1,g.loop,h);}return c}function Ho(n){return {backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Xc(n,t){return t&&JSON.stringify(n)!==JSON.stringify(t)}var Rs=class{constructor(){this._request=null,this._charts=new Map,this._running=false,this._lastDate=void 0;}_notify(t,e,i,s){let o=e.listeners[s],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}));}_refresh(){this._request||(this._running=true,this._request=Xn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh();}));}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let o=i.items,r=o.length-1,a=false,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=true):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=false,this._notify(s,i,t,"complete"),i.initial=false),e+=o.length;}),this._lastDate=t,e===0&&(this._running=false);}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:false,initial:true,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i);}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e);}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=true,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh());}running(t){if(!this._running)return false;let e=this._charts.get(t);return !(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete");}remove(t){return this._charts.delete(t)}},Lt=new Rs,hr="transparent",Kc={boolean(n,t,e){return e>.5?t:n},color(n,t,e){let i=de(n||hr),s=i.valid&&de(t||hr);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}},Ls=class{constructor(t,e,i,s){let o=e[i];s=j([t.to,s,o,t.from]);let r=j([t.from,o,s]);this._active=true,this._fn=t.fn||Kc[t.type||typeof r],this._easing=se[t.easing]||se.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=s,this._promises=void 0;}active(){return this._active}update(t,e,i){if(this._active){this._notify(false);let s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=j([t.to,e,s,t.from]),this._from=j([t.from,s,e]);}}cancel(){this._active&&(this.tick(Date.now()),this._active=false,this._notify(false));}tick(t){let e=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||e<i),!this._active){this._target[s]=a,this._notify(true);return}if(e<0){this._target[s]=o;return}l=e/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l);}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i});})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]();}},Gc=["x","y","borderWidth","radius","tension"],qc=["color","borderColor","backgroundColor"];D.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});var Jc=Object.keys(D.animation);D.describe("animation",{_fallback:false,_indexable:false,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});D.set("animations",{colors:{type:"color",properties:qc},numbers:{type:"number",properties:Gc}});D.describe("animations",{_fallback:"animation"});D.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:n=>n|0}}}});var Le=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e);}configure(t){if(!P(t))return;let e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{let s=t[i];if(!P(s))return;let o={};for(let r of Jc)o[r]=s[r];(E(s.properties)&&s.properties||[i]).forEach(r=>{(r===i||!e.has(r))&&e.set(r,o);});});}_animateOptions(t,e){let i=e.options,s=Qc(t,i);if(!s)return [];let o=this._createAnimations(s,i);return i.$shared&&Zc(t.options.$animations,i).then(()=>{t.options=i;},()=>{}),o}_createAnimations(t,e){let i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}let h=e[c],d=o[c],u=i.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new Ls(u,t,c,h),s.push(d);}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return Lt.add(this._chart,i),true}};function Zc(n,t){let e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){let o=n[i[s]];o&&o.active()&&e.push(o.wait());}return Promise.all(e)}function Qc(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:false,$animations:{}})),e}function dr(n,t){let e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return {start:i?o:s,end:i?s:o}}function th(n,t,e){if(e===false)return false;let i=dr(n,e),s=dr(t,e);return {top:s.end,right:i.end,bottom:s.start,left:i.start}}function eh(n){let t,e,i,s;return P(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===false}}function ta(n,t){let e=[],i=n._getSortedDatasetMetas(t),s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function ur(n,t,e,i={}){let s=n.keys,o=i.mode==="single",r,a,l,c;if(t!==null){for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===e){if(i.all)continue;break}c=n.values[l],V(c)&&(o||t===0||ft(t)===ft(c))&&(t+=c);}return t}}function nh(n){let t=Object.keys(n),e=new Array(t.length),i,s,o;for(i=0,s=t.length;i<s;++i)o=t[i],e[i]={x:o,y:n[o]};return e}function fr(n,t){let e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function ih(n,t,e){return `${n.id}.${t.id}.${e.stack||e.type}`}function sh(n){let{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return {min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function oh(n,t,e){let i=n[t]||(n[t]={});return i[e]||(i[e]={})}function gr(n,t,e,i){for(let s of t.getMatchingVisibleMetas(i).reverse()){let o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function pr(n,t){let{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,h=ih(o,r,i),d=t.length,u;for(let f=0;f<d;++f){let g=t[f],{[l]:p,[c]:m}=g,b=g._stacks||(g._stacks={});u=b[c]=oh(s,h,p),u[a]=m,u._top=gr(u,r,true,i.type),u._bottom=gr(u,r,false,i.type);}}function Ss(n,t){let e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function rh(n,t){return vt(n,{active:false,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ah(n,t,e){return vt(n,{active:false,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function fn(n,t){let e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(let s of t){let o=s._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e];}}}var Cs=n=>n==="reset"||n==="none",mr=(n,t)=>t?n:Object.assign({},n),lh=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:ta(e,true),values:null},ht=class{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=false,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=false,this.supportsDecimation=false,this.$context=void 0,this._syncList=[],this.initialize();}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=fr(t.vScale,t),this.addElements();}updateIndex(t){this.index!==t&&fn(this._cachedMeta),this.index=t;}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=e.xAxisID=C(i.xAxisID,Ss(t,"x")),r=e.yAxisID=C(i.yAxisID,Ss(t,"y")),a=e.rAxisID=C(i.rAxisID,Ss(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),h=e.vAxisID=s(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){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset");}_destroy(){let t=this._cachedMeta;this._data&&Yn(this._data,this),t._stacked&&fn(t);}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(P(e))this._data=nh(e);else if(i!==e){if(i){Yn(i,this);let s=this._cachedMeta;fn(s),s._parsed=[];}e&&Object.isExtensible(e)&&os(e,this),this._syncList=[],this._data=e;}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType);}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),s=false;this._dataCheck();let o=e._stacked;e._stacked=fr(e.vScale,e),e.stack!==i.stack&&(s=true,fn(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&pr(this,e._parsed);}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,true);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={};}parse(t,e){let{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis,l=t===0&&e===s.length?true:i._sorted,c=t>0&&i._parsed[t-1],h,d,u;if(this._parsing===false)i._parsed=s,i._sorted=true,u=s;else {E(s[t])?u=this.parseArrayData(i,s,t,e):P(s[t])?u=this.parseObjectData(i,s,t,e):u=this.parsePrimitiveData(i,s,t,e);let f=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)i._parsed[h+t]=d=u[h],l&&(f()&&(l=false),c=d);i._sorted=l;}r&&pr(this,u);}parsePrimitiveData(t,e,i,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(s),u,f,g;for(u=0,f=s;u<f;++u)g=u+i,d[u]={[a]:h||o.parse(c[g],g),[l]:r.parse(e[g],g)};return d}parseArrayData(t,e,i,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,h,d;for(l=0,c=s;l<c;++l)h=l+i,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,i,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),h,d,u,f;for(h=0,d=s;h<d;++h)u=h+i,f=e[u],c[h]={x:o.parse(_t(f,a),u),y:r.parse(_t(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){let s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:ta(s,true),values:e._stacks[t.axis]};return ur(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){let o=i[e.axis],r=o===null?NaN:o,a=s&&i._stacks[e.axis];s&&a&&(s.values=a,r=ur(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r);}getMinMax(t,e){let i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=lh(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=sh(a),u,f;function g(){f=s[u];let p=f[a.axis];return !V(f[t.axis])||h>p||d<p}for(u=0;u<r&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=r-1;u>=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){let e=this._cachedMeta._parsed,i=[],s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],V(r)&&i.push(r);return i}getMaxOverflow(){return false}getLabelAndValue(t){let e=this._cachedMeta,i=e.iScale,s=e.vScale,o=this.getParsed(t);return {label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let e=this._cachedMeta;this.update(t||"default"),e._clip=eh(C(this.options.clip,th(e.xScale,e.yScale,this.getMaxOverflow())));}update(t){}draw(){let t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,h;for(i.dataset&&i.dataset.draw(t,o,a,l),h=a;h<a+l;++h){let d=s[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){let i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=ah(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t;}else o=this.$context||(this.$context=rh(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,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",i){let s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&H(i);if(a)return mr(a,l);let c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(D.elements[t]),g=()=>this.getContext(i,s),p=c.resolveNamedOptions(u,f,g,d);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(mr(p,l))),p}_resolveAnimations(t,e,i){let s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==false){let h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,i,e));}let c=new Le(s,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||Cs(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,s){Cs(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i);}updateSharedOptions(t,e,i){t&&!Cs(e)&&this._resolveAnimations(void 0,e).update(t,i);}_setStyle(t,e,i,s){t.active=s;let o=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o});}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",false);}setHoverStyle(t,e,i){this._setStyle(t,i,"active",true);}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",false);}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",true);}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=i.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o);}_insertElements(t,e,i=true){let s=this._cachedMeta,o=s.data,r=t+e,a,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(s._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset");}updateElements(t,e,i,s){}_removeElements(t,e){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,e);i._stacked&&fn(i,s);}i.data.splice(t,e);}_sync(t){if(this._parsing)this._syncList.push(t);else {let[e,i,s]=t;this[e](i,s);}this.chart._dataChanges.push([this.index,...t]);}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t]);}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1]);}_onDataShift(){this._sync(["_removeElements",0,1]);}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i]);}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length]);}};ht.defaults={};ht.prototype.datasetElementType=null;ht.prototype.dataElementType=null;function ch(n,t){if(!n._cache.$bar){let e=n.getMatchingVisibleMetas(t),i=[];for(let s=0,o=e.length;s<o;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Un(i.sort((s,o)=>s-o));}return n._cache.$bar}function hh(n){let t=n.iScale,e=ch(t,n.type),i=t._length,s,o,r,a,l=()=>{r===32767||r===-32768||(H(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r);};for(s=0,o=e.length;s<o;++s)r=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return i}function dh(n,t,e,i){let s=e.barThickness,o,r;return A(s)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=s*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[n]-o/2}}function uh(n,t,e,i){let s=t.pixels,o=s[n],r=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null,l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);let c=o-(o-Math.min(r,a))/2*l;return {chunk:Math.abs(a-r)/2*l/i,ratio:e.barPercentage,start:c}}function fh(n,t,e,i){let s=e.parse(n[0],i),o=e.parse(n[1],i),r=Math.min(s,o),a=Math.max(s,o),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:s,end:o,min:r,max:a};}function ea(n,t,e,i){return E(n)?fh(n,t,e,i):t[e.axis]=e.parse(n,i),t}function br(n,t,e,i){let s=n.iScale,o=n.vScale,r=s.getLabels(),a=s===o,l=[],c,h,d,u;for(c=e,h=e+i;c<h;++c)u=t[c],d={},d[s.axis]=a||s.parse(r[c],c),l.push(ea(u,d,o,c));return l}function ks(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function gh(n,t,e){return n!==0?ft(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function ph(n){let t,e,i,s,o;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:i,reverse:t,top:s,bottom:o}}function mh(n,t,e,i){let s=t.borderSkipped,o={};if(!s){n.borderSkipped=o;return}if(s===true){n.borderSkipped={top:true,right:true,bottom:true,left:true};return}let{start:r,end:a,reverse:l,top:c,bottom:h}=ph(n);s==="middle"&&e&&(n.enableBorderRadius=true,(e._top||0)===i?s=c:(e._bottom||0)===i?s=h:(o[yr(h,r,a,l)]=true,s=c)),o[yr(s,r,a,l)]=true,n.borderSkipped=o;}function yr(n,t,e,i){return i?(n=bh(n,t,e),n=xr(n,e,t)):n=xr(n,t,e),n}function bh(n,t,e){return n===t?e:n===e?t:n}function xr(n,t,e){return n==="start"?t:n==="end"?e:n}function yh(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t;}var ge=class extends ht{parsePrimitiveData(t,e,i,s){return br(t,e,i,s)}parseArrayData(t,e,i,s){return br(t,e,i,s)}parseObjectData(t,e,i,s){let{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=[],u,f,g,p;for(u=i,f=i+s;u<f;++u)p=e[u],g={},g[o.axis]=o.parse(_t(p,c),u),d.push(ea(_t(p,h),g,r,u));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);let o=i._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){let e=this._cachedMeta,{iScale:i,vScale:s}=e,o=this.getParsed(t),r=o._custom,a=ks(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return {label:""+i.getLabelForValue(o[i.axis]),value:a}}initialize(){this.enableOptionSharing=true,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack;}update(t){let e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t);}updateElements(t,e,i,s){let o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,s);for(let f=e;f<e+i;f++){let g=this.getParsed(f),p=o||A(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,h),b=(g._stacks||{})[a.axis],y={horizontal:c,base:p.base,enableBorderRadius:!b||ks(g._custom)||r===b._top||r===b._bottom,x:c?p.head:m.center,y:c?m.center:p.head,height:c?m.size:Math.abs(p.size),width:c?Math.abs(p.size):m.size};u&&(y.options=d||this.resolveDataElementOptions(f,t[f].active?"active":s));let x=y.options||t[f].options;mh(y,x,b,r),yh(y,x,h.ratio),this.updateElement(t[f],f,y,s);}}_getStacks(t,e){let{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=i.options.stacked,r=[],a=l=>{let c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(A(h)||isNaN(h))return true};for(let l of s)if(!(e!==void 0&&a(l))&&((o===false||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,i){let s=this._getStacks(t,i),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){let t=this.options,e=this._cachedMeta,i=e.iScale,s=[],o,r;for(o=0,r=e.data.length;o<r;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));let a=t.barThickness;return {min:a||hh(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:e,_stacked:i},options:{base:s,minBarLength:o}}=this,r=s||0,a=this.getParsed(t),l=a._custom,c=ks(l),h=a[e.axis],d=0,u=i?this.applyStack(e,a,i):h,f,g;u!==h&&(d=u-h,u=h),c&&(h=l.barStart,u=l.barEnd-l.barStart,h!==0&&ft(h)!==ft(l.barEnd)&&(d=0),d+=h);let p=!A(s)&&!c?s:d,m=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?f=e.getPixelForValue(d+u):f=m,g=f-m,Math.abs(g)<o){g=gh(g,e,r)*o,h===r&&(m-=g/2);let b=e.getPixelForDecimal(0),y=e.getPixelForDecimal(1),x=Math.min(b,y),_=Math.max(b,y);m=Math.max(Math.min(m,_),x),f=m+g;}if(m===e.getPixelForValue(r)){let b=ft(g)*e.getLineWidthForValue(r)/2;m+=b,g-=b;}return {size:g,base:m,head:f,center:f+g/2}}_calculateBarIndexPixels(t,e){let i=e.scale,s=this.options,o=s.skipNull,r=C(s.maxBarThickness,1/0),a,l;if(e.grouped){let c=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?uh(t,e,s,c):dh(t,e,s,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=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(r,e.min*e.ratio);return {base:a-l/2,head:a+l/2,center:a,size:l}}draw(){let t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length,o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&i[o].draw(this._ctx);}};ge.id="bar";ge.defaults={datasetElementType:false,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:true,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};ge.overrides={scales:{_index_:{type:"category",offset:true,grid:{offset:true}},_value_:{type:"linear",beginAtZero:true}}};var Ie=class extends ht{initialize(){this.enableOptionSharing=true,super.initialize();}parsePrimitiveData(t,e,i,s){let o=super.parsePrimitiveData(t,e,i,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+i).radius;return o}parseArrayData(t,e,i,s){let o=super.parseArrayData(t,e,i,s);for(let r=0;r<o.length;r++){let a=e[i+r];o[r]._custom=C(a[2],this.resolveDataElementOptions(r+i).radius);}return o}parseObjectData(t,e,i,s){let o=super.parseObjectData(t,e,i,s);for(let r=0;r<o.length;r++){let a=e[i+r];o[r]._custom=C(a&&a.r&&+a.r,this.resolveDataElementOptions(r+i).radius);}return o}getMaxOverflow(){let t=this._cachedMeta.data,e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,{xScale:i,yScale:s}=e,o=this.getParsed(t),r=i.getLabelForValue(o.x),a=s.getLabelForValue(o.y),l=o._custom;return {label:e.label,value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t);}updateElements(t,e,i,s){let o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=r.axis,d=a.axis;for(let u=e;u<e+i;u++){let f=t[u],g=!o&&this.getParsed(u),p={},m=p[h]=o?r.getPixelForDecimal(.5):r.getPixelForValue(g[h]),b=p[d]=o?a.getBasePixel():a.getPixelForValue(g[d]);p.skip=isNaN(m)||isNaN(b),c&&(p.options=l||this.resolveDataElementOptions(u,f.active?"active":s),o&&(p.options.radius=0)),this.updateElement(f,u,p,s);}}resolveDataElementOptions(t,e){let i=this.getParsed(t),s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:false}));let o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=C(i&&i._custom,o),s}};Ie.id="bubble";Ie.defaults={datasetElementType:false,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Ie.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return ""}}}}};function xh(n,t,e){let i=1,s=1,o=0,r=0;if(t<z){let a=n,l=a+t,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),u=Math.sin(l),f=(x,_,v)=>he(x,a,l,true)?1:Math.max(_,_*e,v,v*e),g=(x,_,v)=>he(x,a,l,true)?-1:Math.min(_,_*e,v,v*e),p=f(0,c,d),m=f(W,h,u),b=g(O,c,d),y=g(O+W,h,u);i=(p-b)/2,s=(m-y)/2,o=-(p+b)/2,r=-(m+y)/2;}return {ratioX:i,ratioY:s,offsetX:o,offsetY:r}}var qt=class extends ht{constructor(t,e){super(t,e),this.enableOptionSharing=true,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0;}linkScales(){}parse(t,e){let i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===false)s._parsed=i;else {let o=l=>+i[l];if(P(i[t])){let{key:l="value"}=this._parsing;o=c=>+_t(i[c],l);}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r);}}_getRotation(){return U(this.options.rotation-90)}_getCircumference(){return U(this.options.circumference)}_getRotationExtents(){let t=z,e=-z;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){let s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r);}return {rotation:t,circumference:e-t}}update(t){let e=this.chart,{chartArea:i}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(Zi(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:g,offsetY:p}=xh(d,h,l),m=(i.width-r)/u,b=(i.height-r)/f,y=Math.max(Math.min(m,b)/2,0),x=Wn(this.options.radius,y),_=Math.max(x*l,0),v=(x-_)/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=p*x,s.total=this.calculateTotal(),this.outerRadius=x-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*c,0),this.updateElements(o,0,o.length,t);}_circumference(t,e){let i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/z)}updateElements(t,e,i,s){let o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,d=(a.top+a.bottom)/2,u=o&&c.animateScale,f=u?0:this.innerRadius,g=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(e,s),b=this._getRotation(),y;for(y=0;y<e;++y)b+=this._circumference(y,o);for(y=e;y<e+i;++y){let x=this._circumference(y,o),_=t[y],v={x:h+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+x,circumference:x,outerRadius:g,innerRadius:f};m&&(v.options=p||this.resolveDataElementOptions(y,_.active?"active":s)),b+=x,this.updateElement(_,y,v,s);}}calculateTotal(){let t=this._cachedMeta,e=t.data,i=0,s;for(s=0;s<e.length;s++){let o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(o));}return i}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?z*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=ue(e._parsed[t],i.options.locale);return {label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0,i=this.chart,s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){r=i.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){let o=this.resolveDataElementOptions(i);e=Math.max(e,o.offset||0,o.hoverOffset||0);}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(C(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};qt.id="doughnut";qt.defaults={datasetElementType:false,dataElementType:"arc",animation:{animateRotate:true,animateScale:false},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};qt.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};qt.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){let t=n.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=n.legend.options;return t.labels.map((i,s)=>{let r=n.getDatasetMeta(0).controller.getStyle(s);return {text:i,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!n.getDataVisibility(s),index:s}})}return []}},onClick(n,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update();}},tooltip:{callbacks:{title(){return ""},label(n){let t=n.label,e=": "+n.formattedValue;return E(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};var Fe=class extends ht{initialize(){this.enableOptionSharing=true,this.supportsDecimation=true,super.initialize();}update(t){let e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled,{start:a,count:l}=Gn(e,s,r);this._drawStart=a,this._drawCount=l,qn(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t);}updateElements(t,e,i,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s),u=r.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=ct(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",y=e>0&&this.getParsed(e-1);for(let x=e;x<e+i;++x){let _=t[x],v=this.getParsed(x),M=b?_:{},w=A(v[f]),k=M[u]=r.getPixelForValue(v[u],x),S=M[f]=o||w?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,v,l):v[f],x);M.skip=isNaN(k)||isNaN(S)||w,M.stop=x>0&&Math.abs(v[u]-y[u])>m,p&&(M.parsed=v,M.raw=c.data[x]),d&&(M.options=h||this.resolveDataElementOptions(x,_.active?"active":s)),b||this.updateElement(_,x,M,s),y=v;}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw();}};Fe.id="line";Fe.defaults={datasetElementType:"line",dataElementType:"point",showLine:true,spanGaps:false};Fe.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var ze=class extends ht{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0;}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=ue(e._parsed[t].r,i.options.locale);return {label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return ni.bind(this)(t,e,i,s)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t);}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{let o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o));}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a;}updateElements(t,e,i,s){let o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*O,f=u,g,p=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,s,p);for(g=e;g<e+i;g++){let m=t[g],b=f,y=f+this._computeAngle(g,s,p),x=r.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=y,o&&(l.animateScale&&(x=0),l.animateRotate&&(b=y=u));let _={x:h,y:d,innerRadius:0,outerRadius:x,startAngle:b,endAngle:y,options:this.resolveDataElementOptions(g,m.active?"active":s)};this.updateElement(m,g,_,s);}}countVisibleElements(){let t=this._cachedMeta,e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++;}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?U(this.resolveDataElementOptions(t,e).angle||i):0}};ze.id="polarArea";ze.defaults={dataElementType:"arc",animation:{animateRotate:true,animateScale:true},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};ze.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){let t=n.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=n.legend.options;return t.labels.map((i,s)=>{let r=n.getDatasetMeta(0).controller.getStyle(s);return {text:i,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!n.getDataVisibility(s),index:s}})}return []}},onClick(n,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update();}},tooltip:{callbacks:{title(){return ""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:false},beginAtZero:true,grid:{circular:true},pointLabels:{display:false},startAngle:0}}};var _n=class extends qt{};_n.id="pie";_n.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var Be=class extends ht{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return {label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return ni.bind(this)(t,e,i,s)}update(t){let e=this._cachedMeta,i=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(i.points=s,t!=="resize"){let r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);let a={_loop:true,_fullLoop:o.length===s.length,options:r};this.updateElement(i,void 0,a,t);}this.updateElements(s,0,s.length,t);}updateElements(t,e,i,s){let o=this._cachedMeta.rScale,r=s==="reset";for(let a=e;a<e+i;a++){let l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),h=o.getPointPositionForValue(a,this.getParsed(a).r),d=r?o.xCenter:h.x,u=r?o.yCenter:h.y,f={x:d,y:u,angle:h.angle,skip:isNaN(d)||isNaN(u),options:c};this.updateElement(l,a,f,s);}}};Be.id="radar";Be.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:true,elements:{line:{fill:"start"}}};Be.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};var J=class{constructor(){this.x=void 0,this.y=void 0,this.active=false,this.options=void 0,this.$animations=void 0;}tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return {x:e,y:i}}hasValue(){return ct(this.x)&&ct(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o];}),s}};J.defaults={};J.defaultRoutes=void 0;var na={values(n){return E(n)?n:""+n},numeric(n,t,e){if(n===0)return "0";let i=this.chart.options.locale,s,o=n;if(e.length>1){let c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=_h(n,e);}let r=ot(Math.abs(o)),a=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ue(n,i,l)},logarithmic(n,t,e){if(n===0)return "0";let i=n/Math.pow(10,Math.floor(ot(n)));return i===1||i===2||i===5?na.numeric.call(this,n,t,e):""}};function _h(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Ci={formatters:na};D.set("scale",{display:true,offset:false,reverse:false,beginAtZero:false,bounds:"ticks",grace:0,grid:{display:true,lineWidth:1,drawBorder:true,drawOnChartArea:true,drawTicks:true,tickLength:8,tickWidth:(n,t)=>t.lineWidth,tickColor:(n,t)=>t.color,offset:false,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:false,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:false,textStrokeWidth:0,textStrokeColor:"",padding:3,display:true,autoSkip:true,autoSkipPadding:3,labelOffset:0,callback:Ci.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:false,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});D.route("scale.ticks","color","","color");D.route("scale.grid","color","","borderColor");D.route("scale.grid","borderColor","","borderColor");D.route("scale.title","color","","color");D.describe("scale",{_fallback:false,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});D.describe("scales",{_fallback:"scale"});D.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function vh(n,t){let e=n.options.ticks,i=e.maxTicksLimit||wh(n),s=e.major.enabled?Sh(t):[],o=s.length,r=s[0],a=s[o-1],l=[];if(o>i)return Ch(t,l,s,o/i),l;let c=Mh(s,t,i);if(o>0){let h,d,u=o>1?Math.round((a-r)/(o-1)):null;for(di(t,l,c,A(u)?0:r-u,r),h=0,d=o-1;h<d;h++)di(t,l,c,s[h],s[h+1]);return di(t,l,c,a,A(u)?t.length:a+u),l}return di(t,l,c),l}function wh(n){let t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Mh(n,t,e){let i=kh(n),s=t.length/e;if(!i)return Math.max(s,1);let o=ts(i);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function Sh(n){let t=[],e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Ch(n,t,e,i){let s=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<n.length;r++)r===o&&(t.push(n[r]),s++,o=e[s*i]);}function di(n,t,e,i,s){let o=C(i,0),r=Math.min(C(s,n.length),n.length),a=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-i,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(n[c]),a++,h=Math.round(o+a*e));}function kh(n){let t=n.length,e,i;if(t<2)return false;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return false;return i}var Ph=n=>n==="left"?"right":n==="right"?"left":n,_r=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e;function vr(n,t){let e=[],i=n.length/t,s=n.length,o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function Th(n,t,e){let i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,r=n._endPixel,a=1e-6,l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-o,r-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function Dh(n,t){I(n,e=>{let i=e.gc,s=i.length/2,o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s);}});}function gn(n){return n.drawTicks?n.tickLength:0}function wr(n,t){if(!n.display)return 0;let e=N(n.font,t),i=$(n.padding);return (E(n.text)?n.text.length:1)*e.lineHeight+i.height}function Ah(n,t){return vt(n,{scale:t,type:"scale"})}function Oh(n,t,e){return vt(n,{tick:e,index:t,type:"tick"})}function Eh(n,t,e){let i=an(n);return (e&&t!=="right"||!e&&t==="right")&&(i=Ph(i)),i}function Rh(n,t,e,i){let{top:s,left:o,bottom:r,right:a,chart:l}=n,{chartArea:c,scales:h}=l,d=0,u,f,g,p=r-s,m=a-o;if(n.isHorizontal()){if(f=Q(i,o,a),P(e)){let b=Object.keys(e)[0],y=e[b];g=h[b].getPixelForValue(y)+p-t;}else e==="center"?g=(c.bottom+c.top)/2+p-t:g=_r(n,e,t);u=a-o;}else {if(P(e)){let b=Object.keys(e)[0],y=e[b];f=h[b].getPixelForValue(y)-m+t;}else e==="center"?f=(c.left+c.right)/2-m+t:f=_r(n,e,t);g=Q(i,r,s),d=e==="left"?-W:W;}return {titleX:f,titleY:g,maxWidth:u,rotation:d}}var pe=class n extends J{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=false,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=false,this.$context=void 0;}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax);}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=st(t,Number.POSITIVE_INFINITY),e=st(e,Number.NEGATIVE_INFINITY),i=st(i,Number.POSITIVE_INFINITY),s=st(s,Number.NEGATIVE_INFINITY),{min:st(t,i),max:st(e,s),minDefined:V(t),maxDefined:V(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return {min:e,max:i};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,r.min)),o||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=s&&e>i?e:i,{min:st(e,st(i,e)),max:st(i,st(e,i))}}getPadding(){return {left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=false;}beforeUpdate(){L(this.options.beforeUpdate,[this]);}update(t,e,i){let{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ps(this,o,s),this._dataLimitsCached=true),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?vr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=vh(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,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels;}afterUpdate(){L(this.options.afterUpdate,[this]);}beforeSetDimensions(){L(this.options.beforeSetDimensions,[this]);}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0;}afterSetDimensions(){L(this.options.afterSetDimensions,[this]);}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),L(this.options[t],[this]);}beforeDataLimits(){this._callHooks("beforeDataLimits");}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits");}beforeBuildTicks(){this._callHooks("beforeBuildTicks");}buildTicks(){return []}afterBuildTicks(){this._callHooks("afterBuildTicks");}beforeTickToLabelConversion(){L(this.options.beforeTickToLabelConversion,[this]);}generateTickLabels(t){let e=this.options.ticks,i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=L(e.callback,[o.value,i,t],this);}afterTickToLabelConversion(){L(this.options.afterTickToLabelConversion,[this]);}beforeCalculateLabelRotation(){L(this.options.beforeCalculateLabelRotation,[this]);}calculateLabelRotation(){let t=this.options,e=t.ticks,i=this.ticks.length,s=e.minRotation||0,o=e.maxRotation,r=s,a,l,c;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=Z(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-gn(t.grid)-e.padding-wr(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=ce(Math.min(Math.asin(Z((h.highest.height+6)/a,-1,1)),Math.asin(Z(l/c,-1,1))-Math.asin(Z(u/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r;}afterCalculateLabelRotation(){L(this.options.afterCalculateLabelRotation,[this]);}afterAutoSkip(){}beforeFit(){L(this.options.beforeFit,[this]);}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=wr(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=gn(o)+l):(t.height=this.maxHeight,t.width=gn(o)+l),i.display&&this.ticks.length){let{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=i.padding*2,g=U(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){let b=i.mirror?0:m*d.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+b+f);}else {let b=i.mirror?0:p*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f);}this._calculatePadding(c,h,m,p);}}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,i,s){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),u=0,f=0;l?c?(u=s*t.width,f=i*e.height):(u=i*t.height,f=s*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0);}else {let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r;}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom));}afterFit(){L(this.options.afterFit,[this]);}isHorizontal(){let{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,i;for(e=0,i=t.length;e<i;e++)A(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion();}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=vr(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length);}return t}_computeLabelSizes(t,e){let{ctx:i,_longestTextCache:s}=this,o=[],r=[],a=0,l=0,c,h,d,u,f,g,p,m,b,y,x;for(c=0;c<e;++c){if(u=t[c].label,f=this._resolveTickFontOptions(c),i.font=g=f.string,p=s[g]=s[g]||{data:{},gc:[]},m=f.lineHeight,b=y=0,!A(u)&&!E(u))b=De(i,p.data,p.gc,b,u),y=m;else if(E(u))for(h=0,d=u.length;h<d;++h)x=u[h],!A(x)&&!E(x)&&(b=De(i,p.data,p.gc,b,x),y+=m);o.push(b),r.push(y),a=Math.max(b,a),l=Math.max(y,l);}Dh(s,e);let _=o.indexOf(a),v=r.indexOf(l),M=w=>({width:o[w]||0,height:r[w]||0});return {first:M(0),last:M(e-1),widest:M(_),highest:M(v),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return ns(this._alignToPixels?At(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&t<e.length){let i=e[t];return i.$context||(i.$context=Oh(this.getContext(),t,i))}return this.$context||(this.$context=Ah(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,e=U(this.labelRotation),i=Math.abs(Math.cos(e)),s=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*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e=this.axis,i=this.chart,s=this.options,{grid:o,position:r}=s,a=o.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),d=gn(o),u=[],f=o.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,p=g/2,m=function(T){return At(i,T,g)},b,y,x,_,v,M,w,k,S,F,B,R;if(r==="top")b=m(this.bottom),M=this.bottom-d,k=b-p,F=m(t.top)+p,R=t.bottom;else if(r==="bottom")b=m(this.top),F=t.top,R=m(t.bottom)-p,M=b+p,k=this.top+d;else if(r==="left")b=m(this.right),v=this.right-d,w=b-p,S=m(t.left)+p,B=t.right;else if(r==="right")b=m(this.left),S=t.left,B=m(t.right)-p,v=b+p,w=this.left+d;else if(e==="x"){if(r==="center")b=m((t.top+t.bottom)/2+.5);else if(P(r)){let T=Object.keys(r)[0],G=r[T];b=m(this.chart.scales[T].getPixelForValue(G));}F=t.top,R=t.bottom,M=b+p,k=M+d;}else if(e==="y"){if(r==="center")b=m((t.left+t.right)/2);else if(P(r)){let T=Object.keys(r)[0],G=r[T];b=m(this.chart.scales[T].getPixelForValue(G));}v=b-p,w=v-d,S=t.left,B=t.right;}let K=C(s.ticks.maxTicksLimit,h),et=Math.max(1,Math.ceil(h/K));for(y=0;y<h;y+=et){let T=o.setContext(this.getContext(y)),G=T.lineWidth,X=T.color,ie=T.borderDash||[],Ni=T.borderDashOffset,Ce=T.tickWidth,On=T.tickColor,ke=T.tickBorderDash||[],Ze=T.tickBorderDashOffset;x=Th(this,y,a),x!==void 0&&(_=At(i,x,G),l?v=w=S=B=_:M=k=F=R=_,u.push({tx1:v,ty1:M,tx2:w,ty2:k,x1:S,y1:F,x2:B,y2:R,width:G,color:X,borderDash:ie,borderDashOffset:Ni,tickWidth:Ce,tickColor:On,tickBorderDash:ke,tickBorderDashOffset:Ze}));}return this._ticksLength=h,this._borderValue=b,u}_computeLabelItems(t){let e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=gn(i.grid),f=u+h,g=d?-h:f,p=-U(this.labelRotation),m=[],b,y,x,_,v,M,w,k,S,F,B,R,K="middle";if(s==="top")M=this.bottom-g,w=this._getXAxisLabelAlignment();else if(s==="bottom")M=this.top+g,w=this._getXAxisLabelAlignment();else if(s==="left"){let T=this._getYAxisLabelAlignment(u);w=T.textAlign,v=T.x;}else if(s==="right"){let T=this._getYAxisLabelAlignment(u);w=T.textAlign,v=T.x;}else if(e==="x"){if(s==="center")M=(t.top+t.bottom)/2+f;else if(P(s)){let T=Object.keys(s)[0],G=s[T];M=this.chart.scales[T].getPixelForValue(G)+f;}w=this._getXAxisLabelAlignment();}else if(e==="y"){if(s==="center")v=(t.left+t.right)/2-f;else if(P(s)){let T=Object.keys(s)[0],G=s[T];v=this.chart.scales[T].getPixelForValue(G);}w=this._getYAxisLabelAlignment(u).textAlign;}e==="y"&&(l==="start"?K="top":l==="end"&&(K="bottom"));let et=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){x=a[b],_=x.label;let T=o.setContext(this.getContext(b));k=this.getPixelForTick(b)+o.labelOffset,S=this._resolveTickFontOptions(b),F=S.lineHeight,B=E(_)?_.length:1;let G=B/2,X=T.color,ie=T.textStrokeColor,Ni=T.textStrokeWidth,Ce=w;r?(v=k,w==="inner"&&(b===y-1?Ce=this.options.reverse?"left":"right":b===0?Ce=this.options.reverse?"right":"left":Ce="center"),s==="top"?c==="near"||p!==0?R=-B*F+F/2:c==="center"?R=-et.highest.height/2-G*F+F:R=-et.highest.height+F/2:c==="near"||p!==0?R=F/2:c==="center"?R=et.highest.height/2-G*F:R=et.highest.height-B*F,d&&(R*=-1)):(M=k,R=(1-B)*F/2);let On;if(T.showLabelBackdrop){let ke=$(T.backdropPadding),Ze=et.heights[b],ji=et.widths[b],Hi=M+R-ke.top,Vi=v-ke.left;switch(K){case "middle":Hi-=Ze/2;break;case "bottom":Hi-=Ze;break}switch(w){case "center":Vi-=ji/2;break;case "right":Vi-=ji;break}On={left:Vi,top:Hi,width:ji+ke.width,height:Ze+ke.height,color:T.backdropColor};}m.push({rotation:p,label:_,font:S,color:X,strokeColor:ie,strokeWidth:Ni,textOffset:R,textAlign:Ce,textBaseline:K,translation:[v,M],backdrop:On});}return m}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-U(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,h;return e==="left"?s?(h=this.right+o,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let 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(){let{ctx:t,options:{backgroundColor:e},left:i,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,o,r),t.restore());}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore());};if(e.display)for(o=0,r=s.length;o<r;++o){let l=s[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(){let{chart:t,ctx:e,options:{grid:i}}=this,s=i.setContext(this.getContext()),o=i.drawBorder?s.borderWidth:0;if(!o)return;let r=i.setContext(this.getContext(0)).lineWidth,a=this._borderValue,l,c,h,d;this.isHorizontal()?(l=At(t,this.left,o)-o/2,c=At(t,this.right,r)+r/2,h=d=a):(h=At(t,this.top,o)-o/2,d=At(t,this.bottom,r)+r/2,l=c=a),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(l,h),e.lineTo(c,d),e.stroke(),e.restore();}drawLabels(t){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&Yt(i,s);let o=this._labelItems||(this._labelItems=this._computeLabelItems(t)),r,a;for(r=0,a=o.length;r<a;++r){let l=o[r],c=l.font,h=l.label;l.backdrop&&(i.fillStyle=l.backdrop.color,i.fillRect(l.backdrop.left,l.backdrop.top,l.backdrop.width,l.backdrop.height));let d=l.textOffset;Ot(i,h,0,d,c,l);}s&&Ut(i);}drawTitle(){let{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;let o=N(i.font),r=$(i.padding),a=i.align,l=o.lineHeight/2;e==="bottom"||e==="center"||P(e)?(l+=r.bottom,E(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;let{titleX:c,titleY:h,maxWidth:d,rotation:u}=Rh(this,l,e,a);Ot(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:Eh(a,e,s),textBaseline:"middle",translation:[c,h]});}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t));}_layers(){let t=this.options,e=t.ticks&&t.ticks.z||0,i=C(t.grid&&t.grid.z,-1);return !this._isVisible()||this.draw!==n.prototype.draw?[{z:e,draw:s=>{this.draw(s);}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle();}},{z:i+1,draw:()=>{this.drawBorder();}},{z:e,draw:s=>{this.drawLabels(s);}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],o,r;for(o=0,r=e.length;o<r;++o){let a=e[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a);}return s}_resolveTickFontOptions(t){let e=this.options.ticks.setContext(this.getContext(t));return N(e.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return (this.isHorizontal()?this.width:this.height)/t}},Re=class{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null);}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let e=Object.getPrototypeOf(t),i;Fh(e)&&(i=this.register(e));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Lh(t,r,i),this.override&&D.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in D[s]&&(delete D[s][i],this.override&&delete $t[i]);}};function Lh(n,t,e){let i=lt(Object.create(null),[e?D.get(e):{},D.get(t),n.defaults]);D.set(t,i),n.defaultRoutes&&Ih(t,n.defaultRoutes),n.descriptors&&D.describe(t,n.descriptors);}function Ih(n,t){Object.keys(t).forEach(e=>{let i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");D.route(o,s,l,a);});}function Fh(n){return "id"in n&&"defaults"in n}var Is=class{constructor(){this.controllers=new Re(ht,"datasets",true),this.elements=new Re(J,"elements"),this.plugins=new Re(Object,"plugins"),this.scales=new Re(pe,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements];}add(...t){this._each("register",t);}remove(...t){this._each("unregister",t);}addControllers(...t){this._each("register",t,this.controllers);}addElements(...t){this._each("register",t,this.elements);}addPlugins(...t){this._each("register",t,this.plugins);}addScales(...t){this._each("register",t,this.scales);}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers);}removeElements(...t){this._each("unregister",t,this.elements);}removePlugins(...t){this._each("unregister",t,this.plugins);}removeScales(...t){this._each("unregister",t,this.scales);}_each(t,e,i){[...e].forEach(s=>{let o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):I(s,r=>{let a=i||this._getRegistryForType(r);this._exec(t,a,r);});});}_exec(t,e,i){let s=sn(t);L(i["before"+s],[],i),e[t](i),L(i["after"+s],[],i);}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){let s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}},Mt=new Is,We=class extends ht{update(t){let e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled,{start:o,count:r}=Gn(e,i,s);if(this._drawStart=o,this._drawCount=r,qn(e)&&(o=0,r=i.length),this.options.showLine){let{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t);}this.updateElements(i,o,r,t);}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=Mt.getElement("line")),super.addElements();}updateElements(t,e,i,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(h),u=this.includeOptions(s,d),f=r.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,b=ct(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||s==="none",x=e>0&&this.getParsed(e-1);for(let _=e;_<e+i;++_){let v=t[_],M=this.getParsed(_),w=y?v:{},k=A(M[g]),S=w[f]=r.getPixelForValue(M[f],_),F=w[g]=o||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[g],_);w.skip=isNaN(S)||isNaN(F)||k,w.stop=_>0&&Math.abs(M[f]-x[f])>b,m&&(w.parsed=M,w.raw=c.data[_]),u&&(w.options=d||this.resolveDataElementOptions(_,v.active?"active":s)),y||this.updateElement(v,_,w,s),x=M;}this.updateSharedOptions(d,s,h);}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}let i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;let o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,r)/2}};We.id="scatter";We.defaults={datasetElementType:false,dataElementType:"point",showLine:false,fill:false};We.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return ""},label(n){return "("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function fe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var vn=class{constructor(t){this.options=t||{};}init(t){}formats(){return fe()}parse(t,e){return fe()}format(t,e){return fe()}add(t,e,i){return fe()}diff(t,e,i){return fe()}startOf(t,e,i){return fe()}endOf(t,e){return fe()}};vn.override=function(n){Object.assign(vn.prototype,n);};var zh={_date:vn};function Bh(n,t,e,i){let{controller:s,data:o,_sorted:r}=n,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let l=a._reversePixels?is:Tt;if(i){if(s._sharedOptions){let c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){let d=l(o,t,e-h),u=l(o,t,e+h);return {lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return {lo:0,hi:o.length-1}}function Sn(n,t,e,i,s){let o=n.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:h}=o[a],{lo:d,hi:u}=Bh(o[a],t,r,s);for(let f=d;f<=u;++f){let g=h[f];g.skip||i(g,c,f);}}}function Wh(n){let t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){let o=t?Math.abs(i.x-s.x):0,r=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Ps(n,t,e,i,s){let o=[];return !s&&!n.isPointInArea(t)||Sn(n,e,t,function(a,l,c){!s&&!re(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c});},true),o}function Nh(n,t,e,i){let s=[];function o(r,a,l){let{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:d}=$n(r,{x:t.x,y:t.y});he(d,c,h)&&s.push({element:r,datasetIndex:a,index:l});}return Sn(n,e,t,o),s}function jh(n,t,e,i,s,o){let r=[],a=Wh(e),l=Number.POSITIVE_INFINITY;function c(h,d,u){let f=h.inRange(t.x,t.y,s);if(i&&!f)return;let g=h.getCenterPoint(s);if(!(!!o||n.isPointInArea(g))&&!f)return;let m=a(t,g);m<l?(r=[{element:h,datasetIndex:d,index:u}],l=m):m===l&&r.push({element:h,datasetIndex:d,index:u});}return Sn(n,e,t,c),r}function Ts(n,t,e,i,s,o){return !o&&!n.isPointInArea(t)?[]:e==="r"&&!i?Nh(n,t,e,s):jh(n,t,e,i,s,o)}function Mr(n,t,e,i,s){let o=[],r=e==="x"?"inXRange":"inYRange",a=false;return Sn(n,e,t,(l,c,h)=>{l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s));}),i&&!a?[]:o}var Hh={modes:{index(n,t,e,i){let s=Rt(t,n),o=e.axis||"x",r=e.includeInvisible||false,a=e.intersect?Ps(n,s,o,i,r):Ts(n,s,o,false,i,r),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{let h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h});}),l):[]},dataset(n,t,e,i){let s=Rt(t,n),o=e.axis||"xy",r=e.includeInvisible||false,a=e.intersect?Ps(n,s,o,i,r):Ts(n,s,o,false,i,r);if(a.length>0){let l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h});}return a},point(n,t,e,i){let s=Rt(t,n),o=e.axis||"xy",r=e.includeInvisible||false;return Ps(n,s,o,i,r)},nearest(n,t,e,i){let s=Rt(t,n),o=e.axis||"xy",r=e.includeInvisible||false;return Ts(n,s,o,e.intersect,i,r)},x(n,t,e,i){let s=Rt(t,n);return Mr(n,s,"x",e.intersect,i)},y(n,t,e,i){let s=Rt(t,n);return Mr(n,s,"y",e.intersect,i)}}},ia=["left","top","right","bottom"];function pn(n,t){return n.filter(e=>e.pos===t)}function Sr(n,t){return n.filter(e=>ia.indexOf(e.pos)===-1&&e.box.axis===t)}function mn(n,t){return n.sort((e,i)=>{let s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Vh(n){let t=[],e,i,s,o,r,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function $h(n){let t={};for(let e of n){let{stack:i,pos:s,stackWeight:o}=e;if(!i||!ia.includes(s))continue;let r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o;}return t}function Yh(n,t){let e=$h(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=n.length;o<r;++o){a=n[o];let{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=h?h*s:l&&t.availableHeight);}return e}function Uh(n){let t=Vh(n),e=mn(t.filter(c=>c.box.fullSize),true),i=mn(pn(t,"left"),true),s=mn(pn(t,"right")),o=mn(pn(t,"top"),true),r=mn(pn(t,"bottom")),a=Sr(t,"x"),l=Sr(t,"y");return {fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:pn(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Cr(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function sa(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right);}function Xh(n,t,e,i){let{pos:s,box:o}=e,r=n.maxPadding;if(!P(s)){e.size&&(n[s]-=e.size);let d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,n[s]+=e.size;}o.getPadding&&sa(r,o.getPadding());let a=Math.max(0,t.outerWidth-Cr(r,n,"left","right")),l=Math.max(0,t.outerHeight-Cr(r,n,"top","bottom")),c=a!==n.w,h=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Kh(n){let t=n.maxPadding;function e(i){let s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom");}function Gh(n,t){let e=t.maxPadding;function i(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r]);}),o}return i(n?["left","right"]:["top","bottom"])}function yn(n,t,e,i){let s=[],o,r,a,l,c,h;for(o=0,r=n.length,c=0;o<r;++o){a=n[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Gh(a.horizontal,t));let{same:d,other:u}=Xh(t,e,a,i);c|=d&&s.length,h=h||u,l.fullSize||s.push(a);}return c&&yn(s,t,e,i)||h}function ui(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s;}function kr(n,t,e,i){let s=e.padding,{x:o,y:r}=t;for(let a of n){let l=a.box,c=i[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){let d=t.w*h,u=c.size||l.height;H(c.start)&&(r=c.start),l.fullSize?ui(l,s.left,r,e.outerWidth-s.right-s.left,u):ui(l,t.left+c.placed,r,d,u),c.start=r,c.placed+=d,r=l.bottom;}else {let d=t.h*h,u=c.size||l.width;H(c.start)&&(o=c.start),l.fullSize?ui(l,o,s.top,u,e.outerHeight-s.bottom-s.top):ui(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right;}}t.x=o,t.y=r;}D.set("layout",{autoPadding:true,padding:{top:0,right:0,bottom:0,left:0}});var gt={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||false,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return [{z:0,draw(e){t.draw(e);}}]},n.boxes.push(t);},removeBox(n,t){let e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1);},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight;},update(n,t,e,i){if(!n)return;let s=$(n.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=Uh(n.boxes),l=a.vertical,c=a.horizontal;I(n.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout();});let h=l.reduce((p,m)=>m.box.options&&m.box.options.display===false?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);sa(u,$(i));let f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),g=Yh(l.concat(c),d);yn(a.fullSize,f,d,g),yn(l,f,d,g),yn(c,f,d,g)&&yn(l,f,d,g),Kh(f),kr(a.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,kr(a.rightAndBottom,f,d,g),n.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},I(a.chartArea,p=>{let m=p.box;Object.assign(m,n.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0});});}},bi=class{acquireContext(t,e){}releaseContext(t){return false}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return true}updateConfig(t){}},Fs=class extends bi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=false;}},mi="$chartjs",qh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pr=n=>n===null||n==="";function Jh(n,t){let e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[mi]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Pr(s)){let o=ri(n,"width");o!==void 0&&(n.width=o);}if(Pr(i))if(n.style.height==="")n.height=n.width/(t||2);else {let o=ri(n,"height");o!==void 0&&(n.height=o);}return n}var oa=_s?{passive:true}:false;function Zh(n,t,e){n.addEventListener(t,e,oa);}function Qh(n,t,e){n.canvas.removeEventListener(t,e,oa);}function td(n,t){let e=qh[n.type]||n.type,{x:i,y:s}=Rt(n,t);return {type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function yi(n,t){for(let e of n)if(e===t||e.contains(t))return true}function ed(n,t,e){let i=n.canvas,s=new MutationObserver(o=>{let r=false;for(let a of o)r=r||yi(a.addedNodes,i),r=r&&!yi(a.removedNodes,i);r&&e();});return s.observe(document,{childList:true,subtree:true}),s}function nd(n,t,e){let i=n.canvas,s=new MutationObserver(o=>{let r=false;for(let a of o)r=r||yi(a.removedNodes,i),r=r&&!yi(a.addedNodes,i);r&&e();});return s.observe(document,{childList:true,subtree:true}),s}var wn=new Map,Tr=0;function ra(){let n=window.devicePixelRatio;n!==Tr&&(Tr=n,wn.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t();}));}function id(n,t){wn.size||window.addEventListener("resize",ra),wn.set(n,t);}function sd(n){wn.delete(n),wn.size||window.removeEventListener("resize",ra);}function od(n,t,e){let i=n.canvas,s=i&&un(i);if(!s)return;let o=Kn((a,l)=>{let c=s.clientWidth;e(a,l),c<s.clientWidth&&e();},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h);});return r.observe(s),id(n,o),r}function Ds(n,t,e){e&&e.disconnect(),t==="resize"&&sd(n);}function rd(n,t,e){let i=n.canvas,s=Kn(o=>{n.ctx!==null&&e(td(o,n));},n,o=>{let r=o[0];return [r,r.offsetX,r.offsetY]});return Zh(i,t,s),s}var zs=class extends bi{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Jh(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[mi])return false;let i=e[mi].initial;["height","width"].forEach(o=>{let r=i[o];A(r)?e.removeAttribute(o):e.setAttribute(o,r);});let s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o];}),e.width=e.width,delete e[mi],true}addEventListener(t,e,i){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={}),r={attach:ed,detach:nd,resize:od}[e]||rd;s[e]=r(t,e,i);}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;(({attach:Ds,detach:Ds,resize:Ds})[e]||Qh)(t,e,s),i[e]=void 0;}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return xs(t,e,i,s)}isAttached(t){let e=un(t);return !!(e&&e.isConnected)}};function ad(n){return !ii()||typeof OffscreenCanvas!="undefined"&&n instanceof OffscreenCanvas?Fs:zs}var Bs=class{constructor(){this._init=[];}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,true),this._notify(this._init,t,"install"));let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,i,s){s=s||{};for(let o of t){let r=o.plugin,a=r[i],l=[e,s,o.options];if(L(a,l,r)===false&&s.cancelable)return false}return true}invalidate(){A(this._cache)||(this._oldCache=this._cache,this._cache=void 0);}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,s=C(i.options&&i.options.plugins,{}),o=ld(i);return s===false&&!e?[]:hd(t,o,s,e)}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start");}};function ld(n){let t={},e=[],i=Object.keys(Mt.plugins.items);for(let o=0;o<i.length;o++)e.push(Mt.getPlugin(i[o]));let s=n.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=true);}return {plugins:e,localIds:t}}function cd(n,t){return !t&&n===false?null:n===true?{}:n}function hd(n,{plugins:t,localIds:e},i,s){let o=[],r=n.getContext();for(let a of t){let l=a.id,c=cd(i[l],s);c!==null&&o.push({plugin:a,options:dd(n.config,{plugin:a,local:e[l]},c,r)});}return o}function dd(n,{plugin:t,local:e},i,s){let o=n.pluginScopeKeys(t),r=n.getOptionScopes(i,o);return e&&t.defaults&&r.push(t.defaults),n.createResolver(r,s,[""],{scriptable:false,indexable:false,allKeys:true})}function Ws(n,t){let e=D.datasets[n]||{};return ((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function ud(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function fd(n,t){return n===t?"_index_":"_value_"}function gd(n){if(n==="top"||n==="bottom")return "x";if(n==="left"||n==="right")return "y"}function Ns(n,t){return n==="x"||n==="y"?n:t.axis||gd(t.position)||n.charAt(0).toLowerCase()}function pd(n,t){let e=$t[n.type]||{scales:{}},i=t.scales||{},s=Ws(n.type,t),o=Object.create(null),r=Object.create(null);return Object.keys(i).forEach(a=>{let l=i[a];if(!P(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let c=Ns(a,l),h=fd(c,s),d=e.scales||{};o[c]=o[c]||a,r[a]=ae(Object.create(null),[{axis:c},l,d[c],d[h]]);}),n.data.datasets.forEach(a=>{let l=a.type||n.type,c=a.indexAxis||Ws(l,t),d=($t[l]||{}).scales||{};Object.keys(d).forEach(u=>{let f=ud(u,c),g=a[f+"AxisID"]||o[f]||f;r[g]=r[g]||Object.create(null),ae(r[g],[{axis:f},i[g],d[u]]);});}),Object.keys(r).forEach(a=>{let l=r[a];ae(l,[D.scales[l.type],D.scale]);}),r}function aa(n){let t=n.options||(n.options={});t.plugins=C(t.plugins,{}),t.scales=pd(n,t);}function la(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function md(n){return n=n||{},n.data=la(n.data),aa(n),n}var Dr=new Map,ca=new Set;function fi(n,t){let e=Dr.get(n);return e||(e=t(),Dr.set(n,e),ca.add(e)),e}var bn=(n,t,e)=>{let i=_t(t,e);i!==void 0&&n.add(i);},js=class{constructor(t){this._config=md(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=la(t);}get options(){return this._config.options}set options(t){this._config.options=t;}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),aa(t);}clearCache(){this._scopeCache.clear(),this._resolverCache.clear();}datasetScopeKeys(t){return fi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return fi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return fi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return fi(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,s=i.get(t);return (!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){let{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;let l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>bn(l,t,d))),h.forEach(d=>bn(l,s,d)),h.forEach(d=>bn(l,$t[o]||{},d)),h.forEach(d=>bn(l,D,d)),h.forEach(d=>bn(l,Jn,d));});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ca.has(e)&&r.set(e,c),c}chartOptionScopes(){let{options:t,type:e}=this;return [t,$t[e]||{},D.datasets[e]||{},{type:e},D,Jn]}resolveNamedOptions(t,e,i,s=[""]){let o={$shared:true},{resolver:r,subPrefixes:a}=Ar(this._resolverCache,t,s),l=r;if(yd(r,e)){o.$shared=false,i=tt(i)?i():i;let c=this.createResolver(t,i,a);l=Vt(r,i,c);}for(let c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],s){let{resolver:o}=Ar(this._resolverCache,t,i);return P(e)?Vt(o,e,void 0,s):o}};function Ar(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));let s=e.join(),o=i.get(s);return o||(o={resolver:dn(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}var bd=n=>P(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||tt(n[e]),false);function yd(n,t){let{isScriptable:e,isIndexable:i}=ei(n);for(let s of t){let o=e(s),r=i(s),a=(r||o)&&n[s];if(o&&(tt(a)||bd(a))||r&&E(a))return true}return false}var xd="3.9.1",_d=["top","bottom","left","right","chartArea"];function Or(n,t){return n==="top"||n==="bottom"||_d.indexOf(n)===-1&&t==="x"}function Er(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Rr(n){let t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),L(e&&e.onComplete,[n],t);}function vd(n){let t=n.chart,e=t.options.animation;L(e&&e.onProgress,[n],t);}function ha(n){return ii()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}var xi={},da=n=>{let t=ha(n);return Object.values(xi).filter(e=>e.canvas===t).pop()};function wd(n,t,e){let i=Object.keys(n);for(let s of i){let o=+s;if(o>=t){let r=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=r);}}}function Md(n,t,e,i){return !e||n.type==="mouseout"?null:i?t:n}var it=class{constructor(t,e){let i=this.config=new js(e),s=ha(t),o=da(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||ad(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Ji(),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 Bs,this.$proxies={},this._hiddenIndices={},this.attached=false,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=rs(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],xi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Lt.listen(this,"complete",Rr),Lt.listen(this,"progress",vd),this._initialize(),this.attached&&this.update();}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return A(t)?e&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t;}get options(){return this._options}set options(t){this.config.options=t;}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():oi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zn(this.canvas,this.ctx),this}stop(){return Lt.stop(this),this}resize(t,e){Lt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e);}_resize(t,e){let i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,oi(this,a,true)&&(this.notifyPlugins("resize",{size:r}),L(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render());}ensureScalesHaveIDs(){let e=this.options.scales||{};I(e,(i,s)=>{i.id=s;});}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=false,r),{}),o=[];e&&(o=o.concat(Object.keys(e).map(r=>{let a=e[r],l=Ns(r,a),c=l==="r",h=l==="x";return {options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),I(o,r=>{let a=r.options,l=a.id,c=Ns(l,a),h=C(a.type,r.dtype);(a.position===void 0||Or(a.position,c)!==Or(r.dposition))&&(a.position=r.dposition),s[l]=true;let d=null;if(l in i&&i[l].type===h)d=i[l];else {let u=Mt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),i[d.id]=d;}d.init(a,t);}),I(s,(r,a)=>{r||delete i[a];}),I(i,r=>{gt.configure(this,r,r.options),gt.addBox(this,r);});}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e);}this._sortedMetasets=t.slice(0).sort(Er("order","index"));}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s);});}buildOrUpdateControllers(){let t=[],e=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){let o=e[i],r=this.getDatasetMeta(i),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||Ws(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else {let l=Mt.getController(a),{datasetElementType:c,dataElementType:h}=D.datasets[a];Object.assign(l.prototype,{dataElementType:Mt.getElement(h),datasetElementType:c&&Mt.getElement(c)}),r.controller=new l(this,i),t.push(r.controller);}}return this._updateMetasets(),t}_resetElements(){I(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset();},this);}reset(){this._resetElements(),this.notifyPlugins("reset");}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:true})===false)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){let{controller:d}=this.getDatasetMeta(c),u=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),r=Math.max(+d.getMaxOverflow(),r);}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||I(o,c=>{c.reset();}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Er("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,true):a.length&&this._updateHoverStyles(a,a,true),this.render();}_updateScales(){I(this.scales,t=>{gt.removeBox(this,t);}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales();}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Nn(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents());}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:o}of e){let r=i==="_removeElements"?-o:o;wd(t,s,r);}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<e;o++)if(!Nn(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:true})===false)return;gt.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],I(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()));},this),this._layers.forEach((s,o)=>{s._idx=o;}),this.notifyPlugins("afterLayout");}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:true})!==false){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,tt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t});}}_updateDataset(t,e){let i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:true};this.notifyPlugins("beforeDatasetUpdate",s)!==false&&(i.controller._update(e),s.cancelable=false,this.notifyPlugins("afterDatasetUpdate",s));}render(){this.notifyPlugins("beforeRender",{cancelable:true})!==false&&(Lt.has(this)?this.attached&&!Lt.running(this)&&Lt.start(this):(this.draw(),Rr({chart:this})));}draw(){let t;if(this._resizeBeforeDraw){let{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null;}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:true})===false)return;let e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw");}_getSortedDatasetMetas(t){let e=this._sortedMetasets,i=[],s,o;for(s=0,o=e.length;s<o;++s){let r=e[s];(!t||r.visible)&&i.push(r);}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(true)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:true})===false)return;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw");}_drawDataset(t){let e=this.ctx,i=t._clip,s=!i.disabled,o=this.chartArea,r={meta:t,index:t.index,cancelable:true};this.notifyPlugins("beforeDatasetDraw",r)!==false&&(s&&Yt(e,{left:i.left===false?0:o.left-i.left,right:i.right===false?this.width:o.right+i.right,top:i.top===false?0:o.top-i.top,bottom:i.bottom===false?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&Ut(e),r.cancelable=false,this.notifyPlugins("afterDatasetDraw",r));}isPointInArea(t){return re(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){let o=Hh.modes[e];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,s=i.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:false},i.push(s)),s}getContext(){return this.$context||(this.$context=vt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return false;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e;}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t];}getDataVisibility(t){return !this._hiddenIndices[t]}_updateVisibility(t,e,i){let s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);H(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0));}hide(t,e){this._updateVisibility(t,e,false);}show(t,e){this._updateVisibility(t,e,true);}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t];}_stop(){let t,e;for(this.stop(),Lt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t);}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Zn(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete xi[this.id],this.notifyPlugins("afterDestroy");}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=true;}bindUserEvents(){let t=this._listeners,e=this.platform,i=(o,r)=>{e.addEventListener(this,o,r),t[o]=r;},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o);};I(this.options.events,o=>i(o,s));}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c;},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l]);},o=(l,c)=>{this.canvas&&this.resize(l,c);},r,a=()=>{s("attach",a),this.attached=true,this.resize(),i("resize",o),i("detach",r);};r=()=>{this.attached=false,s("resize",o),this._stop(),this._resize(0,0),i("attach",a);},e.isAttached(this.canvas)?a():r();}unbindEvents(){I(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t);}),this._listeners={},I(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t);}),this._responsiveListeners=void 0;}updateHoverStyle(t,e,i){let s=i?"set":"remove",o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index);}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return {datasetIndex:o,element:a.data[r],index:r}});!Oe(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e));}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){let s=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=i?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,false),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,true);}_eventHandler(t,e){let i={event:t,replay:e,cancelable:true,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===false)return;let o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=false,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){let{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,i,r),l=Qi(t),c=Md(t,this._lastEvent,i,l);i&&(this._lastEvent=null,L(o.onHover,[t,a,this],this),l&&L(o.onClick,[t,a,this],this));let h=!Oe(a,s);return (h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return [];if(!i)return e;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}},Lr=()=>I(it.instances,n=>n._plugins.invalidate()),Kt=true;Object.defineProperties(it,{defaults:{enumerable:Kt,value:D},instances:{enumerable:Kt,value:xi},overrides:{enumerable:Kt,value:$t},registry:{enumerable:Kt,value:Mt},version:{enumerable:Kt,value:xd},getChart:{enumerable:Kt,value:da},register:{enumerable:Kt,value:(...n)=>{Mt.add(...n),Lr();}},unregister:{enumerable:Kt,value:(...n)=>{Mt.remove(...n),Lr();}}});function ua(n,t,e){let{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t,c=s/a;n.beginPath(),n.arc(o,r,a,i-c,e+c),l>s?(c=s/l,n.arc(o,r,l,e+c,i-c,true)):n.arc(o,r,s,e+W,i-W),n.closePath(),n.clip();}function Sd(n){return hn(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Cd(n,t,e,i){let s=Sd(n.options.borderRadius),o=(e-t)/2,r=Math.min(o,i*t/2),a=l=>{let c=(e-Math.min(o,l))*i/2;return Z(l,0,Math.min(o,c))};return {outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Z(s.innerStart,0,r),innerEnd:Z(s.innerEnd,0,r)}}function Ee(n,t,e,i){return {x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Hs(n,t,e,i,s,o){let{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+i+e-c,0),u=h>0?h+i+e+c:0,f=0,g=s-l;if(i){let T=h>0?h-i:0,G=d>0?d-i:0,X=(T+G)/2,ie=X!==0?g*X/(X+i):g;f=(g-ie)/2;}let p=Math.max(.001,g*d-e/O)/d,m=(g-p)/2,b=l+m+f,y=s-m-f,{outerStart:x,outerEnd:_,innerStart:v,innerEnd:M}=Cd(t,u,d,y-b),w=d-x,k=d-_,S=b+x/w,F=y-_/k,B=u+v,R=u+M,K=b+v/B,et=y-M/R;if(n.beginPath(),o){if(n.arc(r,a,d,S,F),_>0){let X=Ee(k,F,r,a);n.arc(X.x,X.y,_,F,y+W);}let T=Ee(R,y,r,a);if(n.lineTo(T.x,T.y),M>0){let X=Ee(R,et,r,a);n.arc(X.x,X.y,M,y+W,et+Math.PI);}if(n.arc(r,a,u,y-M/u,b+v/u,true),v>0){let X=Ee(B,K,r,a);n.arc(X.x,X.y,v,K+Math.PI,b-W);}let G=Ee(w,b,r,a);if(n.lineTo(G.x,G.y),x>0){let X=Ee(w,S,r,a);n.arc(X.x,X.y,x,b-W,S);}}else {n.moveTo(r,a);let T=Math.cos(S)*d+r,G=Math.sin(S)*d+a;n.lineTo(T,G);let X=Math.cos(F)*d+r,ie=Math.sin(F)*d+a;n.lineTo(X,ie);}n.closePath();}function kd(n,t,e,i,s){let{fullCircles:o,startAngle:r,circumference:a}=t,l=t.endAngle;if(o){Hs(n,t,e,i,r+z,s);for(let c=0;c<o;++c)n.fill();isNaN(a)||(l=r+a%z,a%z===0&&(l+=z));}return Hs(n,t,e,i,l,s),n.fill(),l}function Pd(n,t,e){let{x:i,y:s,startAngle:o,pixelMargin:r,fullCircles:a}=t,l=Math.max(t.outerRadius-r,0),c=t.innerRadius+r,h;for(e&&ua(n,t,o+z),n.beginPath(),n.arc(i,s,c,o+z,o,true),h=0;h<a;++h)n.stroke();for(n.beginPath(),n.arc(i,s,l,o,o+z),h=0;h<a;++h)n.stroke();}function Td(n,t,e,i,s,o){let{options:r}=t,{borderWidth:a,borderJoinStyle:l}=r,c=r.borderAlign==="inner";a&&(c?(n.lineWidth=a*2,n.lineJoin=l||"round"):(n.lineWidth=a,n.lineJoin=l||"bevel"),t.fullCircles&&Pd(n,t,c),c&&ua(n,t,s),Hs(n,t,e,i,s,o),n.stroke());}var Ft=class extends J{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t);}inRange(t,e,i){let s=this.getProps(["x","y"],i),{angle:o,distance:r}=$n(s,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2,g=C(d,l-a)>=z||he(o,a,l),p=mt(r,c+u,h+u);return g&&p}getCenterPoint(t){let{x:e,y:i,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(s+o)/2,d=(r+a+c+l)/2;return {x:e+Math.cos(h)*d,y:i+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,s=(e.offset||0)/2,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>z?Math.floor(i/z):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;let c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=O&&(a=s);}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;let l=kd(t,this,a,o,r);Td(t,this,a,o,l,r),t.restore();}};Ft.id="arc";Ft.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:true};Ft.defaultRoutes={backgroundColor:"backgroundColor"};function fa(n,t,e=t){n.lineCap=C(e.borderCapStyle,t.borderCapStyle),n.setLineDash(C(e.borderDash,t.borderDash)),n.lineDashOffset=C(e.borderDashOffset,t.borderDashOffset),n.lineJoin=C(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=C(e.borderWidth,t.borderWidth),n.strokeStyle=C(e.borderColor,t.borderColor);}function Dd(n,t,e){n.lineTo(e.x,e.y);}function Ad(n){return n.stepped?fs:n.tension||n.cubicInterpolationMode==="monotone"?gs:Dd}function ga(n,t,e={}){let i=n.length,{start:s=0,end:o=i-1}=e,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return {count:i,start:l,loop:t.loop,ilen:c<l&&!h?i+c-l:c-l}}function Od(n,t,e,i){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=ga(s,e,i),h=Ad(o),{move:d=true,reverse:u}=i||{},f,g,p;for(f=0;f<=c;++f)g=s[(a+(u?c-f:f))%r],!g.skip&&(d?(n.moveTo(g.x,g.y),d=false):h(n,p,g,u,o.stepped),p=g);return l&&(g=s[(a+(u?c:0))%r],h(n,p,g,u,o.stepped)),!!l}function Ed(n,t,e,i){let s=t.points,{count:o,start:r,ilen:a}=ga(s,e,i),{move:l=true,reverse:c}=i||{},h=0,d=0,u,f,g,p,m,b,y=_=>(r+(c?a-_:_))%o,x=()=>{p!==m&&(n.lineTo(h,m),n.lineTo(h,p),n.lineTo(h,b));};for(l&&(f=s[y(0)],n.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=s[y(u)],f.skip)continue;let _=f.x,v=f.y,M=_|0;M===g?(v<p?p=v:v>m&&(m=v),h=(d*h+_)/++d):(x(),n.lineTo(_,v),g=M,d=0,p=m=v),b=v;}x();}function Vs(n){let t=n.options,e=t.borderDash&&t.borderDash.length;return !n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ed:Od}function Rd(n){return n.stepped?vs:n.tension||n.cubicInterpolationMode==="monotone"?ws:Pt}function Ld(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),fa(n,t.options),n.stroke(s);}function Id(n,t,e,i){let{segments:s,options:o}=t,r=Vs(t);for(let a of s)fa(n,o,a.style),n.beginPath(),r(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke();}var Fd=typeof Path2D=="function";function zd(n,t,e,i){Fd&&!t.options.segment?Ld(n,t,e,i):Id(n,t,e,i);}var yt=class extends J{constructor(t){super(),this.animated=true,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=false,this._pointsUpdated=false,this._datasetIndex=void 0,t&&Object.assign(this,t);}updateControlPoints(t,e){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;ys(this._points,i,t,s,e),this._pointsUpdated=true;}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=false;}get points(){return this._points}get segments(){return this._segments||(this._segments=Ms(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i=this.options,s=t[e],o=this.points,r=hi(this,{property:e,start:s,end:s});if(!r.length)return;let a=[],l=Rd(i),c,h;for(c=0,h=r.length;c<h;++c){let{start:d,end:u}=r[c],f=o[d],g=o[u];if(f===g){a.push(f);continue}let p=Math.abs((s-f[e])/(g[e]-f[e])),m=l(f,g,p,i.stepped);m[e]=t[e],a.push(m);}return a.length===1?a[0]:a}pathSegment(t,e,i){return Vs(this)(t,this,e,i)}path(t,e,i){let s=this.segments,o=Vs(this),r=this._loop;e=e||0,i=i||this.points.length-e;for(let a of s)r&=o(t,this,a,{start:e,end:e+i-1});return !!r}draw(t,e,i,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),zd(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=false,this._path=void 0);}};yt.id="line";yt.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:true,cubicInterpolationMode:"default",fill:false,spanGaps:false,stepped:false,tension:0};yt.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};yt.descriptors={_scriptable:true,_indexable:n=>n!=="borderDash"&&n!=="fill"};function Ir(n,t,e,i){let s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}var zt=class extends J{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t);}inRange(t,e,i){let s=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Ir(this,t,"x",e)}inYRange(t,e){return Ir(this,t,"y",e)}getCenterPoint(t){let{x:e,y:i}=this.getProps(["x","y"],t);return {x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);let i=e&&t.borderWidth||0;return (e+i)*2}draw(t,e){let i=this.options;this.skip||i.radius<.1||!re(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,cn(t,i,this.x,this.y));}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};zt.id="point";zt.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};zt.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function pa(n,t){let{x:e,y:i,base:s,width:o,height:r}=n.getProps(["x","y","base","width","height"],t),a,l,c,h,d;return n.horizontal?(d=r/2,a=Math.min(e,s),l=Math.max(e,s),c=i-d,h=i+d):(d=o/2,a=e-d,l=e+d,c=Math.min(i,s),h=Math.max(i,s)),{left:a,top:c,right:l,bottom:h}}function Gt(n,t,e,i){return n?0:Z(t,e,i)}function Bd(n,t,e){let i=n.options.borderWidth,s=n.borderSkipped,o=ti(i);return {t:Gt(s.top,o.top,0,e),r:Gt(s.right,o.right,0,t),b:Gt(s.bottom,o.bottom,0,e),l:Gt(s.left,o.left,0,t)}}function Wd(n,t,e){let{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=bt(s),r=Math.min(t,e),a=n.borderSkipped,l=i||P(s);return {topLeft:Gt(!l||a.top||a.left,o.topLeft,0,r),topRight:Gt(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Gt(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Gt(!l||a.bottom||a.right,o.bottomRight,0,r)}}function Nd(n){let t=pa(n),e=t.right-t.left,i=t.bottom-t.top,s=Bd(n,e/2,i/2),o=Wd(n,e/2,i/2);return {outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function As(n,t,e,i){let s=t===null,o=e===null,a=n&&!(s&&o)&&pa(n,i);return a&&(s||mt(t,a.left,a.right))&&(o||mt(e,a.top,a.bottom))}function jd(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Hd(n,t){n.rect(t.x,t.y,t.w,t.h);}function Os(n,t,e={}){let i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,o=(n.x+n.w!==e.x+e.w?t:0)-i,r=(n.y+n.h!==e.y+e.h?t:0)-s;return {x:n.x+i,y:n.y+s,w:n.w+o,h:n.h+r,radius:n.radius}}var Bt=class extends J{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){let{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:r}=Nd(this),a=jd(r.radius)?Et:Hd;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Os(r,e,o)),t.clip(),a(t,Os(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Os(o,e)),t.fillStyle=s,t.fill(),t.restore();}inRange(t,e,i){return As(this,t,e,i)}inXRange(t,e){return As(this,t,null,e)}inYRange(t,e){return As(this,null,t,e)}getCenterPoint(t){let{x:e,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return {x:o?(e+s)/2:e,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};Bt.id="bar";Bt.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Bt.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function Vd(n,t,e){let i=n.segments,s=n.points,o=t.points,r=[];for(let a of i){let{start:l,end:c}=a;c=Us(l,c,s);let h=$s(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:s[l],end:s[c]});continue}let d=hi(t,h);for(let u of d){let f=$s(e,o[u.start],o[u.end],u.loop),g=ci(a,s,f);for(let p of g)r.push({source:p,target:u,start:{[e]:Fr(h,f,"start",Math.max)},end:{[e]:Fr(h,f,"end",Math.min)}});}}return r}function $s(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=nt(s),o=nt(o)),{property:n,start:s,end:o}}function $d(n,t){let{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=Us(r,a,s);let l=s[r],c=s[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}));}),o}function Us(n,t,e){for(;t>n;t--){let i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Fr(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function ma(n,t){let e=[],i=false;return E(n)?(i=true,e=n):e=$d(n,t),e.length?new yt({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function zr(n){return n&&n.fill!==false}function Yd(n,t,e){let s=n[t].fill,o=[t],r;if(!e)return s;for(;s!==false&&o.indexOf(s)===-1;){if(!V(s))return s;if(r=n[s],!r)return false;if(r.visible)return s;o.push(s),s=r.fill;}return false}function Ud(n,t,e){let i=qd(n);if(P(i))return isNaN(i.value)?false:i;let s=parseFloat(i);return V(s)&&Math.floor(s)===s?Xd(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Xd(n,t,e,i){return (n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?false:e}function Kd(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:P(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Gd(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:P(n)?i=n.value:i=t.getBaseValue(),i}function qd(n){let t=n.options,e=t.fill,i=C(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===false||i===null?false:i===true?"origin":i}function Jd(n){let{scale:t,index:e,line:i}=n,s=[],o=i.segments,r=i.points,a=Zd(t,e);a.push(ma({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){let c=o[l];for(let h=c.start;h<=c.end;h++)Qd(s,r[h],a);}return new yt({points:s,options:{}})}function Zd(n,t){let e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){let o=i[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset);}return e}function Qd(n,t,e){let i=[];for(let s=0;s<e.length;s++){let o=e[s],{first:r,last:a,point:l}=tu(o,t,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i);}function tu(n,t,e){let i=n.interpolate(t,e);if(!i)return {};let s=i[e],o=n.segments,r=n.points,a=false,l=false;for(let c=0;c<o.length;c++){let h=o[c],d=r[h.start][e],u=r[h.end][e];if(mt(s,d,u)){a=s===d,l=s===u;break}}return {first:a,last:l,point:i}}var _i=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius;}pathSegment(t,e,i){let{x:s,y:o,radius:r}=this;return e=e||{start:0,end:z},t.arc(s,o,r,e.end,e.start,true),!i.bounds}interpolate(t){let{x:e,y:i,radius:s}=this,o=t.angle;return {x:e+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}};function eu(n){let{chart:t,fill:e,line:i}=n;if(V(e))return nu(t,e);if(e==="stack")return Jd(n);if(e==="shape")return true;let s=iu(n);return s instanceof _i?s:ma(s,i)}function nu(n,t){let e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function iu(n){return (n.scale||{}).getPointPositionForValue?ou(n):su(n)}function su(n){let{scale:t={},fill:e}=n,i=Kd(e,t);if(V(i)){let s=t.isHorizontal();return {x:s?i:null,y:s?null:i}}return null}function ou(n){let{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,r=Gd(e,t,o),a=[];if(i.grid.circular){let l=t.getPointPositionForValue(0,o);return new _i({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function Es(n,t,e){let i=eu(t),{line:s,scale:o,axis:r}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:d=c}=l||{};i&&s.points.length&&(Yt(n,e),ru(n,{line:s,target:i,above:h,below:d,area:e,scale:o,axis:r}),Ut(n));}function ru(n,t){let{line:e,target:i,above:s,below:o,area:r,scale:a}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&o!==s&&(Br(n,i,r.top),Wr(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),Br(n,i,r.bottom)),Wr(n,{line:e,target:i,color:o,scale:a,property:l}),n.restore();}function Br(n,t,e){let{segments:i,points:s}=t,o=true,r=false;n.beginPath();for(let a of i){let{start:l,end:c}=a,h=s[l],d=s[Us(l,c,s)];o?(n.moveTo(h.x,h.y),o=false):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),r=!!t.pathSegment(n,a,{move:r}),r?n.closePath():n.lineTo(d.x,e);}n.lineTo(t.first().x,e),n.closePath(),n.clip();}function Wr(n,t){let{line:e,target:i,property:s,color:o,scale:r}=t,a=Vd(e,i,s);for(let{source:l,target:c,start:h,end:d}of a){let{style:{backgroundColor:u=o}={}}=l,f=i!==true;n.save(),n.fillStyle=u,au(n,r,f&&$s(s,h,d)),n.beginPath();let g=!!e.pathSegment(n,l),p;if(f){g?n.closePath():Nr(n,i,d,s);let m=!!i.pathSegment(n,c,{move:g,reverse:true});p=g&&m,p||Nr(n,i,h,s);}n.closePath(),n.fill(p?"evenodd":"nonzero"),n.restore();}}function au(n,t,e){let{top:i,bottom:s}=t.chart.chartArea,{property:o,start:r,end:a}=e||{};o==="x"&&(n.beginPath(),n.rect(r,i,a-r,s-i),n.clip());}function Nr(n,t,e,i){let s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y);}var ba={id:"filler",afterDatasetsUpdate(n,t,e){let i=(n.data.datasets||[]).length,s=[],o,r,a,l;for(r=0;r<i;++r)o=n.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof yt&&(l={visible:n.isDatasetVisible(r),index:r,fill:Ud(a,r,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<i;++r)l=s[r],!(!l||l.fill===false)&&(l.fill=Yd(s,r,e.propagate));},beforeDraw(n,t,e){let i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let r=s.length-1;r>=0;--r){let a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&Es(n.ctx,a,o));}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){let o=i[s].$filler;zr(o)&&Es(n.ctx,o,n.chartArea);}},beforeDatasetDraw(n,t,e){let i=t.meta.$filler;!zr(i)||e.drawTime!=="beforeDatasetDraw"||Es(n.ctx,i,n.chartArea);},defaults:{propagate:true,drawTime:"beforeDatasetDraw"}},jr=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},lu=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index,vi=class extends J{constructor(t){super(),this._added=false,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=false,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit();}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height);}buildLabels(){let t=this.options.labels||{},e=L(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e;}fit(){let{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,s=N(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=jr(i,o),c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,o,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight);}_fitRows(t,e,i,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a,d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,p)=>{let m=i+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(p>0?0:1)]=0,f+=h,u++),l[p]={left:0,top:f,row:u,width:m,height:s},c[c.length-1]+=m+a;}),d}_fitCols(t,e,i,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t,d=a,u=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{let y=i+e/2+o.measureText(m.text).width;b>0&&f+s+2*a>h&&(d+=u+a,c.push({width:u,height:f}),g+=u+a,p++,u=f=0),l[b]={left:g,top:f,col:p,width:y,height:s},u=Math.max(u,y),f+=s+a;}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Xt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Q(i,this.left+s,this.right-this.lineWidths[a]);for(let c of e)a!==c.row&&(a=c.row,l=Q(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s;}else {let a=0,l=Q(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of e)c.col!==a&&(a=c.col,l=Q(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s;}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;Yt(t,this),this._draw(),Ut(t);}}_draw(){let{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=D.color,l=Xt(t.rtl,this.left,this.width),c=N(r.font),{color:h,padding:d}=r,u=c.size,f=u/2,g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:b}=jr(r,u),y=function(w,k,S){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();let F=C(S.lineWidth,1);if(s.fillStyle=C(S.fillStyle,a),s.lineCap=C(S.lineCap,"butt"),s.lineDashOffset=C(S.lineDashOffset,0),s.lineJoin=C(S.lineJoin,"miter"),s.lineWidth=F,s.strokeStyle=C(S.strokeStyle,a),s.setLineDash(C(S.lineDash,[])),r.usePointStyle){let B={radius:m*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:F},R=l.xPlus(w,p/2),K=k+f;Qn(s,B,R,K,r.pointStyleWidth&&p);}else {let B=k+Math.max((u-m)/2,0),R=l.leftForLtr(w,p),K=bt(S.borderRadius);s.beginPath(),Object.values(K).some(et=>et!==0)?Et(s,{x:R,y:B,w:p,h:m,radius:K}):s.rect(R,B,p,m),s.fill(),F!==0&&s.stroke();}s.restore();},x=function(w,k,S){Ot(s,S.text,w,k+b/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)});},_=this.isHorizontal(),v=this._computeTitleHeight();_?g={x:Q(o,this.left+d,this.right-i[0]),y:this.top+d+v,line:0}:g={x:this.left+d,y:Q(o,this.top+v+d,this.bottom-e[0].height),line:0},ai(this.ctx,t.textDirection);let M=b+d;this.legendItems.forEach((w,k)=>{s.strokeStyle=w.fontColor||h,s.fillStyle=w.fontColor||h;let S=s.measureText(w.text).width,F=l.textAlign(w.textAlign||(w.textAlign=r.textAlign)),B=p+f+S,R=g.x,K=g.y;l.setWidth(this.width),_?k>0&&R+B+d>this.right&&(K=g.y+=M,g.line++,R=g.x=Q(o,this.left+d,this.right-i[g.line])):k>0&&K+M>this.bottom&&(R=g.x=R+e[g.line].width+d,g.line++,K=g.y=Q(o,this.top+v+d,this.bottom-e[g.line].height));let et=l.x(R);y(et,K,w),R=as(F,R+p+f,_?R+B:this.right,t.rtl),x(l.x(R),K,w),_?g.x+=B+d:g.y+=M;}),li(this.ctx,t.textDirection);}drawTitle(){let t=this.options,e=t.title,i=N(e.font),s=$(e.padding);if(!e.display)return;let o=Xt(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.size/2,c=s.top+l,h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=Q(t.align,d,this.right-u);else {let g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+Q(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight());}let f=Q(a,d,d+u);r.textAlign=o.textAlign(an(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Ot(r,e.text,f,h,i);}_computeTitleHeight(){let t=this.options.title,e=N(t.font),i=$(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(mt(t,this.left,this.right)&&mt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],mt(t,s.left,s.left+s.width)&&mt(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){let e=this.options;if(!cu(t.type,e))return;let i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=lu(s,i);s&&!o&&L(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&L(e.onHover,[t,i,this],this);}else i&&L(e.onClick,[t,i,this],this);}};function cu(n,t){return !!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var ya={id:"legend",_element:vi,start(n,t,e){let i=n.legend=new vi({ctx:n.ctx,options:e,chart:n});gt.configure(n,i,e),gt.addBox(n,i);},stop(n){gt.removeBox(n,n.legend),delete n.legend;},beforeUpdate(n,t,e){let i=n.legend;gt.configure(n,i,e),i.options=e;},afterUpdate(n){let t=n.legend;t.buildLabels(),t.adjustHitBoxes();},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event);},defaults:{display:true,position:"top",align:"center",fullSize:true,reverse:false,weight:1e3,onClick(n,t,e){let i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=true):(s.show(i),t.hidden=false);},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){let t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:o}}=n.legend.options;return n._getSortedDatasetMetas().map(r=>{let a=r.controller.getStyle(e?0:void 0),l=$(a.borderWidth);return {text:t[r.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!r.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:r.index}},this)}},title:{color:n=>n.chart.options.color,display:false,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}},wi=class extends J{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,e){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let s=E(i.text)?i.text.length:1;this._padding=$(i.padding);let o=s*N(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o;}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:i,bottom:s,right:o,options:r}=this,a=r.align,l=0,c,h,d;return this.isHorizontal()?(h=Q(a,i,o),d=e+t,c=o-i):(r.position==="left"?(h=i+t,d=Q(a,s,e),l=O*-0.5):(h=o-t,d=Q(a,e,s),l=O*.5),c=s-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=N(e.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Ot(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:an(e.align),textBaseline:"middle",translation:[r,a]});}};function hu(n,t){let e=new wi({ctx:n.ctx,options:t,chart:n});gt.configure(n,e,t),gt.addBox(n,e),n.titleBlock=e;}var xa={id:"title",_element:wi,start(n,t,e){hu(n,e);},stop(n){let t=n.titleBlock;gt.removeBox(n,t),delete n.titleBlock;},beforeUpdate(n,t,e){let i=n.titleBlock;gt.configure(n,i,e),i.options=e;},defaults:{align:"center",display:false,font:{weight:"bold"},fullSize:true,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:true,_indexable:false}};var xn={average(n){if(!n.length)return false;let t,e,i=0,s=0,o=0;for(t=0,e=n.length;t<e;++t){let r=n[t].element;if(r&&r.hasValue()){let a=r.tooltipPosition();i+=a.x,s+=a.y,++o;}}return {x:i/o,y:s/o}},nearest(n,t){if(!n.length)return false;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=n.length;o<r;++o){let l=n[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),h=Dt(t,c);h<s&&(s=h,a=l);}}if(a){let l=a.tooltipPosition();e=l.x,i=l.y;}return {x:e,y:i}}};function wt(n,t){return t&&(E(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function It(n){return (typeof n=="string"||n instanceof String)&&n.indexOf(`
2
- `)>-1?n.split(`
3
- `):n}function du(n,t){let{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return {chart:n,label:r,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Hr(n,t){let e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:r,boxHeight:a}=t,l=N(t.bodyFont),c=N(t.titleFont),h=N(t.footerFont),d=o.length,u=s.length,f=i.length,g=$(t.padding),p=g.height,m=0,b=i.reduce((_,v)=>_+v.before.length+v.lines.length+v.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){let _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*_+(b-f)*l.lineHeight+(b-1)*t.bodySpacing;}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0,x=function(_){m=Math.max(m,e.measureText(_).width+y);};return e.save(),e.font=c.string,I(n.title,x),e.font=l.string,I(n.beforeBody.concat(n.afterBody),x),y=t.displayColors?r+2+t.boxPadding:0,I(i,_=>{I(_.before,x),I(_.lines,x),I(_.after,x);}),y=0,e.font=h.string,I(n.footer,x),e.restore(),m+=g.width,{width:m,height:p}}function uu(n,t){let{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function fu(n,t,e,i){let{x:s,width:o}=i,r=e.caretSize+e.caretPadding;if(n==="left"&&s+o+r>t.width||n==="right"&&s-o-r<0)return true}function gu(n,t,e,i){let{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=n,c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),fu(c,n,t,e)&&(c="center"),c}function Vr(n,t,e){let i=e.yAlign||t.yAlign||uu(n,e);return {xAlign:e.xAlign||t.xAlign||gu(n,t,e,i),yAlign:i}}function pu(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function mu(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function $r(n,t,e,i){let{caretSize:s,caretPadding:o,cornerRadius:r}=n,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=bt(r),g=pu(t,a),p=mu(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+s:a==="right"&&(g+=Math.max(d,f)+s),{x:Z(g,0,i.width-t.width),y:Z(p,0,i.height-t.height)}}function gi(n,t,e){let i=$(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Yr(n){return wt([],It(n))}function bu(n,t,e){return vt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ur(n,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}var Mn=class extends J{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||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0;}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0;}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new Le(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=bu(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),o=i.title.apply(this,[t]),r=i.afterTitle.apply(this,[t]),a=[];return a=wt(a,It(s)),a=wt(a,It(o)),a=wt(a,It(r)),a}getBeforeBody(t,e){return Yr(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){let{callbacks:i}=e,s=[];return I(t,o=>{let r={before:[],lines:[],after:[]},a=Ur(i,o);wt(r.before,It(a.beforeLabel.call(this,o))),wt(r.lines,a.label.call(this,o)),wt(r.after,It(a.afterLabel.call(this,o))),s.push(r);}),s}getAfterBody(t,e){return Yr(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){let{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),o=i.footer.apply(this,[t]),r=i.afterFooter.apply(this,[t]),a=[];return a=wt(a,It(s)),a=wt(a,It(o)),a=wt(a,It(r)),a}_createItems(t){let e=this._active,i=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(du(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,u)=>t.filter(h,d,u,i))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,i))),I(a,h=>{let d=Ur(t.callbacks,h);s.push(d.labelColor.call(this,h)),o.push(d.labelPointStyle.call(this,h)),r.push(d.labelTextColor.call(this,h));}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){let i=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else {let a=xn[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);let l=this._size=Hr(this,i),c=Object.assign({},a,l),h=Vr(this.chart,i,c),d=$r(i,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&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e});}drawCaret(t,e,i,s){let o=this.getCaretPosition(t,i,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3);}getCaretPosition(t,e,i){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=bt(a),{x:u,y:f}=t,{width:g,height:p}=e,m,b,y,x,_,v;return o==="center"?(_=f+p/2,s==="left"?(m=u,b=m-r,x=_+r,v=_-r):(m=u+g,b=m+r,x=_-r,v=_+r),y=m):(s==="left"?b=u+Math.max(l,h)+r:s==="right"?b=u+g-Math.max(c,d)-r:b=this.caretX,o==="top"?(x=f,_=x-r,m=b-r,y=b+r):(x=f+p,_=x+r,m=b+r,y=b-r),v=x),{x1:m,x2:b,x3:y,y1:x,y2:_,y3:v}}drawTitle(t,e,i){let s=this.title,o=s.length,r,a,l;if(o){let c=Xt(i.rtl,this.x,this.width);for(t.x=gi(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=N(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a);}}_drawColorBox(t,e,i,s,o){let r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c,boxPadding:h}=o,d=N(o.bodyFont),u=gi(this,"left",o),f=s.x(u),g=l<d.lineHeight?(d.lineHeight-l)/2:0,p=e.y+g;if(o.usePointStyle){let m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=s.leftForLtr(f,c)+c/2,y=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,cn(t,m,b,y),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,cn(t,m,b,y);}else {t.lineWidth=P(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let m=s.leftForLtr(f,c-h),b=s.leftForLtr(s.xPlus(f,1),c-h-2),y=bt(r.borderRadius);Object.values(y).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Et(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Et(t,{x:b,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,p+1,c-2,l-2));}t.fillStyle=this.labelTextColors[i];}drawBody(t,e,i){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,d=N(i.bodyFont),u=d.lineHeight,f=0,g=Xt(i.rtl,this.x,this.width),p=function(k){e.fillText(k,g.x(t.x+f),t.y+u/2),t.y+=u+o;},m=g.textAlign(r),b,y,x,_,v,M,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=gi(this,m,i),e.fillStyle=i.bodyColor,I(this.beforeBody,p),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,_=0,M=s.length;_<M;++_){for(b=s[_],y=this.labelTextColors[_],e.fillStyle=y,I(b.before,p),x=b.lines,a&&x.length&&(this._drawColorBox(e,t,_,g,i),u=Math.max(d.lineHeight,l)),v=0,w=x.length;v<w;++v)p(x[v]),u=d.lineHeight;I(b.after,p);}f=0,u=d.lineHeight,I(this.afterBody,p),t.y-=o;}drawFooter(t,e,i){let s=this.footer,o=s.length,r,a;if(o){let l=Xt(i.rtl,this.x,this.width);for(t.x=gi(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",r=N(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing;}}drawBackground(t,e,i,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=bt(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-u,l),e.quadraticCurveTo(a+c,l,a+c,l+u),r==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+h-g),e.quadraticCurveTo(a+c,l+h,a+c-g,l+h),r==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke();}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){let r=xn[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=Hr(this,t),l=Object.assign({},r,this._size),c=Vr(e,t,l),h=$r(t,l,c,e);(s._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){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let r=$(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=i,this.drawBackground(o,t,s,e),ai(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),li(t,e.textDirection),t.restore());}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,s=t.map(({datasetIndex:a,index:l})=>{let 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=!Oe(i,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=true,this.update(true));}handleEvent(t,e,i=true){if(e&&this._ignoreReplayEvents)return false;this._ignoreReplayEvents=false;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!Oe(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(true,e))),l}_getActiveElements(t,e,i,s){let o=this.options;if(t.type==="mouseout")return [];if(!s)return e;let r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){let{caretX:i,caretY:s,options:o}=this,r=xn[o.position].call(this,t,e);return r!==false&&(i!==r.x||s!==r.y)}};Mn.positioners=xn;var _a={id:"tooltip",_element:Mn,positioners:xn,afterInit(n,t,e){e&&(n.tooltip=new Mn({chart:n,options:e}));},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e);},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e);},afterDraw(n){let t=n.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",e)===false)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e);}},afterEvent(n,t){if(n.tooltip){let e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=true);}},defaults:{enabled:true,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:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:true,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:{beforeTitle:pt,title(n){if(n.length>0){let t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return ""},afterTitle:pt,beforeBody:pt,beforeLabel:pt,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");let e=n.formattedValue;return A(e)||(t+=e),t},labelColor(n){let e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.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(n){let e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return {pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:pt,afterBody:pt,beforeFooter:pt,footer:pt,afterFooter:pt}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:false,callbacks:{_scriptable:false,_indexable:false},animation:{_fallback:false},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};var yu=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function xu(n,t,e,i){let s=n.indexOf(t);if(s===-1)return yu(n,t,e,i);let o=n.lastIndexOf(t);return s!==o?e:s}var _u=(n,t)=>n===null?null:Z(Math.round(n),0,t),me=class extends pe{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[];}init(t){let e=this._addedLabels;if(e.length){let i=this.getLabels();for(let{index:s,label:o}of e)i[s]===o&&i.splice(s,1);this._addedLabels=[];}super.init(t);}parse(t,e){if(A(t))return null;let i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:xu(i,t,C(e,t),this._addedLabels),_u(e,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(true);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s;}buildTicks(){let t=this.min,e=this.max,i=this.options.offset,s=[],o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){let e=this.getLabels();return t>=0&&t<e.length?e[t]: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){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};me.id="category";me.defaults={ticks:{callback:me.prototype.getLabelForValue}};function vu(n,t){let e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=n,f=o||1,g=h-1,{min:p,max:m}=t,b=!A(r),y=!A(a),x=!A(c),_=(m-p)/(d+1),v=jn((m-p)/g/f)*f,M,w,k,S;if(v<1e-14&&!b&&!y)return [{value:p},{value:m}];S=Math.ceil(m/v)-Math.floor(p/v),S>g&&(v=jn(S*v/g/f)*f),A(l)||(M=Math.pow(10,l),v=Math.ceil(v*M)/M),s==="ticks"?(w=Math.floor(p/v)*v,k=Math.ceil(m/v)*v):(w=p,k=m),b&&y&&o&&es((a-r)/o,v/1e3)?(S=Math.round(Math.min((a-r)/v,h)),v=(a-r)/S,w=r,k=a):x?(w=b?r:w,k=y?a:k,S=c-1,v=(k-w)/S):(S=(k-w)/v,le(S,Math.round(S),v/1e3)?S=Math.round(S):S=Math.ceil(S));let F=Math.max(Vn(v),Vn(w));M=Math.pow(10,A(l)?F:l),w=Math.round(w*M)/M,k=Math.round(k*M)/M;let B=0;for(b&&(u&&w!==r?(e.push({value:r}),w<r&&B++,le(Math.round((w+B*v)*M)/M,r,Xr(r,_,n))&&B++):w<r&&B++);B<S;++B)e.push({value:Math.round((w+B*v)*M)/M});return y&&u&&k!==a?e.length&&le(e[e.length-1].value,a,Xr(a,_,n))?e[e.length-1].value=a:e.push({value:a}):(!y||k===a)&&e.push({value:k}),e}function Xr(n,t,{horizontal:e,minRotation:i}){let s=U(i),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+n).length;return Math.min(t/o,r)}var Ne=class extends pe{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 A(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=e?s:l,a=l=>o=i?o:l;if(t){let l=ft(s),c=ft(o);l<0&&c<0?a(0):l>0&&c>0&&r(0);}if(s===o){let l=1;(o>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(o*.05)),a(o+l),t||r(s-l);}this.min=s,this.max=o;}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==false},o=this._range||this,r=vu(s,o);return t.bounds==="ticks"&&Hn(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(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s;}this._startValue=e,this._endValue=i,this._valueRange=i-e;}getLabelForValue(t){return ue(t,this.chart.options.locale,this.options.ticks.format)}},je=class extends Ne{determineDataLimits(){let{min:t,max:e}=this.getMinMax(true);this.min=V(t)?t:0,this.max=V(e)?e:1,this.handleTickRangeOptions();}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=U(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};je.id="linear";je.defaults={ticks:{callback:Ci.formatters.numeric}};function Kr(n){return n/Math.pow(10,Math.floor(ot(n)))===1}function wu(n,t){let e=Math.floor(ot(t.max)),i=Math.ceil(t.max/Math.pow(10,e)),s=[],o=st(n.min,Math.pow(10,Math.floor(ot(t.min)))),r=Math.floor(ot(o)),a=Math.floor(o/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do s.push({value:o,major:Kr(o)}),++a,a===10&&(a=1,++r,l=r>=0?1:l),o=Math.round(a*Math.pow(10,r)*l)/l;while(r<e||r===e&&a<i);let c=st(n.max,o);return s.push({value:c,major:Kr(o)}),s}var Mi=class extends pe{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0;}parse(t,e){let i=Ne.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=true;return}return V(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(true);this.min=V(t)?Math.max(0,t):null,this.max=V(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=true),this.handleTickRangeOptions();}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,s=this.max,o=l=>i=t?i:l,r=l=>s=e?s:l,a=(l,c)=>Math.pow(10,Math.floor(ot(l))+c);i===s&&(i<=0?(o(1),r(10)):(o(a(i,-1)),r(a(s,1)))),i<=0&&o(a(s,-1)),s<=0&&r(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&o(a(i,-1)),this.min=i,this.max=s;}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=wu(e,this);return t.bounds==="ticks"&&Hn(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":ue(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=ot(t),this._valueRange=ot(this.max)-ot(t);}getPixelForValue(t){return (t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ot(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};Mi.id="logarithmic";Mi.defaults={ticks:{callback:Ci.formatters.logarithmic,major:{enabled:true}}};function Ys(n){let t=n.ticks;if(t.display&&n.display){let e=$(t.backdropPadding);return C(t.font&&t.font.size,D.font.size)+e.height}return 0}function Mu(n,t,e){return e=E(e)?e:[e],{w:us(n,t.string,e),h:e.length*t.lineHeight}}function Gr(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function Su(n){let t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],o=n._pointLabels.length,r=n.options.pointLabels,a=r.centerPointLabels?O/o:0;for(let l=0;l<o;l++){let c=r.setContext(n.getPointLabelContext(l));s[l]=c.padding;let h=n.getPointPosition(l,n.drawingArea+s[l],a),d=N(c.font),u=Mu(n.ctx,d,n._pointLabels[l]);i[l]=u;let f=nt(n.getIndexAngle(l)+a),g=Math.round(ce(f)),p=Gr(g,h.x,u.w,0,180),m=Gr(g,h.y,u.h,90,270);Cu(e,t,f,p,m);}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=ku(n,i,s);}function Cu(n,t,e,i,s){let o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e)),a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,n.b=Math.max(n.b,t.b+l));}function ku(n,t,e){let i=[],s=n._pointLabels.length,o=n.options,r=Ys(o)/2,a=n.drawingArea,l=o.pointLabels.centerPointLabels?O/s:0;for(let c=0;c<s;c++){let h=n.getPointPosition(c,a+r+e[c],l),d=Math.round(ce(nt(h.angle+W))),u=t[c],f=Du(h.y,u.h,d),g=Pu(d),p=Tu(h.x,u.w,g);i.push({x:h.x,y:f,textAlign:g,left:p,top:f,right:p+u.w,bottom:f+u.h});}return i}function Pu(n){return n===0||n===180?"center":n<180?"left":"right"}function Tu(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Du(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Au(n,t){let{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){let o=i.setContext(n.getPointLabelContext(s)),r=N(o.font),{x:a,y:l,textAlign:c,left:h,top:d,right:u,bottom:f}=n._pointLabelItems[s],{backdropColor:g}=o;if(!A(g)){let p=bt(o.borderRadius),m=$(o.backdropPadding);e.fillStyle=g;let b=h-m.left,y=d-m.top,x=u-h+m.width,_=f-d+m.height;Object.values(p).some(v=>v!==0)?(e.beginPath(),Et(e,{x:b,y,w:x,h:_,radius:p}),e.fill()):e.fillRect(b,y,x,_);}Ot(e,n._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"});}}function va(n,t,e,i){let{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,z);else {let o=n.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=n.getPointPosition(r,t),s.lineTo(o.x,o.y);}}function Ou(n,t,e,i){let s=n.ctx,o=t.circular,{color:r,lineWidth:a}=t;!o&&!i||!r||!a||e<0||(s.save(),s.strokeStyle=r,s.lineWidth=a,s.setLineDash(t.borderDash),s.lineDashOffset=t.borderDashOffset,s.beginPath(),va(n,e,o,i),s.closePath(),s.stroke(),s.restore());}function Eu(n,t,e){return vt(n,{label:e,index:t,type:"pointLabel"})}var He=class extends Ne{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[];}setDimensions(){let t=this._padding=$(Ys(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2);}determineDataLimits(){let{min:t,max:e}=this.getMinMax(false);this.min=V(t)&&!isNaN(t)?t:0,this.max=V(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions();}computeTickLimit(){return Math.ceil(this.drawingArea/Ys(this.options))}generateTickLabels(t){Ne.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{let s=L(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i));}fit(){let t=this.options;t.display&&t.pointLabels.display?Su(this):this.setCenterPoint(0,0,0,0);}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s));}getIndexAngle(t){let e=z/(this._pointLabels.length||1),i=this.options.startAngle||0;return nt(t*e+U(i))}getDistanceFromCenterForValue(t){if(A(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(A(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t<e.length){let i=e[t];return Eu(this.getContext(),t,i)}}getPointPosition(t,e,i=0){let s=this.getIndexAngle(t)-W+i;return {x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:e,top:i,right:s,bottom:o}=this._pointLabelItems[t];return {left:e,top:i,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:e}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),va(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore();}}drawGrid(){let t=this.ctx,e=this.options,{angleLines:i,grid:s}=e,o=this._pointLabels.length,r,a,l;if(e.pointLabels.display&&Au(this,o),s.display&&this.ticks.forEach((c,h)=>{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);let d=s.setContext(this.getContext(h-1));Ou(this,d,a,o);}}),i.display){for(t.save(),r=o-1;r>=0;r--){let c=i.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:d}=c;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke());}t.restore();}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let s=this.getIndexAngle(0),o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;let c=i.setContext(this.getContext(l)),h=N(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let d=$(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height);}Ot(t,a.label,0,-o,h,{color:c.color});}),t.restore();}drawTitle(){}};He.id="radialLinear";He.defaults={display:true,animate:true,position:"chartArea",angleLines:{display:true,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:false},startAngle:0,ticks:{showLabelBackdrop:true,callback:Ci.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:true,font:{size:10},callback(n){return n},padding:5,centerPointLabels:false}};He.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};He.descriptors={angleLines:{_fallback:"grid"}};var ki={millisecond:{common:true,size:1,steps:1e3},second:{common:true,size:1e3,steps:60},minute:{common:true,size:6e4,steps:60},hour:{common:true,size:36e5,steps:24},day:{common:true,size:864e5,steps:30},week:{common:false,size:6048e5,steps:4},month:{common:true,size:2628e6,steps:12},quarter:{common:false,size:7884e6,steps:4},year:{common:true,size:3154e7}},rt=Object.keys(ki);function Ru(n,t){return n-t}function qr(n,t){if(A(t))return null;let e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts,r=t;return typeof i=="function"&&(r=i(r)),V(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(ct(o)||o===true)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function Jr(n,t,e,i){let s=rt.length;for(let o=rt.indexOf(n);o<s-1;++o){let r=ki[rt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return rt[o]}return rt[s-1]}function Lu(n,t,e,i,s){for(let o=rt.length-1;o>=rt.indexOf(e);o--){let r=rt[o];if(ki[r].common&&n._adapter.diff(s,i,r)>=t-1)return r}return rt[e?rt.indexOf(e):0]}function Iu(n){for(let t=rt.indexOf(n)+1,e=rt.length;t<e;++t)if(ki[rt[t]].common)return rt[t]}function Zr(n,t,e){if(!e)n[t]=true;else if(e.length){let{lo:i,hi:s}=rn(e,t),o=e[i]>=t?e[i]:e[s];n[o]=true;}}function Fu(n,t,e,i){let s=n._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value,a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=true);return t}function Qr(n,t,e){let i=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:false});return o===0||!e?i:Fu(n,i,s,e)}var Ve=class extends pe{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=false,this._parseOpts=void 0;}init(t,e){let i=t.time||(t.time={}),s=this._adapter=new zh._date(t.adapters.date);s.init(e),ae(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized;}parse(t,e){return t===void 0?null:qr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]};}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,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(false))),s=V(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=V(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o);}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,r=this.max,a=ss(s,o,r);return this._unit=e.unit||(i.autoSkip?Jr(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Lu(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Iu(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Qr(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value));}initOffsets(t){let e=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;e=Z(e,0,r),i=Z(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)};}_generate(){let t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||Jr(o.minUnit,e,i,this._getLabelCapacity(e)),a=C(o.stepSize,1),l=r==="week"?o.isoWeekday:false,c=ct(l)||l===true,h={},d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);let g=s.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<i;u=+t.add(u,a,r),f++)Zr(h,u,g);return (u===i||s.bounds==="ticks"||f===1)&&Zr(h,u,g),Object.keys(h).sort((p,m)=>p-m).map(p=>+p)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){let o=this.options,r=o.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=i[e],u=l&&h&&d&&d.major,f=this._adapter.format(t,s||(u?h:c)),g=o.ticks.callback;return g?L(g,[f,e,i],this):f}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t);}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,i=this.ctx.measureText(t).width,s=U(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return {w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){let e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,Qr(this,[t],this._majorUnit),s),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,i;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],e,i;if(t.length)return t;let s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(qr(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Un(t.sort(Ru))}};Ve.id="time";Ve.defaults={bounds:"data",adapters:{},time:{parser:false,unit:false,round:false,isoWeekday:false,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:false}}};function pi(n,t,e){let i=0,s=n.length-1,o,r,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Tt(n,"pos",t)),{pos:o,time:a}=n[i],{pos:r,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Tt(n,"time",t)),{time:o,pos:a}=n[i],{time:r,pos:l}=n[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var Si=class extends Ve{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0;}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=pi(e,this.min),this._tableRange=pi(e,this.max)-this._minPos,super.initOffsets(t);}buildLookupTable(t){let{min:e,max:i}=this,s=[],o=[],r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=i&&s.push(c);if(s.length<2)return [{time:e,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)h=s[r+1],l=s[r-1],c=s[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return (pi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return pi(this._table,i*this._tableRange+this._minPos,true)}};Si.id="timeseries";Si.defaults=Ve.defaults;var wa=(function(){if(typeof window!="undefined"){if(window.devicePixelRatio)return window.devicePixelRatio;var n=window.screen;if(n)return (n.deviceXDPI||1)/(n.logicalXDPI||1)}return 1})(),kn={toTextLines:function(n){var t=[],e;for(n=[].concat(n);n.length;)e=n.pop(),typeof e=="string"?t.unshift.apply(t,e.split(`
4
- `)):Array.isArray(e)?n.push.apply(n,e):A(n)||t.unshift(""+e);return t},textSize:function(n,t,e){var i=[].concat(t),s=i.length,o=n.font,r=0,a;for(n.font=e.string,a=0;a<s;++a)r=Math.max(n.measureText(i[a]).width,r);return n.font=o,{height:s*e.lineHeight,width:r}},bound:function(n,t,e){return Math.max(n,Math.min(t,e))},arrayDiff:function(n,t){var e=n.slice(),i=[],s,o,r,a;for(s=0,r=t.length;s<r;++s)a=t[s],o=e.indexOf(a),o===-1?i.push([a,1]):e.splice(o,1);for(s=0,r=e.length;s<r;++s)i.push([e[s],-1]);return i},rasterize:function(n){return Math.round(n*wa)/wa}};function Xs(n,t){var e=t.x,i=t.y;if(e===null)return {x:0,y:-1};if(i===null)return {x:1,y:0};var s=n.x-e,o=n.y-i,r=Math.sqrt(s*s+o*o);return {x:r?s/r:0,y:r?o/r:-1}}function zu(n,t,e,i,s){switch(s){case "center":e=i=0;break;case "bottom":e=0,i=1;break;case "right":e=1,i=0;break;case "left":e=-1,i=0;break;case "top":e=0,i=-1;break;case "start":e=-e,i=-i;break;case "end":break;default:s*=Math.PI/180,e=Math.cos(s),i=Math.sin(s);break}return {x:n,y:t,vx:e,vy:i}}var Bu=0,Sa=1,Ca=2,ka=4,Pa=8;function Pi(n,t,e){var i=Bu;return n<e.left?i|=Sa:n>e.right&&(i|=Ca),t<e.top?i|=Pa:t>e.bottom&&(i|=ka),i}function Wu(n,t){for(var e=n.x0,i=n.y0,s=n.x1,o=n.y1,r=Pi(e,i,t),a=Pi(s,o,t),l,c,h;!(!(r|a)||r&a);)l=r||a,l&Pa?(c=e+(s-e)*(t.top-i)/(o-i),h=t.top):l&ka?(c=e+(s-e)*(t.bottom-i)/(o-i),h=t.bottom):l&Ca?(h=i+(o-i)*(t.right-e)/(s-e),c=t.right):l&Sa&&(h=i+(o-i)*(t.left-e)/(s-e),c=t.left),l===r?(e=c,i=h,r=Pi(e,i,t)):(s=c,o=h,a=Pi(s,o,t));return {x0:e,x1:s,y0:i,y1:o}}function Ti(n,t){var e=t.anchor,i=n,s,o;return t.clamp&&(i=Wu(i,t.area)),e==="start"?(s=i.x0,o=i.y0):e==="end"?(s=i.x1,o=i.y1):(s=(i.x0+i.x1)/2,o=(i.y0+i.y1)/2),zu(s,o,n.vx,n.vy,t.align)}var Di={arc:function(n,t){var e=(n.startAngle+n.endAngle)/2,i=Math.cos(e),s=Math.sin(e),o=n.innerRadius,r=n.outerRadius;return Ti({x0:n.x+i*o,y0:n.y+s*o,x1:n.x+i*r,y1:n.y+s*r,vx:i,vy:s},t)},point:function(n,t){var e=Xs(n,t.origin),i=e.x*n.options.radius,s=e.y*n.options.radius;return Ti({x0:n.x-i,y0:n.y-s,x1:n.x+i,y1:n.y+s,vx:e.x,vy:e.y},t)},bar:function(n,t){var e=Xs(n,t.origin),i=n.x,s=n.y,o=0,r=0;return n.horizontal?(i=Math.min(n.x,n.base),o=Math.abs(n.base-n.x)):(s=Math.min(n.y,n.base),r=Math.abs(n.base-n.y)),Ti({x0:i,y0:s+r,x1:i+o,y1:s,vx:e.x,vy:e.y},t)},fallback:function(n,t){var e=Xs(n,t.origin);return Ti({x0:n.x,y0:n.y,x1:n.x+(n.width||0),y1:n.y+(n.height||0),vx:e.x,vy:e.y},t)}},Wt=kn.rasterize;function Nu(n){var t=n.borderWidth||0,e=n.padding,i=n.size.height,s=n.size.width,o=-s/2,r=-i/2;return {frame:{x:o-e.left-t,y:r-e.top-t,w:s+e.width+t*2,h:i+e.height+t*2},text:{x:o,y:r,w:s,h:i}}}function ju(n,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 i=e.getBasePixel();return n.horizontal?{x:i,y:null}:{x:null,y:i}}function Hu(n){return n instanceof Ft?Di.arc:n instanceof zt?Di.point:n instanceof Bt?Di.bar:Di.fallback}function Vu(n,t,e,i,s,o){var r=Math.PI/2;if(o){var a=Math.min(o,s/2,i/2),l=t+a,c=e+a,h=t+i-a,d=e+s-a;n.moveTo(t,c),l<h&&c<d?(n.arc(l,c,a,-Math.PI,-r),n.arc(h,c,a,-r,0),n.arc(h,d,a,0,r),n.arc(l,d,a,r,Math.PI)):l<h?(n.moveTo(l,e),n.arc(h,c,a,-r,r),n.arc(l,c,a,r,Math.PI+r)):c<d?(n.arc(l,c,a,-Math.PI,0),n.arc(l,d,a,0,Math.PI)):n.arc(l,c,a,-Math.PI,Math.PI),n.closePath(),n.moveTo(t,e);}else n.rect(t,e,i,s);}function $u(n,t,e){var i=e.backgroundColor,s=e.borderColor,o=e.borderWidth;!i&&(!s||!o)||(n.beginPath(),Vu(n,Wt(t.x)+o/2,Wt(t.y)+o/2,Wt(t.w)-o,Wt(t.h)-o,e.borderRadius),n.closePath(),i&&(n.fillStyle=i,n.fill()),s&&o&&(n.strokeStyle=s,n.lineWidth=o,n.lineJoin="miter",n.stroke()));}function Yu(n,t,e){var i=e.lineHeight,s=n.w,o=n.x,r=n.y+i/2;return t==="center"?o+=s/2:(t==="end"||t==="right")&&(o+=s),{h:i,w:s,x:o,y:r}}function Uu(n,t,e){var i=n.shadowBlur,s=e.stroked,o=Wt(e.x),r=Wt(e.y),a=Wt(e.w);s&&n.strokeText(t,o,r,a),e.filled&&(i&&s&&(n.shadowBlur=0),n.fillText(t,o,r,a),i&&s&&(n.shadowBlur=i));}function Xu(n,t,e,i){var s=i.textAlign,o=i.color,r=!!o,a=i.font,l=t.length,c=i.textStrokeColor,h=i.textStrokeWidth,d=c&&h,u;if(!(!l||!r&&!d))for(e=Yu(e,s,a),n.font=a.string,n.textAlign=s,n.textBaseline="middle",n.shadowBlur=i.textShadowBlur,n.shadowColor=i.textShadowColor,r&&(n.fillStyle=o),d&&(n.lineJoin="round",n.lineWidth=h,n.strokeStyle=c),u=0,l=t.length;u<l;++u)Uu(n,t[u],{stroked:d,filled:r,w:e.w,x:e.x,y:e.y+e.h*u});}var Ta=function(n,t,e,i){var s=this;s._config=n,s._index=i,s._model=null,s._rects=null,s._ctx=t,s._el=e;};lt(Ta.prototype,{_modelize:function(n,t,e,i){var s=this,o=s._index,r=N(j([e.font,{}],i,o)),a=j([e.color,D.color],i,o);return {align:j([e.align,"center"],i,o),anchor:j([e.anchor,"center"],i,o),area:i.chart.chartArea,backgroundColor:j([e.backgroundColor,null],i,o),borderColor:j([e.borderColor,null],i,o),borderRadius:j([e.borderRadius,0],i,o),borderWidth:j([e.borderWidth,0],i,o),clamp:j([e.clamp,false],i,o),clip:j([e.clip,false],i,o),color:a,display:n,font:r,lines:t,offset:j([e.offset,4],i,o),opacity:j([e.opacity,1],i,o),origin:ju(s._el,i),padding:$(j([e.padding,4],i,o)),positioner:Hu(s._el),rotation:j([e.rotation,0],i,o)*(Math.PI/180),size:kn.textSize(s._ctx,t,r),textAlign:j([e.textAlign,"start"],i,o),textShadowBlur:j([e.textShadowBlur,0],i,o),textShadowColor:j([e.textShadowColor,a],i,o),textStrokeColor:j([e.textStrokeColor,a],i,o),textStrokeWidth:j([e.textStrokeWidth,0],i,o)}},update:function(n){var t=this,e=null,i=null,s=t._index,o=t._config,r,a,l,c=j([o.display,true],n,s);c&&(r=n.dataset.data[s],a=C(L(o.formatter,[r,n]),r),l=A(a)?[]:kn.toTextLines(a),l.length&&(e=t._modelize(c,l,o,n),i=Nu(e))),t._model=e,t._rects=i;},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(n,t){var e=this,i=n.ctx,s=e._model,o=e._rects,r;this.visible()&&(i.save(),s.clip&&(r=s.area,i.beginPath(),i.rect(r.left,r.top,r.right-r.left,r.bottom-r.top),i.clip()),i.globalAlpha=kn.bound(0,s.opacity,1),i.translate(Wt(t.x),Wt(t.y)),i.rotate(s.rotation),$u(i,o.frame,s),Xu(i,s.lines,o.text,s),i.restore());}});var Ku=Number.MIN_SAFE_INTEGER||-9007199254740991,Gu=Number.MAX_SAFE_INTEGER||9007199254740991;function Cn(n,t,e){var i=Math.cos(e),s=Math.sin(e),o=t.x,r=t.y;return {x:o+i*(n.x-o)-s*(n.y-r),y:r+s*(n.x-o)+i*(n.y-r)}}function Ma(n,t){var e=Gu,i=Ku,s=t.origin,o,r,a,l,c;for(o=0;o<n.length;++o)r=n[o],a=r.x-s.x,l=r.y-s.y,c=t.vx*a+t.vy*l,e=Math.min(e,c),i=Math.max(i,c);return {min:e,max:i}}function Ai(n,t){var e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);return {vx:(t.x-n.x)/s,vy:(t.y-n.y)/s,origin:n,ln:s}}var Da=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0};};lt(Da.prototype,{center:function(){var n=this._rect;return {x:n.x+n.w/2,y:n.y+n.h/2}},update:function(n,t,e){this._rotation=e,this._rect={x:t.x+n.x,y:t.y+n.y,w:t.w,h:t.h};},contains:function(n){var t=this,e=1,i=t._rect;return n=Cn(n,t.center(),-t._rotation),!(n.x<i.x-e||n.y<i.y-e||n.x>i.x+i.w+e*2||n.y>i.y+i.h+e*2)},intersects:function(n){var t=this._points(),e=n._points(),i=[Ai(t[0],t[1]),Ai(t[0],t[3])],s,o,r;for(this._rotation!==n._rotation&&i.push(Ai(e[0],e[1]),Ai(e[0],e[3])),s=0;s<i.length;++s)if(o=Ma(t,i[s]),r=Ma(e,i[s]),o.max<r.min||r.max<o.min)return false;return true},_points:function(){var n=this,t=n._rect,e=n._rotation,i=n.center();return [Cn({x:t.x,y:t.y},i,e),Cn({x:t.x+t.w,y:t.y},i,e),Cn({x:t.x+t.w,y:t.y+t.h},i,e),Cn({x:t.x,y:t.y+t.h},i,e)]}});function Aa(n,t,e){var i=t.positioner(n,t),s=i.vx,o=i.vy;if(!s&&!o)return {x:i.x,y:i.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(s),Math.abs(o));return c*=s*d,h*=o*d,c+=t.offset*s,h+=t.offset*o,{x:i.x+c,y:i.y+h}}function qu(n,t){var e,i,s,o;for(e=n.length-1;e>=0;--e)for(s=n[e].$layout,i=e-1;i>=0&&s._visible;--i)o=n[i].$layout,o._visible&&s._box.intersects(o._box)&&t(s,o);return n}function Ju(n){var t,e,i,s,o,r,a;for(t=0,e=n.length;t<e;++t)i=n[t],s=i.$layout,s._visible&&(a=new Proxy(i._el,{get:(l,c)=>l.getProps([c],true)[c]}),o=i.geometry(),r=Aa(a,i.model(),o),s._box.update(r,o,i.rotation()));return qu(n,function(l,c){var h=l._hidable,d=c._hidable;h&&d||d?c._visible=false:h&&(l._visible=false);})}var Pn={prepare:function(n){var t=[],e,i,s,o,r;for(e=0,s=n.length;e<s;++e)for(i=0,o=n[e].length;i<o;++i)r=n[e][i],t.push(r),r.$layout={_box:new Da,_hidable:false,_visible:true,_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(n){var t=false,e,i,s,o,r;for(e=0,i=n.length;e<i;++e)s=n[e],o=s.model(),r=s.$layout,r._hidable=o&&o.display==="auto",r._visible=s.visible(),t|=r._hidable;t&&Ju(n);},lookup:function(n,t){var e,i;for(e=n.length-1;e>=0;--e)if(i=n[e].$layout,i&&i._visible&&i._box.contains(t))return n[e];return null},draw:function(n,t){var e,i,s,o,r,a;for(e=0,i=t.length;e<i;++e)s=t[e],o=s.$layout,o._visible&&(r=s.geometry(),a=Aa(s._el,s.model(),r),o._box.update(a,r,s.rotation()),s.draw(n,a));}},Zu=function(n){if(A(n))return null;var t=n,e,i,s;if(P(n))if(!A(n.label))t=n.label;else if(!A(n.r))t=n.r;else for(t="",e=Object.keys(n),s=0,i=e.length;s<i;++s)t+=(s!==0?", ":"")+e[s]+": "+n[e[s]];return ""+t},Qu={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:false,clip:false,color:void 0,display:true,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:Zu,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},at="$datalabels",Oa="$default";function tf(n,t){var e=n.datalabels,i={},s=[],o,r;return e===false?null:(e===true&&(e={}),t=lt({},[t,e]),o=t.labels||{},r=Object.keys(o),delete t.labels,r.length?r.forEach(function(a){o[a]&&s.push(lt({},[t,o[a],{_key:a}]));}):s.push(t),i=s.reduce(function(a,l){return I(l.listeners||{},function(c,h){a[h]=a[h]||{},a[h][l._key||Oa]=c;}),delete l.listeners,a},{}),{labels:s,listeners:i})}function Ks(n,t,e,i){if(t){var s=e.$context,o=e.$groups,r;t[o._set]&&(r=t[o._set][o._key],r&&L(r,[s,i])===true&&(n[at]._dirty=true,e.update(s)));}}function ef(n,t,e,i,s){var o,r;!e&&!i||(e?i?e!==i&&(r=o=true):r=true:o=true,r&&Ks(n,t.leave,e,s),o&&Ks(n,t.enter,i,s));}function nf(n,t){var e=n[at],i=e._listeners,s,o;if(!(!i.enter&&!i.leave)){if(t.type==="mousemove")o=Pn.lookup(e._labels,t);else if(t.type!=="mouseout")return;s=e._hovered,e._hovered=o,ef(n,i,s,o,t);}}function sf(n,t){var e=n[at],i=e._listeners.click,s=i&&Pn.lookup(e._labels,t);s&&Ks(n,i,s,t);}var Ea={id:"datalabels",defaults:Qu,beforeInit:function(n){n[at]={_actives:[]};},beforeUpdate:function(n){var t=n[at];t._listened=false,t._listeners={},t._datasets=[],t._labels=[];},afterDatasetUpdate:function(n,t,e){var i=t.index,s=n[at],o=s._datasets[i]=[],r=n.isDatasetVisible(i),a=n.data.datasets[i],l=tf(a,e),c=t.meta.data||[],h=n.ctx,d,u,f,g,p,m,b,y;for(h.save(),d=0,f=c.length;d<f;++d)if(b=c[d],b[at]=[],r&&b&&n.getDataVisibility(d)&&!b.skip)for(u=0,g=l.labels.length;u<g;++u)p=l.labels[u],m=p._key,y=new Ta(p,h,b,d),y.$groups={_set:i,_key:m||Oa},y.$context={active:false,chart:n,dataIndex:d,dataset:a,datasetIndex:i},y.update(y.$context),b[at].push(y),o.push(y);h.restore(),lt(s._listeners,l.listeners,{merger:function(x,_,v){_[x]=_[x]||{},_[x][t.index]=v[x],s._listened=true;}});},afterUpdate:function(n){n[at]._labels=Pn.prepare(n[at]._datasets);},afterDatasetsDraw:function(n){Pn.draw(n,n[at]._labels);},beforeEvent:function(n,t){if(n[at]._listened){var e=t.event;switch(e.type){case "mousemove":case "mouseout":nf(n,e);break;case "click":sf(n,e);break}}},afterEvent:function(n){var t=n[at],e=t._actives,i=t._actives=n.getActiveElements(),s=kn.arrayDiff(e,i),o,r,a,l,c,h,d;for(o=0,r=s.length;o<r;++o)if(c=s[o],c[1])for(d=c[0].element[at]||[],a=0,l=d.length;a<l;++a)h=d[a],h.$context.active=c[1]===1,h.update(h.$context);(t._dirty||s.length)&&(Pn.update(t._labels),n.render()),delete t._dirty;}};var Ra={modes:{point(n,t){return Ei(n,t,{intersect:true})},nearest(n,t,e){return af(n,t,e)},x(n,t,e){return Ei(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Ei(n,t,{intersect:e.intersect,axis:"y"})}}};function io(n,t,e){return (Ra.modes[e.mode]||Ra.modes.nearest)(n,t,e)}function of(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",true)||n.inRange(t.x,t.y,"y",true):n.inRange(t.x,t.y,e,true)}function rf(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Ei(n,t,e){return n.visibleElements.filter(i=>e.intersect?i.inRange(t.x,t.y):of(i,t,e.axis))}function af(n,t,e){let i=Number.POSITIVE_INFINITY;return Ei(n,t,e).reduce((s,o)=>{let r=o.getCenterPoint(),a=rf(t,r,e.axis),l=Dt(t,a);return l<i?(s=[o],i=l):l===i&&s.push(o),s},[]).sort((s,o)=>s._index-o._index).slice(0,1)}var lf=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,be=.001,Li=(n,t,e)=>Math.min(e,Math.max(t,n));function cf(n,t,e){for(let i of Object.keys(n))n[i]=Li(n[i],t,e);return n}function hf(n,t,e,i){if(!n||!t||e<=0)return false;let s=i/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+s,2)}function Za(n,{x:t,y:e,x2:i,y2:s},o,r){let a=r/2,l=n.x>=t-a-be&&n.x<=i+a+be,c=n.y>=e-a-be&&n.y<=s+a+be;return o==="x"?l:(o==="y"||l)&&c}function Xe(n,t){let{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return {x:e,y:i}}function df(n,t,e,i=true){let s=e.split("."),o=0;for(let r of t.split(".")){let a=s[o++];if(parseInt(r,10)<parseInt(a,10))break;if(lf(a,r)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return false}}return true}var Qa=n=>typeof n=="string"&&n.endsWith("%"),tl=n=>parseFloat(n)/100,el=n=>Li(tl(n),0,1);function so(n,t){return t==="start"?0:t==="end"?n:Qa(t)?el(t)*n:n/2}function Qt(n,t,e=true){return typeof t=="number"?t:Qa(t)?(e?el(t):tl(t))*n:n}function uf(n,t){let{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function oo(n,t="center"){return P(n)?{x:C(n.x,t),y:C(n.y,t)}:(n=C(n,t),{x:n,y:n})}function nl(n){return n&&(H(n.xValue)||H(n.yValue))}function Dn(n,t,e,i=false){let s=e.init;if(s){if(s===true)return sl(t,i)}else return;return ff(t,i,L(s,[{chart:n,properties:t,options:e}]))}function il(n,t,e){let i=false;return t.forEach(s=>{tt(n[s])?(i=true,e[s]=n[s]):H(e[s])&&delete e[s];}),i}function sl({centerX:n,centerY:t},e){return e?{centerX:n,centerY:t,radius:0,width:0,height:0}:{x:n,y:t,x2:n,y2:t,width:0,height:0}}function ff(n,t,e){if(e===true)return sl(n,t);if(P(e))return e}var Gs=new Map,gf=n=>isNaN(n)||n<=0,pf=n=>n.reduce(function(t,e){return t+=e.string,t},"");function Ii(n){if(n&&typeof n=="object"){let t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function ro(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(U(i)),n.translate(-t,-e));}function te(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle,n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle,n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,true}function Ke(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY;}function ao(n,t){let e=t.content;if(Ii(e))return {width:Qt(e.width,t.width),height:Qt(e.height,t.height)};let i=t.font,s=E(i)?i.map(l=>N(l)):[N(i)],o=t.textStrokeWidth,r=E(e)?e:[e],a=r.join()+pf(s)+o+(n._measureText?"-spriting":"");return Gs.has(a)||Gs.set(a,_f(n,r,s,o)),Gs.get(a)}function ol(n,t,e){let{x:i,y:s,width:o,height:r}=t;n.save(),Ke(n,e);let a=te(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Et(n,{x:i,y:s,w:o,h:r,radius:cf(bt(e.borderRadius),0,Math.min(o,r)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore();}function mf(n,t,e){let i=e.content;if(Ii(i)){n.save(),n.globalAlpha=Mf(e.opacity,i.style.opacity),n.drawImage(i,t.x,t.y,t.width,t.height),n.restore();return}let s=E(i)?i:[i],o=e.font,r=E(o)?o.map(d=>N(d)):[N(o)],a=e.color,l=E(a)?a:[a],c=uf(t,e),h=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,bf(n,e)&&vf(n,{x:c,y:h},s,r),wf(n,{x:c,y:h},s,{fonts:r,colors:l}),n.restore();}function bf(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,true}function yf(n,t,e,i){let{radius:s,options:o}=t,r=o.pointStyle,a=o.rotation,l=(a||0)*on;if(Ii(r)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(r,-r.width/2,-r.height/2,r.width,r.height),n.restore();return}gf(s)||xf(n,{x:e,y:i,radius:s,rotation:a,style:r,rad:l});}function xf(n,{x:t,y:e,radius:i,rotation:s,style:o,rad:r}){let a,l,c,h;switch(n.beginPath(),o){default:n.arc(t,e,i,0,z),n.closePath();break;case "triangle":n.moveTo(t+Math.sin(r)*i,e-Math.cos(r)*i),r+=Te,n.lineTo(t+Math.sin(r)*i,e-Math.cos(r)*i),r+=Te,n.lineTo(t+Math.sin(r)*i,e-Math.cos(r)*i),n.closePath();break;case "rectRounded":h=i*.516,c=i-h,a=Math.cos(r+ut)*c,l=Math.sin(r+ut)*c,n.arc(t-a,e-l,h,r-O,r-W),n.arc(t+l,e-a,h,r-W,r),n.arc(t+a,e+l,h,r,r+W),n.arc(t-l,e+a,h,r+W,r+O),n.closePath();break;case "rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}r+=ut;case "rectRot":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case "crossRot":r+=ut;case "cross":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case "star":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),r+=ut,a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case "line":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case "dash":n.moveTo(t,e),n.lineTo(t+Math.cos(r)*i,e+Math.sin(r)*i);break}n.fill();}function _f(n,t,e,i){n.save();let s=t.length,o=0,r=i;for(let a=0;a<s;a++){let l=e[Math.min(a,e.length-1)];n.font=l.string;let c=t[a];o=Math.max(o,n.measureText(c).width+i),r+=l.lineHeight;}return n.restore(),{width:o,height:r}}function vf(n,{x:t,y:e},i,s){n.beginPath();let o=0;i.forEach(function(r,a){let l=s[Math.min(a,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(r,t,e+c/2+o),o+=c;}),n.stroke();}function wf(n,{x:t,y:e},i,{fonts:s,colors:o}){let r=0;i.forEach(function(a,l){let c=o[Math.min(l,o.length-1)],h=s[Math.min(l,s.length-1)],d=h.lineHeight;n.beginPath(),n.font=h.string,n.fillStyle=c,n.fillText(a,t,e+d/2+r),r+=d,n.fill();});}function Mf(n,t){let e=ct(n)?n:t;return ct(e)?Li(e,0,1):1}var La={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function $e(n,t,e){return t=typeof t=="number"?t:n.parse(t),V(t)?n.getPixelForValue(t):e}function ye(n,t,e){let i=t[e];if(i||e==="scaleID")return i;let s=e.charAt(0),o=Object.values(n).filter(r=>r.axis&&r.axis===s);return o.length?o[0].id:s}function rl(n,t){if(n){let e=n.options.reverse,i=$e(n,t.min,e?t.end:t.start),s=$e(n,t.max,e?t.start:t.end);return {start:i,end:s}}}function al(n,t){let{chartArea:e,scales:i}=n,s=i[ye(i,t,"xScaleID")],o=i[ye(i,t,"yScaleID")],r=e.width/2,a=e.height/2;return s&&(r=$e(s,t.xValue,s.left+s.width/2)),o&&(a=$e(o,t.yValue,o.top+o.height/2)),{x:r,y:a}}function lo(n,t){let e=n.scales,i=e[ye(e,t,"xScaleID")],s=e[ye(e,t,"yScaleID")];if(!i&&!s)return {};let{left:o,right:r}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea,c=Ia(i,{min:t.xMin,max:t.xMax,start:o,end:r});o=c.start,r=c.end;let h=Ia(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=h.start,l=h.end,{x:o,y:a,x2:r,y2:l,width:r-o,height:l-a,centerX:o+(r-o)/2,centerY:a+(l-a)/2}}function ll(n,t){if(!nl(t)){let e=lo(n,t),i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);let s=i*2,o=e.centerX+t.xAdjust,r=e.centerY+t.yAdjust;return {x:o-i,y:r-i,x2:o+i,y2:r+i,centerX:o,centerY:r,width:s,height:s,radius:i}}return Cf(n,t)}function Sf(n,t){let{scales:e,chartArea:i}=n,s=e[t.scaleID],o={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?kf(s,o,t):Pf(e,o,t),o}function cl(n,t,e){let i=lo(n,t);return i.initProperties=Dn(n,i,t,e),i.elements=[{type:"label",optionScope:"label",properties:Af(n,i,t),initProperties:i.initProperties}],i}function Cf(n,t){let e=al(n,t),i=t.radius*2;return {x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Ia(n,t){let e=rl(n,t)||t;return {start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function kf(n,t,e){let i=$e(n,e.value,NaN),s=$e(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s);}function Pf(n,t,e){for(let i of Object.keys(La)){let s=n[ye(n,e,i)];if(s){let{min:o,max:r,start:a,end:l,startProp:c,endProp:h}=La[i],d=rl(s,{min:e[o],max:e[r],start:s[a],end:s[l]});t[c]=d.start,t[h]=d.end;}}}function Tf({properties:n,options:t},e,i,s){let{x:o,x2:r,width:a}=n;return hl({start:o,end:r,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function Df({properties:n,options:t},e,i,s){let{y:o,y2:r,height:a}=n;return hl({start:o,end:r,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function hl(n,t){let{start:e,end:i,borderWidth:s}=n,{position:o,padding:{start:r,end:a},adjust:l}=t,c=i-s-e-r-a-t.size;return e+s/2+l+so(c,o)}function Af(n,t,e){let i=e.label;i.backgroundColor="transparent",i.callout.display=false;let s=oo(i.position),o=$(i.padding),r=ao(n.ctx,i),a=Tf({properties:t,options:e},r,s,o),l=Df({properties:t,options:e},r,s,o),c=r.width+o.width,h=r.height+o.height;return {x:a,y:l,x2:a+c,y2:l+h,width:c,height:h,centerX:a+c/2,centerY:l+h/2,rotation:i.rotation}}function we(n,t,e){let i=Math.cos(e),s=Math.sin(e),o=t.x,r=t.y;return {x:o+i*(n.x-o)-s*(n.y-r),y:r+s*(n.x-o)+i*(n.y-r)}}var qs=["enter","leave"],co=qs.concat("click");function Of(n,t,e){t.listened=il(e,co,t.listeners),t.moveListened=false,t._getElements=io,qs.forEach(i=>{tt(e[i])&&(t.moveListened=true);}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&tt(i.click)&&(t.listened=true),t.moveListened||qs.forEach(s=>{tt(i[s])&&(t.listened=true,t.moveListened=true);});});}function Ef(n,t,e){if(n.listened)switch(t.type){case "mousemove":case "mouseout":return Rf(n,t,e);case "click":return Lf(n,t,e)}}function Rf(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=io(n,t,e.interaction):i=[];let s=n.hovered;n.hovered=i;let o={state:n,event:t},r=Fa(o,"leave",s,i);return Fa(o,"enter",i,s)||r}function Fa({state:n,event:t},e,i,s){let o;for(let r of i)s.indexOf(r)<0&&(o=dl(r.options[e]||n.listeners[e],r,t)||o);return o}function Lf(n,t,e){let i=n.listeners,s=io(n,t,e.interaction),o;for(let r of s)o=dl(r.options.click||i.click,r,t)||o;return o}function dl(n,t,e){return L(n,[t.$context,e])===true}var Ri=["afterDraw","beforeDraw"];function If(n,t,e){let i=t.visibleElements;t.hooked=il(e,Ri,t.hooks),t.hooked||i.forEach(s=>{t.hooked||Ri.forEach(o=>{tt(s.options[o])&&(t.hooked=true);});});}function za(n,t,e){if(n.hooked){let i=t.options[e]||n.hooks[e];return L(i,[t.$context])}}function Ff(n,t,e){let i=jf(n.scales,t,e),s=Ba(t,i,"min","suggestedMin");s=Ba(t,i,"max","suggestedMax")||s,s&&tt(t.handleTickRangeOptions)&&t.handleTickRangeOptions();}function zf(n,t){for(let e of n)Wf(e,t);}function Ba(n,t,e,i){if(V(t[e])&&!Bf(n.options,e,i)){let s=n[e]!==t[e];return n[e]=t[e],s}}function Bf(n,t,e){return H(n[t])||H(n[e])}function Wf(n,t){for(let e of ["scaleID","xScaleID","yScaleID"]){let i=ye(t,n,e);i&&!t[i]&&Nf(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`);}}function Nf(n,t){if(t==="scaleID")return true;let e=t.charAt(0);for(let i of ["Min","Max","Value"])if(H(n[e+i]))return true;return false}function jf(n,t,e){let i=t.axis,s=t.id,o=i+"ScaleID",r={min:C(t.min,Number.NEGATIVE_INFINITY),max:C(t.max,Number.POSITIVE_INFINITY)};for(let a of e)a.scaleID===s?Wa(a,t,["value","endValue"],r):ye(n,a,o)===s&&Wa(a,t,[i+"Min",i+"Max",i+"Value"],r);return r}function Wa(n,t,e,i){for(let s of e){let o=n[s];if(H(o)){let r=t.parse(o);i.min=Math.min(i.min,r),i.max=Math.max(i.max,r);}}}var ee=class extends J{inRange(t,e,i,s){let{x:o,y:r}=we({x:t,y:e},this.getCenterPoint(s),U(-this.options.rotation));return Za({x:o,y:r},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(t){return Xe(this,t)}draw(t){t.save(),ro(t,this.getCenterPoint(),this.options.rotation),ol(t,this,this.options),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return cl(t,e)}};ee.id="boxAnnotation";ee.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:false},color:"black",content:null,display:false,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};ee.defaultRoutes={borderColor:"color",backgroundColor:"color"};ee.descriptors={label:{_fallback:true}};var ul=["left","bottom","top","right"],xe=class extends J{inRange(t,e,i,s){let{x:o,y:r}=we({x:t,y:e},this.getCenterPoint(s),U(-this.rotation));return Za({x:o,y:r},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(t){return Xe(this,t)}draw(t){let e=this.options,i=!H(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),ro(t,this.getCenterPoint(),this.rotation),Vf(t,this),ol(t,this,e),mf(t,qf(this),e),t.restore());}resolveElementProperties(t,e){let i;if(nl(e))i=al(t,e);else {let{centerX:a,centerY:l}=lo(t,e);i={x:a,y:l};}let s=$(e.padding),o=ao(t.ctx,e),r=Hf(i,o,e,s);return b(a({initProperties:Dn(t,r,e),pointX:i.x,pointY:i.y},r),{rotation:e.rotation})}};xe.id="labelAnnotation";xe.defaults={adjustScaleRange:true,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:false,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:true,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};xe.defaultRoutes={borderColor:"color"};function Hf(n,t,e,i){let s=t.width+i.width+e.borderWidth,o=t.height+i.height+e.borderWidth,r=oo(e.position,"center"),a=Na(n.x,s,e.xAdjust,r.x),l=Na(n.y,o,e.yAdjust,r.y);return {x:a,y:l,x2:a+s,y2:l+o,width:s,height:o,centerX:a+s/2,centerY:l+o/2}}function Na(n,t,e=0,i){return n-so(t,i)+e}function Vf(n,t){let{pointX:e,pointY:i,options:s}=t,o=s.callout,r=o&&o.display&&Kf(t,o);if(!r||Jf(t,o,r))return;if(n.save(),n.beginPath(),!te(n,o))return n.restore();let{separatorStart:l,separatorEnd:c}=$f(t,r),{sideStart:h,sideEnd:d}=Uf(t,r,l);(o.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(h.x,h.y),n.lineTo(d.x,d.y);let u=we({x:e,y:i},t.getCenterPoint(),U(-t.rotation));n.lineTo(u.x,u.y),n.stroke(),n.restore();}function $f(n,t){let{x:e,y:i,x2:s,y2:o}=n,r=Yf(n,t),a,l;return t==="left"||t==="right"?(a={x:e+r,y:i},l={x:a.x,y:o}):(a={x:e,y:i+r},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function Yf(n,t){let{width:e,height:i,options:s}=n,o=s.callout.margin+s.borderWidth/2;return t==="right"?e+o:t==="bottom"?i+o:-o}function Uf(n,t,e){let{y:i,width:s,height:o,options:r}=n,a=r.callout.start,l=Xf(t,r.callout),c,h;return t==="left"||t==="right"?(c={x:e.x,y:i+Qt(o,a)},h={x:c.x+l,y:c.y}):(c={x:e.x+Qt(s,a),y:e.y},h={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:h}}function Xf(n,t){let e=t.side;return n==="left"||n==="top"?-e:e}function Kf(n,t){let e=t.position;return ul.includes(e)?e:Gf(n,t)}function Gf(n,t){let{x:e,y:i,x2:s,y2:o,width:r,height:a,pointX:l,pointY:c,centerX:h,centerY:d,rotation:u}=n,f={x:h,y:d},g=t.start,p=Qt(r,g),m=Qt(a,g),b=[e,e+p,e+p,s],y=[i+m,o,i,o],x=[];for(let _=0;_<4;_++){let v=we({x:b[_],y:y[_]},f,U(u));x.push({position:ul[_],distance:Dt(v,{x:l,y:c})});}return x.sort((_,v)=>_.distance-v.distance)[0].position}function qf({x:n,y:t,width:e,height:i,options:s}){let o=s.borderWidth/2,r=$(s.padding);return {x:n+r.left+o,y:t+r.top+o,width:e-r.left-r.right-s.borderWidth,height:i-r.top-r.bottom-s.borderWidth}}function Jf(n,t,e){let{pointX:i,pointY:s}=n,o=t.margin,r=i,a=s;return e==="left"?r+=o:e==="right"?r-=o:e==="top"?a+=o:e==="bottom"&&(a-=o),n.inRange(r,a)}var ho=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Js=(n,t,e)=>ho(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,ja=(n,t,e)=>ho(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Tn=n=>n*n,Zf=(n,t,{x:e,y:i,x2:s,y2:o},r)=>r==="y"?{start:Math.min(i,o),end:Math.max(i,o),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},Ha=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Zs=(n,t,e,i)=>({x:Ha(n.x,t.x,e.x,i),y:Ha(n.y,t.y,e.y,i)}),Va=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),$a=(n,t,e,i)=>-Math.atan2(Va(n.x,t.x,e.x,i),Va(n.y,t.y,e.y,i))+.5*O,_e=class extends J{inRange(t,e,i,s){let o=this.options.borderWidth/2;if(i!=="x"&&i!=="y"){let r={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){te(l,this.options);let{chart:h}=this.$context,d=t*h.currentDevicePixelRatio,u=e*h.currentDevicePixelRatio,f=l.isPointInStroke(a,d,u)||Qs(this,r,s);return l.restore(),f}let c=Tn(o);return ng(this,r,c,s)||Qs(this,r,s)}return Qf(this,{mouseX:t,mouseY:e},i,{hBorderWidth:o,useFinalPosition:s})}getCenterPoint(t){return Xe(this,t)}draw(t){let{x:e,y:i,x2:s,y2:o,cp:r,options:a}=this;if(t.save(),!te(t,a))return t.restore();Ke(t,a);let l=Math.sqrt(Math.pow(s-e,2)+Math.pow(o-i,2));if(a.curve&&r)return hg(t,this,r,l),t.restore();let{startOpts:c,endOpts:h,startAdjust:d,endAdjust:u}=fl(this),f=Math.atan2(o-i,s-e);t.translate(e,i),t.rotate(f),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-u,0),t.shadowColor=a.borderShadowColor,t.stroke(),to(t,0,d,c),to(t,l,-u,h),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){let i=Sf(t,e),{x:s,y:o,x2:r,y2:a}=i,l=tg(i,t.chartArea),c=l?eg({x:s,y:o},{x:r,y:a},t.chartArea):{x:s,y:o,x2:r,y2:a,width:Math.abs(r-s),height:Math.abs(a-o)};if(c.centerX=(r+s)/2,c.centerY=(a+o)/2,c.initProperties=Dn(t,c,e),e.curve){let d={x:c.x,y:c.y},u={x:c.x2,y:c.y2};c.cp=cg(c,e,Dt(d,u));}let h=ig(t,c,e.label);return h._visible=l,c.elements=[{type:"label",optionScope:"label",properties:h,initProperties:c.initProperties}],c}};_e.id="lineAnnotation";var Ya={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};_e.defaults={adjustScaleRange:true,arrowHeads:{display:false,end:Object.assign({},Ya),fill:false,length:12,start:Object.assign({},Ya),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:false,controlPoint:{y:"-50%"},display:true,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},xe.defaults.callout),color:"#fff",content:null,display:false,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};_e.descriptors={arrowHeads:{start:{_fallback:true},end:{_fallback:true},_fallback:true}};_e.defaultRoutes={borderColor:"color"};function Qf(n,{mouseX:t,mouseY:e},i,{hBorderWidth:s,useFinalPosition:o}){let r=Zf(t,e,n.getProps(["x","y","x2","y2"],o),i);return r.value>=r.start-s&&r.value<=r.end+s||Qs(n,{mouseX:t,mouseY:e},o,i)}function tg({x:n,y:t,x2:e,y2:i},{top:s,right:o,bottom:r,left:a}){return !(n<a&&e<a||n>o&&e>o||t<s&&i<s||t>r&&i>r)}function Ua({x:n,y:t},e,{top:i,right:s,bottom:o,left:r}){return n<r&&(t=ja(r,{x:n,y:t},e),n=r),n>s&&(t=ja(s,{x:n,y:t},e),n=s),t<i&&(n=Js(i,{x:n,y:t},e),t=i),t>o&&(n=Js(o,{x:n,y:t},e),t=o),{x:n,y:t}}function eg(n,t,e){let{x:i,y:s}=Ua(n,t,e),{x:o,y:r}=Ua(t,n,e);return {x:i,y:s,x2:o,y2:r,width:Math.abs(o-i),height:Math.abs(r-s)}}function ng(n,{mouseX:t,mouseY:e},i=be,s){let{x:o,y:r,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-o,h=l-r,d=Tn(c)+Tn(h),u=d===0?-1:((t-o)*c+(e-r)*h)/d,f,g;return u<0?(f=o,g=r):u>1?(f=a,g=l):(f=o+u*c,g=r+u*h),Tn(t-f)+Tn(e-g)<=i}function Qs(n,{mouseX:t,mouseY:e},i,s){let o=n.label;return o.options.display&&o.inRange(t,e,s,i)}function ig(n,t,e){let i=e.borderWidth,s=$(e.padding),o=ao(n.ctx,e),r=o.width+s.width+i,a=o.height+s.height+i;return og(t,e,{width:r,height:a,padding:s},n.chartArea)}function sg(n){let{x:t,y:e,x2:i,y2:s}=n,o=Math.atan2(s-e,i-t);return o>O/2?o-O:o<O/-2?o+O:o}function og(n,t,e,i){let{width:s,height:o,padding:r}=e,{xAdjust:a,yAdjust:l}=t,c={x:n.x,y:n.y},h={x:n.x2,y:n.y2},d=t.rotation==="auto"?sg(n):U(t.rotation),u=rg(s,o,d),f=ag(n,t,{labelSize:u,padding:r},i),g=n.cp?Zs(c,n.cp,h,f):ho(c,h,f),p={size:u.w,min:i.left,max:i.right,padding:r.left},m={size:u.h,min:i.top,max:i.bottom,padding:r.top},b=Ka(g.x,p)+a,y=Ka(g.y,m)+l;return {x:b-s/2,y:y-o/2,x2:b+s/2,y2:y+o/2,centerX:b,centerY:y,pointX:g.x,pointY:g.y,width:s,height:o,rotation:ce(d)}}function rg(n,t,e){let i=Math.cos(e),s=Math.sin(e);return {w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function ag(n,t,e,i){let s,o=lg(n,i);return t.position==="start"?s=Xa({w:n.x2-n.x,h:n.y2-n.y},e,t,o):t.position==="end"?s=1-Xa({w:n.x-n.x2,h:n.y-n.y2},e,t,o):s=so(1,t.position),s}function Xa(n,t,e,i){let{labelSize:s,padding:o}=t,r=n.w*i.dx,a=n.h*i.dy,l=r>0&&(s.w/2+o.left-i.x)/r,c=a>0&&(s.h/2+o.top-i.y)/a;return Li(Math.max(l,c),0,.25)}function lg(n,t){let{x:e,x2:i,y:s,y2:o}=n,r=Math.min(s,o)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,o),c=t.right-Math.max(e,i);return {x:Math.min(a,c),y:Math.min(r,l),dx:a<=c?1:-1,dy:r<=l?1:-1}}function Ka(n,t){let{size:e,min:i,max:s,padding:o}=t,r=e/2;return e>s-i?(s+i)/2:(i>=n-o-r&&(n=i+o+r),s<=n+o+r&&(n=s-o-r),n)}function fl(n){let t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return {startOpts:e,endOpts:i,startAdjust:Ga(n,e),endAdjust:Ga(n,i)}}function Ga(n,t){if(!t||!t.display)return 0;let{length:e,width:i}=t,s=n.options.borderWidth/2,o={x:e,y:i+s};return Math.abs(Js(0,o,{x:0,y:s}))}function to(n,t,e,i){if(!i||!i.display)return;let{length:s,width:o,fill:r,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Ke(n,i),te(n,i),n.moveTo(c,-o),n.lineTo(t+e,0),n.lineTo(c,o),r===true?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke();}function cg(n,t,e){let{x:i,y:s,x2:o,y2:r,centerX:a,centerY:l}=n,c=Math.atan2(r-s,o-i),h=oo(t.controlPoint,0),d={x:a+Qt(e,h.x,false),y:l+Qt(e,h.y,false)};return we(d,{x:a,y:l},c)}function qa(n,{x:t,y:e},{angle:i,adjust:s},o){!o||!o.display||(n.save(),n.translate(t,e),n.rotate(i),to(n,0,-s,o),n.restore());}function hg(n,t,e,i){let{x:s,y:o,x2:r,y2:a,options:l}=t,{startOpts:c,endOpts:h,startAdjust:d,endAdjust:u}=fl(t),f={x:s,y:o},g={x:r,y:a},p=$a(f,e,g,0),m=$a(f,e,g,1)-O,b=Zs(f,e,g,d/i),y=Zs(f,e,g,1-u/i),x=new Path2D;n.beginPath(),x.moveTo(b.x,b.y),x.quadraticCurveTo(e.x,e.y,y.x,y.y),n.shadowColor=l.borderShadowColor,n.stroke(x),t.path=x,t.ctx=n,qa(n,b,{angle:p,adjust:d},c),qa(n,y,{angle:m,adjust:u},h);}var ve=class extends J{inRange(t,e,i,s){let o=this.options.rotation,r=this.options.borderWidth;if(i!=="x"&&i!=="y")return dg({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),o,r);let{x:a,y:l,x2:c,y2:h}=this.getProps(["x","y","x2","y2"],s),d=r/2,u=i==="y"?{start:l,end:h}:{start:a,end:c},f=we({x:t,y:e},this.getCenterPoint(s),U(-o));return f[i]>=u.start-d-be&&f[i]<=u.end+d+be}getCenterPoint(t){return Xe(this,t)}draw(t){let{width:e,height:i,centerX:s,centerY:o,options:r}=this;t.save(),ro(t,this.getCenterPoint(),r.rotation),Ke(t,this.options),t.beginPath(),t.fillStyle=r.backgroundColor;let a=te(t,r);t.ellipse(s,o,i/2,e/2,O/2,0,2*O),t.fill(),a&&(t.shadowColor=r.borderShadowColor,t.stroke()),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return cl(t,e,true)}};ve.id="ellipseAnnotation";ve.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,label:Object.assign({},ee.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};ve.defaultRoutes={borderColor:"color",backgroundColor:"color"};ve.descriptors={label:{_fallback:true}};function dg(n,t,e,i){let{width:s,height:o,centerX:r,centerY:a}=t,l=s/2,c=o/2;if(l<=0||c<=0)return false;let h=U(e||0),d=i/2||0,u=Math.cos(h),f=Math.sin(h),g=Math.pow(u*(n.x-r)+f*(n.y-a),2),p=Math.pow(f*(n.x-r)-u*(n.y-a),2);return g/Math.pow(l+d,2)+p/Math.pow(c+d,2)<=1.0001}var Ye=class extends J{inRange(t,e,i,s){let{x:o,y:r,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),h=this.options.borderWidth;if(i!=="x"&&i!=="y")return hf({x:t,y:e},this.getCenterPoint(s),c/2,h);let d=h/2,u=i==="y"?{start:r,end:l,value:e}:{start:o,end:a,value:t};return u.value>=u.start-d&&u.value<=u.end+d}getCenterPoint(t){return Xe(this,t)}draw(t){let e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Ke(t,e);let s=te(t,e);yf(t,this,this.centerX,this.centerY),s&&!Ii(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i;}resolveElementProperties(t,e){let i=ll(t,e);return i.initProperties=Dn(t,i,e,true),i}};Ye.id="pointAnnotation";Ye.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};Ye.defaultRoutes={borderColor:"color",backgroundColor:"color"};var Ue=class extends J{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&fg(this.elements,t,e,s);let o=we({x:t,y:e},this.getCenterPoint(s),U(-this.options.rotation)),r=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...r),l=Math.max(...r);return o[i]>=a&&o[i]<=l}getCenterPoint(t){return Xe(this,t)}draw(t){let{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ke(t,i);let s=te(t,i),o=true;for(let r of e)o?(t.moveTo(r.x,r.y),o=false):t.lineTo(r.x,r.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore();}resolveElementProperties(t,e){let i=ll(t,e),{sides:s,rotation:o}=e,r=[],a=2*O/s,l=o*on;for(let c=0;c<s;c++,l+=a){let h=ug(i,e,l);h.initProperties=Dn(t,i,e),r.push(h);}return i.elements=r,i}};Ue.id="polygonAnnotation";Ue.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};Ue.defaultRoutes={borderColor:"color",backgroundColor:"color"};function ug({centerX:n,centerY:t},{radius:e,borderWidth:i},s){let o=i/2,r=Math.sin(s),a=Math.cos(s),l={x:n+r*e,y:t-a*e};return {type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:n+r*(e+o),bY:t-a*(e+o)}}}function fg(n,t,e,i){let s=false,o=n[n.length-1].getProps(["bX","bY"],i);for(let r of n){let a=r.getProps(["bX","bY"],i);a.bY>e!=o.bY>e&&t<(o.bX-a.bX)*(e-a.bY)/(o.bY-a.bY)+a.bX&&(s=!s),o=a;}return s}var Zt={box:ee,ellipse:ve,label:xe,line:_e,point:Ye,polygon:Ue};Object.keys(Zt).forEach(n=>{D.describe(`elements.${Zt[n].id}`,{_fallback:"plugins.annotation.common"});});var gg={update:Object.assign},pg=co.concat(Ri),Ja=(n,t)=>P(t)?no(n,t):n,eo=n=>n==="color"||n==="font";function uo(n="line"){return Zt[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function mg(n,t,e,i){let s=yg(n,e.animations,i),o=t.annotations,r=vg(t.elements,o);for(let a=0;a<o.length;a++){let l=o[a],c=gl(r,a,l.type),h=l.setContext(_g(n,c,l)),d=c.resolveElementProperties(n,h);d.skip=bg(d),"elements"in d&&(xg(c,d.elements,h,s),delete d.elements),H(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=pl(h),s.update(c,d);}}function bg(n){return isNaN(n.x)||isNaN(n.y)}function yg(n,t,e){return e==="reset"||e==="none"||e==="resize"?gg:new Le(n,t)}function xg(n,t,e,i){let s=n.elements||(n.elements=[]);s.length=t.length;for(let o=0;o<t.length;o++){let r=t[o],a=r.properties,l=gl(s,o,r.type,r.initProperties),c=e[r.optionScope].override(r);a.options=pl(c),i.update(l,a);}}function gl(n,t,e,i){let s=Zt[uo(e)],o=n[t];return (!o||!(o instanceof s))&&(o=n[t]=new s,Object.assign(o,i)),o}function pl(n){let t=Zt[uo(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,no(n,t.defaults),no(n,t.defaultRoutes));for(let i of pg)e[i]=n[i];return e}function no(n,t){let e={};for(let i of Object.keys(t)){let s=t[i],o=n[i];eo(i)&&E(o)?e[i]=o.map(r=>Ja(r,s)):e[i]=Ja(o,s);}return e}function _g(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function vg(n,t){let e=t.length,i=n.length;if(i<e){let s=e-i;n.splice(i,0,...new Array(s));}else i>e&&n.splice(e,i-e);return n}var wg="2.2.1",Jt=new Map,Mg=co.concat(Ri),ml={id:"annotation",version:wg,beforeRegister(){df("chart.js","3.7",it.version);},afterRegister(){it.register(Zt);},afterUnregister(){it.unregister(Zt);},beforeInit(n){Jt.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:false,moveListened:false,hooks:{},hooked:false,hovered:[]});},beforeUpdate(n,t,e){let i=Jt.get(n),s=i.annotations=[],o=e.annotations;P(o)?Object.keys(o).forEach(r=>{let a=o[r];P(a)&&(a.id=r,s.push(a));}):E(o)&&s.push(...o),zf(s,n.scales);},afterDataLimits(n,t){let e=Jt.get(n);Ff(n,t.scale,e.annotations.filter(i=>i.display&&i.adjustScaleRange));},afterUpdate(n,t,e){let i=Jt.get(n);Of(n,i,e),mg(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),If(n,i,e);},beforeDatasetsDraw(n,t,e){Oi(n,"beforeDatasetsDraw",e.clip);},afterDatasetsDraw(n,t,e){Oi(n,"afterDatasetsDraw",e.clip);},beforeDraw(n,t,e){Oi(n,"beforeDraw",e.clip);},afterDraw(n,t,e){Oi(n,"afterDraw",e.clip);},beforeEvent(n,t,e){let i=Jt.get(n);Ef(i,t.event,e)&&(t.changed=true);},afterDestroy(n){Jt.delete(n);},_getState(n){return Jt.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:true,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:false,label:{}}},descriptors:{_indexable:false,_scriptable:n=>!Mg.includes(n)&&n!=="init",annotations:{_allKeys:false,_fallback:(n,t)=>`elements.${Zt[uo(t.type)].id}`},interaction:{_fallback:true},common:{label:{_indexable:eo,_fallback:true},_indexable:eo}},additionalOptionScopes:[""]};function Oi(n,t,e){let{ctx:i,chartArea:s}=n,o=Jt.get(n);e&&Yt(i,s);let r=Sg(o.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(let a of r)Cg(i,s,o,a);e&&Ut(i);}function Sg(n,t){let e=[];for(let i of n)if(i.options.drawTime===t&&e.push({element:i,main:true}),i.elements&&i.elements.length)for(let s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function Cg(n,t,e,i){let s=i.element;i.main?(za(e,s,"beforeDraw"),s.draw(n,t),za(e,s,"afterDraw")):s.draw(n,t);}var go=it.version,kg=go?(n,t)=>n.parse(t):(n,t)=>t;function Pg(n,t){let e=ct(t)?parseFloat(t):kg(n,t);return n.getPixelForValue(e)}var bl=n=>n&&n.right>n.left&&n.bottom>n.top;function yl(n,t,e){return t==="r"?n.createRadialGradient(e.xCenter,e.yCenter,0,e.xCenter,e.yCenter,e.drawingArea):t==="y"?n.createLinearGradient(0,e.bottom,0,e.top):n.createLinearGradient(e.left,0,e.right,0)}function xl(n,t){t.forEach(function(e){n.addColorStop(e.stop,e.color.rgbString());});}function _l(n,t,e){if(n.options.has(t.key)){let s=n.options.get(t.key).filter(o=>o.datasetIndex===e);if(s.length)return s[0]}}function vl(n,t){if(n.type==="radialLinear"){let o=n.getDistanceFromCenterForValue(t);return {pixel:o,stop:o/n.drawingArea}}let e=n.options.reverse,i=Pg(n,t),s=n.getDecimalForPixel(i);return {pixel:i,stop:e?1-s:s}}var fo=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Ge=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Tg(n,t,e){let i=t.color.rgb,s=Ge(i.r/255),o=Ge(i.g/255),r=Ge(i.b/255),a=e.color.rgb,l=Ge(a.r/255),c=Ge(a.g/255),h=Ge(a.b/255);return de({r:Math.round(fo(s+n*(l-s))*255),g:Math.round(fo(o+n*(c-o))*255),b:Math.round(fo(r+n*(h-r))*255),a:i.a+n*Math.abs(a.a-i.a)})}function Dg(n,t,e,i){let s=_l(n,t,e);if(!s||!s.stopColors.length)return;let{stop:o}=vl(s.scale,i),r,a;for(let l of s.stopColors){if(l.stop===o)return l.color;l.stop<o?r=l:l.stop>o&&!a&&(a=l);}return a?Tg(o,r,a):r}var wl=[{key:"backgroundColor",legendItemKey:"fillStyle"},{key:"borderColor",legendItemKey:"strokeStyle"}],Ag=(n,t)=>t.labels&&t.labels.font&&H(t.labels.font.size)?t.labels.font.size:n.options.font.size;function Og(n,t,e,i,s){let o=_l(n,e,i.datasetIndex);if(!o||!o.stopColors.length)return;let r=yl(t,o.axis,s);xl(r,o.stopColors),i[e.legendItemKey]=r;}function Eg(n,{boxWidth:t,boxHeight:e}){return {top:n.top,left:n.left,bottom:n.top+e,right:n.left+t,xCenter:n.left+t/2,yCenter:n.top+e/2,drawingArea:Math.max(t,e)/2}}function Rg(n,t,e,i){let s=n.legend.legendHitBoxes[e.datasetIndex],o=Eg(s,i);bl(o)&&wl.forEach(function(r){Og(t,n.ctx,r,e,o);});}function Lg(n,t,e,i){for(let s of n.legend.legendItems)wl.forEach(function(o){let r=e.data[s.index],a=Dg(t,o,i,r);a&&a.valid&&(s[o.legendItemKey]=a.rgbString());});}function Ig(n,t){let e=n.legend,i=e.options,s=i.labels.boxHeight?i.labels.boxHeight:Ag(n,i),o=i.labels.boxWidth,r=n.data.datasets;for(let a=0;a<r.length;a++){let l=e.legendItems[a];l.datasetIndex===a?Rg(n,t,l,{boxWidth:o,boxHeight:s}):Lg(n,t,r[a],a);}}var Fi=new Map,Fg=go?(n,t)=>n[t+"Scale"]:(n,t)=>n.controller["_"+t+"Scale"];function zg(n,t,e){for(let i of Object.keys(t)){let{pixel:s,stop:o}=vl(n,i);if(isFinite(s)&&isFinite(o)){let r=de(t[i]);r&&r.valid&&e.push({stop:Math.max(0,Math.min(1,o)),color:r});}}e.sort((i,s)=>i.stop-s.stop);}function Bg(n,t,e,i){t[e]=i,n.dataset&&(n.dataset.options?n.dataset.options[e]=i:n.dataset[e]=i);}function Wg(n,t,e,i){let s=n.options.get(e);return s?t.hidden||(s=s.filter(o=>o.datasetIndex!==i),n.options.set(e,s)):(s=[],n.options.set(e,s)),s}function Ng(n,t,e,i,s){let o=n.ctx,r=n.getDatasetMeta(s);if(!r.hidden)for(let[a,l]of Object.entries(e)){let{axis:c,colors:h}=l;if(!h)continue;let d=Fg(r,c);if(!d){console.warn(`Scale not found for '${c}'-axis in datasets[${s}] of chart id ${n.id}, skipping.`);continue}let u=Wg(t,r,a,s),f={datasetIndex:s,axis:c,scale:d,stopColors:[]};u.push(f);let g=yl(o,c,d);zg(d,h,f.stopColors),f.stopColors.length&&(xl(g,f.stopColors),Bg(r,i,a,g));}}var Ml={id:"gradient",beforeInit(n){let t={};t.options=new Map,Fi.set(n,t);},beforeDatasetsUpdate(n){let t=n.chartArea;if(!bl(t))return;let e=Fi.get(n),i=n.data.datasets;for(let s=0;s<i.length;s++){let o=i[s],r=o.gradient;r&&Ng(n,e,r,o,s);}},afterUpdate(n){let t=Fi.get(n);n.legend&&n.legend.options.display!==false&&go&&Ig(n,t);},destroy(n){Fi.delete(n);}};var jg=[me,je,Bt,xa,_a,ya,Ea,zt,yt,ba,Ft,ml,Ml];it.register(...jg);var Tl="label";function Cl(n,t){typeof n=="function"?n(t):n&&(n.current=t);}function Hg(n,t){Object.assign(n.options,t);}function Dl(n,t){n.labels=t;}function Al(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Tl,i=[];n.datasets=t.map(s=>{let o=n.datasets.find(r=>r[e]===s[e]);return !o||!s.data||i.includes(o)?a({},s):(i.push(o),Object.assign(o,s),o)});}function Vg(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tl,e={labels:[],datasets:[]};return Dl(e,n.labels),Al(e,n.datasets,t),e}function $g(n,t){let b=n,{height:e=150,width:i=300,redraw:s=false,datasetIdKey:o,type:r,data:a$1,options:l,plugins:c$1=[],fallbackContent:h,updateMode:d}=b,u=c(b,["height","width","redraw","datasetIdKey","type","data","options","plugins","fallbackContent","updateMode"]),f=useRef(null),g=useRef(),p=()=>{f.current&&(g.current=new it(f.current,{type:r,data:Vg(a$1,o),options:l&&a({},l),plugins:c$1}),Cl(t,g.current));},m=()=>{Cl(t,null),g.current&&(g.current.destroy(),g.current=null);};return useEffect(()=>{!s&&g.current&&l&&Hg(g.current,l);},[s,l]),useEffect(()=>{!s&&g.current&&Dl(g.current.config.data,a$1.labels);},[s,a$1.labels]),useEffect(()=>{!s&&g.current&&a$1.datasets&&Al(g.current.config.data,a$1.datasets,o);},[s,a$1.datasets]),useEffect(()=>{g.current&&(s?(m(),setTimeout(p)):g.current.update(d));},[s,l,a$1.labels,a$1.datasets,d]),useEffect(()=>{g.current&&(m(),setTimeout(p));},[r]),useEffect(()=>(p(),()=>m()),[]),kl.createElement("canvas",Object.assign({ref:f,role:"img",height:e,width:i},u),h)}var Yg=forwardRef($g);function Ug(n,t){return it.register(t),forwardRef((e,i)=>kl.createElement(Yg,Object.assign({},e,{ref:i,type:n})))}var Ol=Ug("bar",ge);var El={id:"redrawBeforeFirstDrawPlugin",beforeDraw(n){n.$rendered||(n.$rendered=true,n.update("none"));}};var po=(n,t=1)=>{let e=Math.round(t*255).toString(16).padStart(2,"0");return `${n}${e}`};var mo=n=>n.palette.text.secondary,bo=n=>n.palette.outlinedBorder,yo=n=>({family:n.typography.fontFamily,size:parseInt(n.typography.body.fontSize)});function xo(n){let t=["#4caf50","#2196f3","#ff5722","#ff9800","#e91e63","#3f51b5","#00bcd4","#81c784","#64b5f6","#ff8a65","#ffb74d","#f06292","#7986cb","#4dd0e1","#a5d6a7","#90caf9","#ffab91","#ffcc80","#f48fb1","#9fa8da","#80deea"];return t[n%t.length]}function Xg(n){let t=[],e=new Date;switch(n){case CreditUsageTimeRange.LastDay:{let i=new Date(e);i.setHours(i.getHours()-23),i.setMinutes(0,0,0);for(let s=0;s<24;s++){let o=new Date(i);o.setHours(o.getHours()+s),t.push(o.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}));}break}case CreditUsageTimeRange.LastWeek:{for(let i=6;i>=0;i--){let s=new Date(e);s.setDate(s.getDate()-i),t.push(s.toLocaleDateString("en-US",{month:"short",day:"2-digit"}));}break}case CreditUsageTimeRange.LastYear:{for(let i=11;i>=0;i--){let s=new Date(e);s.setMonth(s.getMonth()-i),t.push(s.toLocaleDateString("en-US",{month:"short",year:"2-digit"}));}break}case CreditUsageTimeRange.LastMonth:default:{for(let i=29;i>=0;i--){let s=new Date(e);s.setDate(s.getDate()-i),t.push(s.toLocaleDateString("en-US",{month:"short",day:"2-digit"}));}break}}return t}function Kg(n,t){let e=new Date(n);switch(e.setMinutes(0,0,0),t){case CreditUsageTimeRange.LastDay:return e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});case CreditUsageTimeRange.LastYear:return n.toLocaleDateString("en-US",{month:"short",year:"2-digit"});case CreditUsageTimeRange.LastWeek:case CreditUsageTimeRange.LastMonth:default:return n.toLocaleDateString("en-US",{month:"short",day:"2-digit"})}}function Gg(n,t){return {responsive:true,maintainAspectRatio:false,interaction:{mode:"point",intersect:true},elements:{bar:{borderRadius:4,borderSkipped:"bottom"}},plugins:{legend:{display:false},tooltip:{enabled:false,external:t},datalabels:{display:false}},scales:{x:{type:"category",stacked:true,ticks:{color:mo(n),font:yo(n),maxRotation:45,maxTicksLimit:15},grid:{color:bo(n),drawOnChartArea:false,drawTicks:false}},y:{type:"linear",stacked:true,beginAtZero:true,ticks:{color:mo(n),font:yo(n),callback:e=>k(Number(e))},grid:{color:po(bo(n),.5),drawOnChartArea:true,drawTicks:false,borderDash:[5,5]}}}}}function Rl(n,t,e,i){let s=Xg(i);if(!n||!n.series||n.series.length===0)return {data:null,options:null};let o=n.series.map((l,c)=>{let h=l.featureName,d=new Map;l.points.forEach(g=>{let p=Kg(new Date(g.timestamp),i),m=d.get(p)||0;d.set(p,m+g.value);});let u=s.map(g=>d.get(g)||0),f=xo(c);return {label:h,data:u,backgroundColor:po(f,.8),borderColor:f,borderWidth:1}}).reverse(),r={labels:s,datasets:o},a=Gg(t,e);return {data:r,options:a}}var ep=300;function Il(n,t){let e=t.dataPoints[0],i=e.parsed.y,s=n.scales.y,o=i/s.max*(s.bottom-s.top),r=t.caretY+o/2,a=n.getDatasetMeta(e.datasetIndex).data[e.dataIndex],l=a.x-a.width/2,c=n.canvas.offsetTop+r,h=n.canvas.offsetLeft+l;return {top:c,left:h}}function np(n,t){let e=n.canvas.offsetTop+t.caretY,i=n.canvas.offsetLeft+t.caretX;return {top:e,left:i}}function Fl(n,t=np){let[e,i]=useState(0),[s,o]=useState(0),[r,a]=useState(false),[l,c]=useState(),h=useCallback(u=>{let{chart:f,tooltip:g}=u;if(g.opacity===0){a(false);return}let{top:p,left:m}=t(f,g);o(m),i(p),c(n(g)),a(true);},[n,t]);return {tooltipInfo:{positionTop:e,positionLeft:s,isOpen:r,payload:l},tooltipHandler:h}}var ip=e(Qg)`
5
- position: absolute;
6
- `,sp=e.div`
7
- position: absolute;
8
- background-color: white;
9
- border-radius: 8px;
10
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
11
- padding: ${({$padding:n=16})=>n}px;
12
- max-width: 500px;
13
- z-index: 1000;
14
- pointer-events: none;
15
- opacity: ${({$isOpen:n})=>n?1:0};
16
- transition: opacity 0.2s ease-in-out;
17
- transform: translateY(-50%); /* Center vertically on the anchor point */
18
-
19
- &::before {
20
- content: '';
21
- position: absolute;
22
- width: 0;
23
- height: 0;
24
- border: 8px solid transparent;
25
- border-left-color: white;
26
- right: -16px;
27
- top: 50%;
28
- transform: translateY(-50%);
29
- filter: drop-shadow(2px 0 2px rgba(0, 0, 0, 0.1));
30
- }
31
- `,zl=({children:n,tooltipInfo:{positionTop:t,positionLeft:e,payload:i,isOpen:s},$padding:o})=>{let[r,a]=useState(false),[l,c]=useState(false),h=useRef(tp(()=>c(false),ep));return useEffect(()=>{i&&(r||s)?(h.current.cancel(),c(true)):h.current();},[i,r,s]),jsxs(Fragment,{children:[jsx(ip,{style:{top:t,left:e}}),jsx(sp,{$isOpen:l,$padding:o,style:{top:t,left:e-140},onMouseEnter:()=>a(true),onMouseLeave:()=>a(false),children:n})]})};var lp=e.div`
32
- width: 3px;
33
- margin-right: 15px;
34
- `;function Wl({tooltipInfo:n}){if(!n.payload)return jsx(Fragment,{});let{featureName:t,usage:e,date:i,color:s}=n.payload;return jsx(zl,{tooltipInfo:n,placement:"top",$padding:16,children:jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8},className:"stigg-credit-usage-chart-tooltip",children:[jsx(lp,{style:{backgroundColor:s,marginTop:2}}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[jsx(f,{variant:"body1",color:"secondary",children:i}),jsx(f,{variant:"body1",color:"primary",children:t}),jsxs("div",{style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},children:[jsx(f,{variant:"body1",color:"primary",children:k(e,{maximumFractionDigits:5})}),jsx(f,{variant:"body1",color:"primary",children:"Credits"})]})]})]})})}function Nl(){let n=useCallback(t=>{if(Bl(t.dataPoints)||Bl(t.labelColors))return;let e=t.dataPoints[0],i=t.labelColors[0];if(!e||!i)return;let s=e.dataset.label||"Unknown Feature",o=e.parsed.y||0,r=e.label||"",a=i.backgroundColor;return {featureName:s,usage:o,date:r,color:a}},[]);return Fl(n,Il)}var hp=e.div`
35
- padding: 8px;
36
- margin: 0 12px;
37
- `,dp=e.div`
38
- display: flex;
39
- align-items: center;
40
- `,up=e.div`
41
- flex: 1;
42
- position: relative;
43
- align-items: center;
44
- display: flex;
45
- `,fp=e.div`
46
- height: 24px;
47
- width: ${({$width:n,$minContentWidth:t})=>{let e=Math.min(n,100),i=Math.max(t,80);return `max(${e}%, ${i}px)`}};
48
- background-color: #f5f6f9;
49
- border-radius: 4px;
50
- position: relative;
51
- display: flex;
52
- align-items: center;
53
- justify-content: space-between;
54
- padding: 0 8px;
55
- `,gp=e.div`
56
- width: 12px;
57
- height: 12px;
58
- border-radius: 2px;
59
- background-color: ${({$color:n})=>n};
60
- margin-right: 8px;
61
- flex-shrink: 0;
62
- `,pp=e.div`
63
- margin-right: 24px;
64
- flex-shrink: 0;
65
- overflow: hidden;
66
- text-overflow: ellipsis;
67
- white-space: nowrap;
68
- `;function jl({creditUsageData:n}){var s,o;if(!n||!n.series||n.series.length===0)return null;let t=n.series.map((r,a)=>{let l=r.featureId,c=r.featureName,h=r.totalCredits,d=xo(a);return {featureId:l,featureName:c,totalCredits:h,color:d}}).sort((r,a)=>a.totalCredits-r.totalCredits),e=Math.max(...t.map(r=>r.totalCredits)),i=(r,a)=>{let l=Math.min(r.length*7,200),c=k(a,{maximumFractionDigits:5}).length*8;return 20+l+16+c+16};return jsxs(hp,{className:"stigg-credit-usage-chart-legend",children:[jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[jsx(f,{style:{marginBottom:12},variant:"body1",color:"secondary",className:"stigg-credit-usage-chart-legend-title",children:"Top sources"}),jsx(f,{variant:"caption",color:"disabled",className:"stigg-credit-usage-chart-legend-title-currency-units",children:(o=(s=n.currency)==null?void 0:s.units)==null?void 0:o.plural})]}),jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:t.map(r=>{let a=e>0?r.totalCredits/e*100:0,l=i(r.featureName,r.totalCredits);return jsx(dp,{className:`stigg-credit-usage-chart-legend-item stigg-credit-usage-chart-legend-item-${r.featureId}`,children:jsx(up,{className:"stigg-credit-usage-chart-legend-bar-container",children:jsxs(fp,{$width:a,$minContentWidth:l,children:[jsxs("div",{style:{display:"flex",alignItems:"center"},children:[jsx(gp,{$color:r.color}),jsx(pp,{className:"stigg-credit-usage-chart-legend-feature-name",children:jsx(f,{variant:"body1",color:"primary",className:"stigg-credit-usage-chart-legend-feature-name-text",children:r.featureName})})]}),jsx(f,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-usage-chart-legend-value",children:k(r.totalCredits,{maximumFractionDigits:5})})]})})},r.featureId)})})]})}var mp=e.div`
69
- display: flex;
70
- flex-direction: column;
71
- justify-content: center;
72
- align-items: center;
73
- height: 100%;
74
- `,bp=e(i)`
75
- svg {
76
- width: 32px;
77
- height: 32px;
78
- }
79
- `;function Vl(){return jsxs(mp,{className:"stigg-credit-usage-chart-empty-state",children:[jsx(bp,{icon:"PayAsYouGoCharge",style:{display:"flex"}}),jsx(f,{variant:"body1",color:"primary",bold:true,children:"No Usage Recorded"})]})}var xp=e.div`
80
- display: flex;
81
- justify-content: center;
82
- align-items: center;
83
- height: 100%;
84
- `;function Yl(){return jsx(xp,{className:"stigg-credit-usage-chart-error-state",children:jsx(f,{variant:"body1",color:"error",children:"Failed to load credit usage"})})}var Ul=[{value:CreditUsageTimeRange.LastDay,label:"Last 24 Hours"},{value:CreditUsageTimeRange.LastWeek,label:"Last 7 Days"},{value:CreditUsageTimeRange.LastMonth,label:"Last 30 Days"},{value:CreditUsageTimeRange.LastYear,label:"Last 12 Months"}],Mp=e(wp)`
85
- border-radius: 10px;
86
- height: 38px;
87
- min-width: 150px;
88
-
89
- &:hover .MuiOutlinedInput-notchedOutline {
90
- border-color: ${({theme:n})=>n.stigg.palette.outlinedBorder};
91
- }
92
- `,Sp=e(vp)`
93
- & .MuiInputBase-input {
94
- padding: 10px 12px;
95
- }
96
-
97
- &.Mui-focused .MuiOutlinedInput-notchedOutline {
98
- border-color: ${({theme:n})=>n.stigg.palette.primary} !important;
99
- }
100
- `;function Xl({isLoading:n,totalCredits:t,selectedTimeRange:e,setSelectedTimeRange:i,error:s,localization:o$1,currencyUnit:r}){return jsxs("div",{className:"stigg-credit-usage-chart-header",style:{display:"flex",flexDirection:"row",marginBottom:16,justifyContent:"space-between"},children:[jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8,alignItems:"center"},children:[jsx(f,{variant:"h3",color:"primary",className:"stigg-credit-usage-chart-title",children:o$1.title}),n?jsx(o,{width:100,height:24}):jsxs(Fragment,{children:[jsx(f,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:"|"}),jsxs(f,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:[o$1.totalSpend,": ",k(t||0,{maximumFractionDigits:5})," ",r||""]})]})]}),!n&&!s&&jsx(Mp,{className:"stigg-credit-usage-chart-time-range-select",value:e,input:jsx(Sp,{}),onChange:a=>i(a.target.value),renderValue:a=>{var l;return jsxs(f,{variant:"body1",color:"primary",children:[((l=Ul.find(c=>c.value===a))==null?void 0:l.label)||""," "]})},children:Ul.map(a=>jsx(_p,{value:a.value,children:jsx(f,{variant:"body1",color:"primary",children:a.label})},a.value))})]})}var Tp=e.div`
101
- display: flex;
102
- flex-direction: column;
103
- gap: 8px;
104
- `,Dp=e.div`
105
- align-items: center;
106
- justify-content: center;
107
- min-height: 480px;
108
- display: flex;
109
- flex-direction: column;
110
- gap: 8px;
111
- padding: 16px;
112
- border-radius: 8px;
113
- border: 1px solid ${({theme:n})=>{var t,e;return ((e=(t=n==null?void 0:n.stigg)==null?void 0:t.palette)==null?void 0:e.outlinedBorder)||"#e0e0e0"}};
114
- background-color: ${({theme:n})=>{var t,e;return ((e=(t=n==null?void 0:n.stigg)==null?void 0:t.palette)==null?void 0:e.backgroundPaper)||"#ffffff"}};
115
- `,Ap=e(Pp)`
116
- border-radius: 4px;
117
- height: 400px;
118
- width: 100%;
119
- `;function xb({currencyId:n,timeRange:t,localization:e}){var y,x;let i=v(),s=u({optional:true}),o=s==null?void 0:s.stigg,r=a(a({},I$1),e),[a$1,l]=useState(t),{creditUsage:c,isLoading:h,error:d}=K({currencyId:n,timeRange:a$1}),{tooltipInfo:u$1,tooltipHandler:f}=Nl(),{data:g,options:p}=useMemo(()=>Rl(c||null,i,f,a$1),[c,i,f,a$1]),m=useMemo(()=>(c==null?void 0:c.series.reduce((_,v)=>_+v.totalCredits,0))||0,[c]),b=(x=(y=c==null?void 0:c.currency)==null?void 0:y.units)==null?void 0:x.plural;return jsx(w,{componentTheme:i,children:jsxs(Tp,{className:"stigg-credit-usage-chart-container",children:[jsx(Dp,{className:"stigg-credit-usage-chart-card",children:jsxs("div",{style:{width:"100%"},children:[jsx(Xl,{isLoading:h,totalCredits:m,selectedTimeRange:a$1,setSelectedTimeRange:l,error:d,localization:r,currencyUnit:b}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[jsx("div",{style:{height:"400px",position:"relative"},children:h?jsx(Ap,{className:"stigg-credit-usage-chart-skeleton"}):d?jsx(Yl,{}):(c==null?void 0:c.series.length)===0?jsx(Vl,{}):jsxs(Fragment,{children:[jsx(Wl,{tooltipInfo:u$1}),jsx(Ol,{className:"stigg-credit-usage-chart-bar",data:g!=null?g:{labels:[],datasets:[]},options:p!=null?p:{},plugins:[El]})]})}),!h&&jsx(jl,{creditUsageData:c})]})]})}),jsx(q,{source:"credit_usage_chart",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:o==null?void 0:o.getShowWatermark()})]})})}/*! Bundled license information:
120
-
121
- chart.js/dist/chunks/helpers.segment.mjs:
122
- chart.js/dist/chart.mjs:
123
- chart.js/dist/helpers.mjs:
124
- (*!
125
- * Chart.js v3.9.1
126
- * https://www.chartjs.org
127
- * (c) 2022 Chart.js Contributors
128
- * Released under the MIT License
129
- *)
130
-
131
- chart.js/dist/chunks/helpers.segment.mjs:
132
- (*!
133
- * @kurkle/color v0.2.1
134
- * https://github.com/kurkle/color#readme
135
- * (c) 2022 Jukka Kurkela
136
- * Released under the MIT License
137
- *)
138
-
139
- chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.esm.js:
140
- (*!
141
- * chartjs-plugin-datalabels v2.2.0
142
- * https://chartjs-plugin-datalabels.netlify.app
143
- * (c) 2017-2022 chartjs-plugin-datalabels contributors
144
- * Released under the MIT license
145
- *)
146
-
147
- chartjs-plugin-annotation/dist/chartjs-plugin-annotation.esm.js:
148
- (*!
149
- * chartjs-plugin-annotation v2.2.1
150
- * https://www.chartjs.org/chartjs-plugin-annotation/index
151
- * (c) 2023 chartjs-plugin-annotation Contributors
152
- * Released under the MIT License
153
- *)
154
-
155
- chartjs-plugin-gradient/dist/chartjs-plugin-gradient.esm.js:
156
- (*!
157
- * chartjs-plugin-gradient v0.6.1
158
- * https://github.com/kurkle/chartjs-plugin-gradient#readme
159
- * (c) 2022 Jukka Kurkela
160
- * Released under the MIT License
161
- *)
162
- */export{xb as CreditUsageChart};