nemesischart 0.1.15 → 0.1.17

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,3 +1,3 @@
1
- (function(ot,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],g):(ot=typeof globalThis<"u"?globalThis:ot||self,g(ot.NemesisChart={},ot.Vue))})(this,(function(ot,g){"use strict";const an=(i,t)=>{const e=i.__vccOpts||i;for(const[s,n]of t)e[s]=n;return e},ln={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},di=an({__name:"Cards",props:{cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},titulo:{type:String,default:"Card Title"},valor:{type:String,default:"0"},descricao:{type:String,default:"This is a card component."},botao_todos:{type:Boolean,default:!1}},emits:["click"],setup(i,{emit:t}){const e=i,s={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},n=t,o=g.computed(()=>s[e.cor]??"bg-white"),r=()=>{n("click")};return(a,l)=>(g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass([o.value,"border-1 surface-border border-round-xl cursor-pointer flex flex-column w-full transition-linear transition-all transition-duration-200 select-none",o.value==="bg-black"?"hover:bg-black-alpha-90":"hover:bg-white-alpha-70"]),style:{padding:"1.25rem",gap:"1.438rem"},onClick:r},[g.createElementVNode("p",{class:g.normalizeClass(["m-0 text-xs font-medium",o.value==="bg-black"?"text-white":"text-gray-900"])},g.toDisplayString(i.titulo),3),g.createElementVNode("div",null,[g.createElementVNode("h2",{class:g.normalizeClass(["m-0 text-3xl font-semibold",o.value==="bg-black"?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},g.toDisplayString(i.valor),3),g.createElementVNode("p",ln,g.toDisplayString(i.descricao),1)]),i.botao_todos?(g.openBlock(),g.createElementBlock("button",{key:0,class:g.normalizeClass(["nc-btn-todos text-xs",o.value==="bg-black"?"text-white":"text-gray-900"])},[...l[0]||(l[0]=[g.createTextVNode(" Ver Todos ",-1),g.createElementVNode("i",{class:"pi pi-angle-right text-xs"},null,-1)])],2)):g.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-c2f86ac2"]]);function Bt(i){return i+.5|0}const pt=(i,t,e)=>Math.max(Math.min(i,e),t);function Nt(i){return pt(Bt(i*2.55),0,255)}function mt(i){return pt(Bt(i*255),0,255)}function dt(i){return pt(Bt(i/2.55)/100,0,1)}function fi(i){return pt(Bt(i*100),0,100)}const et={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Le=[..."0123456789ABCDEF"],cn=i=>Le[i&15],hn=i=>Le[(i&240)>>4]+Le[i&15],se=i=>(i&240)>>4===(i&15),dn=i=>se(i.r)&&se(i.g)&&se(i.b)&&se(i.a);function fn(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&et[i[1]]*17,g:255&et[i[2]]*17,b:255&et[i[3]]*17,a:t===5?et[i[4]]*17:255}:(t===7||t===9)&&(e={r:et[i[1]]<<4|et[i[2]],g:et[i[3]]<<4|et[i[4]],b:et[i[5]]<<4|et[i[6]],a:t===9?et[i[7]]<<4|et[i[8]]:255})),e}const un=(i,t)=>i<255?t(i):"";function gn(i){var t=dn(i)?cn:hn;return i?"#"+t(i.r)+t(i.g)+t(i.b)+un(i.a,t):void 0}const pn=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ui(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function mn(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function bn(i,t,e){const s=ui(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function xn(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function Ie(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),r=Math.min(e,s,n),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=xn(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function ze(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(mt)}function Fe(i,t,e){return ze(ui,i,t,e)}function _n(i,t,e){return ze(bn,i,t,e)}function yn(i,t,e){return ze(mn,i,t,e)}function gi(i){return(i%360+360)%360}function kn(i){const t=pn.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Nt(+t[5]):mt(+t[5]));const n=gi(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=_n(n,o,r):t[1]==="hsv"?s=yn(n,o,r):s=Fe(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function wn(i,t){var e=Ie(i);e[0]=gi(e[0]+t),e=Fe(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Mn(i){if(!i)return;const t=Ie(i),e=t[0],s=fi(t[1]),n=fi(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${dt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const pi={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"},mi={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Sn(){const i={},t=Object.keys(mi),e=Object.keys(pi);let s,n,o,r,a;for(s=0;s<t.length;s++){for(r=a=t[s],n=0;n<e.length;n++)o=e[n],a=a.replace(o,pi[o]);o=parseInt(mi[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let ne;function vn(i){ne||(ne=Sn(),ne.transparent=[0,0,0,0]);const t=ne[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Cn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function An(i){const t=Cn.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?Nt(r):pt(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Nt(s):pt(s,0,255)),n=255&(t[4]?Nt(n):pt(n,0,255)),o=255&(t[6]?Nt(o):pt(o,0,255)),{r:s,g:n,b:o,a:e}}}function Dn(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${dt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Be=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Ot=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Pn(i,t,e){const s=Ot(dt(i.r)),n=Ot(dt(i.g)),o=Ot(dt(i.b));return{r:mt(Be(s+e*(Ot(dt(t.r))-s))),g:mt(Be(n+e*(Ot(dt(t.g))-n))),b:mt(Be(o+e*(Ot(dt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function oe(i,t,e){if(i){let s=Ie(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Fe(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function bi(i,t){return i&&Object.assign(t||{},i)}function xi(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=mt(i[3]))):(t=bi(i,{r:0,g:0,b:0,a:1}),t.a=mt(t.a)),t}function On(i){return i.charAt(0)==="r"?An(i):kn(i)}class Vt{constructor(t){if(t instanceof Vt)return t;const e=typeof t;let s;e==="object"?s=xi(t):e==="string"&&(s=fn(t)||vn(t)||On(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=bi(this._rgb);return t&&(t.a=dt(t.a)),t}set rgb(t){this._rgb=xi(t)}rgbString(){return this._valid?Dn(this._rgb):void 0}hexString(){return this._valid?gn(this._rgb):void 0}hslString(){return this._valid?Mn(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Pn(this._rgb,t._rgb,e)),this}clone(){return new Vt(this.rgb)}alpha(t){return this._rgb.a=mt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Bt(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return oe(this._rgb,2,t),this}darken(t){return oe(this._rgb,2,-t),this}saturate(t){return oe(this._rgb,1,t),this}desaturate(t){return oe(this._rgb,1,-t),this}rotate(t){return wn(this._rgb,t),this}}function ft(){}const Tn=(()=>{let i=0;return()=>i++})();function N(i){return i==null}function $(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function E(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function it(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function rt(i,t){return it(i)?i:t}function L(i,t){return typeof i>"u"?t:i}const En=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,_i=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function B(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function I(i,t,e,s){let n,o,r;if($(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(E(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function re(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function ae(i){if($(i))return i.map(ae);if(E(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=ae(i[e[n]]);return t}return i}function yi(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Rn(i,t,e,s){if(!yi(i))return;const n=t[i],o=e[i];E(n)&&E(o)?Ht(n,o,s):t[i]=ae(o)}function Ht(i,t,e){const s=$(t)?t:[t],n=s.length;if(!E(i))return i;e=e||{};const o=e.merger||Rn;let r;for(let a=0;a<n;++a){if(r=s[a],!E(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function Wt(i,t){return Ht(i,t,{merger:Ln})}function Ln(i,t,e){if(!yi(i))return;const s=t[i],n=e[i];E(s)&&E(n)?Wt(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=ae(n))}const ki={"":i=>i,x:i=>i.x,y:i=>i.y};function In(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function zn(i){const t=In(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Tt(i,t){return(ki[t]||(ki[t]=zn(t)))(i)}function Ne(i){return i.charAt(0).toUpperCase()+i.slice(1)}const le=i=>typeof i<"u",bt=i=>typeof i=="function",wi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Fn(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const z=Math.PI,W=2*z,ce=Number.POSITIVE_INFINITY,Bn=z/180,Y=z/2,yt=z/4,Mi=z*2/3,Si=Math.log10,he=Math.sign;function de(i,t,e){return Math.abs(i-t)<e}function vi(i){const t=Math.round(i);i=de(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Si(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Nn(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function Vn(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function fe(i){return!Vn(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function Hn(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Wn(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function at(i){return i*(z/180)}function Ve(i){return i*(180/z)}function Ci(i){if(!it(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Ai(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*z&&(o+=W),{angle:o,distance:n}}function jn(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function J(i){return(i%W+W)%W}function ue(i,t,e,s){const n=J(i),o=J(t),r=J(e),a=J(o-n),l=J(r-n),c=J(n-o),h=J(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function st(i,t,e){return Math.max(t,Math.min(e,i))}function $n(i){return st(i,-32768,32767)}function jt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function He(i,t,e){e=e||(r=>i[r]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const We=(i,t,e,s)=>He(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),Yn=(i,t,e)=>He(i,e,s=>i[s][t]>=e);function Xn(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const Di=["push","pop","shift","splice","unshift"];function Un(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Di.forEach(e=>{const s="_onData"+Ne(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function Pi(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Di.forEach(o=>{delete i[o]}),delete i._chartjs)}function Kn(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Oi=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Ti(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Oi.call(window,()=>{s=!1,i.apply(t,e)}))}}function qn(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Ei=i=>i==="start"?"left":i==="end"?"right":"center",tt=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Gn=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t,ge=i=>i===0||i===1,Ri=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*W/e)),Li=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*W/e)+1,$t={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*Y)+1,easeOutSine:i=>Math.sin(i*Y),easeInOutSine:i=>-.5*(Math.cos(z*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>ge(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>ge(i)?i:Ri(i,.075,.3),easeOutElastic:i=>ge(i)?i:Li(i,.075,.3),easeInOutElastic(i){return ge(i)?i:i<.5?.5*Ri(i*2,.1125,.45):.5+.5*Li(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-$t.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?$t.easeInBounce(i*2)*.5:$t.easeOutBounce(i*2-1)*.5+.5};function Ii(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function zi(i){return Ii(i)?i:new Vt(i)}function je(i){return Ii(i)?i:new Vt(i).saturate(.5).darken(.1).hexString()}const Qn=["x","y","borderWidth","radius","tension"],Zn=["color","borderColor","backgroundColor"];function Jn(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:Zn},numbers:{type:"number",properties:Qn}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function to(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Fi=new Map;function eo(i,t){t=t||{};const e=i+JSON.stringify(t);let s=Fi.get(e);return s||(s=new Intl.NumberFormat(i,t),Fi.set(e,s)),s}function pe(i,t,e){return eo(t,e).format(i)}const io={values(i){return $(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=so(i,e)}const r=Si(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),pe(i,s,l)}};function so(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Bi={formatters:io};function no(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Bi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const kt=Object.create(null),$e=Object.create(null);function Yt(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function Ye(i,t,e){return typeof t=="string"?Ht(Yt(i,t),e):Ht(Yt(i,""),t)}class oo{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>je(n.backgroundColor),this.hoverBorderColor=(s,n)=>je(n.borderColor),this.hoverColor=(s,n)=>je(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Ye(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return Ye($e,t,e)}override(t,e){return Ye(kt,t,e)}route(t,e,s,n){const o=Yt(this,t),r=Yt(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return E(l)?Object.assign({},c,l):L(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var j=new oo({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Jn,to,no]);function ro(i){return!i||N(i.size)||N(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function me(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function ao(i,t,e,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let r=0;const a=e.length;let l,c,h,d,f;for(l=0;l<a;l++)if(d=e[l],d!=null&&!$(d))r=me(i,n,o,r,d);else if($(d))for(c=0,h=d.length;c<h;c++)f=d[c],f!=null&&!$(f)&&(r=me(i,n,o,r,f));i.restore();const u=o.length/2;if(u>e.length){for(l=0;l<u;l++)delete n[o[l]];o.splice(0,u)}return r}function wt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function Ni(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Vi(i,t,e,s){Hi(i,t,e,s,null)}function Hi(i,t,e,s,n){let o,r,a,l,c,h,d,f;const u=t.pointStyle,b=t.rotation,m=t.radius;let p=(b||0)*Bn;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(p),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(m)||m<=0)){switch(i.beginPath(),u){default:n?i.ellipse(e,s,n/2,m,0,0,W):i.arc(e,s,m,0,W),i.closePath();break;case"triangle":h=n?n/2:m,i.moveTo(e+Math.sin(p)*h,s-Math.cos(p)*m),p+=Mi,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*m),p+=Mi,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*m),i.closePath();break;case"rectRounded":c=m*.516,l=m-c,r=Math.cos(p+yt)*l,d=Math.cos(p+yt)*(n?n/2-c:l),a=Math.sin(p+yt)*l,f=Math.sin(p+yt)*(n?n/2-c:l),i.arc(e-d,s-a,c,p-z,p-Y),i.arc(e+f,s-r,c,p-Y,p),i.arc(e+d,s+a,c,p,p+Y),i.arc(e-f,s+r,c,p+Y,p+z),i.closePath();break;case"rect":if(!b){l=Math.SQRT1_2*m,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}p+=yt;case"rectRot":d=Math.cos(p)*(n?n/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(n?n/2:m),i.moveTo(e-d,s-a),i.lineTo(e+f,s-r),i.lineTo(e+d,s+a),i.lineTo(e-f,s+r),i.closePath();break;case"crossRot":p+=yt;case"cross":d=Math.cos(p)*(n?n/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(n?n/2:m),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"star":d=Math.cos(p)*(n?n/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(n?n/2:m),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r),p+=yt,d=Math.cos(p)*(n?n/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(n?n/2:m),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"line":r=n?n/2:Math.cos(p)*m,a=Math.sin(p)*m,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(p)*(n?n/2:m),s+Math.sin(p)*m);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Et(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function Xe(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function Ue(i){i.restore()}function lo(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),N(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function co(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function ho(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Rt(i,t,e,s,n,o={}){const r=$(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,lo(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&ho(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),N(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),co(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function be(i,t){const{x:e,y:s,w:n,h:o,radius:r}=t;i.arc(e+r.topLeft,s+r.topLeft,r.topLeft,1.5*z,z,!0),i.lineTo(e,s+o-r.bottomLeft),i.arc(e+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,z,Y,!0),i.lineTo(e+n-r.bottomRight,s+o),i.arc(e+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,Y,0,!0),i.lineTo(e+n,s+r.topRight),i.arc(e+n-r.topRight,s+r.topRight,r.topRight,0,-Y,!0),i.lineTo(e+r.topLeft,s)}const fo=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,uo=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function go(i,t){const e=(""+i).match(fo);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const po=i=>+i||0;function Ke(i,t){const e={},s=E(t),n=s?Object.keys(t):t,o=E(i)?s?r=>L(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=po(o(r));return e}function mo(i){return Ke(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Lt(i){return Ke(i,["topLeft","topRight","bottomLeft","bottomRight"])}function K(i){const t=mo(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function U(i,t){i=i||{},t=t||j.font;let e=L(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=L(i.style,t.style);s&&!(""+s).match(uo)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:L(i.family,t.family),lineHeight:go(L(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:L(i.weight,t.weight),string:""};return n.string=ro(n),n}function xe(i,t,e,s){let n,o,r;for(n=0,o=i.length;n<o;++n)if(r=i[n],r!==void 0&&r!==void 0)return r}function bo(i,t,e){const{min:s,max:n}=i,o=_i(t,(n-s)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function Mt(i,t){return Object.assign(Object.create(i),t)}function qe(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=Xi("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>qe([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return ji(a,l,()=>vo(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Ui(a).includes(l)},ownKeys(a){return Ui(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function It(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Wi(i,s),setContext:o=>It(i,o,e,s),override:o=>It(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return ji(o,r,()=>_o(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function Wi(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:bt(e)?e:()=>e,isIndexable:bt(s)?s:()=>s}}const xo=(i,t)=>i?i+Ne(t):t,Ge=(i,t)=>E(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ji(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function _o(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return bt(a)&&r.isScriptable(t)&&(a=yo(t,a,i,e)),$(a)&&a.length&&(a=ko(t,a,i,r.isIndexable)),Ge(t,a)&&(a=It(a,n,o&&o[t],r)),a}function yo(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),Ge(i,l)&&(l=Qe(n._scopes,n,i,l)),l}function ko(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(E(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Qe(c,n,i,h);t.push(It(d,o,r&&r[i],a))}}return t}function $i(i,t,e){return bt(i)?i(t,e):i}const wo=(i,t)=>i===!0?t:typeof i=="string"?Tt(t,i):void 0;function Mo(i,t,e,s,n){for(const o of t){const r=wo(e,o);if(r){i.add(r);const a=$i(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function Qe(i,t,e,s){const n=t._rootScopes,o=$i(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Yi(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=Yi(a,r,o,l,s),l===null)?!1:qe(Array.from(a),[""],n,o,()=>So(t,e,s))}function Yi(i,t,e,s,n){for(;e;)e=Mo(i,t,e,s,n);return e}function So(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return $(n)&&E(e)?e:n||{}}function vo(i,t,e,s){let n;for(const o of t)if(n=Xi(xo(o,i),e),typeof n<"u")return Ge(i,n)?Qe(e,s,i,n):n}function Xi(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Ui(i){let t=i._keys;return t||(t=i._keys=Co(i._scopes)),t}function Co(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function Ao(i,t,e,s){const{iScale:n}=i,{key:o="r"}=this._parsing,r=new Array(s);let a,l,c,h;for(a=0,l=s;a<l;++a)c=a+e,h=t[c],r[a]={r:n.parse(Tt(h,o),c)};return r}function Ze(){return typeof window<"u"&&typeof document<"u"}function Je(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function _e(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const ye=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Do(i,t){return ye(i).getPropertyValue(t)}const Po=["top","right","bottom","left"];function St(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=Po[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Oo=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function To(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(Oo(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function vt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=ye(e),o=n.boxSizing==="border-box",r=St(n,"padding"),a=St(n,"border","width"),{x:l,y:c,box:h}=To(i,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:u,height:b}=t;return o&&(u-=r.width+a.width,b-=r.height+a.height),{x:Math.round((l-d)/u*e.width/s),y:Math.round((c-f)/b*e.height/s)}}function Eo(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&Je(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=ye(o),l=St(a,"border","width"),c=St(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=_e(a.maxWidth,o,"clientWidth"),n=_e(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||ce,maxHeight:n||ce}}const xt=i=>Math.round(i*10)/10;function Ro(i,t,e,s){const n=ye(i),o=St(n,"margin"),r=_e(n.maxWidth,i,"clientWidth")||ce,a=_e(n.maxHeight,i,"clientHeight")||ce,l=Eo(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const f=St(n,"border","width"),u=St(n,"padding");c-=u.width+f.width,h-=u.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=xt(Math.min(c,r,l.maxWidth)),h=xt(Math.min(h,a,l.maxHeight)),c&&!h&&(h=xt(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=xt(Math.floor(h*s))),{width:c,height:h}}function Ki(i,t,e){const s=t||1,n=xt(i.height*s),o=xt(i.width*s);i.height=xt(i.height),i.width=xt(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Lo=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Ze()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function qi(i,t){const e=Do(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const Io=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},zo=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function zt(i,t,e){return i?Io(t,e):zo()}function Gi(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Qi(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function ke(i,t,e){return i.options.clip?i[e]:t[e]}function Fo(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:ke(e,t,"left"),right:ke(e,t,"right"),top:ke(s,t,"top"),bottom:ke(s,t,"bottom")}:t}function Bo(i,t){const e=t._clip;if(e.disabled)return!1;const s=Fo(t,i.chartArea);return{left:e.left===!1?0:s.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:s.right+(e.right===!0?0:e.right),top:e.top===!1?0:s.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:s.bottom+(e.bottom===!0?0:e.bottom)}}class No{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Oi.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ut=new No;const Zi="transparent",Vo={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=zi(i||Zi),n=s.valid&&zi(t||Zi);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Ho{constructor(t,e,s,n){const o=e[s];n=xe([t.to,n,o,t.from]);const r=xe([t.from,o,n]);this._active=!0,this._fn=t.fn||Vo[t.type||typeof r],this._easing=$t[t.easing]||$t.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=xe([t.to,e,n,t.from]),this._from=xe([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<s),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class Ji{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!E(t))return;const e=Object.keys(j.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!E(o))return;const r={};for(const a of e)r[a]=o[a];($(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=jo(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Wo(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const f=s.get(c);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new Ho(f,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return ut.add(this._chart,s),!0}}function Wo(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function jo(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function ts(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function $o(i,t,e){if(e===!1)return!1;const s=ts(i,e),n=ts(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function Yo(i){let t,e,s,n;return E(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function es(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function is(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===e){if(h=!0,s.all)continue;break}c=i.values[l],it(c)&&(o||t===0||he(t)===he(c))&&(t+=c)}return!h&&!s.all?0:t}function Xo(i,t){const{iScale:e,vScale:s}=t,n=e.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[n]:h,[o]:i[h]};return a}function ti(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Uo(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Ko(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function qo(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function ss(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function ns(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Uo(o,r,s),d=t.length;let f;for(let u=0;u<d;++u){const b=t[u],{[l]:m,[c]:p}=b,x=b._stacks||(b._stacks={});f=x[c]=qo(n,h,m),f[a]=p,f._top=ss(f,r,!0,s.type),f._bottom=ss(f,r,!1,s.type);const y=f._visualValues||(f._visualValues={});y[a]=p}}function ei(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Go(i,t){return Mt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Qo(i,t,e){return Mt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Xt(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const ii=i=>i==="reset"||i==="none",os=(i,t)=>t?i:Object.assign({},i),Zo=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:es(e,!0),values:null};class si{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ti(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Xt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,f,u,b)=>d==="x"?f:d==="r"?b:u,o=e.xAxisID=L(s.xAxisID,ei(t,"x")),r=e.yAxisID=L(s.yAxisID,ei(t,"y")),a=e.rAxisID=L(s.rAxisID,ei(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Pi(this._data,this),t._stacked&&Xt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(E(e)){const n=this._cachedMeta;this._data=Xo(e,n)}else if(s!==e){if(s){Pi(s,this);const n=this._cachedMeta;Xt(n),n._parsed=[]}e&&Object.isExtensible(e)&&Un(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=ti(e.vScale,e),e.stack!==s.stack&&(n=!0,Xt(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(ns(this,e._parsed),e._stacked=ti(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,f;if(this._parsing===!1)s._parsed=n,s._sorted=!0,f=n;else{$(n[t])?f=this.parseArrayData(s,n,t,e):E(n[t])?f=this.parseObjectData(s,n,t,e):f=this.parsePrimitiveData(s,n,t,e);const u=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)s._parsed[h+t]=d=f[h],l&&(u()&&(l=!1),c=d);s._sorted=l}r&&ns(this,f)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let f,u,b;for(f=0,u=n;f<u;++f)b=f+s,d[f]={[a]:h||o.parse(c[b],b),[l]:r.parse(e[b],b)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,f,u;for(h=0,d=n;h<d;++h)f=h+s,u=e[f],c[h]={x:o.parse(Tt(u,a),f),y:r.parse(Tt(u,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:es(n,!0),values:e._stacks[t.axis]._visualValues};return is(a,r,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let r=o===null?NaN:o;const a=n&&s._stacks[e.axis];n&&a&&(n.values=a,r=is(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,r=n.length,a=this._getOtherScale(t),l=Zo(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=Ko(a);let f,u;function b(){u=n[f];const m=u[a.axis];return!it(u[t.axis])||h>m||d<m}for(f=0;f<r&&!(!b()&&(this.updateRangeFromParsed(c,t,u,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!b()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],it(r)&&s.push(r);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Yo(L(this.options.clip,$o(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=n[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Qo(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Go(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&le(s);if(a)return os(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),u=Object.keys(j.elements[t]),b=()=>this.getContext(s,n,e),m=c.resolveNamedOptions(f,u,b,d);return m.$shared&&(m.$shared=l,o[r]=Object.freeze(os(m,l))),m}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,s,e))}const c=new Ji(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ii(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){ii(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!ii(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&Xt(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Jo(i,t,e){let s=1,n=1,o=0,r=0;if(t<W){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),f=Math.sin(l),u=(_,w,k)=>ue(_,a,l,!0)?1:Math.max(w,w*e,k,k*e),b=(_,w,k)=>ue(_,a,l,!0)?-1:Math.min(w,w*e,k,k*e),m=u(0,c,d),p=u(Y,h,f),x=b(z,c,d),y=b(z+Y,h,f);s=(m-x)/2,n=(p-y)/2,o=-(m+x)/2,r=-(p+y)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}class tr extends si{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const d=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:n,pointStyle:s,borderRadius:r&&(a||d.borderRadius),index:c}}):[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(E(s[t])){const{key:l="value"}=this._parsing;o=c=>+Tt(s[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)n._parsed[r]=o(r)}}_getRotation(){return at(this.options.rotation-90)}_getCircumference(){return at(this.options.circumference)}_getRotationExtents(){let t=W,e=-W;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const n=this.chart.getDatasetMeta(s).controller,o=n._getRotation(),r=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,n=this._cachedMeta,o=n.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(s.width,s.height)-r)/2,0),l=Math.min(En(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:u,offsetX:b,offsetY:m}=Jo(d,h,l),p=(s.width-r)/f,x=(s.height-r)/u,y=Math.max(Math.min(p,x)/2,0),_=_i(this.options.radius,y),w=Math.max(_*l,0),k=(_-w)/this._getVisibleDatasetWeightTotal();this.offsetX=b*_,this.offsetY=m*_,n.total=this.calculateTotal(),this.outerRadius=_-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const s=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/W)}updateElements(t,e,s,n){const o=n==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=o&&c.animateScale,u=f?0:this.innerRadius,b=f?0:this.outerRadius,{sharedOptions:m,includeOptions:p}=this._getSharedOptions(e,n);let x=this._getRotation(),y;for(y=0;y<e;++y)x+=this._circumference(y,o);for(y=e;y<e+s;++y){const _=this._circumference(y,o),w=t[y],k={x:h+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+_,circumference:_,outerRadius:b,innerRadius:u};p&&(k.options=m||this.resolveDataElementOptions(y,w.active?"active":n)),x+=_,this.updateElement(w,y,k,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,n;for(n=0;n<e.length;n++){const o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?W*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=pe(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,r,a,l;if(!t){for(n=0,o=s.data.datasets.length;n<o;++n)if(s.isDatasetVisible(n)){r=s.getDatasetMeta(n),t=r.data,a=r.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)l=a.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,n=t.length;s<n;++s){const o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(L(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class er extends si{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=pe(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return Ao.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),r=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,s,n){const o=n==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*z;let u=f,b;const m=360/this.countVisibleElements();for(b=0;b<e;++b)u+=this._computeAngle(b,n,m);for(b=e;b<e+s;b++){const p=t[b];let x=u,y=u+this._computeAngle(b,n,m),_=r.getDataVisibility(b)?c.getDistanceFromCenterForValue(this.getParsed(b).r):0;u=y,o&&(l.animateScale&&(_=0),l.animateRotate&&(x=y=f));const w={x:h,y:d,innerRadius:0,outerRadius:_,startAngle:x,endAngle:y,options:this.resolveDataElementOptions(b,p.active?"active":n)};this.updateElement(p,b,w,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((s,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?at(this.resolveDataElementOptions(t,e).angle||s):0}}function Ct(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ni{static override(t){Object.assign(ni.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Ct()}parse(){return Ct()}format(){return Ct()}add(){return Ct()}diff(){return Ct()}startOf(){return Ct()}endOf(){return Ct()}}var ir={_date:ni};function sr(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?Yn:We;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const f=c(o,t,e-d),u=c(o,t,e+d);return{lo:f.lo,hi:u.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:f}=i,u=f.slice(0,h.lo+1).reverse().findIndex(m=>!N(m[d.axis]));h.lo-=Math.max(0,u);const b=f.slice(h.hi).findIndex(m=>!N(m[d.axis]));h.hi+=Math.max(0,b)}return h}}return{lo:0,hi:o.length-1}}function we(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:f}=sr(o[a],t,r,n);for(let u=d;u<=f;++u){const b=h[u];b.skip||s(b,c,u)}}}function nr(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,r=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function oi(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||we(i,e,t,function(a,l,c){!n&&!Et(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function or(i,t,e,s){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=Ai(r,{x:t.x,y:t.y});ue(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return we(i,e,t,o),n}function rr(i,t,e,s,n,o){let r=[];const a=nr(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const u=h.inRange(t.x,t.y,n);if(s&&!u)return;const b=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(b))&&!u)return;const p=a(t,b);p<l?(r=[{element:h,datasetIndex:d,index:f}],l=p):p===l&&r.push({element:h,datasetIndex:d,index:f})}return we(i,e,t,c),r}function ri(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?or(i,t,e,n):rr(i,t,e,s,n,o)}function rs(i,t,e,s,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return we(i,e,t,(l,c,h)=>{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var ar={modes:{index(i,t,e,s){const n=vt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?oi(i,n,o,s,r):ri(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=vt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?oi(i,n,o,s,r):ri(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,s){const n=vt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return oi(i,n,o,s,r)},nearest(i,t,e,s){const n=vt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return ri(i,n,o,e.intersect,s,r)},x(i,t,e,s){const n=vt(t,i);return rs(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=vt(t,i);return rs(i,n,"y",e.intersect,s)}}};const as=["left","top","right","bottom"];function Ut(i,t){return i.filter(e=>e.pos===t)}function ls(i,t){return i.filter(e=>as.indexOf(e.pos)===-1&&e.box.axis===t)}function Kt(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function lr(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function cr(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!as.includes(n))continue;const r=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function hr(i,t){const e=cr(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&t.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:l&&t.availableHeight)}return e}function dr(i){const t=lr(i),e=Kt(t.filter(c=>c.box.fullSize),!0),s=Kt(Ut(t,"left"),!0),n=Kt(Ut(t,"right")),o=Kt(Ut(t,"top"),!0),r=Kt(Ut(t,"bottom")),a=ls(t,"x"),l=ls(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:Ut(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function cs(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function hs(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function fr(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!E(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&hs(r,o.getPadding());const a=Math.max(0,t.outerWidth-cs(r,i,"left","right")),l=Math.max(0,t.outerHeight-cs(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function ur(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function gr(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function qt(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,gr(a.horizontal,t));const{same:d,other:f}=fr(t,e,a,s);c|=d&&n.length,h=h||f,l.fullSize||n.push(a)}return c&&qt(n,t,e,s)||h}function Me(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function ds(i,t,e,s){const n=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=s[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,f=c.size||l.height;le(c.start)&&(r=c.start),l.fullSize?Me(l,n.left,r,e.outerWidth-n.right-n.left,f):Me(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,f=c.size||l.width;le(c.start)&&(o=c.start),l.fullSize?Me(l,o,n.top,f,e.outerHeight-n.bottom-n.top):Me(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var _t={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=K(i.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=dr(i.boxes),l=a.vertical,c=a.horizontal;I(i.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},n);hs(f,K(s));const u=Object.assign({maxPadding:f,w:o,h:r,x:n.left,y:n.top},n),b=hr(l.concat(c),d);qt(a.fullSize,u,d,b),qt(l,u,d,b),qt(c,u,d,b)&&qt(l,u,d,b),ur(u),ds(a.leftAndTop,u,d,b),u.x+=u.w,u.y+=u.h,ds(a.rightAndBottom,u,d,b),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},I(a.chartArea,m=>{const p=m.box;Object.assign(p,i.chartArea),p.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class fs{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class pr extends fs{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Se="$chartjs",mr={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},us=i=>i===null||i==="";function br(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[Se]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",us(n)){const o=qi(i,"width");o!==void 0&&(i.width=o)}if(us(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=qi(i,"height");o!==void 0&&(i.height=o)}return i}const gs=Lo?{passive:!0}:!1;function xr(i,t,e){i&&i.addEventListener(t,e,gs)}function _r(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,gs)}function yr(i,t){const e=mr[i.type]||i.type,{x:s,y:n}=vt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function ve(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function kr(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ve(a.addedNodes,s),r=r&&!ve(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function wr(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ve(a.removedNodes,s),r=r&&!ve(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Gt=new Map;let ps=0;function ms(){const i=window.devicePixelRatio;i!==ps&&(ps=i,Gt.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Mr(i,t){Gt.size||window.addEventListener("resize",ms),Gt.set(i,t)}function Sr(i){Gt.delete(i),Gt.size||window.removeEventListener("resize",ms)}function vr(i,t,e){const s=i.canvas,n=s&&Je(s);if(!n)return;const o=Ti((a,l)=>{const c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),Mr(i,o),r}function ai(i,t,e){e&&e.disconnect(),t==="resize"&&Sr(i)}function Cr(i,t,e){const s=i.canvas,n=Ti(o=>{i.ctx!==null&&e(yr(o,i))},i);return xr(s,t,n),n}class Ar extends fs{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(br(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[Se])return!1;const s=e[Se].initial;["height","width"].forEach(o=>{const r=s[o];N(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Se],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:kr,detach:wr,resize:vr}[e]||Cr;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ai,detach:ai,resize:ai}[e]||_r)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Ro(t,e,s,n)}isAttached(t){const e=t&&Je(t);return!!(e&&e.isConnected)}}function Dr(i){return!Ze()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?pr:Ar}class Qt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return fe(this.x)&&fe(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}function Pr(i,t){const e=i.options.ticks,s=Or(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Er(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Rr(t,c,o,r/n),c;const h=Tr(o,t,n);if(r>0){let d,f;const u=r>1?Math.round((l-a)/(r-1)):null;for(Ce(t,c,h,N(u)?0:a-u,a),d=0,f=r-1;d<f;d++)Ce(t,c,h,o[d],o[d+1]);return Ce(t,c,h,l,N(u)?t.length:l+u),c}return Ce(t,c,h),c}function Or(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Tr(i,t,e){const s=Lr(i),n=t.length/e;if(!s)return Math.max(n,1);const o=Nn(s);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function Er(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function Rr(i,t,e,s){let n=0,o=e[0],r;for(s=Math.ceil(s),r=0;r<i.length;r++)r===o&&(t.push(i[r]),n++,o=e[n*s])}function Ce(i,t,e,s,n){const o=L(s,0),r=Math.min(L(n,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function Lr(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const Ir=i=>i==="left"?"right":i==="right"?"left":i,bs=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,xs=(i,t)=>Math.min(t||i,i);function _s(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function zr(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function Fr(i,t){I(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Zt(i){return i.drawTicks?i.tickLength:0}function ys(i,t){if(!i.display)return 0;const e=U(i.font,t),s=K(i.padding);return($(i.text)?i.text.length:1)*e.lineHeight+s.height}function Br(i,t){return Mt(i,{scale:t,type:"scale"})}function Nr(i,t,e){return Mt(i,{tick:e,index:t,type:"tick"})}function Vr(i,t,e){let s=Ei(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Ir(s)),s}function Hr(i,t,e,s){const{top:n,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,u,b;const m=r-n,p=a-o;if(i.isHorizontal()){if(u=tt(s,o,a),E(e)){const x=Object.keys(e)[0],y=e[x];b=h[x].getPixelForValue(y)+m-t}else e==="center"?b=(c.bottom+c.top)/2+m-t:b=bs(i,e,t);f=a-o}else{if(E(e)){const x=Object.keys(e)[0],y=e[x];u=h[x].getPixelForValue(y)-p+t}else e==="center"?u=(c.left+c.right)/2-p+t:u=bs(i,e,t);b=tt(s,r,n),d=e==="left"?-Y:Y}return{titleX:u,titleY:b,maxWidth:f,rotation:d}}class Jt extends Qt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=rt(t,Number.POSITIVE_INFINITY),e=rt(e,Number.NEGATIVE_INFINITY),s=rt(s,Number.POSITIVE_INFINITY),n=rt(n,Number.NEGATIVE_INFINITY),{min:rt(t,s),max:rt(e,n),minDefined:it(t),maxDefined:it(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(s=Math.max(s,r.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:rt(e,rt(s,e)),max:rt(s,rt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){B(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=bo(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?_s(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Pr(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){B(this.options.afterUpdate,[this])}beforeSetDimensions(){B(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(){B(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),B(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){B(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=B(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){B(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){B(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=xs(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r=n,a,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,u=st(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:u/(s-1),d+6>a&&(a=u/(s-(t.offset?.5:1)),l=this.maxHeight-Zt(t.grid)-e.padding-ys(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=Ve(Math.min(Math.asin(st((h.highest.height+6)/a,-1,1)),Math.asin(st(l/c,-1,1))-Math.asin(st(f/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){B(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){B(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=ys(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Zt(o)+l):(t.height=this.maxHeight,t.width=Zt(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=s.padding*2,b=at(this.labelRotation),m=Math.cos(b),p=Math.sin(b);if(a){const x=s.mirror?0:p*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+x+u)}else{const x=s.mirror?0:m*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+x+u)}this._calculatePadding(c,h,p,m)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,u=0;l?c?(f=n*t.width,u=s*e.height):(f=s*t.height,u=n*e.width):o==="start"?u=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,u=e.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){B(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)N(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=_s(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/xs(e,s));let c=0,h=0,d,f,u,b,m,p,x,y,_,w,k;for(d=0;d<e;d+=l){if(b=t[d].label,m=this._resolveTickFontOptions(d),n.font=p=m.string,x=o[p]=o[p]||{data:{},gc:[]},y=m.lineHeight,_=w=0,!N(b)&&!$(b))_=me(n,x.data,x.gc,_,b),w=y;else if($(b))for(f=0,u=b.length;f<u;++f)k=b[f],!N(k)&&!$(k)&&(_=me(n,x.data,x.gc,_,k),w+=y);r.push(_),a.push(w),c=Math.max(_,c),h=Math.max(w,h)}Fr(o,e);const M=r.indexOf(c),S=a.indexOf(h),v=C=>({width:r[C]||0,height:a[C]||0});return{first:v(0),last:v(e-1),widest:v(M),highest:v(S),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return $n(this._alignToPixels?wt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=Nr(this.getContext(),t,s))}return this.$context||(this.$context=Br(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=at(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Zt(o),u=[],b=a.setContext(this.getContext()),m=b.display?b.width:0,p=m/2,x=function(T){return wt(s,T,m)};let y,_,w,k,M,S,v,C,A,D,O,V;if(r==="top")y=x(this.bottom),S=this.bottom-f,C=y-p,D=x(t.top)+p,V=t.bottom;else if(r==="bottom")y=x(this.top),D=t.top,V=x(t.bottom)-p,S=y+p,C=this.top+f;else if(r==="left")y=x(this.right),M=this.right-f,v=y-p,A=x(t.left)+p,O=t.right;else if(r==="right")y=x(this.left),A=t.left,O=x(t.right)-p,M=y+p,v=this.left+f;else if(e==="x"){if(r==="center")y=x((t.top+t.bottom)/2+.5);else if(E(r)){const T=Object.keys(r)[0],R=r[T];y=x(this.chart.scales[T].getPixelForValue(R))}D=t.top,V=t.bottom,S=y+p,C=S+f}else if(e==="y"){if(r==="center")y=x((t.left+t.right)/2);else if(E(r)){const T=Object.keys(r)[0],R=r[T];y=x(this.chart.scales[T].getPixelForValue(R))}M=y-p,v=M-f,A=t.left,O=t.right}const X=L(n.ticks.maxTicksLimit,d),P=Math.max(1,Math.ceil(d/X));for(_=0;_<d;_+=P){const T=this.getContext(_),R=o.setContext(T),H=a.setContext(T),F=R.lineWidth,Q=R.color,nt=H.dash||[],Z=H.dashOffset,At=R.tickWidth,ht=R.tickColor,Dt=R.tickBorderDash||[],Pt=R.tickBorderDashOffset;w=zr(this,_,l),w!==void 0&&(k=wt(s,w,F),c?M=v=A=O=k:S=C=D=V=k,u.push({tx1:M,ty1:S,tx2:v,ty2:C,x1:A,y1:D,x2:O,y2:V,width:F,color:Q,borderDash:nt,borderDashOffset:Z,tickWidth:At,tickColor:ht,tickBorderDash:Dt,tickBorderDashOffset:Pt}))}return this._ticksLength=d,this._borderValue=y,u}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=Zt(s.grid),u=f+h,b=d?-h:u,m=-at(this.labelRotation),p=[];let x,y,_,w,k,M,S,v,C,A,D,O,V="middle";if(n==="top")M=this.bottom-b,S=this._getXAxisLabelAlignment();else if(n==="bottom")M=this.top+b,S=this._getXAxisLabelAlignment();else if(n==="left"){const P=this._getYAxisLabelAlignment(f);S=P.textAlign,k=P.x}else if(n==="right"){const P=this._getYAxisLabelAlignment(f);S=P.textAlign,k=P.x}else if(e==="x"){if(n==="center")M=(t.top+t.bottom)/2+u;else if(E(n)){const P=Object.keys(n)[0],T=n[P];M=this.chart.scales[P].getPixelForValue(T)+u}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")k=(t.left+t.right)/2-u;else if(E(n)){const P=Object.keys(n)[0],T=n[P];k=this.chart.scales[P].getPixelForValue(T)}S=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?V="top":l==="end"&&(V="bottom"));const X=this._getLabelSizes();for(x=0,y=a.length;x<y;++x){_=a[x],w=_.label;const P=o.setContext(this.getContext(x));v=this.getPixelForTick(x)+o.labelOffset,C=this._resolveTickFontOptions(x),A=C.lineHeight,D=$(w)?w.length:1;const T=D/2,R=P.color,H=P.textStrokeColor,F=P.textStrokeWidth;let Q=S;r?(k=v,S==="inner"&&(x===y-1?Q=this.options.reverse?"left":"right":x===0?Q=this.options.reverse?"right":"left":Q="center"),n==="top"?c==="near"||m!==0?O=-D*A+A/2:c==="center"?O=-X.highest.height/2-T*A+A:O=-X.highest.height+A/2:c==="near"||m!==0?O=A/2:c==="center"?O=X.highest.height/2-T*A:O=X.highest.height-D*A,d&&(O*=-1),m!==0&&!P.showLabelBackdrop&&(k+=A/2*Math.sin(m))):(M=v,O=(1-D)*A/2);let nt;if(P.showLabelBackdrop){const Z=K(P.backdropPadding),At=X.heights[x],ht=X.widths[x];let Dt=O-Z.top,Pt=0-Z.left;switch(V){case"middle":Dt-=At/2;break;case"bottom":Dt-=At;break}switch(S){case"center":Pt-=ht/2;break;case"right":Pt-=ht;break;case"inner":x===y-1?Pt-=ht:x>0&&(Pt-=ht/2);break}nt={left:Pt,top:Dt,width:ht+Z.width,height:At+Z.height,color:P.backdropColor}}p.push({label:w,font:C,textOffset:O,options:{rotation:m,color:R,strokeColor:H,strokeWidth:F,textAlign:Q,textBaseline:V,translation:[k,M],backdrop:nt}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-at(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const l=n[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),r=s.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,f;this.isHorizontal()?(c=wt(t,this.left,r)-r/2,h=wt(t,this.right,a)+a/2,d=f=l):(d=wt(t,this.top,r)-r/2,f=wt(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&Xe(s,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;Rt(s,c,0,h,l,a)}n&&Ue(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=U(s.font),r=K(s.padding),a=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||E(e)?(l+=r.bottom,$(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=Hr(this,l,e,a);Rt(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:f,textAlign:Vr(a,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=L(t.grid&&t.grid.z,-1),n=L(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Jt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return U(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ae{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;$r(e)&&(s=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,Wr(t,r,s),this.override&&j.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in j[n]&&(delete j[n][s],this.override&&delete kt[s])}}function Wr(i,t,e){const s=Ht(Object.create(null),[e?j.get(e):{},j.get(t),i.defaults]);j.set(t,s),i.defaultRoutes&&jr(t,i.defaultRoutes),i.descriptors&&j.describe(t,i.descriptors)}function jr(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");j.route(o,n,l,a)})}function $r(i){return"id"in i&&"defaults"in i}class Yr{constructor(){this.controllers=new Ae(si,"datasets",!0),this.elements=new Ae(Qt,"elements"),this.plugins=new Ae(Object,"plugins"),this.scales=new Ae(Jt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):I(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=Ne(t);B(s["before"+n],[],s),e[t](s),B(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var lt=new Yr;class Xr{constructor(){this._init=void 0}notify(t,e,s,n){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(B(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){N(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=L(s.options&&s.options.plugins,{}),o=Ur(s);return n===!1&&!e?[]:qr(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Ur(i){const t={},e=[],s=Object.keys(lt.plugins.items);for(let o=0;o<s.length;o++)e.push(lt.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Kr(i,t){return!t&&i===!1?null:i===!0?{}:i}function qr(i,{plugins:t,localIds:e},s,n){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Kr(s[l],n);c!==null&&o.push({plugin:a,options:Gr(i.config,{plugin:a,local:e[l]},c,r)})}return o}function Gr(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(s,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function li(i,t){const e=j.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Qr(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Zr(i,t){return i===t?"_index_":"_value_"}function ks(i){if(i==="x"||i==="y"||i==="r")return i}function Jr(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function ci(i,...t){if(ks(i))return i;for(const e of t){const s=e.axis||Jr(e.position)||i.length>1&&ks(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function ws(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function ta(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return ws(i,"x",e[0])||ws(i,"y",e[0])}return{}}function ea(i,t){const e=kt[i.type]||{scales:{}},s=t.scales||{},n=li(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!E(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=ci(r,a,ta(r,i),j.scales[a.type]),c=Zr(l,n),h=e.scales||{};o[r]=Wt(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||li(a,t),h=(kt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=Qr(d,l),u=r[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),Wt(o[u],[{axis:f},s[u],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Wt(a,[j.scales[a.type],j.scale])}),o}function Ms(i){const t=i.options||(i.options={});t.plugins=L(t.plugins,{}),t.scales=ea(i,t)}function Ss(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function ia(i){return i=i||{},i.data=Ss(i.data),Ms(i),i}const vs=new Map,Cs=new Set;function De(i,t){let e=vs.get(i);return e||(e=t(),vs.set(i,e),Cs.add(e)),e}const te=(i,t,e)=>{const s=Tt(t,e);s!==void 0&&i.add(s)};class sa{constructor(t){this._config=ia(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=Ss(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ms(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return De(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return De(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return De(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return De(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>te(l,t,d))),h.forEach(d=>te(l,n,d)),h.forEach(d=>te(l,kt[o]||{},d)),h.forEach(d=>te(l,j,d)),h.forEach(d=>te(l,$e,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Cs.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,kt[e]||{},j.datasets[e]||{},{type:e},j,$e]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=As(this._resolverCache,t,n);let l=r;if(oa(r,e)){o.$shared=!1,s=bt(s)?s():s;const c=this.createResolver(t,s,a);l=It(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=As(this._resolverCache,t,s);return E(e)?It(o,e,void 0,n):o}}function As(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:qe(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const na=i=>E(i)&&Object.getOwnPropertyNames(i).some(t=>bt(i[t]));function oa(i,t){const{isScriptable:e,isIndexable:s}=Wi(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(bt(a)||na(a))||r&&$(a))return!0}return!1}var ra="4.5.1";const aa=["top","bottom","left","right","chartArea"];function Ds(i,t){return i==="top"||i==="bottom"||aa.indexOf(i)===-1&&t==="x"}function Ps(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Os(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),B(e&&e.onComplete,[i],t)}function la(i){const t=i.chart,e=t.options.animation;B(e&&e.onProgress,[i],t)}function Ts(i){return Ze()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Pe={},Es=i=>{const t=Ts(i);return Object.values(Pe).filter(e=>e.canvas===t).pop()};function ca(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function ha(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}class ee{static defaults=j;static instances=Pe;static overrides=kt;static registry=lt;static version=ra;static getChart=Es;static register(...t){lt.add(...t),Rs()}static unregister(...t){lt.remove(...t),Rs()}constructor(t,e){const s=this.config=new sa(e),n=Ts(t),o=Es(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Dr(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Tn(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Xr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qn(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Pe[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ut.listen(this,"complete",Os),ut.listen(this,"progress",la),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return N(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return lt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ki(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ni(this.canvas,this.ctx),this}stop(){return ut.stop(this),this}resize(t,e){ut.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Ki(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),B(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};I(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=ci(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=>{const a=r.options,l=a.id,c=ci(l,a),h=L(a.type,r.dtype);(a.position===void 0||Ds(a.position,c)!==Ds(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const f=lt.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),I(n,(r,a)=>{r||delete s[a]}),I(s,r=>{_t.configure(this,r,r.options),_t.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Ps("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let r=this.getDatasetMeta(s);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=a,r.indexAxis=o.indexAxis||li(a,this.options),r.order=o.order||0,r.index=s,r.label=""+o.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{const l=lt.getController(a),{datasetElementType:c,dataElementType:h}=j.datasets[a];Object.assign(l,{dataElementType:lt.getElement(h),datasetElementType:c&&lt.getElement(c)}),r.controller=new l(this,s),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){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),f=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),n||I(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ps("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){I(this.scales,t=>{_t.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!wi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;ca(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!wi(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;_t.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],I(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,bt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ut.has(this)?this.attached&&!ut.running(this)&&ut.start(this):(this.draw(),Os({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&s.push(r)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s={meta:t,index:t.index,cancelable:!0},n=Bo(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(n&&Xe(e,n),t.controller.draw(),n&&Ue(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Et(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=ar.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=Mt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);le(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ut.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ni(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Pe[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};I(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){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,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!re(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=Fn(t),c=ha(t,this._lastEvent,s,l);s&&(this._lastEvent=null,B(o.onHover,[t,a,this],this),l&&B(o.onClick,[t,a,this],this));const h=!re(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}function Rs(){return I(ee.instances,i=>i._plugins.invalidate())}function da(i,t,e){const{startAngle:s,x:n,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,J(s-e));if(i.beginPath(),i.arc(n,o,r-c/2,s+d/2,e-d/2),a>0){const f=Math.min(c/a,J(s-e));i.arc(n,o,a+c/2,e-f/2,s+f/2,!0)}else{const f=Math.min(c/2,r*J(s-e));if(h==="round")i.arc(n,o,f,e-z/2,s+z/2,!0);else if(h==="bevel"){const u=2*f*f,b=-u*Math.cos(e+z/2)+n,m=-u*Math.sin(e+z/2)+o,p=u*Math.cos(s+z/2)+n,x=u*Math.sin(s+z/2)+o;i.lineTo(b,m),i.lineTo(p,x)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function fa(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=n/a;i.beginPath(),i.arc(o,r,a,s-c,e+c),l>n?(c=n/l,i.arc(o,r,l,e+c,s-c,!0)):i.arc(o,r,n,e+Y,s-Y),i.closePath(),i.clip()}function ua(i){return Ke(i,["outerStart","outerEnd","innerStart","innerEnd"])}function ga(i,t,e,s){const n=ua(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,s*t/2),a=l=>{const c=(e-Math.min(o,l))*s/2;return st(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:st(n.innerStart,0,r),innerEnd:st(n.innerEnd,0,r)}}function Ft(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function Oe(i,t,e,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),f=h>0?h+s+e+c:0;let u=0;const b=n-l;if(s){const P=h>0?h-s:0,T=d>0?d-s:0,R=(P+T)/2,H=R!==0?b*R/(R+s):b;u=(b-H)/2}const m=Math.max(.001,b*d-e/z)/d,p=(b-m)/2,x=l+p+u,y=n-p-u,{outerStart:_,outerEnd:w,innerStart:k,innerEnd:M}=ga(t,f,d,y-x),S=d-_,v=d-w,C=x+_/S,A=y-w/v,D=f+k,O=f+M,V=x+k/D,X=y-M/O;if(i.beginPath(),o){const P=(C+A)/2;if(i.arc(r,a,d,C,P),i.arc(r,a,d,P,A),w>0){const F=Ft(v,A,r,a);i.arc(F.x,F.y,w,A,y+Y)}const T=Ft(O,y,r,a);if(i.lineTo(T.x,T.y),M>0){const F=Ft(O,X,r,a);i.arc(F.x,F.y,M,y+Y,X+Math.PI)}const R=(y-M/f+(x+k/f))/2;if(i.arc(r,a,f,y-M/f,R,!0),i.arc(r,a,f,R,x+k/f,!0),k>0){const F=Ft(D,V,r,a);i.arc(F.x,F.y,k,V+Math.PI,x-Y)}const H=Ft(S,x,r,a);if(i.lineTo(H.x,H.y),_>0){const F=Ft(S,C,r,a);i.arc(F.x,F.y,_,x-Y,C)}}else{i.moveTo(r,a);const P=Math.cos(C)*d+r,T=Math.sin(C)*d+a;i.lineTo(P,T);const R=Math.cos(A)*d+r,H=Math.sin(A)*d+a;i.lineTo(R,H)}i.closePath()}function pa(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Oe(i,t,e,s,l,n);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%W||W))}return Oe(i,t,e,s,l,n),i.fill(),l}function ma(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:f,borderRadius:u}=l,b=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=f,b?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let m=t.endAngle;if(o){Oe(i,t,e,s,m,n);for(let p=0;p<o;++p)i.stroke();isNaN(a)||(m=r+(a%W||W))}b&&fa(i,t,m),l.selfJoin&&m-r>=z&&u===0&&h!=="miter"&&da(i,t,m),o||(Oe(i,t,e,s,m,n),i.stroke())}class Ls extends Qt{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,s){const n=this.getProps(["x","y"],s),{angle:o,distance:r}=Ai(n,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,u=L(d,l-a),b=ue(o,a,l)&&a!==l,m=u>=W||b,p=jt(r,c+f,h+f);return m&&p}getCenterPoint(t){const{x:e,y:s,startAngle:n,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(n+o)/2,d=(r+a+c+l)/2;return{x:e+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:s}=this,n=(e.offset||0)/4,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=s>W?Math.floor(s/W):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*n,Math.sin(a)*n);const l=1-Math.sin(Math.min(z,s||0)),c=n*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,pa(t,this,c,o,r),ma(t,this,c,o,r),t.restore()}}const Is=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},ba=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class zs extends Qt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=B(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=U(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Is(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,u=-h;return this.legendItems.forEach((b,m)=>{const p=s+e/2+o.measureText(b.text).width;(m===0||c[c.length-1]+p+2*a>r)&&(d+=h,c[c.length-(m>0?0:1)]=0,u+=h,f++),l[m]={left:0,top:u,row:f,width:p,height:n},c[c.length-1]+=p+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,f=0,u=0,b=0,m=0;return this.legendItems.forEach((p,x)=>{const{itemWidth:y,itemHeight:_}=xa(s,e,o,p,n);x>0&&u+_+2*a>h&&(d+=f+a,c.push({width:f,height:u}),b+=f+a,m++,f=u=0),l[x]={left:b,top:u,col:m,width:y,height:_},f=Math.max(f,y),u+=_+a}),d+=f,c.push({width:f,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=zt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=tt(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=tt(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=tt(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=tt(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Xe(t,this),this._draw(),Ue(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=j.color,l=zt(t.rtl,this.left,this.width),c=U(r.font),{padding:h}=r,d=c.size,f=d/2;let u;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:b,boxHeight:m,itemHeight:p}=Is(r,d),x=function(M,S,v){if(isNaN(b)||b<=0||isNaN(m)||m<0)return;n.save();const C=L(v.lineWidth,1);if(n.fillStyle=L(v.fillStyle,a),n.lineCap=L(v.lineCap,"butt"),n.lineDashOffset=L(v.lineDashOffset,0),n.lineJoin=L(v.lineJoin,"miter"),n.lineWidth=C,n.strokeStyle=L(v.strokeStyle,a),n.setLineDash(L(v.lineDash,[])),r.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:C},D=l.xPlus(M,b/2),O=S+f;Hi(n,A,D,O,r.pointStyleWidth&&b)}else{const A=S+Math.max((d-m)/2,0),D=l.leftForLtr(M,b),O=Lt(v.borderRadius);n.beginPath(),Object.values(O).some(V=>V!==0)?be(n,{x:D,y:A,w:b,h:m,radius:O}):n.rect(D,A,b,m),n.fill(),C!==0&&n.stroke()}n.restore()},y=function(M,S,v){Rt(n,v.text,M,S+p/2,c,{strikethrough:v.hidden,textAlign:l.textAlign(v.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?u={x:tt(o,this.left+h,this.right-s[0]),y:this.top+h+w,line:0}:u={x:this.left+h,y:tt(o,this.top+w+h,this.bottom-e[0].height),line:0},Gi(this.ctx,t.textDirection);const k=p+h;this.legendItems.forEach((M,S)=>{n.strokeStyle=M.fontColor,n.fillStyle=M.fontColor;const v=n.measureText(M.text).width,C=l.textAlign(M.textAlign||(M.textAlign=r.textAlign)),A=b+f+v;let D=u.x,O=u.y;l.setWidth(this.width),_?S>0&&D+A+h>this.right&&(O=u.y+=k,u.line++,D=u.x=tt(o,this.left+h,this.right-s[u.line])):S>0&&O+k>this.bottom&&(D=u.x=D+e[u.line].width+h,u.line++,O=u.y=tt(o,this.top+w+h,this.bottom-e[u.line].height));const V=l.x(D);if(x(V,O,M),D=Gn(C,D+b+f,_?D+A:this.right,t.rtl),y(l.x(D),O,M),_)u.x+=A+h;else if(typeof M.text!="string"){const X=c.lineHeight;u.y+=Fs(M,X)+h}else u.y+=k}),Qi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=U(e.font),n=K(e.padding);if(!e.display)return;const o=zt(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=tt(t.align,d,this.right-f);else{const b=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);h=c+tt(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}const u=tt(a,d,d+f);r.textAlign=o.textAlign(Ei(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,Rt(r,e.text,u,h,s)}_computeTitleHeight(){const t=this.options.title,e=U(t.font),s=K(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(jt(t,this.left,this.right)&&jt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],jt(t,n.left,n.left+n.width)&&jt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!ka(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=ba(n,s);n&&!o&&B(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&B(e.onHover,[t,s,this],this)}else s&&B(e.onClick,[t,s,this],this)}}function xa(i,t,e,s,n){const o=_a(s,i,t,e),r=ya(n,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function _a(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function ya(i,t,e){let s=i;return typeof t.text!="string"&&(s=Fs(t,e)),s}function Fs(i,t){const e=i.text?i.text.length:0;return t*e}function ka(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Bs={id:"legend",_element:zs,start(i,t,e){const s=i.legend=new zs({ctx:i.ctx,options:e,chart:i});_t.configure(i,s,e),_t.addBox(i,s)},stop(i){_t.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;_t.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=K(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};const ie={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=jn(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function ct(i,t){return t&&($(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function gt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
1
+ (function(it,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(it=typeof globalThis<"u"?globalThis:it||self,u(it.NemesisChart={},it.Vue))})(this,(function(it,u){"use strict";const Fs=(i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e},Ns={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},Ci=Fs({__name:"Cards",props:{cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},titulo:{type:String,default:"Card Title"},valor:{type:String,default:"0"},descricao:{type:String,default:"This is a card component."},botao_todos:{type:Boolean,default:!1}},emits:["click"],setup(i,{emit:t}){const e=i,n={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},s=t,o=u.computed(()=>n[e.cor]??"bg-white"),r=()=>{s("click")};return(a,l)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass([o.value,"border-1 surface-border border-round-xl cursor-pointer flex flex-column w-full transition-linear transition-all transition-duration-200 select-none",o.value==="bg-black"?"hover:bg-black-alpha-90":"hover:bg-white-alpha-70"]),style:{padding:"1.25rem",gap:"1.438rem"},onClick:r},[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",o.value==="bg-black"?"text-white":"text-gray-900"])},u.toDisplayString(i.titulo),3),u.createElementVNode("div",null,[u.createElementVNode("h2",{class:u.normalizeClass(["m-0 text-3xl font-semibold",o.value==="bg-black"?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},u.toDisplayString(i.valor),3),u.createElementVNode("p",Ns,u.toDisplayString(i.descricao),1)]),i.botao_todos?(u.openBlock(),u.createElementBlock("button",{key:0,class:u.normalizeClass(["nc-btn-todos text-xs",o.value==="bg-black"?"text-white":"text-gray-900"])},[...l[0]||(l[0]=[u.createTextVNode(" Ver Todos ",-1),u.createElementVNode("i",{class:"pi pi-angle-right text-xs"},null,-1)])],2)):u.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-c2f86ac2"]]);function Ut(i){return i+.5|0}const mt=(i,t,e)=>Math.max(Math.min(i,e),t);function Xt(i){return mt(Ut(i*2.55),0,255)}function bt(i){return mt(Ut(i*255),0,255)}function dt(i){return mt(Ut(i/2.55)/100,0,1)}function Di(i){return mt(Ut(i*100),0,100)}const st={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},je=[..."0123456789ABCDEF"],Vs=i=>je[i&15],Ws=i=>je[(i&240)>>4]+je[i&15],he=i=>(i&240)>>4===(i&15),Hs=i=>he(i.r)&&he(i.g)&&he(i.b)&&he(i.a);function js(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&st[i[1]]*17,g:255&st[i[2]]*17,b:255&st[i[3]]*17,a:t===5?st[i[4]]*17:255}:(t===7||t===9)&&(e={r:st[i[1]]<<4|st[i[2]],g:st[i[3]]<<4|st[i[4]],b:st[i[5]]<<4|st[i[6]],a:t===9?st[i[7]]<<4|st[i[8]]:255})),e}const $s=(i,t)=>i<255?t(i):"";function Ys(i){var t=Hs(i)?Vs:Ws;return i?"#"+t(i.r)+t(i.g)+t(i.b)+$s(i.a,t):void 0}const Us=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Pi(i,t,e){const n=t*Math.min(e,1-e),s=(o,r=(o+i/30)%12)=>e-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Xs(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function qs(i,t,e){const n=Pi(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function Ks(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function $e(i){const e=i.r/255,n=i.g/255,s=i.b/255,o=Math.max(e,n,s),r=Math.min(e,n,s),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=Ks(e,n,s,h,o),l=l*60+.5),[l|0,c||0,a]}function Ye(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(bt)}function Ue(i,t,e){return Ye(Pi,i,t,e)}function Gs(i,t,e){return Ye(qs,i,t,e)}function Js(i,t,e){return Ye(Xs,i,t,e)}function Ai(i){return(i%360+360)%360}function Qs(i){const t=Us.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?Xt(+t[5]):bt(+t[5]));const s=Ai(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=Gs(s,o,r):t[1]==="hsv"?n=Js(s,o,r):n=Ue(s,o,r),{r:n[0],g:n[1],b:n[2],a:e}}function Zs(i,t){var e=$e(i);e[0]=Ai(e[0]+t),e=Ue(e),i.r=e[0],i.g=e[1],i.b=e[2]}function to(i){if(!i)return;const t=$e(i),e=t[0],n=Di(t[1]),s=Di(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${dt(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const Oi={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"},Ti={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 eo(){const i={},t=Object.keys(Ti),e=Object.keys(Oi);let n,s,o,r,a;for(n=0;n<t.length;n++){for(r=a=t[n],s=0;s<e.length;s++)o=e[s],a=a.replace(o,Oi[o]);o=parseInt(Ti[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let de;function io(i){de||(de=eo(),de.transparent=[0,0,0,0]);const t=de[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const no=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function so(i){const t=no.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const r=+t[7];e=t[8]?Xt(r):mt(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?Xt(n):mt(n,0,255)),s=255&(t[4]?Xt(s):mt(s,0,255)),o=255&(t[6]?Xt(o):mt(o,0,255)),{r:n,g:s,b:o,a:e}}}function oo(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${dt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Xe=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,zt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function ro(i,t,e){const n=zt(dt(i.r)),s=zt(dt(i.g)),o=zt(dt(i.b));return{r:bt(Xe(n+e*(zt(dt(t.r))-n))),g:bt(Xe(s+e*(zt(dt(t.g))-s))),b:bt(Xe(o+e*(zt(dt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function fe(i,t,e){if(i){let n=$e(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Ue(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function Ei(i,t){return i&&Object.assign(t||{},i)}function Li(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=bt(i[3]))):(t=Ei(i,{r:0,g:0,b:0,a:1}),t.a=bt(t.a)),t}function ao(i){return i.charAt(0)==="r"?so(i):Qs(i)}class qt{constructor(t){if(t instanceof qt)return t;const e=typeof t;let n;e==="object"?n=Li(t):e==="string"&&(n=js(t)||io(t)||ao(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Ei(this._rgb);return t&&(t.a=dt(t.a)),t}set rgb(t){this._rgb=Li(t)}rgbString(){return this._valid?oo(this._rgb):void 0}hexString(){return this._valid?Ys(this._rgb):void 0}hslString(){return this._valid?to(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=ro(this._rgb,t._rgb,e)),this}clone(){return new qt(this.rgb)}alpha(t){return this._rgb.a=bt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ut(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return fe(this._rgb,2,t),this}darken(t){return fe(this._rgb,2,-t),this}saturate(t){return fe(this._rgb,1,t),this}desaturate(t){return fe(this._rgb,1,-t),this}rotate(t){return Zs(this._rgb,t),this}}function ft(){}const lo=(()=>{let i=0;return()=>i++})();function z(i){return i==null}function j(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function E(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function X(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function at(i,t){return X(i)?i:t}function T(i,t){return typeof i>"u"?t:i}const co=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Ri=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function N(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function I(i,t,e,n){let s,o,r;if(j(i))for(o=i.length,s=0;s<o;s++)t.call(e,i[s],s);else if(E(i))for(r=Object.keys(i),o=r.length,s=0;s<o;s++)t.call(e,i[r[s]],r[s])}function ue(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function ge(i){if(j(i))return i.map(ge);if(E(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=ge(i[e[s]]);return t}return i}function Bi(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function ho(i,t,e,n){if(!Bi(i))return;const s=t[i],o=e[i];E(s)&&E(o)?Kt(s,o,n):t[i]=ge(o)}function Kt(i,t,e){const n=j(t)?t:[t],s=n.length;if(!E(i))return i;e=e||{};const o=e.merger||ho;let r;for(let a=0;a<s;++a){if(r=n[a],!E(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function Gt(i,t){return Kt(i,t,{merger:fo})}function fo(i,t,e){if(!Bi(i))return;const n=t[i],s=e[i];E(n)&&E(s)?Gt(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=ge(s))}const zi={"":i=>i,x:i=>i.x,y:i=>i.y};function uo(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function go(i){const t=uo(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function It(i,t){return(zi[t]||(zi[t]=go(t)))(i)}function qe(i){return i.charAt(0).toUpperCase()+i.slice(1)}const pe=i=>typeof i<"u",xt=i=>typeof i=="function",Ii=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function po(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const B=Math.PI,V=2*B,mo=V+B,me=Number.POSITIVE_INFINITY,bo=B/180,Y=B/2,wt=B/4,Fi=B*2/3,Ni=Math.log10,Ft=Math.sign;function Jt(i,t,e){return Math.abs(i-t)<e}function Vi(i){const t=Math.round(i);i=Jt(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Ni(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function xo(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function yo(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Qt(i){return!yo(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function _o(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function ko(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function rt(i){return i*(B/180)}function Ke(i){return i*(180/B)}function Wi(i){if(!X(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Hi(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let o=Math.atan2(n,e);return o<-.5*B&&(o+=V),{angle:o,distance:s}}function Ge(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function wo(i,t){return(i-t+mo)%V-B}function K(i){return(i%V+V)%V}function Zt(i,t,e,n){const s=K(i),o=K(t),r=K(e),a=K(o-s),l=K(r-s),c=K(s-o),h=K(s-r);return s===o||s===r||n&&o===r||a>l&&c<h}function G(i,t,e){return Math.max(t,Math.min(e,i))}function So(i){return G(i,-32768,32767)}function St(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function Je(i,t,e){e=e||(r=>i[r]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const Mt=(i,t,e,n)=>Je(i,e,n?s=>{const o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),Mo=(i,t,e)=>Je(i,e,n=>i[n][t]>=e);function vo(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const ji=["push","pop","shift","splice","unshift"];function Co(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ji.forEach(e=>{const n="_onData"+qe(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...o)}),r}})})}function $i(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(ji.forEach(o=>{delete i[o]}),delete i._chartjs)}function Do(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Yi=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Ui(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,Yi.call(window,()=>{n=!1,i.apply(t,e)}))}}function Po(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const Xi=i=>i==="start"?"left":i==="end"?"right":"center",nt=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Ao=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function Oo(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=r.axis,{min:d,max:f,minDefined:g,maxDefined:p}=r.getUserBounds();if(g){if(s=Math.min(Mt(l,h,d).lo,e?n:Mt(t,h,r.getPixelForValue(d)).lo),c){const m=l.slice(0,s+1).reverse().findIndex(b=>!z(b[a.axis]));s-=Math.max(0,m)}s=G(s,0,n-1)}if(p){let m=Math.max(Mt(l,r.axis,f,!0).hi+1,e?0:Mt(t,h,r.getPixelForValue(f),!0).hi+1);if(c){const b=l.slice(m-1).findIndex(x=>!z(x[a.axis]));m+=Math.max(0,b)}o=G(m,s,n)-s}else o=n-s}return{start:s,count:o}}function To(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const be=i=>i===0||i===1,qi=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*V/e)),Ki=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*V/e)+1,te={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*Y)+1,easeOutSine:i=>Math.sin(i*Y),easeInOutSine:i=>-.5*(Math.cos(B*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>be(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>be(i)?i:qi(i,.075,.3),easeOutElastic:i=>be(i)?i:Ki(i,.075,.3),easeInOutElastic(i){return be(i)?i:i<.5?.5*qi(i*2,.1125,.45):.5+.5*Ki(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-te.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?te.easeInBounce(i*2)*.5:te.easeOutBounce(i*2-1)*.5+.5};function Qe(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Gi(i){return Qe(i)?i:new qt(i)}function Ze(i){return Qe(i)?i:new qt(i).saturate(.5).darken(.1).hexString()}const Eo=["x","y","borderWidth","radius","tension"],Lo=["color","borderColor","backgroundColor"];function Ro(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:Lo},numbers:{type:"number",properties:Eo}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Bo(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ji=new Map;function zo(i,t){t=t||{};const e=i+JSON.stringify(t);let n=Ji.get(e);return n||(n=new Intl.NumberFormat(i,t),Ji.set(e,n)),n}function xe(i,t,e){return zo(t,e).format(i)}const Io={values(i){return j(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Fo(i,e)}const r=Ni(Math.abs(o)),a=isNaN(r)?1: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),xe(i,n,l)}};function Fo(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var ti={formatters:Io};function No(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ti.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const vt=Object.create(null),ei=Object.create(null);function ee(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function ii(i,t,e){return typeof t=="string"?Kt(ee(i,t),e):Kt(ee(i,""),t)}class Vo{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=n=>n.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,s)=>Ze(s.backgroundColor),this.hoverBorderColor=(n,s)=>Ze(s.borderColor),this.hoverColor=(n,s)=>Ze(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return ii(this,t,e)}get(t){return ee(this,t)}describe(t,e){return ii(ei,t,e)}override(t,e){return ii(vt,t,e)}route(t,e,n,s){const o=ee(this,t),r=ee(this,n),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[s];return E(l)?Object.assign({},c,l):T(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var $=new Vo({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ro,Bo,No]);function Wo(i){return!i||z(i.size)||z(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ye(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function Ho(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let r=0;const a=e.length;let l,c,h,d,f;for(l=0;l<a;l++)if(d=e[l],d!=null&&!j(d))r=ye(i,s,o,r,d);else if(j(d))for(c=0,h=d.length;c<h;c++)f=d[c],f!=null&&!j(f)&&(r=ye(i,s,o,r,f));i.restore();const g=o.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[o[l]];o.splice(0,g)}return r}function Ct(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function Qi(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function ni(i,t,e,n){Zi(i,t,e,n,null)}function Zi(i,t,e,n,s){let o,r,a,l,c,h,d,f;const g=t.pointStyle,p=t.rotation,m=t.radius;let b=(p||0)*bo;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(b),i.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),i.restore();return}if(!(isNaN(m)||m<=0)){switch(i.beginPath(),g){default:s?i.ellipse(e,n,s/2,m,0,0,V):i.arc(e,n,m,0,V),i.closePath();break;case"triangle":h=s?s/2:m,i.moveTo(e+Math.sin(b)*h,n-Math.cos(b)*m),b+=Fi,i.lineTo(e+Math.sin(b)*h,n-Math.cos(b)*m),b+=Fi,i.lineTo(e+Math.sin(b)*h,n-Math.cos(b)*m),i.closePath();break;case"rectRounded":c=m*.516,l=m-c,r=Math.cos(b+wt)*l,d=Math.cos(b+wt)*(s?s/2-c:l),a=Math.sin(b+wt)*l,f=Math.sin(b+wt)*(s?s/2-c:l),i.arc(e-d,n-a,c,b-B,b-Y),i.arc(e+f,n-r,c,b-Y,b),i.arc(e+d,n+a,c,b,b+Y),i.arc(e-f,n+r,c,b+Y,b+B),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,h=s?s/2:l,i.rect(e-h,n-l,2*h,2*l);break}b+=wt;case"rectRot":d=Math.cos(b)*(s?s/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),i.moveTo(e-d,n-a),i.lineTo(e+f,n-r),i.lineTo(e+d,n+a),i.lineTo(e-f,n+r),i.closePath();break;case"crossRot":b+=wt;case"cross":d=Math.cos(b)*(s?s/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),i.moveTo(e-d,n-a),i.lineTo(e+d,n+a),i.moveTo(e+f,n-r),i.lineTo(e-f,n+r);break;case"star":d=Math.cos(b)*(s?s/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),i.moveTo(e-d,n-a),i.lineTo(e+d,n+a),i.moveTo(e+f,n-r),i.lineTo(e-f,n+r),b+=wt,d=Math.cos(b)*(s?s/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),i.moveTo(e-d,n-a),i.lineTo(e+d,n+a),i.moveTo(e+f,n-r),i.lineTo(e-f,n+r);break;case"line":r=s?s/2:Math.cos(b)*m,a=Math.sin(b)*m,i.moveTo(e-r,n-a),i.lineTo(e+r,n+a);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(b)*(s?s/2:m),n+Math.sin(b)*m);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function ut(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function _e(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function ke(i){i.restore()}function jo(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function $o(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function Yo(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),z(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function Uo(i,t,e,n,s){if(s.strikethrough||s.underline){const o=i.measureText(n),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function Xo(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Nt(i,t,e,n,s,o={}){const r=j(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,Yo(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Xo(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),z(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,n,o.maxWidth)),i.fillText(c,e,n,o.maxWidth),Uo(i,e,n,c,o),n+=Number(s.lineHeight);i.restore()}function we(i,t){const{x:e,y:n,w:s,h:o,radius:r}=t;i.arc(e+r.topLeft,n+r.topLeft,r.topLeft,1.5*B,B,!0),i.lineTo(e,n+o-r.bottomLeft),i.arc(e+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,B,Y,!0),i.lineTo(e+s-r.bottomRight,n+o),i.arc(e+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,Y,0,!0),i.lineTo(e+s,n+r.topRight),i.arc(e+s-r.topRight,n+r.topRight,r.topRight,0,-Y,!0),i.lineTo(e+r.topLeft,n)}const qo=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ko=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Go(i,t){const e=(""+i).match(qo);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const Jo=i=>+i||0;function si(i,t){const e={},n=E(t),s=n?Object.keys(t):t,o=E(i)?n?r=>T(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of s)e[r]=Jo(o(r));return e}function Qo(i){return si(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Vt(i){return si(i,["topLeft","topRight","bottomLeft","bottomRight"])}function J(i){const t=Qo(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function q(i,t){i=i||{},t=t||$.font;let e=T(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=T(i.style,t.style);n&&!(""+n).match(Ko)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:T(i.family,t.family),lineHeight:Go(T(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:T(i.weight,t.weight),string:""};return s.string=Wo(s),s}function Se(i,t,e,n){let s,o,r;for(s=0,o=i.length;s<o;++s)if(r=i[s],r!==void 0&&r!==void 0)return r}function Zo(i,t,e){const{min:n,max:s}=i,o=Ri(t,(s-n)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function yt(i,t){return Object.assign(Object.create(i),t)}function oi(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=on("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>oi([a,...i],t,o,n)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return en(a,l,()=>ar(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return rn(a).includes(l)},ownKeys(a){return rn(a)},set(a,l,c){const h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function Wt(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:tn(i,n),setContext:o=>Wt(i,o,e,n),override:o=>Wt(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return en(o,r,()=>er(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function tn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:xt(e)?e:()=>e,isIndexable:xt(n)?n:()=>n}}const tr=(i,t)=>i?i+qe(t):t,ri=(i,t)=>E(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function en(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function er(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=i;let a=n[t];return xt(a)&&r.isScriptable(t)&&(a=ir(t,a,i,e)),j(a)&&a.length&&(a=nr(t,a,i,r.isIndexable)),ri(t,a)&&(a=Wt(a,s,o&&o[t],r)),a}function ir(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||n);return a.delete(i),ri(i,l)&&(l=ai(s._scopes,s,i,l)),l}function nr(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(E(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=ai(c,s,i,h);t.push(Wt(d,o,r&&r[i],a))}}return t}function nn(i,t,e){return xt(i)?i(t,e):i}const sr=(i,t)=>i===!0?t:typeof i=="string"?It(t,i):void 0;function or(i,t,e,n,s){for(const o of t){const r=sr(e,o);if(r){i.add(r);const a=nn(r._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==n)return a}else if(r===!1&&typeof n<"u"&&e!==n)return null}return!1}function ai(i,t,e,n){const s=t._rootScopes,o=nn(t._fallback,e,n),r=[...i,...s],a=new Set;a.add(n);let l=sn(a,r,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=sn(a,r,o,l,n),l===null)?!1:oi(Array.from(a),[""],s,o,()=>rr(t,e,n))}function sn(i,t,e,n,s){for(;e;)e=or(i,t,e,n,s);return e}function rr(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return j(s)&&E(e)?e:s||{}}function ar(i,t,e,n){let s;for(const o of t)if(s=on(tr(o,i),e),typeof s<"u")return ri(i,s)?ai(e,n,i,s):s}function on(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function rn(i){let t=i._keys;return t||(t=i._keys=lr(i._scopes)),t}function lr(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function cr(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+e,h=t[c],r[a]={r:s.parse(It(h,o),c)};return r}const hr=Number.EPSILON||1e-14,Ht=(i,t)=>t<i.length&&!i[t].skip&&i[t],an=i=>i==="x"?"y":"x";function dr(i,t,e,n){const s=i.skip?t:i,o=t,r=e.skip?t:e,a=Ge(o,s),l=Ge(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,f=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function fr(i,t,e){const n=i.length;let s,o,r,a,l,c=Ht(i,0);for(let h=0;h<n-1;++h)if(l=c,c=Ht(i,h+1),!(!l||!c)){if(Jt(t[h],0,hr)){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 ur(i,t,e="x"){const n=an(e),s=i.length;let o,r,a,l=Ht(i,0);for(let c=0;c<s;++c){if(r=a,a=l,l=Ht(i,c+1),!a)continue;const h=a[e],d=a[n];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${n}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${n}`]=d+o*t[c])}}function gr(i,t="x"){const e=an(t),n=i.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=Ht(i,0);for(r=0;r<n;++r)if(a=l,l=c,c=Ht(i,r+1),!!l){if(c){const 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]}fr(i,s,o),ur(i,o,t)}function Me(i,t,e){return Math.max(Math.min(i,e),t)}function pr(i,t){let e,n,s,o,r,a=ut(i[0],t);for(e=0,n=i.length;e<n;++e)r=o,o=a,a=e<n-1&&ut(i[e+1],t),o&&(s=i[e],r&&(s.cp1x=Me(s.cp1x,t.left,t.right),s.cp1y=Me(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Me(s.cp2x,t.left,t.right),s.cp2y=Me(s.cp2y,t.top,t.bottom)))}function mr(i,t,e,n,s){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")gr(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)a=i[o],l=dr(c,a,i[Math.min(o+1,r-(n?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&&pr(i,e)}function li(){return typeof window<"u"&&typeof document<"u"}function ci(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ve(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const Ce=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function br(i,t){return Ce(i).getPropertyValue(t)}const xr=["top","right","bottom","left"];function Dt(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=xr[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const yr=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function _r(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let r=!1,a,l;if(yr(s,o,i.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Pt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=Ce(e),o=s.boxSizing==="border-box",r=Dt(s,"padding"),a=Dt(s,"border","width"),{x:l,y:c,box:h}=_r(i,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:g,height:p}=t;return o&&(g-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/g*e.width/n),y:Math.round((c-f)/p*e.height/n)}}function kr(i,t,e){let n,s;if(t===void 0||e===void 0){const o=i&&ci(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Ce(o),l=Dt(a,"border","width"),c=Dt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,n=ve(a.maxWidth,o,"clientWidth"),s=ve(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||me,maxHeight:s||me}}const _t=i=>Math.round(i*10)/10;function wr(i,t,e,n){const s=Ce(i),o=Dt(s,"margin"),r=ve(s.maxWidth,i,"clientWidth")||me,a=ve(s.maxHeight,i,"clientHeight")||me,l=kr(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const f=Dt(s,"border","width"),g=Dt(s,"padding");c-=g.width+f.width,h-=g.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=_t(Math.min(c,r,l.maxWidth)),h=_t(Math.min(h,a,l.maxHeight)),c&&!h&&(h=_t(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=_t(Math.floor(h*n))),{width:c,height:h}}function ln(i,t,e){const n=t||1,s=_t(i.height*n),o=_t(i.width*n);i.height=_t(i.height),i.width=_t(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(i.currentDevicePixelRatio=n,r.height=s,r.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Sr=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};li()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function cn(i,t){const e=br(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function At(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Mr(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function vr(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=At(i,s,e),a=At(s,o,e),l=At(o,t,e),c=At(r,a,e),h=At(a,l,e);return At(c,h,e)}const Cr=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},Dr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function jt(i,t,e){return i?Cr(t,e):Dr()}function hn(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function dn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function fn(i){return i==="angle"?{between:Zt,compare:wo,normalize:K}:{between:St,compare:(t,e)=>t-e,normalize:t=>t}}function un({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function Pr(i,t,e){const{property:n,start:s,end:o}=e,{between:r,normalize:a}=fn(n),l=t.length;let{start:c,end:h,loop:d}=i,f,g;if(d){for(c+=l,h+=l,f=0,g=l;f<g&&r(a(t[c%l][n]),s,o);++f)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function gn(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=fn(n),{start:h,end:d,loop:f,style:g}=Pr(i,t,e),p=[];let m=!1,b=null,x,k,_;const M=()=>l(s,_,x)&&a(s,_)!==0,y=()=>a(o,x)===0||l(o,_,x),S=()=>m||M(),w=()=>!m||y();for(let v=h,C=h;v<=d;++v)k=t[v%r],!k.skip&&(x=c(k[n]),x!==_&&(m=l(x,s,o),b===null&&S()&&(b=a(x,s)===0?v:C),b!==null&&w()&&(p.push(un({start:b,end:v,loop:f,count:r,style:g})),b=null),C=v,_=x));return b!==null&&p.push(un({start:b,end:d,loop:f,count:r,style:g})),p}function pn(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=gn(n[s],i.points,t);o.length&&e.push(...o)}return e}function Ar(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Or(i,t,e,n){const s=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?a.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),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:n}),o}function Tr(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:r,end:a}=Ar(e,s,o,n);if(n===!0)return mn(i,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+s:a,c=!!i._fullLoop&&r===0&&a===s-1;return mn(i,Or(e,r,l,c),e,t)}function mn(i,t,e,n){return!n||!n.setContext||!e?t:Er(i,t,e,n)}function Er(i,t,e,n){const s=i._chart.getContext(),o=bn(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[];let h=o,d=t[0].start,f=d;function g(p,m,b,x){const k=a?-1:1;if(p!==m){for(p+=l;e[p%l].skip;)p-=k;for(;e[m%l].skip;)m+=k;p%l!==m%l&&(c.push({start:p%l,end:m%l,loop:b,style:x}),h=x,d=m%l)}}for(const p of t){d=a?d:p.start;let m=e[d%l],b;for(f=d+1;f<=p.end;f++){const x=e[f%l];b=bn(n.setContext(yt(s,{type:"segment",p0:m,p1:x,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),Lr(b,h)&&g(d,f-1,p.loop,h),m=x,h=b}d<f-1&&g(d,f-1,p.loop,h)}return c}function bn(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Lr(i,t){if(!t)return!1;const e=[],n=function(s,o){return Qe(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}function De(i,t,e){return i.options.clip?i[e]:t[e]}function Rr(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:De(e,t,"left"),right:De(e,t,"right"),top:De(n,t,"top"),bottom:De(n,t,"bottom")}:t}function xn(i,t){const e=t._clip;if(e.disabled)return!1;const n=Rr(t,i.chartArea);return{left:e.left===!1?0:n.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:n.right+(e.right===!0?0:e.right),top:e.top===!1?0:n.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:n.bottom+(e.bottom===!0?0:e.bottom)}}class Br{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const o=e.listeners[s],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(n-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Yi.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var gt=new Br;const yn="transparent",zr={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=Gi(i||yn),s=n.valid&&Gi(t||yn);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Ir{constructor(t,e,n,s){const o=e[n];s=Se([t.to,s,o,t.from]);const r=Se([t.from,o,s]);this._active=!0,this._fn=t.fn||zr[t.type||typeof r],this._easing=te[t.easing]||te.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Se([t.to,e,s,t.from]),this._from=Se([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<n),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/n%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(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}class _n{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!E(t))return;const e=Object.keys($.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!E(o))return;const r={};for(const a of e)r[a]=o[a];(j(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,e){const n=e.options,s=Nr(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&Fr(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const f=n.get(c);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new Ir(f,t,c,h),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return gt.add(this._chart,n),!0}}function Fr(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Nr(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function kn(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function Vr(i,t,e){if(e===!1)return!1;const n=kn(i,e),s=kn(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function Wr(i){let t,e,n,s;return E(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function wn(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function Sn(i,t,e,n={}){const s=i.keys,o=n.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===e){if(h=!0,n.all)continue;break}c=i.values[l],X(c)&&(o||t===0||Ft(t)===Ft(c))&&(t+=c)}return!h&&!n.all?0:t}function Hr(i,t){const{iScale:e,vScale:n}=t,s=e.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[s]:h,[o]:i[h]};return a}function hi(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function jr(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function $r(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Yr(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function Mn(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function vn(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=jr(o,r,n),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:m,[c]:b}=p,x=p._stacks||(p._stacks={});f=x[c]=Yr(s,h,m),f[a]=b,f._top=Mn(f,r,!0,n.type),f._bottom=Mn(f,r,!1,n.type);const k=f._visualValues||(f._visualValues={});k[a]=b}}function di(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function Ur(i,t){return yt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Xr(i,t,e){return yt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ie(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const fi=i=>i==="reset"||i==="none",Cn=(i,t)=>t?i:Object.assign({},i),qr=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:wn(e,!0),values:null};class Pe{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=hi(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ie(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,o=e.xAxisID=T(n.xAxisID,di(t,"x")),r=e.yAxisID=T(n.yAxisID,di(t,"y")),a=e.rAxisID=T(n.rAxisID,di(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){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&$i(this._data,this),t._stacked&&ie(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(E(e)){const s=this._cachedMeta;this._data=Hr(e,s)}else if(n!==e){if(n){$i(n,this);const s=this._cachedMeta;ie(s),s._parsed=[]}e&&Object.isExtensible(e)&&Co(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=hi(e.vScale,e),e.stack!==n.stack&&(s=!0,ie(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(vn(this,e._parsed),e._stacked=hi(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,a=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,d,f;if(this._parsing===!1)n._parsed=s,n._sorted=!0,f=s;else{j(s[t])?f=this.parseArrayData(n,s,t,e):E(s[t])?f=this.parseObjectData(n,s,t,e):f=this.parsePrimitiveData(n,s,t,e);const g=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)n._parsed[h+t]=d=f[h],l&&(g()&&(l=!1),c=d);n._sorted=l}r&&vn(this,f)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(s);let f,g,p;for(f=0,g=s;f<g;++f)p=f+n,d[f]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return d}parseArrayData(t,e,n,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,h,d;for(l=0,c=s;l<c;++l)h=l+n,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,n,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,d,f,g;for(h=0,d=s;h<d;++h)f=h+n,g=e[f],c[h]={x:o.parse(It(g,a),f),y:r.parse(It(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:wn(s,!0),values:e._stacks[t.axis]._visualValues};return Sn(a,r,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const o=n[e.axis];let r=o===null?NaN:o;const a=s&&n._stacks[e.axis];s&&a&&(s.values=a,r=Sn(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,r=s.length,a=this._getOtherScale(t),l=qr(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=$r(a);let f,g;function p(){g=s[f];const m=g[a.axis];return!X(g[t.axis])||h>m||d<m}for(f=0;f<r&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],X(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Wr(T(this.options.clip,Vr(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const 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){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Xr(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=Ur(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&pe(n);if(a)return Cn(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),g=Object.keys($.elements[t]),p=()=>this.getContext(n,s,e),m=c.resolveNamedOptions(f,g,p,d);return m.$shared&&(m.$shared=l,o[r]=Object.freeze(Cn(m,l))),m}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,n,e))}const c=new _n(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||fi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:r}}updateElement(t,e,n,s){fi(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!fi(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=n.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,n=!0){const s=this._cachedMeta,o=s.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&ie(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Kr(i,t,e){let n=1,s=1,o=0,r=0;if(t<V){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),f=Math.sin(l),g=(_,M,y)=>Zt(_,a,l,!0)?1:Math.max(M,M*e,y,y*e),p=(_,M,y)=>Zt(_,a,l,!0)?-1:Math.min(M,M*e,y,y*e),m=g(0,c,d),b=g(Y,h,f),x=p(B,c,d),k=p(B+Y,h,f);n=(m-x)/2,s=(b-k)/2,o=-(m+x)/2,r=-(b+k)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}class Gr extends Pe{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const d=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:s,pointStyle:n,borderRadius:r&&(a||d.borderRadius),index:c}}):[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(E(n[t])){const{key:l="value"}=this._parsing;o=c=>+It(n[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return rt(this.options.rotation-90)}_getCircumference(){return rt(this.options.circumference)}_getRotationExtents(){let t=V,e=-V;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-r)/2,0),l=Math.min(co(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:m}=Kr(d,h,l),b=(n.width-r)/f,x=(n.height-r)/g,k=Math.max(Math.min(b,x)/2,0),_=Ri(this.options.radius,k),M=Math.max(_*l,0),y=(_-M)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=m*_,s.total=this.calculateTotal(),this.outerRadius=_-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/V)}updateElements(t,e,n,s){const 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,f=o&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(e,s);let x=this._getRotation(),k;for(k=0;k<e;++k)x+=this._circumference(k,o);for(k=e;k<e+n;++k){const _=this._circumference(k,o),M=t[k],y={x:h+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+_,circumference:_,outerRadius:p,innerRadius:g};b&&(y.options=m||this.resolveDataElementOptions(k,M.active?"active":s)),x+=_,this.updateElement(M,k,y,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?V*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=xe(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){r=n.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 n=0,s=t.length;n<s;++n){const o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(T(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Jr extends Pe{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=Oo(e,s,r);this._drawStart=a,this._drawCount=l,To(e)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s),f=r.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,b=Qt(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none",k=e+n,_=t.length;let M=e>0&&this.getParsed(e-1);for(let y=0;y<_;++y){const S=t[y],w=x?S:{};if(y<e||y>=k){w.skip=!0;continue}const v=this.getParsed(y),C=z(v[g]),D=w[f]=r.getPixelForValue(v[f],y),P=w[g]=o||C?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,v,l):v[g],y);w.skip=isNaN(D)||isNaN(P)||C,w.stop=y>0&&Math.abs(v[f]-M[f])>b,m&&(w.parsed=v,w.raw=c.data[y]),d&&(w.options=h||this.resolveDataElementOptions(y,S.active?"active":s)),x||this.updateElement(S,y,w,s),M=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Qr extends Pe{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=xe(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return cr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{const 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(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,n,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*B;let g=f,p;const m=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,m);for(p=e;p<e+n;p++){const b=t[p];let x=g,k=g+this._computeAngle(p,s,m),_=r.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=k,o&&(l.animateScale&&(_=0),l.animateRotate&&(x=k=f));const M={x:h,y:d,innerRadius:0,outerRadius:_,startAngle:x,endAngle:k,options:this.resolveDataElementOptions(p,b.active?"active":s)};this.updateElement(b,p,M,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?rt(this.resolveDataElementOptions(t,e).angle||n):0}}function Ot(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ui{static override(t){Object.assign(ui.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Ot()}parse(){return Ot()}format(){return Ot()}add(){return Ot()}diff(){return Ot()}startOf(){return Ot()}endOf(){return Ot()}}var Zr={_date:ui};function ta(i,t,e,n){const{controller:s,data:o,_sorted:r}=i,a=s._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?Mo:Mt;if(n){if(s._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const f=c(o,t,e-d),g=c(o,t,e+d);return{lo:f.lo,hi:g.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=s._cachedMeta,{_parsed:f}=i,g=f.slice(0,h.lo+1).reverse().findIndex(m=>!z(m[d.axis]));h.lo-=Math.max(0,g);const p=f.slice(h.hi).findIndex(m=>!z(m[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function Ae(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:f}=ta(o[a],t,r,s);for(let g=d;g<=f;++g){const p=h[g];p.skip||n(p,c,g)}}}function ea(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const o=t?Math.abs(n.x-s.x):0,r=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function gi(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||Ae(i,e,t,function(a,l,c){!s&&!ut(a,i.chartArea,0)||a.inRange(t.x,t.y,n)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function ia(i,t,e,n){let s=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],n),{angle:d}=Hi(r,{x:t.x,y:t.y});Zt(d,c,h)&&s.push({element:r,datasetIndex:a,index:l})}return Ae(i,e,t,o),s}function na(i,t,e,n,s,o){let r=[];const a=ea(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const g=h.inRange(t.x,t.y,s);if(n&&!g)return;const p=h.getCenterPoint(s);if(!(!!o||i.isPointInArea(p))&&!g)return;const b=a(t,p);b<l?(r=[{element:h,datasetIndex:d,index:f}],l=b):b===l&&r.push({element:h,datasetIndex:d,index:f})}return Ae(i,e,t,c),r}function pi(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?ia(i,t,e,s):na(i,t,e,n,s,o)}function Dn(i,t,e,n,s){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Ae(i,e,t,(l,c,h)=>{l[r]&&l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:o}var sa={modes:{index(i,t,e,n){const s=Pt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?gi(i,s,o,n,r):pi(i,s,o,!1,n,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=Pt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?gi(i,s,o,n,r):pi(i,s,o,!1,n,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,n){const s=Pt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return gi(i,s,o,n,r)},nearest(i,t,e,n){const s=Pt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return pi(i,s,o,e.intersect,n,r)},x(i,t,e,n){const s=Pt(t,i);return Dn(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=Pt(t,i);return Dn(i,s,"y",e.intersect,n)}}};const Pn=["left","top","right","bottom"];function ne(i,t){return i.filter(e=>e.pos===t)}function An(i,t){return i.filter(e=>Pn.indexOf(e.pos)===-1&&e.box.axis===t)}function se(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function oa(i){const t=[];let e,n,s,o,r,a;for(e=0,n=(i||[]).length;e<n;++e)s=i[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 ra(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!Pn.includes(s))continue;const r=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function aa(i,t){const e=ra(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=h?h*s:l&&t.availableHeight)}return e}function la(i){const t=oa(i),e=se(t.filter(c=>c.box.fullSize),!0),n=se(ne(t,"left"),!0),s=se(ne(t,"right")),o=se(ne(t,"top"),!0),r=se(ne(t,"bottom")),a=An(t,"x"),l=An(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:ne(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function On(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function Tn(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function ca(i,t,e,n){const{pos:s,box:o}=e,r=i.maxPadding;if(!E(s)){e.size&&(i[s]-=e.size);const d=n[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[s]+=e.size}o.getPadding&&Tn(r,o.getPadding());const a=Math.max(0,t.outerWidth-On(r,i,"left","right")),l=Math.max(0,t.outerHeight-On(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function ha(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function da(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return n(i?["left","right"]:["top","bottom"])}function oe(i,t,e,n){const s=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,da(a.horizontal,t));const{same:d,other:f}=ca(t,e,a,n);c|=d&&s.length,h=h||f,l.fullSize||s.push(a)}return c&&oe(s,t,e,n)||h}function Oe(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function En(i,t,e,n){const s=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=n[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,f=c.size||l.height;pe(c.start)&&(r=c.start),l.fullSize?Oe(l,s.left,r,e.outerWidth-s.right-s.left,f):Oe(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,f=c.size||l.width;pe(c.start)&&(o=c.start),l.fullSize?Oe(l,o,s.top,f,e.outerHeight-s.bottom-s.top):Oe(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var kt={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,n){if(!i)return;const s=J(i.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=la(i.boxes),l=a.vertical,c=a.horizontal;I(i.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},s);Tn(f,J(n));const g=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),p=aa(l.concat(c),d);oe(a.fullSize,g,d,p),oe(l,g,d,p),oe(c,g,d,p)&&oe(l,g,d,p),ha(g),En(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,En(a.rightAndBottom,g,d,p),i.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},I(a.chartArea,m=>{const b=m.box;Object.assign(b,i.chartArea),b.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Ln{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class fa extends Ln{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Te="$chartjs",ua={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Rn=i=>i===null||i==="";function ga(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Te]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Rn(s)){const o=cn(i,"width");o!==void 0&&(i.width=o)}if(Rn(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=cn(i,"height");o!==void 0&&(i.height=o)}return i}const Bn=Sr?{passive:!0}:!1;function pa(i,t,e){i&&i.addEventListener(t,e,Bn)}function ma(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Bn)}function ba(i,t){const e=ua[i.type]||i.type,{x:n,y:s}=Pt(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Ee(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function xa(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ee(a.addedNodes,n),r=r&&!Ee(a.removedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function ya(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ee(a.removedNodes,n),r=r&&!Ee(a.addedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const re=new Map;let zn=0;function In(){const i=window.devicePixelRatio;i!==zn&&(zn=i,re.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function _a(i,t){re.size||window.addEventListener("resize",In),re.set(i,t)}function ka(i){re.delete(i),re.size||window.removeEventListener("resize",In)}function wa(i,t,e){const n=i.canvas,s=n&&ci(n);if(!s)return;const o=Ui((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(s),_a(i,o),r}function mi(i,t,e){e&&e.disconnect(),t==="resize"&&ka(i)}function Sa(i,t,e){const n=i.canvas,s=Ui(o=>{i.ctx!==null&&e(ba(o,i))},i);return pa(n,t,s),s}class Ma extends Ln{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(ga(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Te])return!1;const n=e[Te].initial;["height","width"].forEach(o=>{const r=n[o];z(r)?e.removeAttribute(o):e.setAttribute(o,r)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Te],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:xa,detach:ya,resize:wa}[e]||Sa;s[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:mi,detach:mi,resize:mi}[e]||ma)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return wr(t,e,n,s)}isAttached(t){const e=t&&ci(t);return!!(e&&e.isConnected)}}function va(i){return!li()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?fa:Ma}class Tt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Qt(this.x)&&Qt(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}function Ca(i,t){const e=i.options.ticks,n=Da(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?Aa(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Oa(t,c,o,r/s),c;const h=Pa(o,t,s);if(r>0){let d,f;const g=r>1?Math.round((l-a)/(r-1)):null;for(Le(t,c,h,z(g)?0:a-g,a),d=0,f=r-1;d<f;d++)Le(t,c,h,o[d],o[d+1]);return Le(t,c,h,l,z(g)?t.length:l+g),c}return Le(t,c,h),c}function Da(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function Pa(i,t,e){const n=Ta(i),s=t.length/e;if(!n)return Math.max(s,1);const o=xo(n);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function Aa(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function Oa(i,t,e,n){let s=0,o=e[0],r;for(n=Math.ceil(n),r=0;r<i.length;r++)r===o&&(t.push(i[r]),s++,o=e[s*n])}function Le(i,t,e,n,s){const o=T(n,0),r=Math.min(T(s,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function Ta(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const Ea=i=>i==="left"?"right":i==="right"?"left":i,Fn=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Nn=(i,t)=>Math.min(t||i,i);function Vn(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function La(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function Ra(i,t){I(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function ae(i){return i.drawTicks?i.tickLength:0}function Wn(i,t){if(!i.display)return 0;const e=q(i.font,t),n=J(i.padding);return(j(i.text)?i.text.length:1)*e.lineHeight+n.height}function Ba(i,t){return yt(i,{scale:t,type:"scale"})}function za(i,t,e){return yt(i,{tick:e,index:t,type:"tick"})}function Ia(i,t,e){let n=Xi(i);return(e&&t!=="right"||!e&&t==="right")&&(n=Ea(n)),n}function Fa(i,t,e,n){const{top:s,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,g,p;const m=r-s,b=a-o;if(i.isHorizontal()){if(g=nt(n,o,a),E(e)){const x=Object.keys(e)[0],k=e[x];p=h[x].getPixelForValue(k)+m-t}else e==="center"?p=(c.bottom+c.top)/2+m-t:p=Fn(i,e,t);f=a-o}else{if(E(e)){const x=Object.keys(e)[0],k=e[x];g=h[x].getPixelForValue(k)-b+t}else e==="center"?g=(c.left+c.right)/2-b+t:g=Fn(i,e,t);p=nt(n,r,s),d=e==="left"?-Y:Y}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class $t extends Tt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:s}=this;return t=at(t,Number.POSITIVE_INFINITY),e=at(e,Number.NEGATIVE_INFINITY),n=at(n,Number.POSITIVE_INFINITY),s=at(s,Number.NEGATIVE_INFINITY),{min:at(t,n),max:at(e,s),minDefined:X(t),maxDefined:X(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:n};const 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||(n=Math.max(n,r.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:at(e,at(n,e)),max:at(n,at(e,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){N(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Zo(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Vn(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Ca(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){N(this.options.afterUpdate,[this])}beforeSetDimensions(){N(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(){N(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),N(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){N(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=N(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){N(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){N(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=Nn(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,g=G(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/n:g/(n-1),d+6>a&&(a=g/(n-(t.offset?.5:1)),l=this.maxHeight-ae(t.grid)-e.padding-Wn(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=Ke(Math.min(Math.asin(G((h.highest.height+6)/a,-1,1)),Math.asin(G(l/c,-1,1))-Math.asin(G(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){N(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){N(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Wn(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=ae(o)+l):(t.height=this.maxHeight,t.width=ae(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),g=n.padding*2,p=rt(this.labelRotation),m=Math.cos(p),b=Math.sin(p);if(a){const x=n.mirror?0:b*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+x+g)}else{const x=n.mirror?0:m*d.width+b*f.height;t.width=Math.min(this.maxWidth,t.width+x+g)}this._calculatePadding(c,h,b,m)}}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,n,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=s*t.width,g=n*e.height):(f=n*t.height,g=s*e.width):o==="start"?g=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((g-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(){N(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e<n;e++)z(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=Vn(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Nn(e,n));let c=0,h=0,d,f,g,p,m,b,x,k,_,M,y;for(d=0;d<e;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),s.font=b=m.string,x=o[b]=o[b]||{data:{},gc:[]},k=m.lineHeight,_=M=0,!z(p)&&!j(p))_=ye(s,x.data,x.gc,_,p),M=k;else if(j(p))for(f=0,g=p.length;f<g;++f)y=p[f],!z(y)&&!j(y)&&(_=ye(s,x.data,x.gc,_,y),M+=k);r.push(_),a.push(M),c=Math.max(_,c),h=Math.max(M,h)}Ra(o,e);const S=r.indexOf(c),w=a.indexOf(h),v=C=>({width:r[C]||0,height:a[C]||0});return{first:v(0),last:v(e-1),widest:v(S),highest:v(w),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return So(this._alignToPixels?Ct(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=za(this.getContext(),t,n))}return this.$context||(this.$context=Ba(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=rt(this.labelRotation),n=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*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=ae(o),g=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,b=m/2,x=function(L){return Ct(n,L,m)};let k,_,M,y,S,w,v,C,D,P,O,W;if(r==="top")k=x(this.bottom),w=this.bottom-f,C=k-b,P=x(t.top)+b,W=t.bottom;else if(r==="bottom")k=x(this.top),P=t.top,W=x(t.bottom)-b,w=k+b,C=this.top+f;else if(r==="left")k=x(this.right),S=this.right-f,v=k-b,D=x(t.left)+b,O=t.right;else if(r==="right")k=x(this.left),D=t.left,O=x(t.right)-b,S=k+b,v=this.left+f;else if(e==="x"){if(r==="center")k=x((t.top+t.bottom)/2+.5);else if(E(r)){const L=Object.keys(r)[0],R=r[L];k=x(this.chart.scales[L].getPixelForValue(R))}P=t.top,W=t.bottom,w=k+b,C=w+f}else if(e==="y"){if(r==="center")k=x((t.left+t.right)/2);else if(E(r)){const L=Object.keys(r)[0],R=r[L];k=x(this.chart.scales[L].getPixelForValue(R))}S=k-b,v=S-f,D=t.left,O=t.right}const U=T(s.ticks.maxTicksLimit,d),A=Math.max(1,Math.ceil(d/U));for(_=0;_<d;_+=A){const L=this.getContext(_),R=o.setContext(L),H=a.setContext(L),F=R.lineWidth,tt=R.color,ot=H.dash||[],et=H.dashOffset,Lt=R.tickWidth,ht=R.tickColor,Rt=R.tickBorderDash||[],Bt=R.tickBorderDashOffset;M=La(this,_,l),M!==void 0&&(y=Ct(n,M,F),c?S=v=D=O=y:w=C=P=W=y,g.push({tx1:S,ty1:w,tx2:v,ty2:C,x1:D,y1:P,x2:O,y2:W,width:F,color:tt,borderDash:ot,borderDashOffset:et,tickWidth:Lt,tickColor:ht,tickBorderDash:Rt,tickBorderDashOffset:Bt}))}return this._ticksLength=d,this._borderValue=k,g}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:o}=n,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=ae(n.grid),g=f+h,p=d?-h:g,m=-rt(this.labelRotation),b=[];let x,k,_,M,y,S,w,v,C,D,P,O,W="middle";if(s==="top")S=this.bottom-p,w=this._getXAxisLabelAlignment();else if(s==="bottom")S=this.top+p,w=this._getXAxisLabelAlignment();else if(s==="left"){const A=this._getYAxisLabelAlignment(f);w=A.textAlign,y=A.x}else if(s==="right"){const A=this._getYAxisLabelAlignment(f);w=A.textAlign,y=A.x}else if(e==="x"){if(s==="center")S=(t.top+t.bottom)/2+g;else if(E(s)){const A=Object.keys(s)[0],L=s[A];S=this.chart.scales[A].getPixelForValue(L)+g}w=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")y=(t.left+t.right)/2-g;else if(E(s)){const A=Object.keys(s)[0],L=s[A];y=this.chart.scales[A].getPixelForValue(L)}w=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?W="top":l==="end"&&(W="bottom"));const U=this._getLabelSizes();for(x=0,k=a.length;x<k;++x){_=a[x],M=_.label;const A=o.setContext(this.getContext(x));v=this.getPixelForTick(x)+o.labelOffset,C=this._resolveTickFontOptions(x),D=C.lineHeight,P=j(M)?M.length:1;const L=P/2,R=A.color,H=A.textStrokeColor,F=A.textStrokeWidth;let tt=w;r?(y=v,w==="inner"&&(x===k-1?tt=this.options.reverse?"left":"right":x===0?tt=this.options.reverse?"right":"left":tt="center"),s==="top"?c==="near"||m!==0?O=-P*D+D/2:c==="center"?O=-U.highest.height/2-L*D+D:O=-U.highest.height+D/2:c==="near"||m!==0?O=D/2:c==="center"?O=U.highest.height/2-L*D:O=U.highest.height-P*D,d&&(O*=-1),m!==0&&!A.showLabelBackdrop&&(y+=D/2*Math.sin(m))):(S=v,O=(1-P)*D/2);let ot;if(A.showLabelBackdrop){const et=J(A.backdropPadding),Lt=U.heights[x],ht=U.widths[x];let Rt=O-et.top,Bt=0-et.left;switch(W){case"middle":Rt-=Lt/2;break;case"bottom":Rt-=Lt;break}switch(w){case"center":Bt-=ht/2;break;case"right":Bt-=ht;break;case"inner":x===k-1?Bt-=ht:x>0&&(Bt-=ht/2);break}ot={left:Bt,top:Rt,width:ht+et.width,height:Lt+et.height,color:A.backdropColor}}b.push({label:M,font:C,textOffset:O,options:{rotation:m,color:R,strokeColor:H,strokeWidth:F,textAlign:tt,textBaseline:W,translation:[y,S],backdrop:ot}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-rt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){const 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(){const{chart:t,ctx:e,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),r=n.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,f;this.isHorizontal()?(c=Ct(t,this.left,r)-r/2,h=Ct(t,this.right,a)+a/2,d=f=l):(d=Ct(t,this.top,r)-r/2,f=Ct(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&_e(n,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;Nt(n,c,0,h,l,a)}s&&ke(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=q(n.font),r=J(n.padding),a=n.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||E(e)?(l+=r.bottom,j(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=Fa(this,l,e,a);Nt(t,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:f,textAlign:Ia(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(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=T(t.grid&&t.grid.z,-1),s=T(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==$t.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return q(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Re{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;Wa(e)&&(n=this.register(e));const 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,Na(t,r,n),this.override&&$.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in $[s]&&(delete $[s][n],this.override&&delete vt[n])}}function Na(i,t,e){const n=Kt(Object.create(null),[e?$.get(e):{},$.get(t),i.defaults]);$.set(t,n),i.defaultRoutes&&Va(t,i.defaultRoutes),i.descriptors&&$.describe(t,i.descriptors)}function Va(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");$.route(o,s,l,a)})}function Wa(i){return"id"in i&&"defaults"in i}class Ha{constructor(){this.controllers=new Re(Pe,"datasets",!0),this.elements=new Re(Tt,"elements"),this.plugins=new Re(Object,"plugins"),this.scales=new Re($t,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):I(s,r=>{const a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,n){const s=qe(t);N(n["before"+s],[],n),e[t](n),N(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var lt=new Ha;class ja{constructor(){this._init=void 0}notify(t,e,n,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,e,n,s){s=s||{};for(const o of t){const r=o.plugin,a=r[n],l=[e,s,o.options];if(N(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,s=T(n.options&&n.options.plugins,{}),o=$a(n);return s===!1&&!e?[]:Ua(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function $a(i){const t={},e=[],n=Object.keys(lt.plugins.items);for(let o=0;o<n.length;o++)e.push(lt.getPlugin(n[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Ya(i,t){return!t&&i===!1?null:i===!0?{}:i}function Ua(i,{plugins:t,localIds:e},n,s){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Ya(n[l],s);c!==null&&o.push({plugin:a,options:Xa(i.config,{plugin:a,local:e[l]},c,r)})}return o}function Xa(i,{plugin:t,local:e},n,s){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(n,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function bi(i,t){const e=$.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function qa(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Ka(i,t){return i===t?"_index_":"_value_"}function Hn(i){if(i==="x"||i==="y"||i==="r")return i}function Ga(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function xi(i,...t){if(Hn(i))return i;for(const e of t){const n=e.axis||Ga(e.position)||i.length>1&&Hn(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function jn(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Ja(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return jn(i,"x",e[0])||jn(i,"y",e[0])}return{}}function Qa(i,t){const e=vt[i.type]||{scales:{}},n=t.scales||{},s=bi(i.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{const a=n[r];if(!E(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=xi(r,a,Ja(r,i),$.scales[a.type]),c=Ka(l,s),h=e.scales||{};o[r]=Gt(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||bi(a,t),h=(vt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=qa(d,l),g=r[f+"AxisID"]||f;o[g]=o[g]||Object.create(null),Gt(o[g],[{axis:f},n[g],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Gt(a,[$.scales[a.type],$.scale])}),o}function $n(i){const t=i.options||(i.options={});t.plugins=T(t.plugins,{}),t.scales=Qa(i,t)}function Yn(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Za(i){return i=i||{},i.data=Yn(i.data),$n(i),i}const Un=new Map,Xn=new Set;function Be(i,t){let e=Un.get(i);return e||(e=t(),Un.set(i,e),Xn.add(e)),e}const le=(i,t,e)=>{const n=It(t,e);n!==void 0&&i.add(n)};class tl{constructor(t){this._config=Za(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=Yn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),$n(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Be(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Be(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Be(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return Be(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,r=this._cachedScopes(t,n),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>le(l,t,d))),h.forEach(d=>le(l,s,d)),h.forEach(d=>le(l,vt[o]||{},d)),h.forEach(d=>le(l,$,d)),h.forEach(d=>le(l,ei,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Xn.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,vt[e]||{},$.datasets[e]||{},{type:e},$,ei]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=qn(this._resolverCache,t,s);let l=r;if(il(r,e)){o.$shared=!1,n=xt(n)?n():n;const c=this.createResolver(t,n,a);l=Wt(r,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=qn(this._resolverCache,t,n);return E(e)?Wt(o,e,void 0,s):o}}function qn(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:oi(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}const el=i=>E(i)&&Object.getOwnPropertyNames(i).some(t=>xt(i[t]));function il(i,t){const{isScriptable:e,isIndexable:n}=tn(i);for(const s of t){const o=e(s),r=n(s),a=(r||o)&&i[s];if(o&&(xt(a)||el(a))||r&&j(a))return!0}return!1}var nl="4.5.1";const sl=["top","bottom","left","right","chartArea"];function Kn(i,t){return i==="top"||i==="bottom"||sl.indexOf(i)===-1&&t==="x"}function Gn(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function Jn(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),N(e&&e.onComplete,[i],t)}function ol(i){const t=i.chart,e=t.options.animation;N(e&&e.onProgress,[i],t)}function Qn(i){return li()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const ze={},Zn=i=>{const t=Qn(i);return Object.values(ze).filter(e=>e.canvas===t).pop()};function rl(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const r=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=r)}}}function al(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}class Et{static defaults=$;static instances=ze;static overrides=vt;static registry=lt;static version=nl;static getChart=Zn;static register(...t){lt.add(...t),ts()}static unregister(...t){lt.remove(...t),ts()}constructor(t,e){const n=this.config=new tl(e),s=Qn(t),o=Zn(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||va(s)),this.platform.updateConfig(n);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=lo(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new ja,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Po(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],ze[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}gt.listen(this,"complete",Jn),gt.listen(this,"progress",ol),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return z(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return lt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ln(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Qi(this.canvas,this.ctx),this}stop(){return gt.stop(this),this}resize(t,e){gt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ln(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),N(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};I(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=xi(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),I(o,r=>{const a=r.options,l=a.id,c=xi(l,a),h=T(a.type,r.dtype);(a.position===void 0||Kn(a.position,c)!==Kn(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in n&&n[l].type===h)d=n[l];else{const f=lt.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(a,t)}),I(s,(r,a)=>{r||delete n[a]}),I(n,r=>{kt.configure(this,r,r.options),kt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(Gn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const o=e[n];let r=this.getDatasetMeta(n);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=a,r.indexAxis=o.indexAxis||bi(a,this.options),r.order=o.order||0,r.index=n,r.label=""+o.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{const l=lt.getController(a),{datasetElementType:c,dataElementType:h}=$.datasets[a];Object.assign(l,{dataElementType:lt.getElement(h),datasetElementType:c&&lt.getElement(c)}),r.controller=new l(this,n),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){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),s||I(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Gn("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){I(this.scales,t=>{kt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Ii(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const r=n==="_removeElements"?-o:o;rl(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!Ii(s,n(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;kt.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],I(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,xt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(gt.has(this)?this.attached&&!gt.running(this)&&gt.start(this):(this.draw(),Jn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let s,o;for(s=0,o=e.length;s<o;++s){const r=e[s];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n={meta:t,index:t.index,cancelable:!0},s=xn(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&_e(e,s),t.controller.draw(),s&&ke(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return ut(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=sa.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=yt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);pe(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),gt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Qi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ze[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,n=(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=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("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,n){const s=n?"set":"remove";let 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];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!ue(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=n?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,n,r),l=po(t),c=al(t,this._lastEvent,n,l);n&&(this._lastEvent=null,N(o.onHover,[t,a,this],this),l&&N(o.onClick,[t,a,this],this));const h=!ue(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function ts(){return I(Et.instances,i=>i._plugins.invalidate())}function ll(i,t,e){const{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,K(n-e));if(i.beginPath(),i.arc(s,o,r-c/2,n+d/2,e-d/2),a>0){const f=Math.min(c/a,K(n-e));i.arc(s,o,a+c/2,e-f/2,n+f/2,!0)}else{const f=Math.min(c/2,r*K(n-e));if(h==="round")i.arc(s,o,f,e-B/2,n+B/2,!0);else if(h==="bevel"){const g=2*f*f,p=-g*Math.cos(e+B/2)+s,m=-g*Math.sin(e+B/2)+o,b=g*Math.cos(n+B/2)+s,x=g*Math.sin(n+B/2)+o;i.lineTo(p,m),i.lineTo(b,x)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function cl(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;i.beginPath(),i.arc(o,r,a,n-c,e+c),l>s?(c=s/l,i.arc(o,r,l,e+c,n-c,!0)):i.arc(o,r,s,e+Y,n-Y),i.closePath(),i.clip()}function hl(i){return si(i,["outerStart","outerEnd","innerStart","innerEnd"])}function dl(i,t,e,n){const s=hl(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,n*t/2),a=l=>{const c=(e-Math.min(o,l))*n/2;return G(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:G(s.innerStart,0,r),innerEnd:G(s.innerEnd,0,r)}}function Yt(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Ie(i,t,e,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+n+e-c,0),f=h>0?h+n+e+c:0;let g=0;const p=s-l;if(n){const A=h>0?h-n:0,L=d>0?d-n:0,R=(A+L)/2,H=R!==0?p*R/(R+n):p;g=(p-H)/2}const m=Math.max(.001,p*d-e/B)/d,b=(p-m)/2,x=l+b+g,k=s-b-g,{outerStart:_,outerEnd:M,innerStart:y,innerEnd:S}=dl(t,f,d,k-x),w=d-_,v=d-M,C=x+_/w,D=k-M/v,P=f+y,O=f+S,W=x+y/P,U=k-S/O;if(i.beginPath(),o){const A=(C+D)/2;if(i.arc(r,a,d,C,A),i.arc(r,a,d,A,D),M>0){const F=Yt(v,D,r,a);i.arc(F.x,F.y,M,D,k+Y)}const L=Yt(O,k,r,a);if(i.lineTo(L.x,L.y),S>0){const F=Yt(O,U,r,a);i.arc(F.x,F.y,S,k+Y,U+Math.PI)}const R=(k-S/f+(x+y/f))/2;if(i.arc(r,a,f,k-S/f,R,!0),i.arc(r,a,f,R,x+y/f,!0),y>0){const F=Yt(P,W,r,a);i.arc(F.x,F.y,y,W+Math.PI,x-Y)}const H=Yt(w,x,r,a);if(i.lineTo(H.x,H.y),_>0){const F=Yt(w,C,r,a);i.arc(F.x,F.y,_,x-Y,C)}}else{i.moveTo(r,a);const A=Math.cos(C)*d+r,L=Math.sin(C)*d+a;i.lineTo(A,L);const R=Math.cos(D)*d+r,H=Math.sin(D)*d+a;i.lineTo(R,H)}i.closePath()}function fl(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Ie(i,t,e,n,l,s);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%V||V))}return Ie(i,t,e,n,l,s),i.fill(),l}function ul(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:f,borderRadius:g}=l,p=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=f,p?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let m=t.endAngle;if(o){Ie(i,t,e,n,m,s);for(let b=0;b<o;++b)i.stroke();isNaN(a)||(m=r+(a%V||V))}p&&cl(i,t,m),l.selfJoin&&m-r>=B&&g===0&&h!=="miter"&&ll(i,t,m),o||(Ie(i,t,e,n,m,s),i.stroke())}class es extends Tt{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.getProps(["x","y"],n),{angle:o,distance:r}=Hi(s,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),f=(this.options.spacing+this.options.borderWidth)/2,g=T(d,l-a),p=Zt(o,a,l)&&a!==l,m=g>=V||p,b=St(r,c+f,h+f);return m&&b}getCenterPoint(t){const{x:e,y:n,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],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:n+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=n>V?Math.floor(n/V):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const l=1-Math.sin(Math.min(B,n||0)),c=s*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,fl(t,this,c,o,r),ul(t,this,c,o,r),t.restore()}}function is(i,t,e=t){i.lineCap=T(e.borderCapStyle,t.borderCapStyle),i.setLineDash(T(e.borderDash,t.borderDash)),i.lineDashOffset=T(e.borderDashOffset,t.borderDashOffset),i.lineJoin=T(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=T(e.borderWidth,t.borderWidth),i.strokeStyle=T(e.borderColor,t.borderColor)}function gl(i,t,e){i.lineTo(e.x,e.y)}function pl(i){return i.stepped?jo:i.tension||i.cubicInterpolationMode==="monotone"?$o:gl}function ns(i,t,e={}){const n=i.length,{start:s=0,end:o=n-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:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function ml(i,t,e,n){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=ns(s,e,n),h=pl(o);let{move:d=!0,reverse:f}=n||{},g,p,m;for(g=0;g<=c;++g)p=s[(a+(f?c-g:g))%r],!p.skip&&(d?(i.moveTo(p.x,p.y),d=!1):h(i,m,p,f,o.stepped),m=p);return l&&(p=s[(a+(f?c:0))%r],h(i,m,p,f,o.stepped)),!!l}function bl(i,t,e,n){const s=t.points,{count:o,start:r,ilen:a}=ns(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,d=0,f,g,p,m,b,x;const k=M=>(r+(c?a-M:M))%o,_=()=>{m!==b&&(i.lineTo(h,b),i.lineTo(h,m),i.lineTo(h,x))};for(l&&(g=s[k(0)],i.moveTo(g.x,g.y)),f=0;f<=a;++f){if(g=s[k(f)],g.skip)continue;const M=g.x,y=g.y,S=M|0;S===p?(y<m?m=y:y>b&&(b=y),h=(d*h+M)/++d):(_(),i.lineTo(M,y),p=S,d=0,m=b=y),x=y}_()}function yi(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?bl:ml}function xl(i){return i.stepped?Mr:i.tension||i.cubicInterpolationMode==="monotone"?vr:At}function yl(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),is(i,t.options),i.stroke(s)}function _l(i,t,e,n){const{segments:s,options:o}=t,r=yi(t);for(const a of s)is(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const kl=typeof Path2D=="function";function wl(i,t,e,n){kl&&!t.options.segment?yl(i,t,e,n):_l(i,t,e,n)}class Fe extends Tt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;mr(this._points,n,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Tr(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,r=pn(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],l=xl(n);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:f}=r[c],g=o[d],p=o[f];if(g===p){a.push(g);continue}const m=Math.abs((s-g[e])/(p[e]-g[e])),b=l(g,p,m,n.stepped);b[e]=t[e],a.push(b)}return a.length===1?a[0]:a}pathSegment(t,e,n){return yi(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=yi(this);let r=this._loop;e=e||0,n=n||this.points.length-e;for(const a of s)r&=o(t,this,a,{start:e,end:e+n-1});return!!r}draw(t,e,n,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),wl(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function ss(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class Sl extends Tt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return ss(this,t,"x",e)}inYRange(t,e){return ss(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const n=e&&t.borderWidth||0;return(e+n)*2}draw(t,e){const n=this.options;this.skip||n.radius<.1||!ut(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,ni(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Ml(i,t,e){const n=i.segments,s=i.points,o=t.points,r=[];for(const a of n){let{start:l,end:c}=a;c=Ne(l,c,s);const h=_i(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:s[l],end:s[c]});continue}const d=pn(t,h);for(const f of d){const g=_i(e,o[f.start],o[f.end],f.loop),p=gn(a,s,g);for(const m of p)r.push({source:m,target:f,start:{[e]:os(h,g,"start",Math.max)},end:{[e]:os(h,g,"end",Math.min)}})}}return r}function _i(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=K(s),o=K(o)),{property:i,start:s,end:o}}function vl(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=Ne(r,a,s);const l=s[r],c=s[a];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Ne(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function os(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function rs(i,t){let e=[],n=!1;return j(i)?(n=!0,e=i):e=vl(i,t),e.length?new Fe({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function as(i){return i&&i.fill!==!1}function Cl(i,t,e){let s=i[t].fill;const o=[t];let r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!X(s))return s;if(r=i[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function Dl(i,t,e){const n=Tl(i);if(E(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return X(s)&&Math.floor(s)===s?Pl(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Pl(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function Al(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:E(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Ol(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:E(i)?n=i.value:n=t.getBaseValue(),n}function Tl(i){const t=i.options,e=t.fill;let n=T(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function El(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,r=n.points,a=Ll(t,e);a.push(rs({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)Rl(s,r[h],a)}return new Fe({points:s,options:{}})}function Ll(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Rl(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:r,last:a,point:l}=Bl(o,t,"x");if(!(!l||r&&a)){if(r)n.unshift(l);else if(i.push(l),!a)break}}i.push(...n)}function Bl(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],o=i.segments,r=i.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],d=r[h.start][e],f=r[h.end][e];if(St(s,d,f)){a=s===d,l=s===f;break}}return{first:a,last:l,point:n}}class ls{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:o,radius:r}=this;return e=e||{start:0,end:V},t.arc(s,o,r,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}}function zl(i){const{chart:t,fill:e,line:n}=i;if(X(e))return Il(t,e);if(e==="stack")return El(i);if(e==="shape")return!0;const s=Fl(i);return s instanceof ls?s:rs(s,n)}function Il(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function Fl(i){return(i.scale||{}).getPointPositionForValue?Vl(i):Nl(i)}function Nl(i){const{scale:t={},fill:e}=i,n=Al(e,t);if(X(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function Vl(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,r=Ol(e,t,o),a=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,o);return new ls({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 ki(i,t,e){const n=zl(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,h=c.fill,d=c.backgroundColor,{above:f=d,below:g=d}=h||{},p=s.getDatasetMeta(o),m=xn(s,p);n&&r.points.length&&(_e(i,e),Wl(i,{line:r,target:n,above:f,below:g,area:e,scale:a,axis:l,clip:m}),ke(i))}function Wl(i,t){const{line:e,target:n,above:s,below:o,area:r,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;i.save();let h=o;o!==s&&(c==="x"?(cs(i,n,r.top),wi(i,{line:e,target:n,color:s,scale:a,property:c,clip:l}),i.restore(),i.save(),cs(i,n,r.bottom)):c==="y"&&(hs(i,n,r.left),wi(i,{line:e,target:n,color:o,scale:a,property:c,clip:l}),i.restore(),i.save(),hs(i,n,r.right),h=s)),wi(i,{line:e,target:n,color:h,scale:a,property:c,clip:l}),i.restore()}function cs(i,t,e){const{segments:n,points:s}=t;let o=!0,r=!1;i.beginPath();for(const a of n){const{start:l,end:c}=a,h=s[l],d=s[Ne(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(d.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function hs(i,t,e){const{segments:n,points:s}=t;let o=!0,r=!1;i.beginPath();for(const a of n){const{start:l,end:c}=a,h=s[l],d=s[Ne(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(e,h.y),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(e,d.y)}i.lineTo(e,t.first().y),i.closePath(),i.clip()}function wi(i,t){const{line:e,target:n,property:s,color:o,scale:r,clip:a}=t,l=Ml(e,n,s);for(const{source:c,target:h,start:d,end:f}of l){const{style:{backgroundColor:g=o}={}}=c,p=n!==!0;i.save(),i.fillStyle=g,Hl(i,r,a,p&&_i(s,d,f)),i.beginPath();const m=!!e.pathSegment(i,c);let b;if(p){m?i.closePath():ds(i,n,f,s);const x=!!n.pathSegment(i,h,{move:m,reverse:!0});b=m&&x,b||ds(i,n,d,s)}i.closePath(),i.fill(b?"evenodd":"nonzero"),i.restore()}}function Hl(i,t,e,n){const s=t.chart.chartArea,{property:o,start:r,end:a}=n||{};if(o==="x"||o==="y"){let l,c,h,d;o==="x"?(l=r,c=s.top,h=a,d=s.bottom):(l=s.left,c=r,h=s.right,d=a),i.beginPath(),e&&(l=Math.max(l,e.left),h=Math.min(h,e.right),c=Math.max(c,e.top),d=Math.min(d,e.bottom)),i.rect(l,c,h-l,d-c),i.clip()}}function ds(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var jl={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<n;++r)o=i.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Fe&&(l={visible:i.isDatasetVisible(r),index:r,fill:Dl(a,r,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<n;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=Cl(s,r,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let r=s.length-1;r>=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),n&&a.fill&&ki(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;as(o)&&ki(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!as(n)||e.drawTime!=="beforeDatasetDraw"||ki(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const fs=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},$l=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class us extends Tt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=N(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=q(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=fs(n,o);let 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,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,g=-h;return this.legendItems.forEach((p,m)=>{const b=n+e/2+o.measureText(p.text).width;(m===0||c[c.length-1]+b+2*a>r)&&(d+=h,c[c.length-(m>0?0:1)]=0,g+=h,f++),l[m]={left:0,top:g,row:f,width:b,height:s},c[c.length-1]+=b+a}),d}_fitCols(t,e,n,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,f=0,g=0,p=0,m=0;return this.legendItems.forEach((b,x)=>{const{itemWidth:k,itemHeight:_}=Yl(n,e,o,b,s);x>0&&g+_+2*a>h&&(d+=f+a,c.push({width:f,height:g}),p+=f+a,m++,f=g=0),l[x]={left:p,top:g,col:m,width:k,height:_},f=Math.max(f,k),g+=_+a}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,r=jt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=nt(n,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=nt(n,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=nt(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=nt(n,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){const t=this.ctx;_e(t,this),this._draw(),ke(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=$.color,l=jt(t.rtl,this.left,this.width),c=q(r.font),{padding:h}=r,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=fs(r,d),x=function(S,w,v){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const C=T(v.lineWidth,1);if(s.fillStyle=T(v.fillStyle,a),s.lineCap=T(v.lineCap,"butt"),s.lineDashOffset=T(v.lineDashOffset,0),s.lineJoin=T(v.lineJoin,"miter"),s.lineWidth=C,s.strokeStyle=T(v.strokeStyle,a),s.setLineDash(T(v.lineDash,[])),r.usePointStyle){const D={radius:m*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:C},P=l.xPlus(S,p/2),O=w+f;Zi(s,D,P,O,r.pointStyleWidth&&p)}else{const D=w+Math.max((d-m)/2,0),P=l.leftForLtr(S,p),O=Vt(v.borderRadius);s.beginPath(),Object.values(O).some(W=>W!==0)?we(s,{x:P,y:D,w:p,h:m,radius:O}):s.rect(P,D,p,m),s.fill(),C!==0&&s.stroke()}s.restore()},k=function(S,w,v){Nt(s,v.text,S,w+b/2,c,{strikethrough:v.hidden,textAlign:l.textAlign(v.textAlign)})},_=this.isHorizontal(),M=this._computeTitleHeight();_?g={x:nt(o,this.left+h,this.right-n[0]),y:this.top+h+M,line:0}:g={x:this.left+h,y:nt(o,this.top+M+h,this.bottom-e[0].height),line:0},hn(this.ctx,t.textDirection);const y=b+h;this.legendItems.forEach((S,w)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const v=s.measureText(S.text).width,C=l.textAlign(S.textAlign||(S.textAlign=r.textAlign)),D=p+f+v;let P=g.x,O=g.y;l.setWidth(this.width),_?w>0&&P+D+h>this.right&&(O=g.y+=y,g.line++,P=g.x=nt(o,this.left+h,this.right-n[g.line])):w>0&&O+y>this.bottom&&(P=g.x=P+e[g.line].width+h,g.line++,O=g.y=nt(o,this.top+M+h,this.bottom-e[g.line].height));const W=l.x(P);if(x(W,O,S),P=Ao(C,P+p+f,_?P+D:this.right,t.rtl),k(l.x(P),O,S),_)g.x+=D+h;else if(typeof S.text!="string"){const U=c.lineHeight;g.y+=gs(S,U)+h}else g.y+=y}),dn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=q(e.font),s=J(e.padding);if(!e.display)return;const o=jt(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=n.size/2,c=s.top+l;let h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=nt(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);h=c+nt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=nt(a,d,d+f);r.textAlign=o.textAlign(Xi(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=n.string,Nt(r,e.text,g,h,n)}_computeTitleHeight(){const t=this.options.title,e=q(t.font),n=J(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(St(t,this.left,this.right)&&St(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],St(t,s.left,s.left+s.width)&&St(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!ql(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=$l(s,n);s&&!o&&N(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&N(e.onHover,[t,n,this],this)}else n&&N(e.onClick,[t,n,this],this)}}function Yl(i,t,e,n,s){const o=Ul(n,i,t,e),r=Xl(s,n,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Ul(i,t,e,n){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+n.measureText(s).width}function Xl(i,t,e){let n=i;return typeof t.text!="string"&&(n=gs(t,e)),n}function gs(i,t){const e=i.text?i.text.length:0;return t*e}function ql(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var ps={id:"legend",_element:us,start(i,t,e){const n=i.legend=new us({ctx:i.ctx,options:e,chart:i});kt.configure(i,n,e),kt.addBox(i,n)},stop(i){kt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;kt.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=J(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};const ce={average(i){if(!i.length)return!1;let t,e,n=new Set,s=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((a,l)=>a+l)/n.size,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Ge(t,c);h<s&&(s=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function ct(i,t){return t&&(j(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function pt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
2
2
  `)>-1?i.split(`
3
- `):i}function wa(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Ns(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=U(t.bodyFont),c=U(t.titleFont),h=U(t.footerFont),d=o.length,f=n.length,u=s.length,b=K(t.padding);let m=b.height,p=0,x=s.reduce((w,k)=>w+k.before.length+k.lines.length+k.after.length,0);if(x+=i.beforeBody.length+i.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=u*w+(x-u)*l.lineHeight+(x-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let y=0;const _=function(w){p=Math.max(p,e.measureText(w).width+y)};return e.save(),e.font=c.string,I(i.title,_),e.font=l.string,I(i.beforeBody.concat(i.afterBody),_),y=t.displayColors?r+2+t.boxPadding:0,I(s,w=>{I(w.before,_),I(w.lines,_),I(w.after,_)}),y=0,e.font=h.string,I(i.footer,_),e.restore(),p+=b.width,{width:p,height:m}}function Ma(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Sa(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function va(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Sa(c,i,t,e)&&(c="center"),c}function Vs(i,t,e){const s=e.yAlign||t.yAlign||Ma(i,e);return{xAlign:e.xAlign||t.xAlign||va(i,t,e,s),yAlign:s}}function Ca(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Aa(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Hs(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:u}=Lt(r);let b=Ca(t,a);const m=Aa(t,l,c);return l==="center"?a==="left"?b+=c:a==="right"&&(b-=c):a==="left"?b-=Math.max(h,f)+n:a==="right"&&(b+=Math.max(d,u)+n),{x:st(b,0,s.width-t.width),y:st(m,0,s.height-t.height)}}function Te(i,t,e){const s=K(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Ws(i){return ct([],gt(i))}function Da(i,t,e){return Mt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function js(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const $s={beforeTitle:ft,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:ft,beforeBody:ft,beforeLabel:ft,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return N(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ft,afterBody:ft,beforeFooter:ft,footer:ft,afterFooter:ft};function q(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?$s[t].call(e,s):n}class Ys extends Qt{static positioners=ie;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new Ji(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Da(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=q(s,"beforeTitle",this,t),o=q(s,"title",this,t),r=q(s,"afterTitle",this,t);let a=[];return a=ct(a,gt(n)),a=ct(a,gt(o)),a=ct(a,gt(r)),a}getBeforeBody(t,e){return Ws(q(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return I(t,o=>{const r={before:[],lines:[],after:[]},a=js(s,o);ct(r.before,gt(q(a,"beforeLabel",this,o))),ct(r.lines,q(a,"label",this,o)),ct(r.after,gt(q(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return Ws(q(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=q(s,"beforeFooter",this,t),o=q(s,"footer",this,t),r=q(s,"afterFooter",this,t);let a=[];return a=ct(a,gt(n)),a=ct(a,gt(o)),a=ct(a,gt(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(wa(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,f)=>t.filter(h,d,f,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),I(a,h=>{const d=js(t.callbacks,h);n.push(q(d,"labelColor",this,h)),o.push(q(d,"labelPointStyle",this,h)),r.push(q(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=ie[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=Ns(this,s),c=Object.assign({},a,l),h=Vs(this.chart,s,c),d=Hs(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Lt(a),{x:f,y:u}=t,{width:b,height:m}=e;let p,x,y,_,w,k;return o==="center"?(w=u+m/2,n==="left"?(p=f,x=p-r,_=w+r,k=w-r):(p=f+b,x=p+r,_=w-r,k=w+r),y=p):(n==="left"?x=f+Math.max(l,h)+r:n==="right"?x=f+b-Math.max(c,d)-r:x=this.caretX,o==="top"?(_=u,w=_-r,p=x-r,y=x+r):(_=u+m,w=_+r,p=x+r,y=x-r),k=_),{x1:p,x2:x,x3:y,y1:_,y2:w,y3:k}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=zt(s.rtl,this.x,this.width);for(t.x=Te(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=U(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=U(o.bodyFont),d=Te(this,"left",o),f=n.x(d),u=l<h.lineHeight?(h.lineHeight-l)/2:0,b=e.y+u;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=n.leftForLtr(f,c)+c/2,x=b+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Vi(t,m,p,x),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Vi(t,m,p,x)}else{t.lineWidth=E(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const m=n.leftForLtr(f,c),p=n.leftForLtr(n.xPlus(f,1),c-2),x=Lt(r.borderRadius);Object.values(x).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,be(t,{x:m,y:b,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),be(t,{x:p,y:b+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,b,c,l),t.strokeRect(m,b,c,l),t.fillStyle=r.backgroundColor,t.fillRect(p,b+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=U(s.bodyFont);let f=d.lineHeight,u=0;const b=zt(s.rtl,this.x,this.width),m=function(v){e.fillText(v,b.x(t.x+u),t.y+f/2),t.y+=f+o},p=b.textAlign(r);let x,y,_,w,k,M,S;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Te(this,p,s),e.fillStyle=s.bodyColor,I(this.beforeBody,m),u=a&&p!=="right"?r==="center"?c/2+h:c+2+h:0,w=0,M=n.length;w<M;++w){for(x=n[w],y=this.labelTextColors[w],e.fillStyle=y,I(x.before,m),_=x.lines,a&&_.length&&(this._drawColorBox(e,t,w,b,s),f=Math.max(d.lineHeight,l)),k=0,S=_.length;k<S;++k)m(_[k]),f=d.lineHeight;I(x.after,m)}u=0,f=d.lineHeight,I(this.afterBody,m),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let r,a;if(o){const l=zt(s.rtl,this.x,this.width);for(t.x=Te(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",r=U(s.footerFont),e.fillStyle=s.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:f,bottomLeft:u,bottomRight:b}=Lt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,s,n),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(a+c,l+h-b),e.quadraticCurveTo(a+c,l+h,a+c-b,l+h),r==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+u,l+h),e.quadraticCurveTo(a,l+h,a,l+h-u),r==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=ie[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Ns(this,t),l=Object.assign({},r,this._size),c=Vs(e,t,l),h=Hs(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=K(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Gi(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Qi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!re(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!re(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=ie[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}var Xs={id:"tooltip",_element:Ys,positioners:ie,afterInit(i,t,e){e&&(i.tooltip=new Ys({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:$s},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Pa(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=i,u=o||1,b=h-1,{min:m,max:p}=t,x=!N(r),y=!N(a),_=!N(c),w=(p-m)/(d+1);let k=vi((p-m)/b/u)*u,M,S,v,C;if(k<1e-14&&!x&&!y)return[{value:m},{value:p}];C=Math.ceil(p/k)-Math.floor(m/k),C>b&&(k=vi(C*k/b/u)*u),N(l)||(M=Math.pow(10,l),k=Math.ceil(k*M)/M),n==="ticks"?(S=Math.floor(m/k)*k,v=Math.ceil(p/k)*k):(S=m,v=p),x&&y&&o&&Hn((a-r)/o,k/1e3)?(C=Math.round(Math.min((a-r)/k,h)),k=(a-r)/C,S=r,v=a):_?(S=x?r:S,v=y?a:v,C=c-1,k=(v-S)/C):(C=(v-S)/k,de(C,Math.round(C),k/1e3)?C=Math.round(C):C=Math.ceil(C));const A=Math.max(Ci(k),Ci(S));M=Math.pow(10,N(l)?A:l),S=Math.round(S*M)/M,v=Math.round(v*M)/M;let D=0;for(x&&(f&&S!==r?(e.push({value:r}),S<r&&D++,de(Math.round((S+D*k)*M)/M,r,Us(r,w,i))&&D++):S<r&&D++);D<C;++D){const O=Math.round((S+D*k)*M)/M;if(y&&O>a)break;e.push({value:O})}return y&&f&&v!==a?e.length&&de(e[e.length-1].value,a,Us(a,w,i))?e[e.length-1].value=a:e.push({value:a}):(!y||v===a)&&e.push({value:v}),e}function Us(i,t,{horizontal:e,minRotation:s}){const n=at(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Ks extends Jt{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 N(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=he(n),c=he(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=Pa(n,o);return t.bounds==="ticks"&&Wn(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return pe(t,this.chart.options.locale,this.options.ticks.format)}}function hi(i){const t=i.ticks;if(t.display&&i.display){const e=K(t.backdropPadding);return L(t.font&&t.font.size,j.font.size)+e.height}return 0}function Oa(i,t,e){return e=$(e)?e:[e],{w:ao(i,t.string,e),h:e.length*t.lineHeight}}function qs(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:i<s||i>n?{start:t-e,end:t}:{start:t,end:t+e}}function Ta(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?z/o:0;for(let l=0;l<o;l++){const c=r.setContext(i.getPointLabelContext(l));n[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+n[l],a),d=U(c.font),f=Oa(i.ctx,d,i._pointLabels[l]);s[l]=f;const u=J(i.getIndexAngle(l)+a),b=Math.round(Ve(u)),m=qs(b,h.x,f.w,0,180),p=qs(b,h.y,f.h,90,270);Ea(e,t,u,m,p)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Ia(i,s,n)}function Ea(i,t,e,s,n){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let a=0,l=0;s.start<t.l?(a=(t.l-s.start)/o,i.l=Math.min(i.l,t.l-a)):s.end>t.r&&(a=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),n.start<t.t?(l=(t.t-n.start)/r,i.t=Math.min(i.t,t.t-l)):n.end>t.b&&(l=(n.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function Ra(i,t,e){const s=i.drawingArea,{extra:n,additionalAngle:o,padding:r,size:a}=e,l=i.getPointPosition(t,s+n+r,o),c=Math.round(Ve(J(l.angle+Y))),h=Ba(l.y,a.h,c),d=za(c),f=Fa(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:f,top:h,right:f+a.w,bottom:h+a.h}}function La(i,t){if(!t)return!0;const{left:e,top:s,right:n,bottom:o}=i;return!(Et({x:e,y:s},t)||Et({x:e,y:o},t)||Et({x:n,y:s},t)||Et({x:n,y:o},t))}function Ia(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:hi(o)/2,additionalAngle:r?z/n:0};let c;for(let h=0;h<n;h++){l.padding=e[h],l.size=t[h];const d=Ra(i,h,l);s.push(d),a==="auto"&&(d.visible=La(d,c),d.visible&&(c=d))}return s}function za(i){return i===0||i===180?"center":i<180?"left":"right"}function Fa(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function Ba(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function Na(i,t,e){const{left:s,top:n,right:o,bottom:r}=e,{backdropColor:a}=t;if(!N(a)){const l=Lt(t.borderRadius),c=K(t.backdropPadding);i.fillStyle=a;const h=s-c.left,d=n-c.top,f=o-s+c.width,u=r-n+c.height;Object.values(l).some(b=>b!==0)?(i.beginPath(),be(i,{x:h,y:d,w:f,h:u,radius:l}),i.fill()):i.fillRect(h,d,f,u)}}function Va(i,t){const{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){const o=i._pointLabelItems[n];if(!o.visible)continue;const r=s.setContext(i.getPointLabelContext(n));Na(e,r,o);const a=U(r.font),{x:l,y:c,textAlign:h}=o;Rt(e,i._pointLabels[n],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Gs(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,W);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let r=1;r<s;r++)o=i.getPointPosition(r,t),n.lineTo(o.x,o.y)}}function Ha(i,t,e,s,n){const o=i.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!s||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),Gs(i,e,r,s),o.closePath(),o.stroke(),o.restore())}function Wa(i,t,e){return Mt(i,{label:e,index:t,type:"pointLabel"})}class ja extends Ks{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Bi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=K(hi(this.options)/2),e=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(e,s)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=it(t)&&!isNaN(t)?t:0,this.max=it(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/hi(this.options))}generateTickLabels(t){Ks.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{const n=B(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?Ta(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){const e=W/(this._pointLabels.length||1),s=this.options.startAngle||0;return J(t*e+at(s))}getDistanceFromCenterForValue(t){if(N(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(N(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const s=e[t];return Wa(this.getContext(),t,s)}}getPointPosition(t,e,s=0){const n=this.getIndexAngle(t)-Y+s;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:s,right:n,bottom:o}=this._pointLabelItems[t];return{left:e,top:s,right:n,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const s=this.ctx;s.save(),s.beginPath(),Gs(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:s,grid:n,border:o}=e,r=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&Va(this,r),n.display&&this.ticks.forEach((h,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const f=this.getContext(d),u=n.setContext(f),b=o.setContext(f);Ha(this,u,l,r,b)}}),s.display){for(t.save(),a=r-1;a>=0;a--){const h=s.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=h;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;const n=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=s.setContext(this.getContext(l)),h=U(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;const d=K(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}Rt(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const Ee={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},G=Object.keys(Ee);function Qs(i,t){return i-t}function Zs(i,t){if(N(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),it(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(fe(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Js(i,t,e,s){const n=G.length;for(let o=G.indexOf(i);o<n-1;++o){const r=Ee[G[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=s)return G[o]}return G[n-1]}function $a(i,t,e,s,n){for(let o=G.length-1;o>=G.indexOf(e);o--){const r=G[o];if(Ee[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return G[e?G.indexOf(e):0]}function Ya(i){for(let t=G.indexOf(i)+1,e=G.length;t<e;++t)if(Ee[G[t]].common)return G[t]}function tn(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=He(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Xa(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function en(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,s.push({value:a,major:!1});return o===0||!e?s:Xa(i,s,n,e)}class sn extends Jt{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),n=this._adapter=new ir._date(t.adapters.date);n.init(e),Wt(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Zs(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=it(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=it(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=Xn(n,o,r);return this._unit=e.unit||(s.autoSkip?Js(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):$a(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Ya(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),en(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=st(e,0,r),s=st(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||Js(o.minUnit,e,s,this._getLabelCapacity(e)),a=L(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=fe(l)||l===!0,h={};let d=e,f,u;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const b=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f<s;f=+t.add(f,a,r),u++)tn(h,f,b);return(f===s||n.bounds==="ticks"||u===1)&&tn(h,f,b),Object.keys(h).sort(Qs).map(m=>+m)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return B(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],f=s[e],u=c&&d&&f&&f.major;return this._adapter.format(t,n||(u?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=at(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:s*o+a*r,h:s*r+a*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,en(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(Zs(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Kn(t.sort(Qs))}}function Re(i,t,e){let s=0,n=i.length-1,o,r,a,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=We(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=We(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class ml extends sn{static id="timeseries";static defaults=sn.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Re(e,this.min),this._tableRange=Re(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],c=n[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Re(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Re(this._table,s*this._tableRange+this._minPos,!0)}}const Ua={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},Ka={class:"flex flex-column gap-2 flex-1 w-full max-w-26rem"},qa={class:"flex align-items-center justify-content-between gap-2 border-bottom-1 pb-1 surface-border"},Ga={class:"flex align-items-center gap-2"},Qa={class:"flex align-items-center gap-2"},Za={class:"flex justify-content-center align-items-center mx-auto",style:{width:"200px",height:"200px","flex-shrink":"0"}},nn={__name:"Polar",props:{label_rotulo:{type:String,default:"Rótulo"},label_quantidade:{type:String,default:"Quantidade"},titulo:{type:String,default:"Polar Chart"},subtitulo:{type:String,default:""},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1E40AF"},direcao:{type:String,default:null,validator:i=>i===null||["horizontal","vertical"].includes(i)}},setup(i){ee.register(er,ja,Ls,Xs,Bs);const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},s=g.computed(()=>e[t.cor]??"bg-white"),n=g.computed(()=>t.cor==="dark");function o(p,x=7){const y=p.replace("#","");let _=parseInt(y.slice(0,2),16),w=parseInt(y.slice(2,4),16),k=parseInt(y.slice(4,6),16);_/=255,w/=255,k/=255;const M=Math.max(_,w,k),S=Math.min(_,w,k);let v,C,A=(M+S)/2;if(M===S)v=C=0;else{const P=M-S;switch(C=A>.5?P/(2-M-S):P/(M+S),M){case _:v=((w-k)/P+(w<k?6:0))/6;break;case w:v=((k-_)/P+2)/6;break;case k:v=((_-w)/P+4)/6;break}}const D=Math.max(.2,A-.3),V=(Math.min(.95,A+.35)-D)/(x-1);function X(P,T,R){const H=T*Math.min(R,1-R),F=Q=>{const nt=(Q+P*12)%12,Z=R-H*Math.max(-1,Math.min(nt-3,9-nt,1));return Math.round(255*Z).toString(16).padStart(2,"0")};return`#${F(0)}${F(8)}${F(4)}`}return Array.from({length:x},(P,T)=>X(v,C,D+V*T))}const r=g.computed(()=>o(t.corPaleta,t.dados.length)),a=g.ref(null),l=g.ref(null),c=g.ref(!0);let h=null,d=null;const f=g.computed(()=>t.direcao==="vertical"?"flex-column-reverse":t.direcao==="horizontal"?"flex-row":c.value?"flex-column-reverse":"flex-row"),u=g.computed(()=>({labels:t.dados.map(p=>p.rotulo),datasets:[{data:t.dados.map(p=>p.quantidade),backgroundColor:r.value,borderWidth:0,borderColor:"transparent"}]})),b=g.computed(()=>({responsive:!0,maintainAspectRatio:!0,animation:{duration:800,easing:"easeOutQuart"},plugins:{legend:{display:!1},tooltip:{enabled:!0}},scales:{r:{ticks:{display:!1},grid:{color:n.value?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.05)"}}}}));function m(){d&&d.destroy(),d=new ee(a.value,{type:"polarArea",data:u.value,options:b.value})}return g.onMounted(()=>{m(),h=new ResizeObserver(([p])=>{c.value=p.contentRect.width<380}),h.observe(l.value)}),g.onBeforeUnmount(()=>{d&&d.destroy(),h&&h.disconnect()}),g.watch(()=>t.dados,()=>{m()},{deep:!0}),g.watch(()=>t.cor,()=>{m()}),g.watch(()=>t.corPaleta,()=>{m()}),(p,x)=>(g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass([s.value,"border-1 surface-border border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none",n.value?"hover:bg-black-alpha-90":"hover:bg-white-alpha-70"]),style:{padding:"1.25rem",gap:"1.438rem"}},[g.createElementVNode("div",null,[g.createElementVNode("p",{class:g.normalizeClass(["m-0 text-xs font-medium",n.value?"text-white":"text-gray-900"])},g.toDisplayString(i.titulo),3),i.subtitulo?(g.openBlock(),g.createElementBlock("p",Ua,g.toDisplayString(i.subtitulo),1)):g.createCommentVNode("",!0)]),g.createElementVNode("div",{ref_key:"containerRef",ref:l,class:g.normalizeClass(["flex w-full h-full gap-3 align-items-center justify-content-between",f.value])},[g.createElementVNode("div",Ka,[g.createElementVNode("div",qa,[g.createElementVNode("div",Ga,[x[0]||(x[0]=g.createElementVNode("span",{style:{width:"10px",height:"10px",flexShrink:0}},null,-1)),g.createElementVNode("span",{class:g.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-500"])},g.toDisplayString(i.label_rotulo),3)]),g.createElementVNode("span",{class:g.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-gray-500"])},g.toDisplayString(i.label_quantidade),3)]),(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(i.dados,(y,_)=>(g.openBlock(),g.createElementBlock("div",{key:_,class:"flex align-items-center justify-content-between"},[g.createElementVNode("div",Qa,[g.createElementVNode("span",{class:"border-circle",style:g.normalizeStyle({backgroundColor:r.value[_],width:"10px",height:"10px",flexShrink:0})},null,4),g.createElementVNode("span",{class:g.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-600"])},g.toDisplayString(y.rotulo),3)]),g.createElementVNode("span",{class:g.normalizeClass(["text-xs font-semibold",n.value?"text-white":"text-gray-900"])},g.toDisplayString(y.quantidade),3)]))),128))]),g.createElementVNode("div",Za,[g.createElementVNode("canvas",{ref_key:"canvasRef",ref:a,width:"200",height:"200"},null,512)])],2)],2))}},Ja={class:"w-full flex flex-row align-items-center justify-content-between"},tl={class:"w-full"},el={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},il={class:"flex w-full gap-3 justify-content-between flex-column",style:{flex:"1","min-height":"0"}},sl={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},nl=["onMouseenter","onMousemove"],ol={class:"flex gap-1",style:{width:"100%","margin-top":"4px"}},on={__name:"CardColumn",props:{titulo:{type:String,default:"CardColumn"},subtitulo:{type:String,default:""},valor:{type:String,default:"0"},descricao:{type:String,default:"This is a card component."},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1E40AF"},moeda:{type:Boolean,default:!1}},setup(i){const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},s=g.computed(()=>e[t.cor]??"bg-white"),n=g.computed(()=>t.cor==="dark"),o=g.computed(()=>t.cor==="dark"?"#252525":"#E9E9E9");function r(_,w=7){const k=_.replace("#","");let M=parseInt(k.slice(0,2),16),S=parseInt(k.slice(2,4),16),v=parseInt(k.slice(4,6),16);M/=255,S/=255,v/=255;const C=Math.max(M,S,v),A=Math.min(M,S,v);let D,O,V=(C+A)/2;if(C===A)D=O=0;else{const H=C-A;switch(O=V>.5?H/(2-C-A):H/(C+A),C){case M:D=((S-v)/H+(S<v?6:0))/6;break;case S:D=((v-M)/H+2)/6;break;case v:D=((M-S)/H+4)/6;break}}const X=Math.max(.2,V-.3),P=Math.min(.95,V+.35),T=w>1?(P-X)/(w-1):0;function R(H,F,Q){const nt=F*Math.min(Q,1-Q),Z=At=>{const ht=(At+H*12)%12,Dt=Q-nt*Math.max(-1,Math.min(ht-3,9-ht,1));return Math.round(255*Dt).toString(16).padStart(2,"0")};return`#${Z(0)}${Z(8)}${Z(4)}`}return Array.from({length:w},(H,F)=>R(D,O,X+T*F))}const a=g.computed(()=>r(t.corPaleta,t.dados.length)),l=g.computed(()=>Math.max(...t.dados.map(_=>_.quantidade),1)),c=g.ref(null),h=g.ref(80);let d=null;g.onMounted(()=>{d=new ResizeObserver(([_])=>{h.value=_.contentRect.height||80}),d.observe(c.value)}),g.onBeforeUnmount(()=>{d&&d.disconnect()});const f=g.ref(null),u=g.ref({visible:!1,x:0,y:0,text:""});function b(_,w){f.value=_,y(_,w)}function m(_,w){y(_,w)}function p(){f.value=null,u.value.visible=!1}function x(_){return t.moeda?Number(_).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}):`${_}`}function y(_,w){const k=t.dados[_],M=w.currentTarget.closest(".chart-container").getBoundingClientRect(),S=w.currentTarget.getBoundingClientRect();u.value={visible:!0,x:S.left-M.left+S.width/2,y:S.top-M.top-8,text:x(k.quantidade)}}return(_,w)=>(g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass([s.value,"border-1 surface-border border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none",n.value?"hover:bg-black-alpha-90":"hover:bg-white-alpha-70"]),style:{padding:"1.25rem",gap:"1.438rem","min-height":"0"}},[g.createElementVNode("div",Ja,[g.createElementVNode("div",tl,[g.createElementVNode("p",{class:g.normalizeClass(["m-0 text-xs font-medium",n.value?"text-white":"text-gray-900"])},g.toDisplayString(i.titulo),3),i.subtitulo?(g.openBlock(),g.createElementBlock("p",el,g.toDisplayString(i.subtitulo),1)):g.createCommentVNode("",!0)]),g.renderSlot(_.$slots,"header-right")]),g.createElementVNode("div",il,[g.createElementVNode("div",null,[g.createElementVNode("h2",{class:g.normalizeClass(["m-0 text-3xl font-semibold",n.value?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},g.toDisplayString(i.valor),3),g.createElementVNode("p",sl,g.toDisplayString(i.descricao),1)]),g.createElementVNode("div",{ref_key:"chartRef",ref:c,class:"chart-container",style:{position:"relative",width:"100%",flex:"1","min-height":"80px"}},[u.value.visible?(g.openBlock(),g.createElementBlock("div",{key:0,style:g.normalizeStyle([{position:"absolute",transform:"translate(-50%, -100%)",background:"rgba(0,0,0,0.75)",color:"#fff","font-size":"0.7rem",padding:"3px 8px","border-radius":"4px","white-space":"nowrap","pointer-events":"none","z-index":"10"},{left:u.value.x+"px",top:u.value.y+"px"}])},g.toDisplayString(u.value.text),5)):g.createCommentVNode("",!0),g.createElementVNode("div",{class:"flex align-items-end gap-1",style:g.normalizeStyle([{width:"100%"},{height:h.value-20+"px"}])},[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(i.dados,(k,M)=>(g.openBlock(),g.createElementBlock("div",{key:M,class:"flex-1",style:{display:"flex","align-items":"flex-end",height:"100%",cursor:"pointer"},onMouseenter:S=>b(M,S),onMousemove:S=>m(M,S),onMouseleave:p},[g.createElementVNode("div",{style:g.normalizeStyle({height:k.quantidade/l.value*100+"%",minHeight:"4px",width:"100%",backgroundColor:f.value===M?a.value[M]:o.value,borderRadius:"4px 4px 4px 4px",transition:"background-color 0.15s ease"})},null,4)],40,nl))),128))],4),g.createElementVNode("div",ol,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(i.dados,(k,M)=>(g.openBlock(),g.createElementBlock("div",{key:M,class:"flex-1 text-center",style:g.normalizeStyle([{"font-size":"0.6rem",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"},{color:n.value?"#888":"#aaa"}])},g.toDisplayString(k.rotulo),5))),128))])],512)])],2))}},rl={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},al={class:"flex flex-column gap-2 flex-1 w-full max-w-26rem"},ll={class:"flex align-items-center justify-content-between gap-2 border-bottom-1 pb-1 surface-border"},cl={class:"flex align-items-center gap-2"},hl={class:"flex align-items-center gap-2"},dl={class:"flex justify-content-center align-items-center mx-auto",style:{position:"relative",width:"200px",height:"200px","flex-shrink":"0"}},fl={key:0,style:{position:"absolute",inset:"0",display:"flex","flex-direction":"column","align-items":"center","justify-content":"center","pointer-events":"none"}},ul={key:0,style:{"font-size":"0.6rem",color:"#7B7B7B","text-align":"center","max-width":"80px","line-height":"1.3"}},rn={__name:"cardPizza",props:{label_rotulo:{type:String,default:"Rótulo"},label_quantidade:{type:String,default:"Quantidade"},titulo:{type:String,default:"Pizza Chart"},subtitulo:{type:String,default:""},valor:{type:String,default:""},descricao:{type:String,default:""},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1E40AF"},direcao:{type:String,default:null,validator:i=>i===null||["horizontal","vertical"].includes(i)}},setup(i){ee.register(tr,Ls,Xs,Bs);const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},s=g.computed(()=>e[t.cor]??"bg-white"),n=g.computed(()=>t.cor==="dark");function o(p,x=7){const y=p.replace("#","");let _=parseInt(y.slice(0,2),16),w=parseInt(y.slice(2,4),16),k=parseInt(y.slice(4,6),16);_/=255,w/=255,k/=255;const M=Math.max(_,w,k),S=Math.min(_,w,k);let v,C,A=(M+S)/2;if(M===S)v=C=0;else{const P=M-S;switch(C=A>.5?P/(2-M-S):P/(M+S),M){case _:v=((w-k)/P+(w<k?6:0))/6;break;case w:v=((k-_)/P+2)/6;break;case k:v=((_-w)/P+4)/6;break}}const D=Math.max(.2,A-.3),V=(Math.min(.95,A+.35)-D)/(x-1);function X(P,T,R){const H=T*Math.min(R,1-R),F=Q=>{const nt=(Q+P*12)%12,Z=R-H*Math.max(-1,Math.min(nt-3,9-nt,1));return Math.round(255*Z).toString(16).padStart(2,"0")};return`#${F(0)}${F(8)}${F(4)}`}return Array.from({length:x},(P,T)=>X(v,C,D+V*T))}const r=g.computed(()=>o(t.corPaleta,t.dados.length)),a=g.ref(null),l=g.ref(null),c=g.ref(!0);let h=null,d=null;const f=g.computed(()=>t.direcao==="vertical"?"flex-column-reverse":t.direcao==="horizontal"?"flex-row":c.value?"flex-column-reverse":"flex-row"),u=g.computed(()=>({labels:t.dados.map(p=>p.rotulo),datasets:[{data:t.dados.map(p=>p.quantidade),backgroundColor:r.value,borderWidth:0,borderColor:"transparent"}]})),b=g.computed(()=>({responsive:!0,maintainAspectRatio:!0,cutout:t.valor?"65%":"50%",animation:{duration:800,easing:"easeOutQuart"},plugins:{legend:{display:!1},tooltip:{enabled:!0}}}));function m(){d&&d.destroy(),d=new ee(a.value,{type:"doughnut",data:u.value,options:b.value})}return g.onMounted(()=>{m(),h=new ResizeObserver(([p])=>{c.value=p.contentRect.width<380}),h.observe(l.value)}),g.onBeforeUnmount(()=>{d&&d.destroy(),h&&h.disconnect()}),g.watch(()=>t.dados,()=>{m()},{deep:!0}),g.watch(()=>t.cor,()=>{m()}),g.watch(()=>t.corPaleta,()=>{m()}),(p,x)=>(g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass([s.value,"border-1 surface-border border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none",n.value?"hover:bg-black-alpha-90":"hover:bg-white-alpha-70"]),style:{padding:"1.25rem",gap:"1.438rem"}},[g.createElementVNode("div",null,[g.createElementVNode("p",{class:g.normalizeClass(["m-0 text-xs font-medium",n.value?"text-white":"text-gray-900"])},g.toDisplayString(i.titulo),3),i.subtitulo?(g.openBlock(),g.createElementBlock("p",rl,g.toDisplayString(i.subtitulo),1)):g.createCommentVNode("",!0)]),g.createElementVNode("div",{ref_key:"containerRef",ref:l,class:g.normalizeClass(["flex w-full h-full align-items-center justify-content-between",[f.value,c.value||t.direcao==="vertical"?"gap-4":"gap-7"]])},[g.createElementVNode("div",al,[g.createElementVNode("div",ll,[g.createElementVNode("div",cl,[x[0]||(x[0]=g.createElementVNode("span",{style:{width:"10px",height:"10px",flexShrink:0}},null,-1)),g.createElementVNode("span",{class:g.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-500"])},g.toDisplayString(t.label_rotulo),3)]),g.createElementVNode("span",{class:g.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-gray-500"])},g.toDisplayString(t.label_quantidade),3)]),(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(i.dados,(y,_)=>(g.openBlock(),g.createElementBlock("div",{key:_,class:"flex align-items-center justify-content-between"},[g.createElementVNode("div",hl,[g.createElementVNode("span",{class:"border-circle",style:g.normalizeStyle({backgroundColor:r.value[_],width:"10px",height:"10px",flexShrink:0})},null,4),g.createElementVNode("span",{class:g.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-600"])},g.toDisplayString(y.rotulo),3)]),g.createElementVNode("span",{class:g.normalizeClass(["text-xs font-semibold",n.value?"text-white":"text-gray-900"])},g.toDisplayString(y.quantidade),3)]))),128))]),g.createElementVNode("div",dl,[g.createElementVNode("canvas",{ref_key:"canvasRef",ref:a,width:"200",height:"200"},null,512),i.valor?(g.openBlock(),g.createElementBlock("div",fl,[g.createElementVNode("span",{class:"font-semibold",style:g.normalizeStyle([{"font-size":"1.25rem","line-height":"1.2","letter-spacing":"-0.5px"},{color:n.value?"#fff":"#111"}])},g.toDisplayString(i.valor),5),i.descricao?(g.openBlock(),g.createElementBlock("span",ul,g.toDisplayString(i.descricao),1)):g.createCommentVNode("",!0)])):g.createCommentVNode("",!0)])],2)],2))}},gl={install(i){i.component("NemesisCards",di),i.component("NemesisPolar",nn),i.component("NemesisCardColumn",on),i.component("NemesisCardPizza",rn)}};ot.CardColumn=on,ot.CardPizza=rn,ot.Cards=di,ot.Polar=nn,ot.default=gl,Object.defineProperties(ot,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
3
+ `):i}function Kl(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:i,label:r,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function ms(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=q(t.bodyFont),c=q(t.titleFont),h=q(t.footerFont),d=o.length,f=s.length,g=n.length,p=J(t.padding);let m=p.height,b=0,x=n.reduce((M,y)=>M+y.before.length+y.lines.length+y.after.length,0);if(x+=i.beforeBody.length+i.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const M=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=g*M+(x-g)*l.lineHeight+(x-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let k=0;const _=function(M){b=Math.max(b,e.measureText(M).width+k)};return e.save(),e.font=c.string,I(i.title,_),e.font=l.string,I(i.beforeBody.concat(i.afterBody),_),k=t.displayColors?r+2+t.boxPadding:0,I(n,M=>{I(M.before,_),I(M.lines,_),I(M.after,_)}),k=0,e.font=h.string,I(i.footer,_),e.restore(),b+=p.width,{width:b,height:m}}function Gl(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function Jl(i,t,e,n){const{x:s,width:o}=n,r=e.caretSize+e.caretPadding;if(i==="left"&&s+o+r>t.width||i==="right"&&s-o-r<0)return!0}function Ql(i,t,e,n){const{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Jl(c,i,t,e)&&(c="center"),c}function bs(i,t,e){const n=e.yAlign||t.yAlign||Gl(i,e);return{xAlign:e.xAlign||t.xAlign||Ql(i,t,e,n),yAlign:n}}function Zl(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function tc(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function xs(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:g}=Vt(r);let p=Zl(t,a);const m=tc(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,f)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:G(p,0,n.width-t.width),y:G(m,0,n.height-t.height)}}function Ve(i,t,e){const n=J(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function ys(i){return ct([],pt(i))}function ec(i,t,e){return yt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function _s(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const ks={beforeTitle:ft,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:ft,beforeBody:ft,beforeLabel:ft,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return z(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ft,afterBody:ft,beforeFooter:ft,footer:ft,afterFooter:ft};function Q(i,t,e,n){const s=i[t].call(e,n);return typeof s>"u"?ks[t].call(e,n):s}class ws extends Tt{static positioners=ce;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new _n(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=ec(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=Q(n,"beforeTitle",this,t),o=Q(n,"title",this,t),r=Q(n,"afterTitle",this,t);let a=[];return a=ct(a,pt(s)),a=ct(a,pt(o)),a=ct(a,pt(r)),a}getBeforeBody(t,e){return ys(Q(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return I(t,o=>{const r={before:[],lines:[],after:[]},a=_s(n,o);ct(r.before,pt(Q(a,"beforeLabel",this,o))),ct(r.lines,Q(a,"label",this,o)),ct(r.after,pt(Q(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return ys(Q(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=Q(n,"beforeFooter",this,t),o=Q(n,"footer",this,t),r=Q(n,"afterFooter",this,t);let a=[];return a=ct(a,pt(s)),a=ct(a,pt(o)),a=ct(a,pt(r)),a}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Kl(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,f)=>t.filter(h,d,f,n))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,n))),I(a,h=>{const d=_s(t.callbacks,h);s.push(Q(d,"labelColor",this,h)),o.push(Q(d,"labelPointStyle",this,h)),r.push(Q(d,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=ce[n.position].call(this,s,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);const l=this._size=ms(this,n),c=Object.assign({},a,l),h=bs(this.chart,n,c),d=xs(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Vt(a),{x:f,y:g}=t,{width:p,height:m}=e;let b,x,k,_,M,y;return o==="center"?(M=g+m/2,s==="left"?(b=f,x=b-r,_=M+r,y=M-r):(b=f+p,x=b+r,_=M-r,y=M+r),k=b):(s==="left"?x=f+Math.max(l,h)+r:s==="right"?x=f+p-Math.max(c,d)-r:x=this.caretX,o==="top"?(_=g,M=_-r,b=x-r,k=x+r):(_=g+m,M=_+r,b=x+r,k=x-r),y=_),{x1:b,x2:x,x3:k,y1:_,y2:M,y3:y}}drawTitle(t,e,n){const s=this.title,o=s.length;let r,a,l;if(o){const c=jt(n.rtl,this.x,this.width);for(t.x=Ve(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",r=q(n.titleFont),a=n.titleSpacing,e.fillStyle=n.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+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,s,o){const r=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,h=q(o.bodyFont),d=Ve(this,"left",o),f=s.x(d),g=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+g;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=s.leftForLtr(f,c)+c/2,x=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ni(t,m,b,x),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ni(t,m,b,x)}else{t.lineWidth=E(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const m=s.leftForLtr(f,c),b=s.leftForLtr(s.xPlus(f,1),c-2),x=Vt(r.borderRadius);Object.values(x).some(k=>k!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,we(t,{x:m,y:p,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),we(t,{x:b,y:p+1,w:c-2,h:l-2,radius:x}),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[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=n,d=q(n.bodyFont);let f=d.lineHeight,g=0;const p=jt(n.rtl,this.x,this.width),m=function(v){e.fillText(v,p.x(t.x+g),t.y+f/2),t.y+=f+o},b=p.textAlign(r);let x,k,_,M,y,S,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Ve(this,b,n),e.fillStyle=n.bodyColor,I(this.beforeBody,m),g=a&&b!=="right"?r==="center"?c/2+h:c+2+h:0,M=0,S=s.length;M<S;++M){for(x=s[M],k=this.labelTextColors[M],e.fillStyle=k,I(x.before,m),_=x.lines,a&&_.length&&(this._drawColorBox(e,t,M,p,n),f=Math.max(d.lineHeight,l)),y=0,w=_.length;y<w;++y)m(_[y]),f=d.lineHeight;I(x.after,m)}g=0,f=d.lineHeight,I(this.afterBody,m),t.y-=o}drawFooter(t,e,n){const s=this.footer,o=s.length;let r,a;if(o){const l=jt(n.rtl,this.x,this.width);for(t.x=Ve(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",r=q(n.footerFont),e.fillStyle=n.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+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=n,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=Vt(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,n,s),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,e,n,s),e.lineTo(a+c,l+h-p),e.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(a+g,l+h),e.quadraticCurveTo(a,l+h,a,l+h-g),r==="center"&&o==="left"&&this.drawCaret(t,e,n,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const r=ce[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=ms(this,t),l=Object.assign({},r,this._size),c=bs(e,t,l),h=xs(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){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const r=J(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=n,this.drawBackground(o,t,s,e),hn(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),dn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!ue(n,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,n),a=this._positionChanged(r,t),l=e||!ue(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,r=ce[o.position].call(this,t,e);return r!==!1&&(n!==r.x||s!==r.y)}}var Si={id:"tooltip",_element:ws,positioners:ce,afterInit(i,t,e){e&&(i.tooltip=new ws({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:ks},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ic=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function nc(i,t,e,n){const s=i.indexOf(t);if(s===-1)return ic(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const sc=(i,t)=>i===null?null:G(Math.round(i),0,t);function Ss(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class oc extends $t{static id="category";static defaults={ticks:{callback:Ss}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:o}of e)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(z(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:nc(n,t,T(e,t),this._addedLabels),sc(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){return Ss.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function rc(i,t){const e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=i,g=o||1,p=h-1,{min:m,max:b}=t,x=!z(r),k=!z(a),_=!z(c),M=(b-m)/(d+1);let y=Vi((b-m)/p/g)*g,S,w,v,C;if(y<1e-14&&!x&&!k)return[{value:m},{value:b}];C=Math.ceil(b/y)-Math.floor(m/y),C>p&&(y=Vi(C*y/p/g)*g),z(l)||(S=Math.pow(10,l),y=Math.ceil(y*S)/S),s==="ticks"?(w=Math.floor(m/y)*y,v=Math.ceil(b/y)*y):(w=m,v=b),x&&k&&o&&_o((a-r)/o,y/1e3)?(C=Math.round(Math.min((a-r)/y,h)),y=(a-r)/C,w=r,v=a):_?(w=x?r:w,v=k?a:v,C=c-1,y=(v-w)/C):(C=(v-w)/y,Jt(C,Math.round(C),y/1e3)?C=Math.round(C):C=Math.ceil(C));const D=Math.max(Wi(y),Wi(w));S=Math.pow(10,z(l)?D:l),w=Math.round(w*S)/S,v=Math.round(v*S)/S;let P=0;for(x&&(f&&w!==r?(e.push({value:r}),w<r&&P++,Jt(Math.round((w+P*y)*S)/S,r,Ms(r,M,i))&&P++):w<r&&P++);P<C;++P){const O=Math.round((w+P*y)*S)/S;if(k&&O>a)break;e.push({value:O})}return k&&f&&v!==a?e.length&&Jt(e[e.length-1].value,a,Ms(a,M,i))?e[e.length-1].value=a:e.push({value:a}):(!k||v===a)&&e.push({value:v}),e}function Ms(i,t,{horizontal:e,minRotation:n}){const s=rt(n),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Mi extends $t{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 z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=e?s:l,a=l=>o=n?o:l;if(t){const l=Ft(s),c=Ft(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=rc(s,o);return t.bounds==="ticks"&&ko(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return xe(t,this.chart.options.locale,this.options.ticks.format)}}class ac extends Mi{static id="linear";static defaults={ticks:{callback:ti.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=X(t)?t:0,this.max=X(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=rt(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function vi(i){const t=i.ticks;if(t.display&&i.display){const e=J(t.backdropPadding);return T(t.font&&t.font.size,$.font.size)+e.height}return 0}function lc(i,t,e){return e=j(e)?e:[e],{w:Ho(i,t.string,e),h:e.length*t.lineHeight}}function vs(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function cc(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?B/o:0;for(let l=0;l<o;l++){const c=r.setContext(i.getPointLabelContext(l));s[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+s[l],a),d=q(c.font),f=lc(i.ctx,d,i._pointLabels[l]);n[l]=f;const g=K(i.getIndexAngle(l)+a),p=Math.round(Ke(g)),m=vs(p,h.x,f.w,0,180),b=vs(p,h.y,f.h,90,270);hc(e,t,g,m,b)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=uc(i,n,s)}function hc(i,t,e,n,s){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let a=0,l=0;n.start<t.l?(a=(t.l-n.start)/o,i.l=Math.min(i.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function dc(i,t,e){const n=i.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=i.getPointPosition(t,n+s+r,o),c=Math.round(Ke(K(l.angle+Y))),h=mc(l.y,a.h,c),d=gc(c),f=pc(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:f,top:h,right:f+a.w,bottom:h+a.h}}function fc(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:o}=i;return!(ut({x:e,y:n},t)||ut({x:e,y:o},t)||ut({x:s,y:n},t)||ut({x:s,y:o},t))}function uc(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:vi(o)/2,additionalAngle:r?B/s:0};let c;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const d=dc(i,h,l);n.push(d),a==="auto"&&(d.visible=fc(d,c),d.visible&&(c=d))}return n}function gc(i){return i===0||i===180?"center":i<180?"left":"right"}function pc(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function mc(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function bc(i,t,e){const{left:n,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!z(a)){const l=Vt(t.borderRadius),c=J(t.backdropPadding);i.fillStyle=a;const h=n-c.left,d=s-c.top,f=o-n+c.width,g=r-s+c.height;Object.values(l).some(p=>p!==0)?(i.beginPath(),we(i,{x:h,y:d,w:f,h:g,radius:l}),i.fill()):i.fillRect(h,d,f,g)}}function xc(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const o=i._pointLabelItems[s];if(!o.visible)continue;const r=n.setContext(i.getPointLabelContext(s));bc(e,r,o);const a=q(r.font),{x:l,y:c,textAlign:h}=o;Nt(e,i._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Cs(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,V);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<n;r++)o=i.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function yc(i,t,e,n,s){const o=i.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!n||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Cs(i,e,r,n),o.closePath(),o.stroke(),o.restore())}function _c(i,t,e){return yt(i,{label:e,index:t,type:"pointLabel"})}class kc extends Mi{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ti.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=J(vi(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=X(t)&&!isNaN(t)?t:0,this.max=X(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/vi(this.options))}generateTickLabels(t){Mi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=N(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?cc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=V/(this._pointLabels.length||1),n=this.options.startAngle||0;return K(t*e+rt(n))}getDistanceFromCenterForValue(t){if(z(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(z(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return _c(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-Y+n;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),Cs(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s,border:o}=e,r=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&xc(this,r),s.display&&this.ticks.forEach((h,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const f=this.getContext(d),g=s.setContext(f),p=o.setContext(f);yc(this,g,l,r,p)}}),n.display){for(t.save(),a=r-1;a>=0;a--){const h=n.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=h;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,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&&this.min>=0&&!e.reverse)return;const c=n.setContext(this.getContext(l)),h=q(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;const d=J(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}Nt(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const We={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Z=Object.keys(We);function Ds(i,t){return i-t}function Ps(i,t){if(z(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let r=t;return typeof n=="function"&&(r=n(r)),X(r)||(r=typeof n=="string"?e.parse(r,n):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(Qt(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function As(i,t,e,n){const s=Z.length;for(let o=Z.indexOf(i);o<s-1;++o){const r=We[Z[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=n)return Z[o]}return Z[s-1]}function wc(i,t,e,n,s){for(let o=Z.length-1;o>=Z.indexOf(e);o--){const r=Z[o];if(We[r].common&&i._adapter.diff(s,n,r)>=t-1)return r}return Z[e?Z.indexOf(e):0]}function Sc(i){for(let t=Z.indexOf(i)+1,e=Z.length;t<e;++t)if(We[Z[t]].common)return Z[t]}function Os(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=Je(e,t),o=e[n]>=t?e[n]:e[s];i[o]=!0}}function Mc(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=e[a],l>=0&&(t[l].major=!0);return t}function Ts(i,t,e){const n=[],s={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,n.push({value:a,major:!1});return o===0||!e?n:Mc(i,n,s,e)}class Es extends $t{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const n=t.time||(t.time={}),s=this._adapter=new Zr._date(t.adapters.date);s.init(e),Gt(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Ps(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:o,minDefined: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(!1))),s=X(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),o=X(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,a=vo(s,o,r);return this._unit=e.unit||(n.autoSkip?As(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):wc(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Sc(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Ts(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=G(e,0,r),n=G(n,0,r),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,r=o.unit||As(o.minUnit,e,n,this._getLabelCapacity(e)),a=T(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Qt(l)||l===!0,h={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(n,e,r)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+r);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<n;f=+t.add(f,a,r),g++)Os(h,f,p);return(f===n||s.bounds==="ticks"||g===1)&&Os(h,f,p),Object.keys(h).sort(Ds).map(m=>+m)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,n,s){const o=this.options,r=o.ticks.callback;if(r)return N(r,[t,e,n],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],f=n[e],g=c&&d&&f&&f.major;return this._adapter.format(t,s||(g?d:h))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=rt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*r,h:n*r+a*o}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,Ts(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,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(Ps(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Do(t.sort(Ds))}}function He(i,t,e){let n=0,s=i.length-1,o,r,a,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=Mt(i,"pos",t)),{pos:o,time:a}=i[n],{pos:r,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=Mt(i,"time",t)),{time:o,pos:a}=i[n],{time:r,pos:l}=i[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class ah extends Es{static id="timeseries";static defaults=Es.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=He(e,this.min),this._tableRange=He(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,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}_generate(){const t=this.min,e=this.max;let n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(e)||n.length===1)&&n.push(e),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(He(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return He(this._table,n*this._tableRange+this._minPos,!0)}}const vc={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},Cc={class:"flex flex-column gap-2 flex-1 w-full max-w-26rem"},Dc={class:"flex align-items-center justify-content-between gap-2 border-bottom-1 pb-1 surface-border"},Pc={class:"flex align-items-center gap-2"},Ac={class:"flex align-items-center gap-2"},Oc={class:"flex justify-content-center align-items-center mx-auto",style:{width:"200px",height:"200px","flex-shrink":"0"}},Ls={__name:"Polar",props:{label_rotulo:{type:String,default:"Rótulo"},label_quantidade:{type:String,default:"Quantidade"},titulo:{type:String,default:"Polar Chart"},subtitulo:{type:String,default:""},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1E40AF"},direcao:{type:String,default:null,validator:i=>i===null||["horizontal","vertical"].includes(i)}},setup(i){Et.register(Qr,kc,es,Si,ps);const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},n=u.computed(()=>e[t.cor]??"bg-white"),s=u.computed(()=>t.cor==="dark");function o(b,x=7){const k=b.replace("#","");let _=parseInt(k.slice(0,2),16),M=parseInt(k.slice(2,4),16),y=parseInt(k.slice(4,6),16);_/=255,M/=255,y/=255;const S=Math.max(_,M,y),w=Math.min(_,M,y);let v,C,D=(S+w)/2;if(S===w)v=C=0;else{const A=S-w;switch(C=D>.5?A/(2-S-w):A/(S+w),S){case _:v=((M-y)/A+(M<y?6:0))/6;break;case M:v=((y-_)/A+2)/6;break;case y:v=((_-M)/A+4)/6;break}}const P=Math.max(.2,D-.3),W=(Math.min(.95,D+.35)-P)/(x-1);function U(A,L,R){const H=L*Math.min(R,1-R),F=tt=>{const ot=(tt+A*12)%12,et=R-H*Math.max(-1,Math.min(ot-3,9-ot,1));return Math.round(255*et).toString(16).padStart(2,"0")};return`#${F(0)}${F(8)}${F(4)}`}return Array.from({length:x},(A,L)=>U(v,C,P+W*L))}const r=u.computed(()=>o(t.corPaleta,t.dados.length)),a=u.ref(null),l=u.ref(null),c=u.ref(!0);let h=null,d=null;const f=u.computed(()=>t.direcao==="vertical"?"flex-column-reverse":t.direcao==="horizontal"?"flex-row":c.value?"flex-column-reverse":"flex-row"),g=u.computed(()=>({labels:t.dados.map(b=>b.rotulo),datasets:[{data:t.dados.map(b=>b.quantidade),backgroundColor:r.value,borderWidth:0,borderColor:"transparent"}]})),p=u.computed(()=>({responsive:!0,maintainAspectRatio:!0,animation:{duration:800,easing:"easeOutQuart"},plugins:{legend:{display:!1},tooltip:{enabled:!0}},scales:{r:{ticks:{display:!1},grid:{color:s.value?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.05)"}}}}));function m(){d&&d.destroy(),d=new Et(a.value,{type:"polarArea",data:g.value,options:p.value})}return u.onMounted(()=>{m(),h=new ResizeObserver(([b])=>{c.value=b.contentRect.width<380}),h.observe(l.value)}),u.onBeforeUnmount(()=>{d&&d.destroy(),h&&h.disconnect()}),u.watch(()=>t.dados,()=>{m()},{deep:!0}),u.watch(()=>t.cor,()=>{m()}),u.watch(()=>t.corPaleta,()=>{m()}),(b,x)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass([n.value,"border-1 surface-border border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none",s.value?"hover:bg-black-alpha-90":"hover:bg-white-alpha-70"]),style:{padding:"1.25rem",gap:"1.438rem"}},[u.createElementVNode("div",null,[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",s.value?"text-white":"text-gray-900"])},u.toDisplayString(i.titulo),3),i.subtitulo?(u.openBlock(),u.createElementBlock("p",vc,u.toDisplayString(i.subtitulo),1)):u.createCommentVNode("",!0)]),u.createElementVNode("div",{ref_key:"containerRef",ref:l,class:u.normalizeClass(["flex w-full h-full gap-3 align-items-center justify-content-between",f.value])},[u.createElementVNode("div",Cc,[u.createElementVNode("div",Dc,[u.createElementVNode("div",Pc,[x[0]||(x[0]=u.createElementVNode("span",{style:{width:"10px",height:"10px",flexShrink:0}},null,-1)),u.createElementVNode("span",{class:u.normalizeClass(["text-xs font-medium",s.value?"text-white":"text-500"])},u.toDisplayString(i.label_rotulo),3)]),u.createElementVNode("span",{class:u.normalizeClass(["text-xs font-medium",s.value?"text-white":"text-gray-500"])},u.toDisplayString(i.label_quantidade),3)]),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(k,_)=>(u.openBlock(),u.createElementBlock("div",{key:_,class:"flex align-items-center justify-content-between"},[u.createElementVNode("div",Ac,[u.createElementVNode("span",{class:"border-circle",style:u.normalizeStyle({backgroundColor:r.value[_],width:"10px",height:"10px",flexShrink:0})},null,4),u.createElementVNode("span",{class:u.normalizeClass(["text-xs font-medium",s.value?"text-white":"text-600"])},u.toDisplayString(k.rotulo),3)]),u.createElementVNode("span",{class:u.normalizeClass(["text-xs font-semibold",s.value?"text-white":"text-gray-900"])},u.toDisplayString(k.quantidade),3)]))),128))]),u.createElementVNode("div",Oc,[u.createElementVNode("canvas",{ref_key:"canvasRef",ref:a,width:"200",height:"200"},null,512)])],2)],2))}},Tc={class:"w-full flex flex-row align-items-center justify-content-between"},Ec={class:"w-full"},Lc={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},Rc={class:"flex w-full gap-3 justify-content-between flex-column",style:{flex:"1","min-height":"0"}},Bc={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},zc=["onMouseenter","onMousemove"],Ic={class:"flex gap-1",style:{width:"100%","margin-top":"4px"}},Rs={__name:"CardColumn",props:{titulo:{type:String,default:"CardColumn"},subtitulo:{type:String,default:""},valor:{type:String,default:"0"},descricao:{type:String,default:"This is a card component."},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1E40AF"},moeda:{type:Boolean,default:!1}},setup(i){const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},n=u.computed(()=>e[t.cor]??"bg-white"),s=u.computed(()=>t.cor==="dark"),o=u.computed(()=>t.cor==="dark"?"#252525":"#E9E9E9");function r(_,M=7){const y=_.replace("#","");let S=parseInt(y.slice(0,2),16),w=parseInt(y.slice(2,4),16),v=parseInt(y.slice(4,6),16);S/=255,w/=255,v/=255;const C=Math.max(S,w,v),D=Math.min(S,w,v);let P,O,W=(C+D)/2;if(C===D)P=O=0;else{const H=C-D;switch(O=W>.5?H/(2-C-D):H/(C+D),C){case S:P=((w-v)/H+(w<v?6:0))/6;break;case w:P=((v-S)/H+2)/6;break;case v:P=((S-w)/H+4)/6;break}}const U=Math.max(.2,W-.3),A=Math.min(.95,W+.35),L=M>1?(A-U)/(M-1):0;function R(H,F,tt){const ot=F*Math.min(tt,1-tt),et=Lt=>{const ht=(Lt+H*12)%12,Rt=tt-ot*Math.max(-1,Math.min(ht-3,9-ht,1));return Math.round(255*Rt).toString(16).padStart(2,"0")};return`#${et(0)}${et(8)}${et(4)}`}return Array.from({length:M},(H,F)=>R(P,O,U+L*F))}const a=u.computed(()=>r(t.corPaleta,t.dados.length)),l=u.computed(()=>Math.max(...t.dados.map(_=>_.quantidade),1)),c=u.ref(null),h=u.ref(80);let d=null;u.onMounted(()=>{d=new ResizeObserver(([_])=>{h.value=_.contentRect.height||80}),d.observe(c.value)}),u.onBeforeUnmount(()=>{d&&d.disconnect()});const f=u.ref(null),g=u.ref({visible:!1,x:0,y:0,text:""});function p(_,M){f.value=_,k(_,M)}function m(_,M){k(_,M)}function b(){f.value=null,g.value.visible=!1}function x(_){return t.moeda?Number(_).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}):`${_}`}function k(_,M){const y=t.dados[_],S=M.currentTarget.closest(".chart-container").getBoundingClientRect(),w=M.currentTarget.getBoundingClientRect();g.value={visible:!0,x:w.left-S.left+w.width/2,y:w.top-S.top-8,text:x(y.quantidade)}}return(_,M)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass([n.value,"border-1 surface-border border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none",s.value?"hover:bg-black-alpha-90":"hover:bg-white-alpha-70"]),style:{padding:"1.25rem",gap:"1.438rem","min-height":"0"}},[u.createElementVNode("div",Tc,[u.createElementVNode("div",Ec,[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",s.value?"text-white":"text-gray-900"])},u.toDisplayString(i.titulo),3),i.subtitulo?(u.openBlock(),u.createElementBlock("p",Lc,u.toDisplayString(i.subtitulo),1)):u.createCommentVNode("",!0)]),u.renderSlot(_.$slots,"header-right")]),u.createElementVNode("div",Rc,[u.createElementVNode("div",null,[u.createElementVNode("h2",{class:u.normalizeClass(["m-0 text-3xl font-semibold",s.value?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},u.toDisplayString(i.valor),3),u.createElementVNode("p",Bc,u.toDisplayString(i.descricao),1)]),u.createElementVNode("div",{ref_key:"chartRef",ref:c,class:"chart-container",style:{position:"relative",width:"100%",flex:"1","min-height":"80px"}},[g.value.visible?(u.openBlock(),u.createElementBlock("div",{key:0,style:u.normalizeStyle([{position:"absolute",transform:"translate(-50%, -100%)",background:"rgba(0,0,0,0.75)",color:"#fff","font-size":"0.7rem",padding:"3px 8px","border-radius":"4px","white-space":"nowrap","pointer-events":"none","z-index":"10"},{left:g.value.x+"px",top:g.value.y+"px"}])},u.toDisplayString(g.value.text),5)):u.createCommentVNode("",!0),u.createElementVNode("div",{class:"flex align-items-end gap-1",style:u.normalizeStyle([{width:"100%"},{height:h.value-20+"px"}])},[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(y,S)=>(u.openBlock(),u.createElementBlock("div",{key:S,class:"flex-1",style:{display:"flex","align-items":"flex-end",height:"100%",cursor:"pointer"},onMouseenter:w=>p(S,w),onMousemove:w=>m(S,w),onMouseleave:b},[u.createElementVNode("div",{style:u.normalizeStyle({height:y.quantidade/l.value*100+"%",minHeight:"4px",width:"100%",backgroundColor:f.value===S?a.value[S]:o.value,borderRadius:"4px 4px 4px 4px",transition:"background-color 0.15s ease"})},null,4)],40,zc))),128))],4),u.createElementVNode("div",Ic,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(y,S)=>(u.openBlock(),u.createElementBlock("div",{key:S,class:"flex-1 text-center",style:u.normalizeStyle([{"font-size":"0.6rem",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"},{color:s.value?"#888":"#aaa"}])},u.toDisplayString(y.rotulo),5))),128))])],512)])],2))}},Fc={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},Nc={class:"flex flex-column gap-2 flex-1 w-full max-w-26rem"},Vc={class:"flex align-items-center justify-content-between gap-2 border-bottom-1 pb-1 surface-border"},Wc={class:"flex align-items-center gap-2"},Hc={class:"flex align-items-center gap-2"},jc={class:"flex justify-content-center align-items-center mx-auto",style:{position:"relative",width:"200px",height:"200px","flex-shrink":"0"}},$c={key:0,style:{position:"absolute",inset:"0",display:"flex","flex-direction":"column","align-items":"center","justify-content":"center","pointer-events":"none"}},Yc={key:0,style:{"font-size":"0.6rem",color:"#7B7B7B","text-align":"center","max-width":"80px","line-height":"1.3"}},Bs={__name:"cardPizza",props:{label_rotulo:{type:String,default:"Rótulo"},label_quantidade:{type:String,default:"Quantidade"},titulo:{type:String,default:"Pizza Chart"},subtitulo:{type:String,default:""},valor:{type:String,default:""},descricao:{type:String,default:""},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1E40AF"},direcao:{type:String,default:null,validator:i=>i===null||["horizontal","vertical"].includes(i)}},setup(i){Et.register(Gr,es,Si,ps);const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},n=u.computed(()=>e[t.cor]??"bg-white"),s=u.computed(()=>t.cor==="dark");function o(b,x=7){const k=b.replace("#","");let _=parseInt(k.slice(0,2),16),M=parseInt(k.slice(2,4),16),y=parseInt(k.slice(4,6),16);_/=255,M/=255,y/=255;const S=Math.max(_,M,y),w=Math.min(_,M,y);let v,C,D=(S+w)/2;if(S===w)v=C=0;else{const A=S-w;switch(C=D>.5?A/(2-S-w):A/(S+w),S){case _:v=((M-y)/A+(M<y?6:0))/6;break;case M:v=((y-_)/A+2)/6;break;case y:v=((_-M)/A+4)/6;break}}const P=Math.max(.2,D-.3),W=(Math.min(.95,D+.35)-P)/(x-1);function U(A,L,R){const H=L*Math.min(R,1-R),F=tt=>{const ot=(tt+A*12)%12,et=R-H*Math.max(-1,Math.min(ot-3,9-ot,1));return Math.round(255*et).toString(16).padStart(2,"0")};return`#${F(0)}${F(8)}${F(4)}`}return Array.from({length:x},(A,L)=>U(v,C,P+W*L))}const r=u.computed(()=>o(t.corPaleta,t.dados.length)),a=u.ref(null),l=u.ref(null),c=u.ref(!0);let h=null,d=null;const f=u.computed(()=>t.direcao==="vertical"?"flex-column-reverse":t.direcao==="horizontal"?"flex-row":c.value?"flex-column-reverse":"flex-row"),g=u.computed(()=>({labels:t.dados.map(b=>b.rotulo),datasets:[{data:t.dados.map(b=>b.quantidade),backgroundColor:r.value,borderWidth:0,borderColor:"transparent"}]})),p=u.computed(()=>({responsive:!0,maintainAspectRatio:!0,cutout:t.valor?"65%":"50%",animation:{duration:800,easing:"easeOutQuart"},plugins:{legend:{display:!1},tooltip:{enabled:!0}}}));function m(){d&&d.destroy(),d=new Et(a.value,{type:"doughnut",data:g.value,options:p.value})}return u.onMounted(()=>{m(),h=new ResizeObserver(([b])=>{c.value=b.contentRect.width<380}),h.observe(l.value)}),u.onBeforeUnmount(()=>{d&&d.destroy(),h&&h.disconnect()}),u.watch(()=>t.dados,()=>{m()},{deep:!0}),u.watch(()=>t.cor,()=>{m()}),u.watch(()=>t.corPaleta,()=>{m()}),(b,x)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass([n.value,"border-1 surface-border border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none",s.value?"hover:bg-black-alpha-90":"hover:bg-white-alpha-70"]),style:{padding:"1.25rem",gap:"1.438rem"}},[u.createElementVNode("div",null,[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",s.value?"text-white":"text-gray-900"])},u.toDisplayString(i.titulo),3),i.subtitulo?(u.openBlock(),u.createElementBlock("p",Fc,u.toDisplayString(i.subtitulo),1)):u.createCommentVNode("",!0)]),u.createElementVNode("div",{ref_key:"containerRef",ref:l,class:u.normalizeClass(["flex w-full h-full align-items-center justify-content-between",[f.value,c.value||t.direcao==="vertical"?"gap-4":"gap-7"]])},[u.createElementVNode("div",Nc,[u.createElementVNode("div",Vc,[u.createElementVNode("div",Wc,[x[0]||(x[0]=u.createElementVNode("span",{style:{width:"10px",height:"10px",flexShrink:0}},null,-1)),u.createElementVNode("span",{class:u.normalizeClass(["text-xs font-medium",s.value?"text-white":"text-500"])},u.toDisplayString(t.label_rotulo),3)]),u.createElementVNode("span",{class:u.normalizeClass(["text-xs font-medium",s.value?"text-white":"text-gray-500"])},u.toDisplayString(t.label_quantidade),3)]),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(k,_)=>(u.openBlock(),u.createElementBlock("div",{key:_,class:"flex align-items-center justify-content-between"},[u.createElementVNode("div",Hc,[u.createElementVNode("span",{class:"border-circle",style:u.normalizeStyle({backgroundColor:r.value[_],width:"10px",height:"10px",flexShrink:0})},null,4),u.createElementVNode("span",{class:u.normalizeClass(["text-xs font-medium",s.value?"text-white":"text-600"])},u.toDisplayString(k.rotulo),3)]),u.createElementVNode("span",{class:u.normalizeClass(["text-xs font-semibold",s.value?"text-white":"text-gray-900"])},u.toDisplayString(k.quantidade),3)]))),128))]),u.createElementVNode("div",jc,[u.createElementVNode("canvas",{ref_key:"canvasRef",ref:a,width:"200",height:"200"},null,512),i.valor?(u.openBlock(),u.createElementBlock("div",$c,[u.createElementVNode("span",{class:"font-semibold",style:u.normalizeStyle([{"font-size":"1.25rem","line-height":"1.2","letter-spacing":"-0.5px"},{color:s.value?"#fff":"#111"}])},u.toDisplayString(i.valor),5),i.descricao?(u.openBlock(),u.createElementBlock("span",Yc,u.toDisplayString(i.descricao),1)):u.createCommentVNode("",!0)])):u.createCommentVNode("",!0)])],2)],2))}},Uc={class:"w-full flex flex-row align-items-center justify-content-between",style:{position:"relative","z-index":"1"}},Xc={class:"w-full"},qc={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},Kc={style:{position:"relative","z-index":"1"}},Gc={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},Jc={style:{position:"absolute",bottom:"0",left:"0",right:"0",height:"160px","pointer-events":"none"}},zs={__name:"cardLines",props:{titulo:{type:String,default:"CardLines"},subtitulo:{type:String,default:""},valor:{type:String,default:"0"},descricao:{type:String,default:"This is a card component."},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1D4ED8"},moeda:{type:Boolean,default:!1}},setup(i){Et.register(Jr,Fe,Sl,ac,oc,Si,jl);const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},n=u.computed(()=>e[t.cor]??"bg-white"),s=u.computed(()=>t.cor==="dark");function o(d){return t.moeda?Number(d).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}):`${d}`}const r=u.ref(null);let a=null;function l(d){const f=d.replace("#",""),g=parseInt(f.slice(0,2),16),p=parseInt(f.slice(2,4),16),m=parseInt(f.slice(4,6),16);return`${g}, ${p}, ${m}`}function c(d,f){const g=l(t.corPaleta),p=d.createLinearGradient(0,f.top,0,f.bottom);return p.addColorStop(0,`rgba(${g}, 0.12)`),p.addColorStop(1,`rgba(${g}, 0)`),p}function h(){a&&a.destroy(),a=new Et(r.value,{type:"line",data:{labels:t.dados.map(d=>d.rotulo),datasets:[{data:t.dados.map(d=>d.quantidade),borderColor:t.corPaleta,backgroundColor(d){const f=d.chart,{ctx:g,chartArea:p}=f;return p?c(g,p):`rgba(${l(t.corPaleta)}, 0.12)`},borderWidth:3,pointRadius:0,pointHitRadius:20,pointHoverRadius:5,pointHoverBackgroundColor:"#fff",pointHoverBorderColor:t.corPaleta,pointHoverBorderWidth:2,tension:.4,fill:!0}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:600,easing:"easeOutQuart"},layout:{padding:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{enabled:!0,displayColors:!1,callbacks:{title:d=>d[0].label,label:d=>o(d.parsed.y)}}},scales:{x:{display:!1},y:{display:!1}}}})}return u.onMounted(()=>h()),u.onBeforeUnmount(()=>{a&&a.destroy()}),u.watch(()=>t.dados,()=>h(),{deep:!0}),u.watch(()=>t.cor,()=>h()),u.watch(()=>t.corPaleta,()=>h()),(d,f)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass([n.value,"border-1 surface-border border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none",s.value?"hover:bg-black-alpha-90":"hover:bg-white-alpha-70"]),style:{padding:"1.25rem",gap:"1.438rem","min-height":"0",position:"relative",overflow:"hidden"}},[u.createElementVNode("div",Uc,[u.createElementVNode("div",Xc,[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",s.value?"text-white":"text-gray-900"])},u.toDisplayString(t.titulo),3),t.subtitulo?(u.openBlock(),u.createElementBlock("p",qc,u.toDisplayString(t.subtitulo),1)):u.createCommentVNode("",!0)]),u.renderSlot(d.$slots,"header-right")]),u.createElementVNode("div",Kc,[u.createElementVNode("h2",{class:u.normalizeClass(["m-0 text-3xl font-semibold",s.value?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},u.toDisplayString(t.valor),3),u.createElementVNode("p",Gc,u.toDisplayString(t.descricao),1)]),u.createElementVNode("div",Jc,[u.createElementVNode("canvas",{ref_key:"canvasRef",ref:r,style:{width:"100%",height:"100%","pointer-events":"auto"}},null,512)]),f[0]||(f[0]=u.createElementVNode("div",{style:{height:"130px"}},null,-1))],2))}},Qc={class:"w-full flex flex-row align-items-center justify-content-between"},Zc={class:"w-full"},th={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},eh={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},ih={style:{color:"#ccc"}},nh=["onMouseenter","onMousemove"],sh={class:"flex gap-1",style:{width:"100%","margin-top":"4px"}},Is={__name:"CardColumnDual",props:{titulo:{type:String,default:"CardColumnDual"},subtitulo:{type:String,default:""},valor:{type:String,default:"0"},descricao:{type:String,default:"This is a card component."},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1E40AF"},moeda:{type:Boolean,default:!1},eixo:{type:String,default:"vertical",validator:i=>["horizontal","vertical"].includes(i)},segmentos:{type:Array,default:()=>[{key:"total_previsto",label:"Previsto"},{key:"total_recebido",label:"Recebido"}]},segmentoTooltip:{type:Object,default:()=>({key:"total_em_aberto",label:"Em aberto"})}},setup(i){const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},n=u.computed(()=>e[t.cor]??"bg-white"),s=u.computed(()=>t.cor==="dark"),o=u.computed(()=>{const y=Array(t.segmentos.length).fill(t.cor==="dark"?"#252525":"#E9E9E9");return y[y.length-1]=t.corPaleta,y}),r=u.computed(()=>Math.max(1,...t.dados.map(y=>t.segmentos.reduce((S,w)=>S+(Number(y[w.key])||0),0))));function a(y){return t.segmentos.map((S,w)=>({key:S.key,label:S.label,valor:Number(y[S.key])||0,cor:o.value[w]}))}function l(y){const S=a(y),w=t.segmentoTooltip?[{label:t.segmentoTooltip.label,valor:Number(y[t.segmentoTooltip.key])||0,cor:s.value?"#666":"#bbb"}]:[];return[...S.map(v=>({label:v.label,valor:v.valor,cor:v.cor})),...w]}const c=u.ref(null),h=u.ref(80),d=u.ref(null),f=u.ref(!1);let g=null,p=null;u.onMounted(()=>{g=new ResizeObserver(([y])=>{h.value=y.contentRect.height||80}),g.observe(c.value),p=new ResizeObserver(([y])=>{f.value=y.contentRect.width<420}),p.observe(d.value)}),u.onBeforeUnmount(()=>{g&&g.disconnect(),p&&p.disconnect()});const m=u.computed(()=>t.eixo==="horizontal"&&!f.value?"flex-row align-items-center":"flex-column"),b=u.ref({visible:!1,x:0,y:0,lines:[]});function x(y){return t.moeda?Number(y).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}):`${y}`}function k(y,S){const w=S.currentTarget.closest(".chart-container").getBoundingClientRect(),v=S.currentTarget.getBoundingClientRect();b.value={visible:!0,x:v.left-w.left+v.width/2,y:v.top-w.top-8,lines:l(y).map(C=>({label:C.label,valor:x(C.valor),cor:C.cor}))}}function _(y,S){k(y,S)}function M(){b.value.visible=!1}return(y,S)=>(u.openBlock(),u.createElementBlock("div",{ref_key:"rootRef",ref:d,class:u.normalizeClass([n.value,"border-1 surface-border border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none",s.value?"hover:bg-black-alpha-90":"hover:bg-white-alpha-70"]),style:{padding:"1.25rem",gap:"1.438rem","min-height":"0"}},[u.createElementVNode("div",Qc,[u.createElementVNode("div",Zc,[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",s.value?"text-white":"text-gray-900"])},u.toDisplayString(i.titulo),3),i.subtitulo?(u.openBlock(),u.createElementBlock("p",th,u.toDisplayString(i.subtitulo),1)):u.createCommentVNode("",!0)]),u.renderSlot(y.$slots,"header-right")]),u.createElementVNode("div",{class:u.normalizeClass(["flex w-full gap-5 justify-content-between",m.value]),style:{flex:"1","min-height":"0"}},[u.createElementVNode("div",null,[u.createElementVNode("h2",{class:u.normalizeClass(["m-0 text-3xl font-semibold",s.value?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},u.toDisplayString(i.valor),3),u.createElementVNode("p",eh,u.toDisplayString(i.descricao),1)]),u.createElementVNode("div",{ref_key:"chartRef",ref:c,class:"chart-container",style:{position:"relative",width:"100%",flex:"1","min-height":"80px",height:"100%"}},[b.value.visible?(u.openBlock(),u.createElementBlock("div",{key:0,style:u.normalizeStyle([{position:"absolute",transform:"translate(-50%, -100%)",background:"rgba(0,0,0,0.8)",color:"#fff","font-size":"0.65rem",padding:"5px 8px","border-radius":"4px","white-space":"nowrap","pointer-events":"none","z-index":"10",display:"flex","flex-direction":"column",gap:"2px"},{left:b.value.x+"px",top:b.value.y+"px"}])},[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(b.value.lines,w=>(u.openBlock(),u.createElementBlock("div",{key:w.label,style:{display:"flex","align-items":"center",gap:"4px"}},[u.createElementVNode("span",{style:u.normalizeStyle({width:"6px",height:"6px",borderRadius:"1px",backgroundColor:w.cor,display:"inline-block",flexShrink:0})},null,4),u.createElementVNode("span",ih,u.toDisplayString(w.label)+":",1),u.createElementVNode("span",null,u.toDisplayString(w.valor),1)]))),128))],4)):u.createCommentVNode("",!0),u.createElementVNode("div",{class:"flex align-items-end gap-1",style:u.normalizeStyle([{width:"100%"},{height:h.value-20+"px"}])},[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(w,v)=>(u.openBlock(),u.createElementBlock("div",{key:v,class:"flex-1",style:{display:"flex","flex-direction":"column","justify-content":"flex-end",height:"100%",cursor:"pointer"},onMouseenter:C=>k(w,C),onMousemove:C=>_(w,C),onMouseleave:M},[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(a(w),(C,D)=>(u.openBlock(),u.createElementBlock("div",{key:C.key,style:u.normalizeStyle({height:C.valor/r.value*(h.value-20)+"px",minHeight:C.valor>0?"3px":"0",width:"100%",backgroundColor:C.cor,borderRadius:D===0?"4px 4px 0 0":D===a(w).length-1?"0 0 4px 4px":"0",transition:"height 0.2s ease",flexShrink:0})},null,4))),128))],40,nh))),128))],4),u.createElementVNode("div",sh,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(w,v)=>(u.openBlock(),u.createElementBlock("div",{key:v,class:"flex-1 text-center",style:u.normalizeStyle([{"font-size":"0.6rem",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"},{color:s.value?"#888":"#aaa"}])},u.toDisplayString(w.rotulo),5))),128))])],512)],2)],2))}},oh={install(i){i.component("NemesisCards",Ci),i.component("NemesisPolar",Ls),i.component("NemesisCardColumn",Rs),i.component("NemesisCardPizza",Bs),i.component("NemesisCardLines",zs),i.component("NemesisCardColumnDual",Is)}};it.CardColumn=Rs,it.CardColumnDual=Is,it.CardLines=zs,it.CardPizza=Bs,it.Cards=Ci,it.Polar=Ls,it.default=oh,Object.defineProperties(it,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));