nemesischart 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nemesischart.es.js +1611 -1428
- package/dist/nemesischart.umd.js +2 -2
- package/package.json +1 -1
package/dist/nemesischart.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(ot,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],x):(ot=typeof globalThis<"u"?globalThis:ot||self,x(ot.NemesisChart={},ot.Vue))})(this,(function(ot,x){"use strict";const tn=(i,t)=>{const e=i.__vccOpts||i;for(const[s,n]of t)e[s]=n;return e},en={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},ci=tn({__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=x.computed(()=>s[e.cor]??"bg-white"),r=()=>{n("click")};return(a,l)=>(x.openBlock(),x.createElementBlock("div",{class:x.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},[x.createElementVNode("p",{class:x.normalizeClass(["m-0 text-xs font-medium",o.value==="bg-black"?"text-white":"text-gray-900"])},x.toDisplayString(i.titulo),3),x.createElementVNode("div",null,[x.createElementVNode("h2",{class:x.normalizeClass(["m-0 text-3xl font-semibold",o.value==="bg-black"?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},x.toDisplayString(i.valor),3),x.createElementVNode("p",en,x.toDisplayString(i.descricao),1)]),i.botao_todos?(x.openBlock(),x.createElementBlock("button",{key:0,class:x.normalizeClass(["nc-btn-todos text-xs",o.value==="bg-black"?"text-white":"text-gray-900"])},[...l[0]||(l[0]=[x.createTextVNode(" Ver Todos ",-1),x.createElementVNode("i",{class:"pi pi-angle-right text-xs"},null,-1)])],2)):x.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-c2f86ac2"]]);function It(i){return i+.5|0}const ht=(i,t,e)=>Math.max(Math.min(i,e),t);function Ft(i){return ht(It(i*2.55),0,255)}function dt(i){return ht(It(i*255),0,255)}function rt(i){return ht(It(i/2.55)/100,0,1)}function hi(i){return ht(It(i*100),0,100)}const J={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},Te=[..."0123456789ABCDEF"],sn=i=>Te[i&15],nn=i=>Te[(i&240)>>4]+Te[i&15],ie=i=>(i&240)>>4===(i&15),on=i=>ie(i.r)&&ie(i.g)&&ie(i.b)&&ie(i.a);function rn(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&J[i[1]]*17,g:255&J[i[2]]*17,b:255&J[i[3]]*17,a:t===5?J[i[4]]*17:255}:(t===7||t===9)&&(e={r:J[i[1]]<<4|J[i[2]],g:J[i[3]]<<4|J[i[4]],b:J[i[5]]<<4|J[i[6]],a:t===9?J[i[7]]<<4|J[i[8]]:255})),e}const an=(i,t)=>i<255?t(i):"";function ln(i){var t=on(i)?sn:nn;return i?"#"+t(i.r)+t(i.g)+t(i.b)+an(i.a,t):void 0}const cn=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function di(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 hn(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 dn(i,t,e){const s=di(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 fn(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 Le(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=fn(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function Re(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(dt)}function Ee(i,t,e){return Re(di,i,t,e)}function un(i,t,e){return Re(dn,i,t,e)}function gn(i,t,e){return Re(hn,i,t,e)}function fi(i){return(i%360+360)%360}function pn(i){const t=cn.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Ft(+t[5]):dt(+t[5]));const n=fi(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=un(n,o,r):t[1]==="hsv"?s=gn(n,o,r):s=Ee(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function mn(i,t){var e=Le(i);e[0]=fi(e[0]+t),e=Ee(e),i.r=e[0],i.g=e[1],i.b=e[2]}function bn(i){if(!i)return;const t=Le(i),e=t[0],s=hi(t[1]),n=hi(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${rt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const ui={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"},gi={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 xn(){const i={},t=Object.keys(gi),e=Object.keys(ui);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,ui[o]);o=parseInt(gi[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let se;function _n(i){se||(se=xn(),se.transparent=[0,0,0,0]);const t=se[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const yn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function wn(i){const t=yn.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?Ft(r):ht(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Ft(s):ht(s,0,255)),n=255&(t[4]?Ft(n):ht(n,0,255)),o=255&(t[6]?Ft(o):ht(o,0,255)),{r:s,g:n,b:o,a:e}}}function kn(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${rt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ie=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Pt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function vn(i,t,e){const s=Pt(rt(i.r)),n=Pt(rt(i.g)),o=Pt(rt(i.b));return{r:dt(Ie(s+e*(Pt(rt(t.r))-s))),g:dt(Ie(n+e*(Pt(rt(t.g))-n))),b:dt(Ie(o+e*(Pt(rt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ne(i,t,e){if(i){let s=Le(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Ee(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function pi(i,t){return i&&Object.assign(t||{},i)}function mi(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=dt(i[3]))):(t=pi(i,{r:0,g:0,b:0,a:1}),t.a=dt(t.a)),t}function Sn(i){return i.charAt(0)==="r"?wn(i):pn(i)}class zt{constructor(t){if(t instanceof zt)return t;const e=typeof t;let s;e==="object"?s=mi(t):e==="string"&&(s=rn(t)||_n(t)||Sn(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=pi(this._rgb);return t&&(t.a=rt(t.a)),t}set rgb(t){this._rgb=mi(t)}rgbString(){return this._valid?kn(this._rgb):void 0}hexString(){return this._valid?ln(this._rgb):void 0}hslString(){return this._valid?bn(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=vn(this._rgb,t._rgb,e)),this}clone(){return new zt(this.rgb)}alpha(t){return this._rgb.a=dt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=It(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 ne(this._rgb,2,t),this}darken(t){return ne(this._rgb,2,-t),this}saturate(t){return ne(this._rgb,1,t),this}desaturate(t){return ne(this._rgb,1,-t),this}rotate(t){return mn(this._rgb,t),this}}function at(){}const Mn=(()=>{let i=0;return()=>i++})();function z(i){return i==null}function N(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function T(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function tt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function it(i,t){return tt(i)?i:t}function L(i,t){return typeof i>"u"?t:i}const Cn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function I(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function R(i,t,e,s){let n,o,r;if(N(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(T(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function oe(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 re(i){if(N(i))return i.map(re);if(T(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=re(i[e[n]]);return t}return i}function bi(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function An(i,t,e,s){if(!bi(i))return;const n=t[i],o=e[i];T(n)&&T(o)?Bt(n,o,s):t[i]=re(o)}function Bt(i,t,e){const s=N(t)?t:[t],n=s.length;if(!T(i))return i;e=e||{};const o=e.merger||An;let r;for(let a=0;a<n;++a){if(r=s[a],!T(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function Ht(i,t){return Bt(i,t,{merger:Pn})}function Pn(i,t,e){if(!bi(i))return;const s=t[i],n=e[i];T(s)&&T(n)?Ht(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=re(n))}const xi={"":i=>i,x:i=>i.x,y:i=>i.y};function On(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 Dn(i){const t=On(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Nt(i,t){return(xi[t]||(xi[t]=Dn(t)))(i)}function Fe(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ae=i=>typeof i<"u",ft=i=>typeof i=="function",_i=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Tn(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const F=Math.PI,$=2*F,le=Number.POSITIVE_INFINITY,Ln=F/180,V=F/2,xt=F/4,yi=F*2/3,wi=Math.log10,ce=Math.sign;function he(i,t,e){return Math.abs(i-t)<e}function ki(i){const t=Math.round(i);i=he(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(wi(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Rn(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 En(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function de(i){return!En(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function In(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Fn(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 ut(i){return i*(F/180)}function ze(i){return i*(180/F)}function vi(i){if(!tt(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Si(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*F&&(o+=$),{angle:o,distance:n}}function zn(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function G(i){return(i%$+$)%$}function Mi(i,t,e,s){const n=G(i),o=G(t),r=G(e),a=G(o-n),l=G(r-n),c=G(n-o),h=G(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function et(i,t,e){return Math.max(t,Math.min(e,i))}function Bn(i){return et(i,-32768,32767)}function Wt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Be(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 He=(i,t,e,s)=>Be(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),Hn=(i,t,e)=>Be(i,e,s=>i[s][t]>=e);function Nn(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 Ci=["push","pop","shift","splice","unshift"];function Wn(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Ci.forEach(e=>{const s="_onData"+Fe(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 Ai(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)&&(Ci.forEach(o=>{delete i[o]}),delete i._chartjs)}function Vn(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Pi=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Oi(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Pi.call(window,()=>{s=!1,i.apply(t,e)}))}}function jn(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Di=i=>i==="start"?"left":i==="end"?"right":"center",Z=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,$n=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t,fe=i=>i===0||i===1,Ti=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*$/e)),Li=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*$/e)+1,Vt={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*V)+1,easeOutSine:i=>Math.sin(i*V),easeInOutSine:i=>-.5*(Math.cos(F*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=>fe(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=>fe(i)?i:Ti(i,.075,.3),easeOutElastic:i=>fe(i)?i:Li(i,.075,.3),easeInOutElastic(i){return fe(i)?i:i<.5?.5*Ti(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-Vt.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?Vt.easeInBounce(i*2)*.5:Vt.easeOutBounce(i*2-1)*.5+.5};function Ri(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ei(i){return Ri(i)?i:new zt(i)}function Ne(i){return Ri(i)?i:new zt(i).saturate(.5).darken(.1).hexString()}const Yn=["x","y","borderWidth","radius","tension"],Un=["color","borderColor","backgroundColor"];function Xn(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:Un},numbers:{type:"number",properties:Yn}}),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 Kn(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ii=new Map;function qn(i,t){t=t||{};const e=i+JSON.stringify(t);let s=Ii.get(e);return s||(s=new Intl.NumberFormat(i,t),Ii.set(e,s)),s}function We(i,t,e){return qn(t,e).format(i)}const Gn={values(i){return N(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=Zn(i,e)}const r=wi(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),We(i,s,l)}};function Zn(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 Fi={formatters:Gn};function Qn(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:Fi.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 _t=Object.create(null),Ve=Object.create(null);function jt(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 je(i,t,e){return typeof t=="string"?Bt(jt(i,t),e):Bt(jt(i,""),t)}class Jn{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)=>Ne(n.backgroundColor),this.hoverBorderColor=(s,n)=>Ne(n.borderColor),this.hoverColor=(s,n)=>Ne(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 je(this,t,e)}get(t){return jt(this,t)}describe(t,e){return je(Ve,t,e)}override(t,e){return je(_t,t,e)}route(t,e,s,n){const o=jt(this,t),r=jt(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return T(l)?Object.assign({},c,l):L(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var H=new Jn({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Xn,Kn,Qn]);function to(i){return!i||z(i.size)||z(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ue(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 eo(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&&!N(d))r=ue(i,n,o,r,d);else if(N(d))for(c=0,h=d.length;c<h;c++)f=d[c],f!=null&&!N(f)&&(r=ue(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 yt(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 zi(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Bi(i,t,e,s){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,p=t.rotation,m=t.radius;let g=(p||0)*Ln;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(g),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,$):i.arc(e,s,m,0,$),i.closePath();break;case"triangle":h=n?n/2:m,i.moveTo(e+Math.sin(g)*h,s-Math.cos(g)*m),g+=yi,i.lineTo(e+Math.sin(g)*h,s-Math.cos(g)*m),g+=yi,i.lineTo(e+Math.sin(g)*h,s-Math.cos(g)*m),i.closePath();break;case"rectRounded":c=m*.516,l=m-c,r=Math.cos(g+xt)*l,d=Math.cos(g+xt)*(n?n/2-c:l),a=Math.sin(g+xt)*l,f=Math.sin(g+xt)*(n?n/2-c:l),i.arc(e-d,s-a,c,g-F,g-V),i.arc(e+f,s-r,c,g-V,g),i.arc(e+d,s+a,c,g,g+V),i.arc(e-f,s+r,c,g+V,g+F),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}g+=xt;case"rectRot":d=Math.cos(g)*(n?n/2:m),r=Math.cos(g)*m,a=Math.sin(g)*m,f=Math.sin(g)*(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":g+=xt;case"cross":d=Math.cos(g)*(n?n/2:m),r=Math.cos(g)*m,a=Math.sin(g)*m,f=Math.sin(g)*(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(g)*(n?n/2:m),r=Math.cos(g)*m,a=Math.sin(g)*m,f=Math.sin(g)*(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),g+=xt,d=Math.cos(g)*(n?n/2:m),r=Math.cos(g)*m,a=Math.sin(g)*m,f=Math.sin(g)*(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(g)*m,a=Math.sin(g)*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(g)*(n?n/2:m),s+Math.sin(g)*m);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Ot(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 Ye(i){i.restore()}function io(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 so(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 no(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Dt(i,t,e,s,n,o={}){const r=N(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,io(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&no(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),z(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),so(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function ge(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*F,F,!0),i.lineTo(e,s+o-r.bottomLeft),i.arc(e+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,F,V,!0),i.lineTo(e+n-r.bottomRight,s+o),i.arc(e+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,V,0,!0),i.lineTo(e+n,s+r.topRight),i.arc(e+n-r.topRight,s+r.topRight,r.topRight,0,-V,!0),i.lineTo(e+r.topLeft,s)}const oo=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ro=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ao(i,t){const e=(""+i).match(oo);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 lo=i=>+i||0;function Ue(i,t){const e={},s=T(t),n=s?Object.keys(t):t,o=T(i)?s?r=>L(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=lo(o(r));return e}function co(i){return Ue(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Tt(i){return Ue(i,["topLeft","topRight","bottomLeft","bottomRight"])}function U(i){const t=co(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Y(i,t){i=i||{},t=t||H.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(ro)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:L(i.family,t.family),lineHeight:ao(L(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:L(i.weight,t.weight),string:""};return n.string=to(n),n}function pe(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 ho(i,t,e){const{min:s,max:n}=i,o=Cn(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 wt(i,t){return Object.assign(Object.create(i),t)}function Xe(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=$i("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>Xe([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 Wi(a,l,()=>_o(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Yi(a).includes(l)},ownKeys(a){return Yi(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function Lt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ni(i,s),setContext:o=>Lt(i,o,e,s),override:o=>Lt(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 Wi(o,r,()=>uo(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 Ni(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:ft(e)?e:()=>e,isIndexable:ft(s)?s:()=>s}}const fo=(i,t)=>i?i+Fe(t):t,Ke=(i,t)=>T(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Wi(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function uo(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return ft(a)&&r.isScriptable(t)&&(a=go(t,a,i,e)),N(a)&&a.length&&(a=po(t,a,i,r.isIndexable)),Ke(t,a)&&(a=Lt(a,n,o&&o[t],r)),a}function go(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),Ke(i,l)&&(l=qe(n._scopes,n,i,l)),l}function po(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(T(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=qe(c,n,i,h);t.push(Lt(d,o,r&&r[i],a))}}return t}function Vi(i,t,e){return ft(i)?i(t,e):i}const mo=(i,t)=>i===!0?t:typeof i=="string"?Nt(t,i):void 0;function bo(i,t,e,s,n){for(const o of t){const r=mo(e,o);if(r){i.add(r);const a=Vi(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=Vi(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=ji(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=ji(a,r,o,l,s),l===null)?!1:Xe(Array.from(a),[""],n,o,()=>xo(t,e,s))}function ji(i,t,e,s,n){for(;e;)e=bo(i,t,e,s,n);return e}function xo(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return N(n)&&T(e)?e:n||{}}function _o(i,t,e,s){let n;for(const o of t)if(n=$i(fo(o,i),e),typeof n<"u")return Ke(i,n)?qe(e,s,i,n):n}function $i(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Yi(i){let t=i._keys;return t||(t=i._keys=yo(i._scopes)),t}function yo(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 wo(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(Nt(h,o),c)};return r}function Ge(){return typeof window<"u"&&typeof document<"u"}function Ze(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function me(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 be=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function ko(i,t){return be(i).getPropertyValue(t)}const vo=["top","right","bottom","left"];function kt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=vo[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const So=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Mo(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(So(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=be(e),o=n.boxSizing==="border-box",r=kt(n,"padding"),a=kt(n,"border","width"),{x:l,y:c,box:h}=Mo(i,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:u,height:p}=t;return o&&(u-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/u*e.width/s),y:Math.round((c-f)/p*e.height/s)}}function Co(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&Ze(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=be(o),l=kt(a,"border","width"),c=kt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=me(a.maxWidth,o,"clientWidth"),n=me(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||le,maxHeight:n||le}}const gt=i=>Math.round(i*10)/10;function Ao(i,t,e,s){const n=be(i),o=kt(n,"margin"),r=me(n.maxWidth,i,"clientWidth")||le,a=me(n.maxHeight,i,"clientHeight")||le,l=Co(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const f=kt(n,"border","width"),u=kt(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=gt(Math.min(c,r,l.maxWidth)),h=gt(Math.min(h,a,l.maxHeight)),c&&!h&&(h=gt(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=gt(Math.floor(h*s))),{width:c,height:h}}function Ui(i,t,e){const s=t||1,n=gt(i.height*s),o=gt(i.width*s);i.height=gt(i.height),i.width=gt(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 Po=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Ge()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function Xi(i,t){const e=ko(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const Oo=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}}},Do=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Rt(i,t,e){return i?Oo(t,e):Do()}function Ki(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 xe(i,t,e){return i.options.clip?i[e]:t[e]}function To(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:xe(e,t,"left"),right:xe(e,t,"right"),top:xe(s,t,"top"),bottom:xe(s,t,"bottom")}:t}function Lo(i,t){const e=t._clip;if(e.disabled)return!1;const s=To(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 Ro{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=Pi.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 lt=new Ro;const Gi="transparent",Eo={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Ei(i||Gi),n=s.valid&&Ei(t||Gi);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Io{constructor(t,e,s,n){const o=e[s];n=pe([t.to,n,o,t.from]);const r=pe([t.from,o,n]);this._active=!0,this._fn=t.fn||Eo[t.type||typeof r],this._easing=Vt[t.easing]||Vt.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=pe([t.to,e,n,t.from]),this._from=pe([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 Zi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!T(t))return;const e=Object.keys(H.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!T(o))return;const r={};for(const a of e)r[a]=o[a];(N(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=zo(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Fo(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 Io(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 lt.add(this._chart,s),!0}}function Fo(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 zo(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 Qi(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 Bo(i,t,e){if(e===!1)return!1;const s=Qi(i,e),n=Qi(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function Ho(i){let t,e,s,n;return T(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function Ji(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 ts(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],tt(c)&&(o||t===0||ce(t)===ce(c))&&(t+=c)}return!h&&!s.all?0:t}function No(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 Qe(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Wo(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Vo(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 jo(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function es(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 is(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=Wo(o,r,s),d=t.length;let f;for(let u=0;u<d;++u){const p=t[u],{[l]:m,[c]:g}=p,b=p._stacks||(p._stacks={});f=b[c]=jo(n,h,m),f[a]=g,f._top=es(f,r,!0,s.type),f._bottom=es(f,r,!1,s.type);const _=f._visualValues||(f._visualValues={});_[a]=g}}function Je(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function $o(i,t){return wt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Yo(i,t,e){return wt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function $t(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 ti=i=>i==="reset"||i==="none",ss=(i,t)=>t?i:Object.assign({},i),Uo=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Ji(e,!0),values:null};class ns{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=Qe(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&&$t(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,f,u,p)=>d==="x"?f:d==="r"?p:u,o=e.xAxisID=L(s.xAxisID,Je(t,"x")),r=e.yAxisID=L(s.yAxisID,Je(t,"y")),a=e.rAxisID=L(s.rAxisID,Je(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&&Ai(this._data,this),t._stacked&&$t(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(T(e)){const n=this._cachedMeta;this._data=No(e,n)}else if(s!==e){if(s){Ai(s,this);const n=this._cachedMeta;$t(n),n._parsed=[]}e&&Object.isExtensible(e)&&Wn(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=Qe(e.vScale,e),e.stack!==s.stack&&(n=!0,$t(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(is(this,e._parsed),e._stacked=Qe(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(n[t])?f=this.parseArrayData(s,n,t,e):T(n[t])?f=this.parseObjectData(s,n,t,e):f=this.parsePrimitiveData(s,n,t,e);const u=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)s._parsed[h+t]=d=f[h],l&&(u()&&(l=!1),c=d);s._sorted=l}r&&is(this,f)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let f,u,p;for(f=0,u=n;f<u;++f)p=f+s,d[f]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,f,u;for(h=0,d=n;h<d;++h)f=h+s,u=e[f],c[h]={x:o.parse(Nt(u,a),f),y:r.parse(Nt(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:Ji(n,!0),values:e._stacks[t.axis]._visualValues};return ts(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=ts(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=Uo(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=Vo(a);let f,u;function p(){u=n[f];const m=u[a.axis];return!tt(u[t.axis])||h>m||d<m}for(f=0;f<r&&!(!p()&&(this.updateRangeFromParsed(c,t,u,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],tt(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=Ho(L(this.options.clip,Bo(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=Yo(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=$o(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&&ae(s);if(a)return ss(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(H.elements[t]),p=()=>this.getContext(s,n,e),m=c.resolveNamedOptions(f,u,p,d);return m.$shared&&(m.$shared=l,o[r]=Object.freeze(ss(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 Zi(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||ti(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){ti(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!ti(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&&$t(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])}}class Xo extends ns{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=We(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return wo.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*F;let u=f,p;const m=360/this.countVisibleElements();for(p=0;p<e;++p)u+=this._computeAngle(p,n,m);for(p=e;p<e+s;p++){const g=t[p];let b=u,_=u+this._computeAngle(p,n,m),w=r.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;u=_,o&&(l.animateScale&&(w=0),l.animateRotate&&(b=_=f));const k={x:h,y:d,innerRadius:0,outerRadius:w,startAngle:b,endAngle:_,options:this.resolveDataElementOptions(p,g.active?"active":n)};this.updateElement(g,p,k,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)?ut(this.resolveDataElementOptions(t,e).angle||s):0}}function St(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ei{static override(t){Object.assign(ei.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return St()}parse(){return St()}format(){return St()}add(){return St()}diff(){return St()}startOf(){return St()}endOf(){return St()}}var Ko={_date:ei};function qo(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?Hn:He;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=>!z(m[d.axis]));h.lo-=Math.max(0,u);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 _e(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}=qo(o[a],t,r,n);for(let u=d;u<=f;++u){const p=h[u];p.skip||s(p,c,u)}}}function Go(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 ii(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||_e(i,e,t,function(a,l,c){!n&&!Ot(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Zo(i,t,e,s){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=Si(r,{x:t.x,y:t.y});Mi(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return _e(i,e,t,o),n}function Qo(i,t,e,s,n,o){let r=[];const a=Go(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const u=h.inRange(t.x,t.y,n);if(s&&!u)return;const p=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(p))&&!u)return;const g=a(t,p);g<l?(r=[{element:h,datasetIndex:d,index:f}],l=g):g===l&&r.push({element:h,datasetIndex:d,index:f})}return _e(i,e,t,c),r}function si(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?Zo(i,t,e,n):Qo(i,t,e,s,n,o)}function os(i,t,e,s,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return _e(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 Jo={modes:{index(i,t,e,s){const n=vt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?ii(i,n,o,s,r):si(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?ii(i,n,o,s,r):si(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 ii(i,n,o,s,r)},nearest(i,t,e,s){const n=vt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return si(i,n,o,e.intersect,s,r)},x(i,t,e,s){const n=vt(t,i);return os(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=vt(t,i);return os(i,n,"y",e.intersect,s)}}};const rs=["left","top","right","bottom"];function Yt(i,t){return i.filter(e=>e.pos===t)}function as(i,t){return i.filter(e=>rs.indexOf(e.pos)===-1&&e.box.axis===t)}function Ut(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 tr(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 er(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!rs.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 ir(i,t){const e=er(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 sr(i){const t=tr(i),e=Ut(t.filter(c=>c.box.fullSize),!0),s=Ut(Yt(t,"left"),!0),n=Ut(Yt(t,"right")),o=Ut(Yt(t,"top"),!0),r=Ut(Yt(t,"bottom")),a=as(t,"x"),l=as(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:Yt(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function ls(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function cs(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 nr(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!T(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&cs(r,o.getPadding());const a=Math.max(0,t.outerWidth-ls(r,i,"left","right")),l=Math.max(0,t.outerHeight-ls(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 or(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 rr(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 Xt(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,rr(a.horizontal,t));const{same:d,other:f}=nr(t,e,a,s);c|=d&&n.length,h=h||f,l.fullSize||n.push(a)}return c&&Xt(n,t,e,s)||h}function ye(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 hs(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;ae(c.start)&&(r=c.start),l.fullSize?ye(l,n.left,r,e.outerWidth-n.right-n.left,f):ye(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;ae(c.start)&&(o=c.start),l.fullSize?ye(l,o,n.top,f,e.outerHeight-n.bottom-n.top):ye(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var pt={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=U(i.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=sr(i.boxes),l=a.vertical,c=a.horizontal;R(i.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,g)=>g.box.options&&g.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);cs(f,U(s));const u=Object.assign({maxPadding:f,w:o,h:r,x:n.left,y:n.top},n),p=ir(l.concat(c),d);Xt(a.fullSize,u,d,p),Xt(l,u,d,p),Xt(c,u,d,p)&&Xt(l,u,d,p),or(u),hs(a.leftAndTop,u,d,p),u.x+=u.w,u.y+=u.h,hs(a.rightAndBottom,u,d,p),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},R(a.chartArea,m=>{const g=m.box;Object.assign(g,i.chartArea),g.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class ds{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 ar extends ds{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const we="$chartjs",lr={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},fs=i=>i===null||i==="";function cr(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[we]={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",fs(n)){const o=Xi(i,"width");o!==void 0&&(i.width=o)}if(fs(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Xi(i,"height");o!==void 0&&(i.height=o)}return i}const us=Po?{passive:!0}:!1;function hr(i,t,e){i&&i.addEventListener(t,e,us)}function dr(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,us)}function fr(i,t){const e=lr[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 ke(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function ur(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ke(a.addedNodes,s),r=r&&!ke(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function gr(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ke(a.removedNodes,s),r=r&&!ke(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Kt=new Map;let gs=0;function ps(){const i=window.devicePixelRatio;i!==gs&&(gs=i,Kt.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function pr(i,t){Kt.size||window.addEventListener("resize",ps),Kt.set(i,t)}function mr(i){Kt.delete(i),Kt.size||window.removeEventListener("resize",ps)}function br(i,t,e){const s=i.canvas,n=s&&Ze(s);if(!n)return;const o=Oi((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),pr(i,o),r}function ni(i,t,e){e&&e.disconnect(),t==="resize"&&mr(i)}function xr(i,t,e){const s=i.canvas,n=Oi(o=>{i.ctx!==null&&e(fr(o,i))},i);return hr(s,t,n),n}class _r extends ds{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(cr(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[we])return!1;const s=e[we].initial;["height","width"].forEach(o=>{const r=s[o];z(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[we],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:ur,detach:gr,resize:br}[e]||xr;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ni,detach:ni,resize:ni}[e]||dr)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Ao(t,e,s,n)}isAttached(t){const e=t&&Ze(t);return!!(e&&e.isConnected)}}function yr(i){return!Ge()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?ar:_r}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 de(this.x)&&de(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 wr(i,t){const e=i.options.ticks,s=kr(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Sr(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Mr(t,c,o,r/n),c;const h=vr(o,t,n);if(r>0){let d,f;const u=r>1?Math.round((l-a)/(r-1)):null;for(ve(t,c,h,z(u)?0:a-u,a),d=0,f=r-1;d<f;d++)ve(t,c,h,o[d],o[d+1]);return ve(t,c,h,l,z(u)?t.length:l+u),c}return ve(t,c,h),c}function kr(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 vr(i,t,e){const s=Cr(i),n=t.length/e;if(!s)return Math.max(n,1);const o=Rn(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 Sr(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function Mr(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 ve(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 Cr(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 Ar=i=>i==="left"?"right":i==="right"?"left":i,ms=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,bs=(i,t)=>Math.min(t||i,i);function xs(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 Pr(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 Or(i,t){R(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 Gt(i){return i.drawTicks?i.tickLength:0}function _s(i,t){if(!i.display)return 0;const e=Y(i.font,t),s=U(i.padding);return(N(i.text)?i.text.length:1)*e.lineHeight+s.height}function Dr(i,t){return wt(i,{scale:t,type:"scale"})}function Tr(i,t,e){return wt(i,{tick:e,index:t,type:"tick"})}function Lr(i,t,e){let s=Di(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Ar(s)),s}function Rr(i,t,e,s){const{top:n,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,u,p;const m=r-n,g=a-o;if(i.isHorizontal()){if(u=Z(s,o,a),T(e)){const b=Object.keys(e)[0],_=e[b];p=h[b].getPixelForValue(_)+m-t}else e==="center"?p=(c.bottom+c.top)/2+m-t:p=ms(i,e,t);f=a-o}else{if(T(e)){const b=Object.keys(e)[0],_=e[b];u=h[b].getPixelForValue(_)-g+t}else e==="center"?u=(c.left+c.right)/2-g+t:u=ms(i,e,t);p=Z(s,r,n),d=e==="left"?-V:V}return{titleX:u,titleY:p,maxWidth:f,rotation:d}}class Zt 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=it(t,Number.POSITIVE_INFINITY),e=it(e,Number.NEGATIVE_INFINITY),s=it(s,Number.POSITIVE_INFINITY),n=it(n,Number.NEGATIVE_INFINITY),{min:it(t,s),max:it(e,n),minDefined:tt(t),maxDefined:tt(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:it(e,it(s,e)),max:it(s,it(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(){I(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=ho(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?xs(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=wr(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(){I(this.options.afterUpdate,[this])}beforeSetDimensions(){I(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(){I(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),I(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){I(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=I(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){I(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){I(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=bs(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=et(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-Gt(t.grid)-e.padding-_s(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=ze(Math.min(Math.asin(et((h.highest.height+6)/a,-1,1)),Math.asin(et(l/c,-1,1))-Math.asin(et(f/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(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=_s(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Gt(o)+l):(t.height=this.maxHeight,t.width=Gt(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=s.padding*2,p=ut(this.labelRotation),m=Math.cos(p),g=Math.sin(p);if(a){const b=s.mirror?0:g*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+b+u)}else{const b=s.mirror?0:m*d.width+g*f.height;t.width=Math.min(this.maxWidth,t.width+b+u)}this._calculatePadding(c,h,g,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(){I(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++)z(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=xs(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/bs(e,s));let c=0,h=0,d,f,u,p,m,g,b,_,w,k,y;for(d=0;d<e;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),n.font=g=m.string,b=o[g]=o[g]||{data:{},gc:[]},_=m.lineHeight,w=k=0,!z(p)&&!N(p))w=ue(n,b.data,b.gc,w,p),k=_;else if(N(p))for(f=0,u=p.length;f<u;++f)y=p[f],!z(y)&&!N(y)&&(w=ue(n,b.data,b.gc,w,y),k+=_);r.push(w),a.push(k),c=Math.max(w,c),h=Math.max(k,h)}Or(o,e);const v=r.indexOf(c),S=a.indexOf(h),M=C=>({width:r[C]||0,height:a[C]||0});return{first:M(0),last:M(e-1),widest:M(v),highest:M(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 Bn(this._alignToPixels?yt(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=Tr(this.getContext(),t,s))}return this.$context||(this.$context=Dr(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ut(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=Gt(o),u=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,g=m/2,b=function(E){return yt(s,E,m)};let _,w,k,y,v,S,M,C,P,A,D,j;if(r==="top")_=b(this.bottom),S=this.bottom-f,C=_-g,A=b(t.top)+g,j=t.bottom;else if(r==="bottom")_=b(this.top),A=t.top,j=b(t.bottom)-g,S=_+g,C=this.top+f;else if(r==="left")_=b(this.right),v=this.right-f,M=_-g,P=b(t.left)+g,D=t.right;else if(r==="right")_=b(this.left),P=t.left,D=b(t.right)-g,v=_+g,M=this.left+f;else if(e==="x"){if(r==="center")_=b((t.top+t.bottom)/2+.5);else if(T(r)){const E=Object.keys(r)[0],B=r[E];_=b(this.chart.scales[E].getPixelForValue(B))}A=t.top,j=t.bottom,S=_+g,C=S+f}else if(e==="y"){if(r==="center")_=b((t.left+t.right)/2);else if(T(r)){const E=Object.keys(r)[0],B=r[E];_=b(this.chart.scales[E].getPixelForValue(B))}v=_-g,M=v-f,P=t.left,D=t.right}const X=L(n.ticks.maxTicksLimit,d),O=Math.max(1,Math.ceil(d/X));for(w=0;w<d;w+=O){const E=this.getContext(w),B=o.setContext(E),Q=a.setContext(E),W=B.lineWidth,mt=B.color,Mt=Q.dash||[],bt=Q.dashOffset,te=B.tickWidth,Ct=B.tickColor,ee=B.tickBorderDash||[],At=B.tickBorderDashOffset;k=Pr(this,w,l),k!==void 0&&(y=yt(s,k,W),c?v=M=P=D=y:S=C=A=j=y,u.push({tx1:v,ty1:S,tx2:M,ty2:C,x1:P,y1:A,x2:D,y2:j,width:W,color:mt,borderDash:Mt,borderDashOffset:bt,tickWidth:te,tickColor:Ct,tickBorderDash:ee,tickBorderDashOffset:At}))}return this._ticksLength=d,this._borderValue=_,u}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=Gt(s.grid),u=f+h,p=d?-h:u,m=-ut(this.labelRotation),g=[];let b,_,w,k,y,v,S,M,C,P,A,D,j="middle";if(n==="top")v=this.bottom-p,S=this._getXAxisLabelAlignment();else if(n==="bottom")v=this.top+p,S=this._getXAxisLabelAlignment();else if(n==="left"){const O=this._getYAxisLabelAlignment(f);S=O.textAlign,y=O.x}else if(n==="right"){const O=this._getYAxisLabelAlignment(f);S=O.textAlign,y=O.x}else if(e==="x"){if(n==="center")v=(t.top+t.bottom)/2+u;else if(T(n)){const O=Object.keys(n)[0],E=n[O];v=this.chart.scales[O].getPixelForValue(E)+u}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")y=(t.left+t.right)/2-u;else if(T(n)){const O=Object.keys(n)[0],E=n[O];y=this.chart.scales[O].getPixelForValue(E)}S=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?j="top":l==="end"&&(j="bottom"));const X=this._getLabelSizes();for(b=0,_=a.length;b<_;++b){w=a[b],k=w.label;const O=o.setContext(this.getContext(b));M=this.getPixelForTick(b)+o.labelOffset,C=this._resolveTickFontOptions(b),P=C.lineHeight,A=N(k)?k.length:1;const E=A/2,B=O.color,Q=O.textStrokeColor,W=O.textStrokeWidth;let mt=S;r?(y=M,S==="inner"&&(b===_-1?mt=this.options.reverse?"left":"right":b===0?mt=this.options.reverse?"right":"left":mt="center"),n==="top"?c==="near"||m!==0?D=-A*P+P/2:c==="center"?D=-X.highest.height/2-E*P+P:D=-X.highest.height+P/2:c==="near"||m!==0?D=P/2:c==="center"?D=X.highest.height/2-E*P:D=X.highest.height-A*P,d&&(D*=-1),m!==0&&!O.showLabelBackdrop&&(y+=P/2*Math.sin(m))):(v=M,D=(1-A)*P/2);let Mt;if(O.showLabelBackdrop){const bt=U(O.backdropPadding),te=X.heights[b],Ct=X.widths[b];let ee=D-bt.top,At=0-bt.left;switch(j){case"middle":ee-=te/2;break;case"bottom":ee-=te;break}switch(S){case"center":At-=Ct/2;break;case"right":At-=Ct;break;case"inner":b===_-1?At-=Ct:b>0&&(At-=Ct/2);break}Mt={left:At,top:ee,width:Ct+bt.width,height:te+bt.height,color:O.backdropColor}}g.push({label:k,font:C,textOffset:D,options:{rotation:m,color:B,strokeColor:Q,strokeWidth:W,textAlign:mt,textBaseline:j,translation:[y,v],backdrop:Mt}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ut(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=yt(t,this.left,r)-r/2,h=yt(t,this.right,a)+a/2,d=f=l):(d=yt(t,this.top,r)-r/2,f=yt(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&&$e(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;Dt(s,c,0,h,l,a)}n&&Ye(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=Y(s.font),r=U(s.padding),a=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||T(e)?(l+=r.bottom,N(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=Rr(this,l,e,a);Dt(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:f,textAlign:Lr(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!==Zt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Y(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Se{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;Fr(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,Er(t,r,s),this.override&&H.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 H[n]&&(delete H[n][s],this.override&&delete _t[s])}}function Er(i,t,e){const s=Bt(Object.create(null),[e?H.get(e):{},H.get(t),i.defaults]);H.set(t,s),i.defaultRoutes&&Ir(t,i.defaultRoutes),i.descriptors&&H.describe(t,i.descriptors)}function Ir(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(".");H.route(o,n,l,a)})}function Fr(i){return"id"in i&&"defaults"in i}class zr{constructor(){this.controllers=new Se(ns,"datasets",!0),this.elements=new Se(qt,"elements"),this.plugins=new Se(Object,"plugins"),this.scales=new Se(Zt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):R(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=Fe(t);I(s["before"+n],[],s),e[t](s),I(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 st=new zr;class Br{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(I(a,l,r)===!1&&n.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 s=t&&t.config,n=L(s.options&&s.options.plugins,{}),o=Hr(s);return n===!1&&!e?[]:Wr(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 Hr(i){const t={},e=[],s=Object.keys(st.plugins.items);for(let o=0;o<s.length;o++)e.push(st.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 Nr(i,t){return!t&&i===!1?null:i===!0?{}:i}function Wr(i,{plugins:t,localIds:e},s,n){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Nr(s[l],n);c!==null&&o.push({plugin:a,options:Vr(i.config,{plugin:a,local:e[l]},c,r)})}return o}function Vr(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 oi(i,t){const e=H.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function jr(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function $r(i,t){return i===t?"_index_":"_value_"}function ys(i){if(i==="x"||i==="y"||i==="r")return i}function Yr(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function ri(i,...t){if(ys(i))return i;for(const e of t){const s=e.axis||Yr(e.position)||i.length>1&&ys(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 Ur(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 Xr(i,t){const e=_t[i.type]||{scales:{}},s=t.scales||{},n=oi(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!T(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=ri(r,a,Ur(r,i),H.scales[a.type]),c=$r(l,n),h=e.scales||{};o[r]=Ht(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||oi(a,t),h=(_t[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=jr(d,l),u=r[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),Ht(o[u],[{axis:f},s[u],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Ht(a,[H.scales[a.type],H.scale])}),o}function ks(i){const t=i.options||(i.options={});t.plugins=L(t.plugins,{}),t.scales=Xr(i,t)}function vs(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Kr(i){return i=i||{},i.data=vs(i.data),ks(i),i}const Ss=new Map,Ms=new Set;function Me(i,t){let e=Ss.get(i);return e||(e=t(),Ss.set(i,e),Ms.add(e)),e}const Qt=(i,t,e)=>{const s=Nt(t,e);s!==void 0&&i.add(s)};class qr{constructor(t){this._config=Kr(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=vs(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(),ks(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Me(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Me(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Me(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return Me(`${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=>Qt(l,t,d))),h.forEach(d=>Qt(l,n,d)),h.forEach(d=>Qt(l,_t[o]||{},d)),h.forEach(d=>Qt(l,H,d)),h.forEach(d=>Qt(l,Ve,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ms.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,_t[e]||{},H.datasets[e]||{},{type:e},H,Ve]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Cs(this._resolverCache,t,n);let l=r;if(Zr(r,e)){o.$shared=!1,s=ft(s)?s():s;const c=this.createResolver(t,s,a);l=Lt(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=Cs(this._resolverCache,t,s);return T(e)?Lt(o,e,void 0,n):o}}function Cs(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:Xe(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const Gr=i=>T(i)&&Object.getOwnPropertyNames(i).some(t=>ft(i[t]));function Zr(i,t){const{isScriptable:e,isIndexable:s}=Ni(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(ft(a)||Gr(a))||r&&N(a))return!0}return!1}var Qr="4.5.1";const Jr=["top","bottom","left","right","chartArea"];function As(i,t){return i==="top"||i==="bottom"||Jr.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"),I(e&&e.onComplete,[i],t)}function ta(i){const t=i.chart,e=t.options.animation;I(e&&e.onProgress,[i],t)}function Ds(i){return Ge()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ce={},Ts=i=>{const t=Ds(i);return Object.values(Ce).filter(e=>e.canvas===t).pop()};function ea(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 ia(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}class ai{static defaults=H;static instances=Ce;static overrides=_t;static registry=st;static version=Qr;static getChart=Ts;static register(...t){st.add(...t),Ls()}static unregister(...t){st.remove(...t),Ls()}constructor(t,e){const s=this.config=new qr(e),n=Ds(t),o=Ts(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||yr(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=Mn(),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 Br,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=jn(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Ce[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}lt.listen(this,"complete",Os),lt.listen(this,"progress",ta),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return z(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 st}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ui(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return zi(this.canvas,this.ctx),this}stop(){return lt.stop(this),this}resize(t,e){lt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){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,Ui(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),I(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};R(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=ri(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),R(o,r=>{const a=r.options,l=a.id,c=ri(l,a),h=L(a.type,r.dtype);(a.position===void 0||As(a.position,c)!==As(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=st.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),R(n,(r,a)=>{r||delete s[a]}),R(s,r=>{pt.configure(this,r,r.options),pt.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||oi(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=st.getController(a),{datasetElementType:c,dataElementType:h}=H.datasets[a];Object.assign(l,{dataElementType:st.getElement(h),datasetElementType:c&&st.getElement(c)}),r.controller=new l(this,s),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){R(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const 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||R(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(){R(this.scales,t=>{pt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!_i(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;ea(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(!_i(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;pt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],R(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,ft(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&&(lt.has(this)?this.attached&&!lt.running(this)&<.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=Lo(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(n&&$e(e,n),t.controller.draw(),n&&Ye(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Ot(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Jo.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=wt(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);ae(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(),lt.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(),zi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ce[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)};R(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(){R(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},R(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,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}});!oe(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=Tn(t),c=ia(t,this._lastEvent,s,l);s&&(this._lastEvent=null,I(o.onHover,[t,a,this],this),l&&I(o.onClick,[t,a,this],this));const h=!oe(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 Ls(){return R(ai.instances,i=>i._plugins.invalidate())}function sa(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,G(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,G(s-e));i.arc(n,o,a+c/2,e-f/2,s+f/2,!0)}else{const f=Math.min(c/2,r*G(s-e));if(h==="round")i.arc(n,o,f,e-F/2,s+F/2,!0);else if(h==="bevel"){const u=2*f*f,p=-u*Math.cos(e+F/2)+n,m=-u*Math.sin(e+F/2)+o,g=u*Math.cos(s+F/2)+n,b=u*Math.sin(s+F/2)+o;i.lineTo(p,m),i.lineTo(g,b)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function na(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+V,s-V),i.closePath(),i.clip()}function oa(i){return Ue(i,["outerStart","outerEnd","innerStart","innerEnd"])}function ra(i,t,e,s){const n=oa(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 et(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:et(n.innerStart,0,r),innerEnd:et(n.innerEnd,0,r)}}function Et(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function Ae(i,t,e,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),f=h>0?h+s+e+c:0;let u=0;const p=n-l;if(s){const O=h>0?h-s:0,E=d>0?d-s:0,B=(O+E)/2,Q=B!==0?p*B/(B+s):p;u=(p-Q)/2}const m=Math.max(.001,p*d-e/F)/d,g=(p-m)/2,b=l+g+u,_=n-g-u,{outerStart:w,outerEnd:k,innerStart:y,innerEnd:v}=ra(t,f,d,_-b),S=d-w,M=d-k,C=b+w/S,P=_-k/M,A=f+y,D=f+v,j=b+y/A,X=_-v/D;if(i.beginPath(),o){const O=(C+P)/2;if(i.arc(r,a,d,C,O),i.arc(r,a,d,O,P),k>0){const W=Et(M,P,r,a);i.arc(W.x,W.y,k,P,_+V)}const E=Et(D,_,r,a);if(i.lineTo(E.x,E.y),v>0){const W=Et(D,X,r,a);i.arc(W.x,W.y,v,_+V,X+Math.PI)}const B=(_-v/f+(b+y/f))/2;if(i.arc(r,a,f,_-v/f,B,!0),i.arc(r,a,f,B,b+y/f,!0),y>0){const W=Et(A,j,r,a);i.arc(W.x,W.y,y,j+Math.PI,b-V)}const Q=Et(S,b,r,a);if(i.lineTo(Q.x,Q.y),w>0){const W=Et(S,C,r,a);i.arc(W.x,W.y,w,b-V,C)}}else{i.moveTo(r,a);const O=Math.cos(C)*d+r,E=Math.sin(C)*d+a;i.lineTo(O,E);const B=Math.cos(P)*d+r,Q=Math.sin(P)*d+a;i.lineTo(B,Q)}i.closePath()}function aa(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Ae(i,t,e,s,l,n);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%$||$))}return Ae(i,t,e,s,l,n),i.fill(),l}function la(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,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){Ae(i,t,e,s,m,n);for(let g=0;g<o;++g)i.stroke();isNaN(a)||(m=r+(a%$||$))}p&&na(i,t,m),l.selfJoin&&m-r>=F&&u===0&&h!=="miter"&&sa(i,t,m),o||(Ae(i,t,e,s,m,n),i.stroke())}class ca 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}=Si(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),p=Mi(o,a,l)&&a!==l,m=u>=$||p,g=Wt(r,c+f,h+f);return m&&g}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>$?Math.floor(s/$):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(F,s||0)),c=n*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,aa(t,this,c,o,r),la(t,this,c,o,r),t.restore()}}const Rs=(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)}},ha=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Es 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=I(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=Y(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Rs(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,u=-h;return this.legendItems.forEach((p,m)=>{const g=s+e/2+o.measureText(p.text).width;(m===0||c[c.length-1]+g+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:g,height:n},c[c.length-1]+=g+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,f=0,u=0,p=0,m=0;return this.legendItems.forEach((g,b)=>{const{itemWidth:_,itemHeight:w}=da(s,e,o,g,n);b>0&&u+w+2*a>h&&(d+=f+a,c.push({width:f,height:u}),p+=f+a,m++,f=u=0),l[b]={left:p,top:u,col:m,width:_,height:w},f=Math.max(f,_),u+=w+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=Rt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Z(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=Z(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=Z(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=Z(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;$e(t,this),this._draw(),Ye(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=H.color,l=Rt(t.rtl,this.left,this.width),c=Y(r.font),{padding:h}=r,d=c.size,f=d/2;let u;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:g}=Rs(r,d),b=function(v,S,M){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;n.save();const C=L(M.lineWidth,1);if(n.fillStyle=L(M.fillStyle,a),n.lineCap=L(M.lineCap,"butt"),n.lineDashOffset=L(M.lineDashOffset,0),n.lineJoin=L(M.lineJoin,"miter"),n.lineWidth=C,n.strokeStyle=L(M.strokeStyle,a),n.setLineDash(L(M.lineDash,[])),r.usePointStyle){const P={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:C},A=l.xPlus(v,p/2),D=S+f;Hi(n,P,A,D,r.pointStyleWidth&&p)}else{const P=S+Math.max((d-m)/2,0),A=l.leftForLtr(v,p),D=Tt(M.borderRadius);n.beginPath(),Object.values(D).some(j=>j!==0)?ge(n,{x:A,y:P,w:p,h:m,radius:D}):n.rect(A,P,p,m),n.fill(),C!==0&&n.stroke()}n.restore()},_=function(v,S,M){Dt(n,M.text,v,S+g/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},w=this.isHorizontal(),k=this._computeTitleHeight();w?u={x:Z(o,this.left+h,this.right-s[0]),y:this.top+h+k,line:0}:u={x:this.left+h,y:Z(o,this.top+k+h,this.bottom-e[0].height),line:0},Ki(this.ctx,t.textDirection);const y=g+h;this.legendItems.forEach((v,S)=>{n.strokeStyle=v.fontColor,n.fillStyle=v.fontColor;const M=n.measureText(v.text).width,C=l.textAlign(v.textAlign||(v.textAlign=r.textAlign)),P=p+f+M;let A=u.x,D=u.y;l.setWidth(this.width),w?S>0&&A+P+h>this.right&&(D=u.y+=y,u.line++,A=u.x=Z(o,this.left+h,this.right-s[u.line])):S>0&&D+y>this.bottom&&(A=u.x=A+e[u.line].width+h,u.line++,D=u.y=Z(o,this.top+k+h,this.bottom-e[u.line].height));const j=l.x(A);if(b(j,D,v),A=$n(C,A+p+f,w?A+P:this.right,t.rtl),_(l.x(A),D,v),w)u.x+=P+h;else if(typeof v.text!="string"){const X=c.lineHeight;u.y+=Is(v,X)+h}else u.y+=y}),qi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=Y(e.font),n=U(e.padding);if(!e.display)return;const o=Rt(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=Z(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,g)=>Math.max(m,g.height),0);h=c+Z(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const u=Z(a,d,d+f);r.textAlign=o.textAlign(Di(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,Dt(r,e.text,u,h,s)}_computeTitleHeight(){const t=this.options.title,e=Y(t.font),s=U(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Wt(t,this.left,this.right)&&Wt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],Wt(t,n.left,n.left+n.width)&&Wt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!ga(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=ha(n,s);n&&!o&&I(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&I(e.onHover,[t,s,this],this)}else s&&I(e.onClick,[t,s,this],this)}}function da(i,t,e,s,n){const o=fa(s,i,t,e),r=ua(n,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function fa(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 ua(i,t,e){let s=i;return typeof t.text!="string"&&(s=Is(t,e)),s}function Is(i,t){const e=i.text?i.text.length:0;return t*e}function ga(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var pa={id:"legend",_element:Es,start(i,t,e){const s=i.legend=new Es({ctx:i.ctx,options:e,chart:i});pt.configure(i,s,e),pt.addBox(i,s)},stop(i){pt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;pt.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=U(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 Jt={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=zn(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 nt(i,t){return t&&(N(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function ct(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
1
|
+
(function(st,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],b):(st=typeof globalThis<"u"?globalThis:st||self,b(st.NemesisChart={},st.Vue))})(this,(function(st,b){"use strict";const en=(i,t)=>{const e=i.__vccOpts||i;for(const[s,n]of t)e[s]=n;return e},sn={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},ci=en({__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=b.computed(()=>s[e.cor]??"bg-white"),r=()=>{n("click")};return(a,l)=>(b.openBlock(),b.createElementBlock("div",{class:b.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},[b.createElementVNode("p",{class:b.normalizeClass(["m-0 text-xs font-medium",o.value==="bg-black"?"text-white":"text-gray-900"])},b.toDisplayString(i.titulo),3),b.createElementVNode("div",null,[b.createElementVNode("h2",{class:b.normalizeClass(["m-0 text-3xl font-semibold",o.value==="bg-black"?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},b.toDisplayString(i.valor),3),b.createElementVNode("p",sn,b.toDisplayString(i.descricao),1)]),i.botao_todos?(b.openBlock(),b.createElementBlock("button",{key:0,class:b.normalizeClass(["nc-btn-todos text-xs",o.value==="bg-black"?"text-white":"text-gray-900"])},[...l[0]||(l[0]=[b.createTextVNode(" Ver Todos ",-1),b.createElementVNode("i",{class:"pi pi-angle-right text-xs"},null,-1)])],2)):b.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-c2f86ac2"]]);function Ft(i){return i+.5|0}const gt=(i,t,e)=>Math.max(Math.min(i,e),t);function zt(i){return gt(Ft(i*2.55),0,255)}function pt(i){return gt(Ft(i*255),0,255)}function ct(i){return gt(Ft(i/2.55)/100,0,1)}function hi(i){return gt(Ft(i*100),0,100)}const J={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},Te=[..."0123456789ABCDEF"],nn=i=>Te[i&15],on=i=>Te[(i&240)>>4]+Te[i&15],ie=i=>(i&240)>>4===(i&15),rn=i=>ie(i.r)&&ie(i.g)&&ie(i.b)&&ie(i.a);function an(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&J[i[1]]*17,g:255&J[i[2]]*17,b:255&J[i[3]]*17,a:t===5?J[i[4]]*17:255}:(t===7||t===9)&&(e={r:J[i[1]]<<4|J[i[2]],g:J[i[3]]<<4|J[i[4]],b:J[i[5]]<<4|J[i[6]],a:t===9?J[i[7]]<<4|J[i[8]]:255})),e}const ln=(i,t)=>i<255?t(i):"";function cn(i){var t=rn(i)?nn:on;return i?"#"+t(i.r)+t(i.g)+t(i.b)+ln(i.a,t):void 0}const hn=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function di(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 dn(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 fn(i,t,e){const s=di(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 un(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 Le(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=un(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function Ee(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(pt)}function Re(i,t,e){return Ee(di,i,t,e)}function gn(i,t,e){return Ee(fn,i,t,e)}function pn(i,t,e){return Ee(dn,i,t,e)}function fi(i){return(i%360+360)%360}function mn(i){const t=hn.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?zt(+t[5]):pt(+t[5]));const n=fi(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=gn(n,o,r):t[1]==="hsv"?s=pn(n,o,r):s=Re(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function bn(i,t){var e=Le(i);e[0]=fi(e[0]+t),e=Re(e),i.r=e[0],i.g=e[1],i.b=e[2]}function xn(i){if(!i)return;const t=Le(i),e=t[0],s=hi(t[1]),n=hi(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${ct(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const ui={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"},gi={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 _n(){const i={},t=Object.keys(gi),e=Object.keys(ui);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,ui[o]);o=parseInt(gi[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let se;function yn(i){se||(se=_n(),se.transparent=[0,0,0,0]);const t=se[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const kn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function wn(i){const t=kn.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?zt(r):gt(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?zt(s):gt(s,0,255)),n=255&(t[4]?zt(n):gt(n,0,255)),o=255&(t[6]?zt(o):gt(o,0,255)),{r:s,g:n,b:o,a:e}}}function vn(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${ct(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ie=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Dt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Sn(i,t,e){const s=Dt(ct(i.r)),n=Dt(ct(i.g)),o=Dt(ct(i.b));return{r:pt(Ie(s+e*(Dt(ct(t.r))-s))),g:pt(Ie(n+e*(Dt(ct(t.g))-n))),b:pt(Ie(o+e*(Dt(ct(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ne(i,t,e){if(i){let s=Le(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Re(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function pi(i,t){return i&&Object.assign(t||{},i)}function mi(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=pt(i[3]))):(t=pi(i,{r:0,g:0,b:0,a:1}),t.a=pt(t.a)),t}function Mn(i){return i.charAt(0)==="r"?wn(i):mn(i)}class Bt{constructor(t){if(t instanceof Bt)return t;const e=typeof t;let s;e==="object"?s=mi(t):e==="string"&&(s=an(t)||yn(t)||Mn(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=pi(this._rgb);return t&&(t.a=ct(t.a)),t}set rgb(t){this._rgb=mi(t)}rgbString(){return this._valid?vn(this._rgb):void 0}hexString(){return this._valid?cn(this._rgb):void 0}hslString(){return this._valid?xn(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=Sn(this._rgb,t._rgb,e)),this}clone(){return new Bt(this.rgb)}alpha(t){return this._rgb.a=pt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ft(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 ne(this._rgb,2,t),this}darken(t){return ne(this._rgb,2,-t),this}saturate(t){return ne(this._rgb,1,t),this}desaturate(t){return ne(this._rgb,1,-t),this}rotate(t){return bn(this._rgb,t),this}}function ht(){}const Cn=(()=>{let i=0;return()=>i++})();function B(i){return i==null}function W(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function L(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function tt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function nt(i,t){return tt(i)?i:t}function R(i,t){return typeof i>"u"?t:i}const An=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function F(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function I(i,t,e,s){let n,o,r;if(W(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(L(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function oe(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 re(i){if(W(i))return i.map(re);if(L(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=re(i[e[n]]);return t}return i}function bi(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Pn(i,t,e,s){if(!bi(i))return;const n=t[i],o=e[i];L(n)&&L(o)?Ht(n,o,s):t[i]=re(o)}function Ht(i,t,e){const s=W(t)?t:[t],n=s.length;if(!L(i))return i;e=e||{};const o=e.merger||Pn;let r;for(let a=0;a<n;++a){if(r=s[a],!L(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 Nt(i,t){return Ht(i,t,{merger:Dn})}function Dn(i,t,e){if(!bi(i))return;const s=t[i],n=e[i];L(s)&&L(n)?Nt(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=re(n))}const xi={"":i=>i,x:i=>i.x,y:i=>i.y};function On(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 Tn(i){const t=On(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Vt(i,t){return(xi[t]||(xi[t]=Tn(t)))(i)}function Fe(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ae=i=>typeof i<"u",mt=i=>typeof i=="function",_i=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Ln(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const z=Math.PI,$=2*z,le=Number.POSITIVE_INFINITY,En=z/180,j=z/2,kt=z/4,yi=z*2/3,ki=Math.log10,ce=Math.sign;function he(i,t,e){return Math.abs(i-t)<e}function wi(i){const t=Math.round(i);i=he(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(ki(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Rn(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 In(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function de(i){return!In(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function Fn(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function zn(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 bt(i){return i*(z/180)}function ze(i){return i*(180/z)}function vi(i){if(!tt(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Si(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+=$),{angle:o,distance:n}}function Bn(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Z(i){return(i%$+$)%$}function Mi(i,t,e,s){const n=Z(i),o=Z(t),r=Z(e),a=Z(o-n),l=Z(r-n),c=Z(n-o),h=Z(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function et(i,t,e){return Math.max(t,Math.min(e,i))}function Hn(i){return et(i,-32768,32767)}function Wt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Be(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 He=(i,t,e,s)=>Be(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),Nn=(i,t,e)=>Be(i,e,s=>i[s][t]>=e);function Vn(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 Ci=["push","pop","shift","splice","unshift"];function Wn(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Ci.forEach(e=>{const s="_onData"+Fe(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 Ai(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)&&(Ci.forEach(o=>{delete i[o]}),delete i._chartjs)}function jn(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Pi=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Di(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Pi.call(window,()=>{s=!1,i.apply(t,e)}))}}function $n(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Oi=i=>i==="start"?"left":i==="end"?"right":"center",Q=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Yn=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t,fe=i=>i===0||i===1,Ti=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*$/e)),Li=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*$/e)+1,jt={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*j)+1,easeOutSine:i=>Math.sin(i*j),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=>fe(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=>fe(i)?i:Ti(i,.075,.3),easeOutElastic:i=>fe(i)?i:Li(i,.075,.3),easeInOutElastic(i){return fe(i)?i:i<.5?.5*Ti(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-jt.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?jt.easeInBounce(i*2)*.5:jt.easeOutBounce(i*2-1)*.5+.5};function Ei(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ri(i){return Ei(i)?i:new Bt(i)}function Ne(i){return Ei(i)?i:new Bt(i).saturate(.5).darken(.1).hexString()}const Un=["x","y","borderWidth","radius","tension"],Xn=["color","borderColor","backgroundColor"];function Kn(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:Xn},numbers:{type:"number",properties:Un}}),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 qn(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ii=new Map;function Gn(i,t){t=t||{};const e=i+JSON.stringify(t);let s=Ii.get(e);return s||(s=new Intl.NumberFormat(i,t),Ii.set(e,s)),s}function Ve(i,t,e){return Gn(t,e).format(i)}const Zn={values(i){return W(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=Qn(i,e)}const r=ki(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),Ve(i,s,l)}};function Qn(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 Fi={formatters:Zn};function Jn(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:Fi.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 wt=Object.create(null),We=Object.create(null);function $t(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 je(i,t,e){return typeof t=="string"?Ht($t(i,t),e):Ht($t(i,""),t)}class to{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)=>Ne(n.backgroundColor),this.hoverBorderColor=(s,n)=>Ne(n.borderColor),this.hoverColor=(s,n)=>Ne(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 je(this,t,e)}get(t){return $t(this,t)}describe(t,e){return je(We,t,e)}override(t,e){return je(wt,t,e)}route(t,e,s,n){const o=$t(this,t),r=$t(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 L(l)?Object.assign({},c,l):R(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var N=new to({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Kn,qn,Jn]);function eo(i){return!i||B(i.size)||B(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ue(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 io(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&&!W(d))r=ue(i,n,o,r,d);else if(W(d))for(c=0,h=d.length;c<h;c++)f=d[c],f!=null&&!W(f)&&(r=ue(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 vt(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 zi(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Bi(i,t,e,s){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,p=t.rotation,m=t.radius;let g=(p||0)*En;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(g),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,$):i.arc(e,s,m,0,$),i.closePath();break;case"triangle":h=n?n/2:m,i.moveTo(e+Math.sin(g)*h,s-Math.cos(g)*m),g+=yi,i.lineTo(e+Math.sin(g)*h,s-Math.cos(g)*m),g+=yi,i.lineTo(e+Math.sin(g)*h,s-Math.cos(g)*m),i.closePath();break;case"rectRounded":c=m*.516,l=m-c,r=Math.cos(g+kt)*l,d=Math.cos(g+kt)*(n?n/2-c:l),a=Math.sin(g+kt)*l,f=Math.sin(g+kt)*(n?n/2-c:l),i.arc(e-d,s-a,c,g-z,g-j),i.arc(e+f,s-r,c,g-j,g),i.arc(e+d,s+a,c,g,g+j),i.arc(e-f,s+r,c,g+j,g+z),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}g+=kt;case"rectRot":d=Math.cos(g)*(n?n/2:m),r=Math.cos(g)*m,a=Math.sin(g)*m,f=Math.sin(g)*(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":g+=kt;case"cross":d=Math.cos(g)*(n?n/2:m),r=Math.cos(g)*m,a=Math.sin(g)*m,f=Math.sin(g)*(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(g)*(n?n/2:m),r=Math.cos(g)*m,a=Math.sin(g)*m,f=Math.sin(g)*(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),g+=kt,d=Math.cos(g)*(n?n/2:m),r=Math.cos(g)*m,a=Math.sin(g)*m,f=Math.sin(g)*(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(g)*m,a=Math.sin(g)*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(g)*(n?n/2:m),s+Math.sin(g)*m);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Ot(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 Ye(i){i.restore()}function so(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),B(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 no(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 oo(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Tt(i,t,e,s,n,o={}){const r=W(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,so(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&oo(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),B(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),no(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function ge(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,j,!0),i.lineTo(e+n-r.bottomRight,s+o),i.arc(e+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,j,0,!0),i.lineTo(e+n,s+r.topRight),i.arc(e+n-r.topRight,s+r.topRight,r.topRight,0,-j,!0),i.lineTo(e+r.topLeft,s)}const ro=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ao=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function lo(i,t){const e=(""+i).match(ro);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 co=i=>+i||0;function Ue(i,t){const e={},s=L(t),n=s?Object.keys(t):t,o=L(i)?s?r=>R(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=co(o(r));return e}function ho(i){return Ue(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Lt(i){return Ue(i,["topLeft","topRight","bottomLeft","bottomRight"])}function K(i){const t=ho(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Y(i,t){i=i||{},t=t||N.font;let e=R(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=R(i.style,t.style);s&&!(""+s).match(ao)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:R(i.family,t.family),lineHeight:lo(R(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:R(i.weight,t.weight),string:""};return n.string=eo(n),n}function pe(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 fo(i,t,e){const{min:s,max:n}=i,o=An(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 St(i,t){return Object.assign(Object.create(i),t)}function Xe(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=$i("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>Xe([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 Vi(a,l,()=>yo(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Yi(a).includes(l)},ownKeys(a){return Yi(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function Et(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ni(i,s),setContext:o=>Et(i,o,e,s),override:o=>Et(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 Vi(o,r,()=>go(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 Ni(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:mt(e)?e:()=>e,isIndexable:mt(s)?s:()=>s}}const uo=(i,t)=>i?i+Fe(t):t,Ke=(i,t)=>L(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Vi(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function go(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return mt(a)&&r.isScriptable(t)&&(a=po(t,a,i,e)),W(a)&&a.length&&(a=mo(t,a,i,r.isIndexable)),Ke(t,a)&&(a=Et(a,n,o&&o[t],r)),a}function po(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),Ke(i,l)&&(l=qe(n._scopes,n,i,l)),l}function mo(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(L(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(Et(d,o,r&&r[i],a))}}return t}function Wi(i,t,e){return mt(i)?i(t,e):i}const bo=(i,t)=>i===!0?t:typeof i=="string"?Vt(t,i):void 0;function xo(i,t,e,s,n){for(const o of t){const r=bo(e,o);if(r){i.add(r);const a=Wi(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=Wi(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=ji(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=ji(a,r,o,l,s),l===null)?!1:Xe(Array.from(a),[""],n,o,()=>_o(t,e,s))}function ji(i,t,e,s,n){for(;e;)e=xo(i,t,e,s,n);return e}function _o(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return W(n)&&L(e)?e:n||{}}function yo(i,t,e,s){let n;for(const o of t)if(n=$i(uo(o,i),e),typeof n<"u")return Ke(i,n)?qe(e,s,i,n):n}function $i(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Yi(i){let t=i._keys;return t||(t=i._keys=ko(i._scopes)),t}function ko(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 wo(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(Vt(h,o),c)};return r}function Ge(){return typeof window<"u"&&typeof document<"u"}function Ze(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function me(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 be=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function vo(i,t){return be(i).getPropertyValue(t)}const So=["top","right","bottom","left"];function Mt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=So[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Mo=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Co(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(Mo(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 Ct(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=be(e),o=n.boxSizing==="border-box",r=Mt(n,"padding"),a=Mt(n,"border","width"),{x:l,y:c,box:h}=Co(i,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:u,height:p}=t;return o&&(u-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/u*e.width/s),y:Math.round((c-f)/p*e.height/s)}}function Ao(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&Ze(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=be(o),l=Mt(a,"border","width"),c=Mt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=me(a.maxWidth,o,"clientWidth"),n=me(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||le,maxHeight:n||le}}const xt=i=>Math.round(i*10)/10;function Po(i,t,e,s){const n=be(i),o=Mt(n,"margin"),r=me(n.maxWidth,i,"clientWidth")||le,a=me(n.maxHeight,i,"clientHeight")||le,l=Ao(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const f=Mt(n,"border","width"),u=Mt(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 Ui(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 Do=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Ge()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function Xi(i,t){const e=vo(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const Oo=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}}},To=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Rt(i,t,e){return i?Oo(t,e):To()}function Ki(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 xe(i,t,e){return i.options.clip?i[e]:t[e]}function Lo(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:xe(e,t,"left"),right:xe(e,t,"right"),top:xe(s,t,"top"),bottom:xe(s,t,"bottom")}:t}function Eo(i,t){const e=t._clip;if(e.disabled)return!1;const s=Lo(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 Ro{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=Pi.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 dt=new Ro;const Gi="transparent",Io={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Ri(i||Gi),n=s.valid&&Ri(t||Gi);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Fo{constructor(t,e,s,n){const o=e[s];n=pe([t.to,n,o,t.from]);const r=pe([t.from,o,n]);this._active=!0,this._fn=t.fn||Io[t.type||typeof r],this._easing=jt[t.easing]||jt.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=pe([t.to,e,n,t.from]),this._from=pe([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 Zi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!L(t))return;const e=Object.keys(N.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!L(o))return;const r={};for(const a of e)r[a]=o[a];(W(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=Bo(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&zo(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 Fo(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 dt.add(this._chart,s),!0}}function zo(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 Bo(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 Qi(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 Ho(i,t,e){if(e===!1)return!1;const s=Qi(i,e),n=Qi(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function No(i){let t,e,s,n;return L(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 Ji(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 ts(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],tt(c)&&(o||t===0||ce(t)===ce(c))&&(t+=c)}return!h&&!s.all?0:t}function Vo(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 Qe(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Wo(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function jo(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 $o(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function es(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 is(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=Wo(o,r,s),d=t.length;let f;for(let u=0;u<d;++u){const p=t[u],{[l]:m,[c]:g}=p,x=p._stacks||(p._stacks={});f=x[c]=$o(n,h,m),f[a]=g,f._top=es(f,r,!0,s.type),f._bottom=es(f,r,!1,s.type);const _=f._visualValues||(f._visualValues={});_[a]=g}}function Je(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Yo(i,t){return St(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Uo(i,t,e){return St(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Yt(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 ti=i=>i==="reset"||i==="none",ss=(i,t)=>t?i:Object.assign({},i),Xo=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Ji(e,!0),values:null};class ns{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=Qe(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&&Yt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,f,u,p)=>d==="x"?f:d==="r"?p:u,o=e.xAxisID=R(s.xAxisID,Je(t,"x")),r=e.yAxisID=R(s.yAxisID,Je(t,"y")),a=e.rAxisID=R(s.rAxisID,Je(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&&Ai(this._data,this),t._stacked&&Yt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(L(e)){const n=this._cachedMeta;this._data=Vo(e,n)}else if(s!==e){if(s){Ai(s,this);const n=this._cachedMeta;Yt(n),n._parsed=[]}e&&Object.isExtensible(e)&&Wn(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=Qe(e.vScale,e),e.stack!==s.stack&&(n=!0,Yt(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(is(this,e._parsed),e._stacked=Qe(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{W(n[t])?f=this.parseArrayData(s,n,t,e):L(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&&is(this,f)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let f,u,p;for(f=0,u=n;f<u;++f)p=f+s,d[f]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,f,u;for(h=0,d=n;h<d;++h)f=h+s,u=e[f],c[h]={x:o.parse(Vt(u,a),f),y:r.parse(Vt(u,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Ji(n,!0),values:e._stacks[t.axis]._visualValues};return ts(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=ts(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=Xo(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=jo(a);let f,u;function p(){u=n[f];const m=u[a.axis];return!tt(u[t.axis])||h>m||d<m}for(f=0;f<r&&!(!p()&&(this.updateRangeFromParsed(c,t,u,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],tt(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=No(R(this.options.clip,Ho(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=Uo(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=Yo(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&&ae(s);if(a)return ss(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(N.elements[t]),p=()=>this.getContext(s,n,e),m=c.resolveNamedOptions(f,u,p,d);return m.$shared&&(m.$shared=l,o[r]=Object.freeze(ss(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 Zi(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||ti(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){ti(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!ti(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&&Yt(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])}}class Ko extends ns{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=Ve(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return wo.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,p;const m=360/this.countVisibleElements();for(p=0;p<e;++p)u+=this._computeAngle(p,n,m);for(p=e;p<e+s;p++){const g=t[p];let x=u,_=u+this._computeAngle(p,n,m),k=r.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;u=_,o&&(l.animateScale&&(k=0),l.animateRotate&&(x=_=f));const v={x:h,y:d,innerRadius:0,outerRadius:k,startAngle:x,endAngle:_,options:this.resolveDataElementOptions(p,g.active?"active":n)};this.updateElement(g,p,v,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)?bt(this.resolveDataElementOptions(t,e).angle||s):0}}function At(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ei{static override(t){Object.assign(ei.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return At()}parse(){return At()}format(){return At()}add(){return At()}diff(){return At()}startOf(){return At()}endOf(){return At()}}var qo={_date:ei};function Go(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?Nn:He;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=>!B(m[d.axis]));h.lo-=Math.max(0,u);const p=f.slice(h.hi).findIndex(m=>!B(m[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function _e(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}=Go(o[a],t,r,n);for(let u=d;u<=f;++u){const p=h[u];p.skip||s(p,c,u)}}}function Zo(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 ii(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||_e(i,e,t,function(a,l,c){!n&&!Ot(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Qo(i,t,e,s){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=Si(r,{x:t.x,y:t.y});Mi(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return _e(i,e,t,o),n}function Jo(i,t,e,s,n,o){let r=[];const a=Zo(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const u=h.inRange(t.x,t.y,n);if(s&&!u)return;const p=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(p))&&!u)return;const g=a(t,p);g<l?(r=[{element:h,datasetIndex:d,index:f}],l=g):g===l&&r.push({element:h,datasetIndex:d,index:f})}return _e(i,e,t,c),r}function si(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?Qo(i,t,e,n):Jo(i,t,e,s,n,o)}function os(i,t,e,s,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return _e(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 tr={modes:{index(i,t,e,s){const n=Ct(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?ii(i,n,o,s,r):si(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=Ct(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?ii(i,n,o,s,r):si(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=Ct(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return ii(i,n,o,s,r)},nearest(i,t,e,s){const n=Ct(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return si(i,n,o,e.intersect,s,r)},x(i,t,e,s){const n=Ct(t,i);return os(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=Ct(t,i);return os(i,n,"y",e.intersect,s)}}};const rs=["left","top","right","bottom"];function Ut(i,t){return i.filter(e=>e.pos===t)}function as(i,t){return i.filter(e=>rs.indexOf(e.pos)===-1&&e.box.axis===t)}function Xt(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 er(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 ir(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!rs.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 sr(i,t){const e=ir(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 nr(i){const t=er(i),e=Xt(t.filter(c=>c.box.fullSize),!0),s=Xt(Ut(t,"left"),!0),n=Xt(Ut(t,"right")),o=Xt(Ut(t,"top"),!0),r=Xt(Ut(t,"bottom")),a=as(t,"x"),l=as(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 ls(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function cs(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 or(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!L(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&&cs(r,o.getPadding());const a=Math.max(0,t.outerWidth-ls(r,i,"left","right")),l=Math.max(0,t.outerHeight-ls(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 rr(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 ar(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 Kt(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,ar(a.horizontal,t));const{same:d,other:f}=or(t,e,a,s);c|=d&&n.length,h=h||f,l.fullSize||n.push(a)}return c&&Kt(n,t,e,s)||h}function ye(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 hs(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;ae(c.start)&&(r=c.start),l.fullSize?ye(l,n.left,r,e.outerWidth-n.right-n.left,f):ye(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;ae(c.start)&&(o=c.start),l.fullSize?ye(l,o,n.top,f,e.outerHeight-n.bottom-n.top):ye(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=nr(i.boxes),l=a.vertical,c=a.horizontal;I(i.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,g)=>g.box.options&&g.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);cs(f,K(s));const u=Object.assign({maxPadding:f,w:o,h:r,x:n.left,y:n.top},n),p=sr(l.concat(c),d);Kt(a.fullSize,u,d,p),Kt(l,u,d,p),Kt(c,u,d,p)&&Kt(l,u,d,p),rr(u),hs(a.leftAndTop,u,d,p),u.x+=u.w,u.y+=u.h,hs(a.rightAndBottom,u,d,p),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},I(a.chartArea,m=>{const g=m.box;Object.assign(g,i.chartArea),g.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class ds{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 lr extends ds{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ke="$chartjs",cr={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},fs=i=>i===null||i==="";function hr(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[ke]={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",fs(n)){const o=Xi(i,"width");o!==void 0&&(i.width=o)}if(fs(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Xi(i,"height");o!==void 0&&(i.height=o)}return i}const us=Do?{passive:!0}:!1;function dr(i,t,e){i&&i.addEventListener(t,e,us)}function fr(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,us)}function ur(i,t){const e=cr[i.type]||i.type,{x:s,y:n}=Ct(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function we(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function gr(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||we(a.addedNodes,s),r=r&&!we(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function pr(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||we(a.removedNodes,s),r=r&&!we(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const qt=new Map;let gs=0;function ps(){const i=window.devicePixelRatio;i!==gs&&(gs=i,qt.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function mr(i,t){qt.size||window.addEventListener("resize",ps),qt.set(i,t)}function br(i){qt.delete(i),qt.size||window.removeEventListener("resize",ps)}function xr(i,t,e){const s=i.canvas,n=s&&Ze(s);if(!n)return;const o=Di((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 ni(i,t,e){e&&e.disconnect(),t==="resize"&&br(i)}function _r(i,t,e){const s=i.canvas,n=Di(o=>{i.ctx!==null&&e(ur(o,i))},i);return dr(s,t,n),n}class yr extends ds{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(hr(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[ke])return!1;const s=e[ke].initial;["height","width"].forEach(o=>{const r=s[o];B(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[ke],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:gr,detach:pr,resize:xr}[e]||_r;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ni,detach:ni,resize:ni}[e]||fr)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Po(t,e,s,n)}isAttached(t){const e=t&&Ze(t);return!!(e&&e.isConnected)}}function kr(i){return!Ge()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?lr:yr}class Gt{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 de(this.x)&&de(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 wr(i,t){const e=i.options.ticks,s=vr(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Mr(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Cr(t,c,o,r/n),c;const h=Sr(o,t,n);if(r>0){let d,f;const u=r>1?Math.round((l-a)/(r-1)):null;for(ve(t,c,h,B(u)?0:a-u,a),d=0,f=r-1;d<f;d++)ve(t,c,h,o[d],o[d+1]);return ve(t,c,h,l,B(u)?t.length:l+u),c}return ve(t,c,h),c}function vr(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 Sr(i,t,e){const s=Ar(i),n=t.length/e;if(!s)return Math.max(n,1);const o=Rn(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 Mr(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function Cr(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 ve(i,t,e,s,n){const o=R(s,0),r=Math.min(R(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 Ar(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 Pr=i=>i==="left"?"right":i==="right"?"left":i,ms=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,bs=(i,t)=>Math.min(t||i,i);function xs(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 Dr(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 Or(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 _s(i,t){if(!i.display)return 0;const e=Y(i.font,t),s=K(i.padding);return(W(i.text)?i.text.length:1)*e.lineHeight+s.height}function Tr(i,t){return St(i,{scale:t,type:"scale"})}function Lr(i,t,e){return St(i,{tick:e,index:t,type:"tick"})}function Er(i,t,e){let s=Oi(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Pr(s)),s}function Rr(i,t,e,s){const{top:n,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,u,p;const m=r-n,g=a-o;if(i.isHorizontal()){if(u=Q(s,o,a),L(e)){const x=Object.keys(e)[0],_=e[x];p=h[x].getPixelForValue(_)+m-t}else e==="center"?p=(c.bottom+c.top)/2+m-t:p=ms(i,e,t);f=a-o}else{if(L(e)){const x=Object.keys(e)[0],_=e[x];u=h[x].getPixelForValue(_)-g+t}else e==="center"?u=(c.left+c.right)/2-g+t:u=ms(i,e,t);p=Q(s,r,n),d=e==="left"?-j:j}return{titleX:u,titleY:p,maxWidth:f,rotation:d}}class Qt extends Gt{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=nt(t,Number.POSITIVE_INFINITY),e=nt(e,Number.NEGATIVE_INFINITY),s=nt(s,Number.POSITIVE_INFINITY),n=nt(n,Number.NEGATIVE_INFINITY),{min:nt(t,s),max:nt(e,n),minDefined:tt(t),maxDefined:tt(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:nt(e,nt(s,e)),max:nt(s,nt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){F(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=fo(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?xs(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=wr(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){F(this.options.afterUpdate,[this])}beforeSetDimensions(){F(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){F(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),F(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){F(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=F(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){F(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){F(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=bs(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=et(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-_s(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=ze(Math.min(Math.asin(et((h.highest.height+6)/a,-1,1)),Math.asin(et(l/c,-1,1))-Math.asin(et(f/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){F(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){F(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=_s(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Zt(o)+l):(t.height=this.maxHeight,t.width=Zt(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=s.padding*2,p=bt(this.labelRotation),m=Math.cos(p),g=Math.sin(p);if(a){const x=s.mirror?0:g*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+x+u)}else{const x=s.mirror?0:m*d.width+g*f.height;t.width=Math.min(this.maxWidth,t.width+x+u)}this._calculatePadding(c,h,g,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(){F(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)B(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=xs(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/bs(e,s));let c=0,h=0,d,f,u,p,m,g,x,_,k,v,y;for(d=0;d<e;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),n.font=g=m.string,x=o[g]=o[g]||{data:{},gc:[]},_=m.lineHeight,k=v=0,!B(p)&&!W(p))k=ue(n,x.data,x.gc,k,p),v=_;else if(W(p))for(f=0,u=p.length;f<u;++f)y=p[f],!B(y)&&!W(y)&&(k=ue(n,x.data,x.gc,k,y),v+=_);r.push(k),a.push(v),c=Math.max(k,c),h=Math.max(v,h)}Or(o,e);const w=r.indexOf(c),S=a.indexOf(h),M=C=>({width:r[C]||0,height:a[C]||0});return{first:M(0),last:M(e-1),widest:M(w),highest:M(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 Hn(this._alignToPixels?vt(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=Lr(this.getContext(),t,s))}return this.$context||(this.$context=Tr(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=bt(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Zt(o),u=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,g=m/2,x=function(E){return vt(s,E,m)};let _,k,v,y,w,S,M,C,A,P,D,V;if(r==="top")_=x(this.bottom),S=this.bottom-f,C=_-g,P=x(t.top)+g,V=t.bottom;else if(r==="bottom")_=x(this.top),P=t.top,V=x(t.bottom)-g,S=_+g,C=this.top+f;else if(r==="left")_=x(this.right),w=this.right-f,M=_-g,A=x(t.left)+g,D=t.right;else if(r==="right")_=x(this.left),A=t.left,D=x(t.right)-g,w=_+g,M=this.left+f;else if(e==="x"){if(r==="center")_=x((t.top+t.bottom)/2+.5);else if(L(r)){const E=Object.keys(r)[0],T=r[E];_=x(this.chart.scales[E].getPixelForValue(T))}P=t.top,V=t.bottom,S=_+g,C=S+f}else if(e==="y"){if(r==="center")_=x((t.left+t.right)/2);else if(L(r)){const E=Object.keys(r)[0],T=r[E];_=x(this.chart.scales[E].getPixelForValue(T))}w=_-g,M=w-f,A=t.left,D=t.right}const U=R(n.ticks.maxTicksLimit,d),O=Math.max(1,Math.ceil(d/U));for(k=0;k<d;k+=O){const E=this.getContext(k),T=o.setContext(E),X=a.setContext(E),H=T.lineWidth,at=T.color,it=X.dash||[],lt=X.dashOffset,yt=T.tickWidth,ut=T.tickColor,ee=T.tickBorderDash||[],Pt=T.tickBorderDashOffset;v=Dr(this,k,l),v!==void 0&&(y=vt(s,v,H),c?w=M=A=D=y:S=C=P=V=y,u.push({tx1:w,ty1:S,tx2:M,ty2:C,x1:A,y1:P,x2:D,y2:V,width:H,color:at,borderDash:it,borderDashOffset:lt,tickWidth:yt,tickColor:ut,tickBorderDash:ee,tickBorderDashOffset:Pt}))}return this._ticksLength=d,this._borderValue=_,u}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=Zt(s.grid),u=f+h,p=d?-h:u,m=-bt(this.labelRotation),g=[];let x,_,k,v,y,w,S,M,C,A,P,D,V="middle";if(n==="top")w=this.bottom-p,S=this._getXAxisLabelAlignment();else if(n==="bottom")w=this.top+p,S=this._getXAxisLabelAlignment();else if(n==="left"){const O=this._getYAxisLabelAlignment(f);S=O.textAlign,y=O.x}else if(n==="right"){const O=this._getYAxisLabelAlignment(f);S=O.textAlign,y=O.x}else if(e==="x"){if(n==="center")w=(t.top+t.bottom)/2+u;else if(L(n)){const O=Object.keys(n)[0],E=n[O];w=this.chart.scales[O].getPixelForValue(E)+u}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")y=(t.left+t.right)/2-u;else if(L(n)){const O=Object.keys(n)[0],E=n[O];y=this.chart.scales[O].getPixelForValue(E)}S=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?V="top":l==="end"&&(V="bottom"));const U=this._getLabelSizes();for(x=0,_=a.length;x<_;++x){k=a[x],v=k.label;const O=o.setContext(this.getContext(x));M=this.getPixelForTick(x)+o.labelOffset,C=this._resolveTickFontOptions(x),A=C.lineHeight,P=W(v)?v.length:1;const E=P/2,T=O.color,X=O.textStrokeColor,H=O.textStrokeWidth;let at=S;r?(y=M,S==="inner"&&(x===_-1?at=this.options.reverse?"left":"right":x===0?at=this.options.reverse?"right":"left":at="center"),n==="top"?c==="near"||m!==0?D=-P*A+A/2:c==="center"?D=-U.highest.height/2-E*A+A:D=-U.highest.height+A/2:c==="near"||m!==0?D=A/2:c==="center"?D=U.highest.height/2-E*A:D=U.highest.height-P*A,d&&(D*=-1),m!==0&&!O.showLabelBackdrop&&(y+=A/2*Math.sin(m))):(w=M,D=(1-P)*A/2);let it;if(O.showLabelBackdrop){const lt=K(O.backdropPadding),yt=U.heights[x],ut=U.widths[x];let ee=D-lt.top,Pt=0-lt.left;switch(V){case"middle":ee-=yt/2;break;case"bottom":ee-=yt;break}switch(S){case"center":Pt-=ut/2;break;case"right":Pt-=ut;break;case"inner":x===_-1?Pt-=ut:x>0&&(Pt-=ut/2);break}it={left:Pt,top:ee,width:ut+lt.width,height:yt+lt.height,color:O.backdropColor}}g.push({label:v,font:C,textOffset:D,options:{rotation:m,color:T,strokeColor:X,strokeWidth:H,textAlign:at,textBaseline:V,translation:[y,w],backdrop:it}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-bt(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=vt(t,this.left,r)-r/2,h=vt(t,this.right,a)+a/2,d=f=l):(d=vt(t,this.top,r)-r/2,f=vt(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&&$e(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;Tt(s,c,0,h,l,a)}n&&Ye(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=Y(s.font),r=K(s.padding),a=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||L(e)?(l+=r.bottom,W(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=Rr(this,l,e,a);Tt(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:f,textAlign:Er(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=R(t.grid&&t.grid.z,-1),n=R(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Qt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Y(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Se{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;zr(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,Ir(t,r,s),this.override&&N.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 N[n]&&(delete N[n][s],this.override&&delete wt[s])}}function Ir(i,t,e){const s=Ht(Object.create(null),[e?N.get(e):{},N.get(t),i.defaults]);N.set(t,s),i.defaultRoutes&&Fr(t,i.defaultRoutes),i.descriptors&&N.describe(t,i.descriptors)}function Fr(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(".");N.route(o,n,l,a)})}function zr(i){return"id"in i&&"defaults"in i}class Br{constructor(){this.controllers=new Se(ns,"datasets",!0),this.elements=new Se(Gt,"elements"),this.plugins=new Se(Object,"plugins"),this.scales=new Se(Qt,"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=Fe(t);F(s["before"+n],[],s),e[t](s),F(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var ot=new Br;class Hr{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(F(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){B(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=R(s.options&&s.options.plugins,{}),o=Nr(s);return n===!1&&!e?[]:Wr(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 Nr(i){const t={},e=[],s=Object.keys(ot.plugins.items);for(let o=0;o<s.length;o++)e.push(ot.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 Vr(i,t){return!t&&i===!1?null:i===!0?{}:i}function Wr(i,{plugins:t,localIds:e},s,n){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Vr(s[l],n);c!==null&&o.push({plugin:a,options:jr(i.config,{plugin:a,local:e[l]},c,r)})}return o}function jr(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 oi(i,t){const e=N.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function $r(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Yr(i,t){return i===t?"_index_":"_value_"}function ys(i){if(i==="x"||i==="y"||i==="r")return i}function Ur(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function ri(i,...t){if(ys(i))return i;for(const e of t){const s=e.axis||Ur(e.position)||i.length>1&&ys(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function ks(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Xr(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 ks(i,"x",e[0])||ks(i,"y",e[0])}return{}}function Kr(i,t){const e=wt[i.type]||{scales:{}},s=t.scales||{},n=oi(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!L(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=ri(r,a,Xr(r,i),N.scales[a.type]),c=Yr(l,n),h=e.scales||{};o[r]=Nt(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||oi(a,t),h=(wt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=$r(d,l),u=r[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),Nt(o[u],[{axis:f},s[u],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Nt(a,[N.scales[a.type],N.scale])}),o}function ws(i){const t=i.options||(i.options={});t.plugins=R(t.plugins,{}),t.scales=Kr(i,t)}function vs(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function qr(i){return i=i||{},i.data=vs(i.data),ws(i),i}const Ss=new Map,Ms=new Set;function Me(i,t){let e=Ss.get(i);return e||(e=t(),Ss.set(i,e),Ms.add(e)),e}const Jt=(i,t,e)=>{const s=Vt(t,e);s!==void 0&&i.add(s)};class Gr{constructor(t){this._config=qr(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=vs(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(),ws(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Me(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Me(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Me(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return Me(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Jt(l,t,d))),h.forEach(d=>Jt(l,n,d)),h.forEach(d=>Jt(l,wt[o]||{},d)),h.forEach(d=>Jt(l,N,d)),h.forEach(d=>Jt(l,We,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ms.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,wt[e]||{},N.datasets[e]||{},{type:e},N,We]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Cs(this._resolverCache,t,n);let l=r;if(Qr(r,e)){o.$shared=!1,s=mt(s)?s():s;const c=this.createResolver(t,s,a);l=Et(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=Cs(this._resolverCache,t,s);return L(e)?Et(o,e,void 0,n):o}}function Cs(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:Xe(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const Zr=i=>L(i)&&Object.getOwnPropertyNames(i).some(t=>mt(i[t]));function Qr(i,t){const{isScriptable:e,isIndexable:s}=Ni(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(mt(a)||Zr(a))||r&&W(a))return!0}return!1}var Jr="4.5.1";const ta=["top","bottom","left","right","chartArea"];function As(i,t){return i==="top"||i==="bottom"||ta.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 Ds(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),F(e&&e.onComplete,[i],t)}function ea(i){const t=i.chart,e=t.options.animation;F(e&&e.onProgress,[i],t)}function Os(i){return Ge()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ce={},Ts=i=>{const t=Os(i);return Object.values(Ce).filter(e=>e.canvas===t).pop()};function ia(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 sa(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}class ai{static defaults=N;static instances=Ce;static overrides=wt;static registry=ot;static version=Jr;static getChart=Ts;static register(...t){ot.add(...t),Ls()}static unregister(...t){ot.remove(...t),Ls()}constructor(t,e){const s=this.config=new Gr(e),n=Os(t),o=Ts(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||kr(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=Cn(),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 Hr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=$n(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Ce[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}dt.listen(this,"complete",Ds),dt.listen(this,"progress",ea),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return B(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 ot}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ui(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return zi(this.canvas,this.ctx),this}stop(){return dt.stop(this),this}resize(t,e){dt.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,Ui(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),F(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};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=ri(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=ri(l,a),h=R(a.type,r.dtype);(a.position===void 0||As(a.position,c)!==As(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=ot.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||oi(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=ot.getController(a),{datasetElementType:c,dataElementType:h}=N.datasets[a];Object.assign(l,{dataElementType:ot.getElement(h),datasetElementType:c&&ot.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);(!_i(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;ia(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(!_i(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,mt(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&&(dt.has(this)?this.attached&&!dt.running(this)&&dt.start(this):(this.draw(),Ds({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=Eo(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(n&&$e(e,n),t.controller.draw(),n&&Ye(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Ot(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=tr.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=St(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);ae(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(),dt.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(),zi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ce[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}});!oe(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=Ln(t),c=sa(t,this._lastEvent,s,l);s&&(this._lastEvent=null,F(o.onHover,[t,a,this],this),l&&F(o.onClick,[t,a,this],this));const h=!oe(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 Ls(){return I(ai.instances,i=>i._plugins.invalidate())}function na(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,Z(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,Z(s-e));i.arc(n,o,a+c/2,e-f/2,s+f/2,!0)}else{const f=Math.min(c/2,r*Z(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,p=-u*Math.cos(e+z/2)+n,m=-u*Math.sin(e+z/2)+o,g=u*Math.cos(s+z/2)+n,x=u*Math.sin(s+z/2)+o;i.lineTo(p,m),i.lineTo(g,x)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function oa(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+j,s-j),i.closePath(),i.clip()}function ra(i){return Ue(i,["outerStart","outerEnd","innerStart","innerEnd"])}function aa(i,t,e,s){const n=ra(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 et(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:et(n.innerStart,0,r),innerEnd:et(n.innerEnd,0,r)}}function It(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function Ae(i,t,e,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),f=h>0?h+s+e+c:0;let u=0;const p=n-l;if(s){const O=h>0?h-s:0,E=d>0?d-s:0,T=(O+E)/2,X=T!==0?p*T/(T+s):p;u=(p-X)/2}const m=Math.max(.001,p*d-e/z)/d,g=(p-m)/2,x=l+g+u,_=n-g-u,{outerStart:k,outerEnd:v,innerStart:y,innerEnd:w}=aa(t,f,d,_-x),S=d-k,M=d-v,C=x+k/S,A=_-v/M,P=f+y,D=f+w,V=x+y/P,U=_-w/D;if(i.beginPath(),o){const O=(C+A)/2;if(i.arc(r,a,d,C,O),i.arc(r,a,d,O,A),v>0){const H=It(M,A,r,a);i.arc(H.x,H.y,v,A,_+j)}const E=It(D,_,r,a);if(i.lineTo(E.x,E.y),w>0){const H=It(D,U,r,a);i.arc(H.x,H.y,w,_+j,U+Math.PI)}const T=(_-w/f+(x+y/f))/2;if(i.arc(r,a,f,_-w/f,T,!0),i.arc(r,a,f,T,x+y/f,!0),y>0){const H=It(P,V,r,a);i.arc(H.x,H.y,y,V+Math.PI,x-j)}const X=It(S,x,r,a);if(i.lineTo(X.x,X.y),k>0){const H=It(S,C,r,a);i.arc(H.x,H.y,k,x-j,C)}}else{i.moveTo(r,a);const O=Math.cos(C)*d+r,E=Math.sin(C)*d+a;i.lineTo(O,E);const T=Math.cos(A)*d+r,X=Math.sin(A)*d+a;i.lineTo(T,X)}i.closePath()}function la(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Ae(i,t,e,s,l,n);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%$||$))}return Ae(i,t,e,s,l,n),i.fill(),l}function ca(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,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){Ae(i,t,e,s,m,n);for(let g=0;g<o;++g)i.stroke();isNaN(a)||(m=r+(a%$||$))}p&&oa(i,t,m),l.selfJoin&&m-r>=z&&u===0&&h!=="miter"&&na(i,t,m),o||(Ae(i,t,e,s,m,n),i.stroke())}class ha extends Gt{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}=Si(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=R(d,l-a),p=Mi(o,a,l)&&a!==l,m=u>=$||p,g=Wt(r,c+f,h+f);return m&&g}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>$?Math.floor(s/$):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,la(t,this,c,o,r),ca(t,this,c,o,r),t.restore()}}const Es=(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)}},da=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Rs extends Gt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=F(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=Y(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Es(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,u=-h;return this.legendItems.forEach((p,m)=>{const g=s+e/2+o.measureText(p.text).width;(m===0||c[c.length-1]+g+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:g,height:n},c[c.length-1]+=g+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,f=0,u=0,p=0,m=0;return this.legendItems.forEach((g,x)=>{const{itemWidth:_,itemHeight:k}=fa(s,e,o,g,n);x>0&&u+k+2*a>h&&(d+=f+a,c.push({width:f,height:u}),p+=f+a,m++,f=u=0),l[x]={left:p,top:u,col:m,width:_,height:k},f=Math.max(f,_),u+=k+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=Rt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Q(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=Q(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=Q(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=Q(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;$e(t,this),this._draw(),Ye(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=N.color,l=Rt(t.rtl,this.left,this.width),c=Y(r.font),{padding:h}=r,d=c.size,f=d/2;let u;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:g}=Es(r,d),x=function(w,S,M){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;n.save();const C=R(M.lineWidth,1);if(n.fillStyle=R(M.fillStyle,a),n.lineCap=R(M.lineCap,"butt"),n.lineDashOffset=R(M.lineDashOffset,0),n.lineJoin=R(M.lineJoin,"miter"),n.lineWidth=C,n.strokeStyle=R(M.strokeStyle,a),n.setLineDash(R(M.lineDash,[])),r.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:C},P=l.xPlus(w,p/2),D=S+f;Hi(n,A,P,D,r.pointStyleWidth&&p)}else{const A=S+Math.max((d-m)/2,0),P=l.leftForLtr(w,p),D=Lt(M.borderRadius);n.beginPath(),Object.values(D).some(V=>V!==0)?ge(n,{x:P,y:A,w:p,h:m,radius:D}):n.rect(P,A,p,m),n.fill(),C!==0&&n.stroke()}n.restore()},_=function(w,S,M){Tt(n,M.text,w,S+g/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},k=this.isHorizontal(),v=this._computeTitleHeight();k?u={x:Q(o,this.left+h,this.right-s[0]),y:this.top+h+v,line:0}:u={x:this.left+h,y:Q(o,this.top+v+h,this.bottom-e[0].height),line:0},Ki(this.ctx,t.textDirection);const y=g+h;this.legendItems.forEach((w,S)=>{n.strokeStyle=w.fontColor,n.fillStyle=w.fontColor;const M=n.measureText(w.text).width,C=l.textAlign(w.textAlign||(w.textAlign=r.textAlign)),A=p+f+M;let P=u.x,D=u.y;l.setWidth(this.width),k?S>0&&P+A+h>this.right&&(D=u.y+=y,u.line++,P=u.x=Q(o,this.left+h,this.right-s[u.line])):S>0&&D+y>this.bottom&&(P=u.x=P+e[u.line].width+h,u.line++,D=u.y=Q(o,this.top+v+h,this.bottom-e[u.line].height));const V=l.x(P);if(x(V,D,w),P=Yn(C,P+p+f,k?P+A:this.right,t.rtl),_(l.x(P),D,w),k)u.x+=A+h;else if(typeof w.text!="string"){const U=c.lineHeight;u.y+=Is(w,U)+h}else u.y+=y}),qi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=Y(e.font),n=K(e.padding);if(!e.display)return;const o=Rt(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=Q(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,g)=>Math.max(m,g.height),0);h=c+Q(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const u=Q(a,d,d+f);r.textAlign=o.textAlign(Oi(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,Tt(r,e.text,u,h,s)}_computeTitleHeight(){const t=this.options.title,e=Y(t.font),s=K(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Wt(t,this.left,this.right)&&Wt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],Wt(t,n.left,n.left+n.width)&&Wt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!pa(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=da(n,s);n&&!o&&F(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&F(e.onHover,[t,s,this],this)}else s&&F(e.onClick,[t,s,this],this)}}function fa(i,t,e,s,n){const o=ua(s,i,t,e),r=ga(n,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function ua(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 ga(i,t,e){let s=i;return typeof t.text!="string"&&(s=Is(t,e)),s}function Is(i,t){const e=i.text?i.text.length:0;return t*e}function pa(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var ma={id:"legend",_element:Rs,start(i,t,e){const s=i.legend=new Rs({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 te={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=Bn(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function rt(i,t){return t&&(W(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function ft(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
2
2
|
`)>-1?i.split(`
|
|
3
|
-
`):i}function ma(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 Fs(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=Y(t.bodyFont),c=Y(t.titleFont),h=Y(t.footerFont),d=o.length,f=n.length,u=s.length,p=U(t.padding);let m=p.height,g=0,b=s.reduce((k,y)=>k+y.before.length+y.lines.length+y.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const k=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=u*k+(b-u)*l.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let _=0;const w=function(k){g=Math.max(g,e.measureText(k).width+_)};return e.save(),e.font=c.string,R(i.title,w),e.font=l.string,R(i.beforeBody.concat(i.afterBody),w),_=t.displayColors?r+2+t.boxPadding:0,R(s,k=>{R(k.before,w),R(k.lines,w),R(k.after,w)}),_=0,e.font=h.string,R(i.footer,w),e.restore(),g+=p.width,{width:g,height:m}}function ba(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function xa(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 _a(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"),xa(c,i,t,e)&&(c="center"),c}function zs(i,t,e){const s=e.yAlign||t.yAlign||ba(i,e);return{xAlign:e.xAlign||t.xAlign||_a(i,t,e,s),yAlign:s}}function ya(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function wa(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Bs(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}=Tt(r);let p=ya(t,a);const m=wa(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,f)+n:a==="right"&&(p+=Math.max(d,u)+n),{x:et(p,0,s.width-t.width),y:et(m,0,s.height-t.height)}}function Pe(i,t,e){const s=U(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Hs(i){return nt([],ct(i))}function ka(i,t,e){return wt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ns(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Ws={beforeTitle:at,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:at,beforeBody:at,beforeLabel:at,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:at,afterBody:at,beforeFooter:at,footer:at,afterFooter:at};function K(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?Ws[t].call(e,s):n}class Vs extends qt{static positioners=Jt;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 Zi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=ka(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=K(s,"beforeTitle",this,t),o=K(s,"title",this,t),r=K(s,"afterTitle",this,t);let a=[];return a=nt(a,ct(n)),a=nt(a,ct(o)),a=nt(a,ct(r)),a}getBeforeBody(t,e){return Hs(K(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return R(t,o=>{const r={before:[],lines:[],after:[]},a=Ns(s,o);nt(r.before,ct(K(a,"beforeLabel",this,o))),nt(r.lines,K(a,"label",this,o)),nt(r.after,ct(K(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return Hs(K(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=K(s,"beforeFooter",this,t),o=K(s,"footer",this,t),r=K(s,"afterFooter",this,t);let a=[];return a=nt(a,ct(n)),a=nt(a,ct(o)),a=nt(a,ct(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(ma(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))),R(a,h=>{const d=Ns(t.callbacks,h);n.push(K(d,"labelColor",this,h)),o.push(K(d,"labelPointStyle",this,h)),r.push(K(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=Jt[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=Fs(this,s),c=Object.assign({},a,l),h=zs(this.chart,s,c),d=Bs(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}=Tt(a),{x:f,y:u}=t,{width:p,height:m}=e;let g,b,_,w,k,y;return o==="center"?(k=u+m/2,n==="left"?(g=f,b=g-r,w=k+r,y=k-r):(g=f+p,b=g+r,w=k-r,y=k+r),_=g):(n==="left"?b=f+Math.max(l,h)+r:n==="right"?b=f+p-Math.max(c,d)-r:b=this.caretX,o==="top"?(w=u,k=w-r,g=b-r,_=b+r):(w=u+m,k=w+r,g=b+r,_=b-r),y=w),{x1:g,x2:b,x3:_,y1:w,y2:k,y3:y}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Rt(s.rtl,this.x,this.width);for(t.x=Pe(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=Y(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=Y(o.bodyFont),d=Pe(this,"left",o),f=n.x(d),u=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+u;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},g=n.leftForLtr(f,c)+c/2,b=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Bi(t,m,g,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Bi(t,m,g,b)}else{t.lineWidth=T(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const m=n.leftForLtr(f,c),g=n.leftForLtr(n.xPlus(f,1),c-2),b=Tt(r.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ge(t,{x:m,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ge(t,{x:g,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(g,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=Y(s.bodyFont);let f=d.lineHeight,u=0;const p=Rt(s.rtl,this.x,this.width),m=function(M){e.fillText(M,p.x(t.x+u),t.y+f/2),t.y+=f+o},g=p.textAlign(r);let b,_,w,k,y,v,S;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Pe(this,g,s),e.fillStyle=s.bodyColor,R(this.beforeBody,m),u=a&&g!=="right"?r==="center"?c/2+h:c+2+h:0,k=0,v=n.length;k<v;++k){for(b=n[k],_=this.labelTextColors[k],e.fillStyle=_,R(b.before,m),w=b.lines,a&&w.length&&(this._drawColorBox(e,t,k,p,s),f=Math.max(d.lineHeight,l)),y=0,S=w.length;y<S;++y)m(w[y]),f=d.lineHeight;R(b.after,m)}u=0,f=d.lineHeight,R(this.afterBody,m),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let r,a;if(o){const l=Rt(s.rtl,this.x,this.width);for(t.x=Pe(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",r=Y(s.footerFont),e.fillStyle=s.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:f,bottomLeft:u,bottomRight:p}=Tt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,s,n),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(a+c,l+h-p),e.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+u,l+h),e.quadraticCurveTo(a,l+h,a,l+h-u),r==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=Jt[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Fs(this,t),l=Object.assign({},r,this._size),c=zs(e,t,l),h=Bs(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=U(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),Ki(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=!oe(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||!oe(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=Jt[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}var va={id:"tooltip",_element:Vs,positioners:Jt,afterInit(i,t,e){e&&(i.tooltip=new Vs({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:Ws},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 Sa(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=i,u=o||1,p=h-1,{min:m,max:g}=t,b=!z(r),_=!z(a),w=!z(c),k=(g-m)/(d+1);let y=ki((g-m)/p/u)*u,v,S,M,C;if(y<1e-14&&!b&&!_)return[{value:m},{value:g}];C=Math.ceil(g/y)-Math.floor(m/y),C>p&&(y=ki(C*y/p/u)*u),z(l)||(v=Math.pow(10,l),y=Math.ceil(y*v)/v),n==="ticks"?(S=Math.floor(m/y)*y,M=Math.ceil(g/y)*y):(S=m,M=g),b&&_&&o&&In((a-r)/o,y/1e3)?(C=Math.round(Math.min((a-r)/y,h)),y=(a-r)/C,S=r,M=a):w?(S=b?r:S,M=_?a:M,C=c-1,y=(M-S)/C):(C=(M-S)/y,he(C,Math.round(C),y/1e3)?C=Math.round(C):C=Math.ceil(C));const P=Math.max(vi(y),vi(S));v=Math.pow(10,z(l)?P:l),S=Math.round(S*v)/v,M=Math.round(M*v)/v;let A=0;for(b&&(f&&S!==r?(e.push({value:r}),S<r&&A++,he(Math.round((S+A*y)*v)/v,r,js(r,k,i))&&A++):S<r&&A++);A<C;++A){const D=Math.round((S+A*y)*v)/v;if(_&&D>a)break;e.push({value:D})}return _&&f&&M!==a?e.length&&he(e[e.length-1].value,a,js(a,k,i))?e[e.length-1].value=a:e.push({value:a}):(!_||M===a)&&e.push({value:M}),e}function js(i,t,{horizontal:e,minRotation:s}){const n=ut(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class $s extends Zt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return z(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=ce(n),c=ce(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=Sa(n,o);return t.bounds==="ticks"&&Fn(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 We(t,this.chart.options.locale,this.options.ticks.format)}}function li(i){const t=i.ticks;if(t.display&&i.display){const e=U(t.backdropPadding);return L(t.font&&t.font.size,H.font.size)+e.height}return 0}function Ma(i,t,e){return e=N(e)?e:[e],{w:eo(i,t.string,e),h:e.length*t.lineHeight}}function Ys(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 Ca(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?F/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=Y(c.font),f=Ma(i.ctx,d,i._pointLabels[l]);s[l]=f;const u=G(i.getIndexAngle(l)+a),p=Math.round(ze(u)),m=Ys(p,h.x,f.w,0,180),g=Ys(p,h.y,f.h,90,270);Aa(e,t,u,m,g)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Da(i,s,n)}function Aa(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 Pa(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(ze(G(l.angle+V))),h=Ra(l.y,a.h,c),d=Ta(c),f=La(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 Oa(i,t){if(!t)return!0;const{left:e,top:s,right:n,bottom:o}=i;return!(Ot({x:e,y:s},t)||Ot({x:e,y:o},t)||Ot({x:n,y:s},t)||Ot({x:n,y:o},t))}function Da(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:li(o)/2,additionalAngle:r?F/n:0};let c;for(let h=0;h<n;h++){l.padding=e[h],l.size=t[h];const d=Pa(i,h,l);s.push(d),a==="auto"&&(d.visible=Oa(d,c),d.visible&&(c=d))}return s}function Ta(i){return i===0||i===180?"center":i<180?"left":"right"}function La(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function Ra(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function Ea(i,t,e){const{left:s,top:n,right:o,bottom:r}=e,{backdropColor:a}=t;if(!z(a)){const l=Tt(t.borderRadius),c=U(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(p=>p!==0)?(i.beginPath(),ge(i,{x:h,y:d,w:f,h:u,radius:l}),i.fill()):i.fillRect(h,d,f,u)}}function Ia(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));Ea(e,r,o);const a=Y(r.font),{x:l,y:c,textAlign:h}=o;Dt(e,i._pointLabels[n],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Us(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,$);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 Fa(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(),Us(i,e,r,s),o.closePath(),o.stroke(),o.restore())}function za(i,t,e){return wt(i,{label:e,index:t,type:"pointLabel"})}class Ba extends $s{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:Fi.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=U(li(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=tt(t)&&!isNaN(t)?t:0,this.max=tt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/li(this.options))}generateTickLabels(t){$s.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{const n=I(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?Ca(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=$/(this._pointLabels.length||1),s=this.options.startAngle||0;return G(t*e+ut(s))}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 s=e[t];return za(this.getContext(),t,s)}}getPointPosition(t,e,s=0){const n=this.getIndexAngle(t)-V+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(),Us(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&&Ia(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),p=o.setContext(f);Fa(this,u,l,r,p)}}),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=Y(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=U(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}Dt(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const Oe={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}},q=Object.keys(Oe);function Xs(i,t){return i-t}function Ks(i,t){if(z(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)),tt(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(de(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function qs(i,t,e,s){const n=q.length;for(let o=q.indexOf(i);o<n-1;++o){const r=Oe[q[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=s)return q[o]}return q[n-1]}function Ha(i,t,e,s,n){for(let o=q.length-1;o>=q.indexOf(e);o--){const r=q[o];if(Oe[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return q[e?q.indexOf(e):0]}function Na(i){for(let t=q.indexOf(i)+1,e=q.length;t<e;++t)if(Oe[q[t]].common)return q[t]}function Gs(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=Be(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Wa(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 Zs(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:Wa(i,s,n,e)}class Qs extends Zt{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 Ko._date(t.adapters.date);n.init(e),Ht(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:Ks(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=tt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=tt(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=Nn(n,o,r);return this._unit=e.unit||(s.autoSkip?qs(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Ha(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Na(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),Zs(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=et(e,0,r),s=et(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||qs(o.minUnit,e,s,this._getLabelCapacity(e)),a=L(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=de(l)||l===!0,h={};let d=e,f,u;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f<s;f=+t.add(f,a,r),u++)Gs(h,f,p);return(f===s||n.bounds==="ticks"||u===1)&&Gs(h,f,p),Object.keys(h).sort(Xs).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 I(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=ut(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,Zs(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(Ks(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Vn(t.sort(Xs))}}function De(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}=He(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}=He(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 Ga extends Qs{static id="timeseries";static defaults=Qs.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=De(e,this.min),this._tableRange=De(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(De(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return De(this._table,s*this._tableRange+this._minPos,!0)}}const Va={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},ja={class:"flex flex-column gap-2 flex-1 w-full max-w-26rem"},$a={class:"flex align-items-center justify-content-between gap-2 border-bottom-1 pb-1 surface-border"},Ya={class:"flex align-items-center gap-2"},Ua={class:"flex align-items-center gap-2"},Xa={class:"flex justify-content-center align-items-center mx-auto",style:{width:"200px",height:"200px","flex-shrink":"0"}},Js={__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){ai.register(Xo,Ba,ca,va,pa);const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},s=x.computed(()=>e[t.cor]??"bg-white"),n=x.computed(()=>t.cor==="dark");function o(g,b=7){const _=g.replace("#","");let w=parseInt(_.slice(0,2),16),k=parseInt(_.slice(2,4),16),y=parseInt(_.slice(4,6),16);w/=255,k/=255,y/=255;const v=Math.max(w,k,y),S=Math.min(w,k,y);let M,C,P=(v+S)/2;if(v===S)M=C=0;else{const O=v-S;switch(C=P>.5?O/(2-v-S):O/(v+S),v){case w:M=((k-y)/O+(k<y?6:0))/6;break;case k:M=((y-w)/O+2)/6;break;case y:M=((w-k)/O+4)/6;break}}const A=Math.max(.2,P-.3),j=(Math.min(.95,P+.35)-A)/(b-1);function X(O,E,B){const Q=E*Math.min(B,1-B),W=mt=>{const Mt=(mt+O*12)%12,bt=B-Q*Math.max(-1,Math.min(Mt-3,9-Mt,1));return Math.round(255*bt).toString(16).padStart(2,"0")};return`#${W(0)}${W(8)}${W(4)}`}return Array.from({length:b},(O,E)=>X(M,C,A+j*E))}const r=x.computed(()=>o(t.corPaleta,t.dados.length)),a=x.ref(null),l=x.ref(null),c=x.ref(!0);let h=null,d=null;const f=x.computed(()=>t.direcao==="vertical"?"flex-column-reverse":t.direcao==="horizontal"?"flex-row":c.value?"flex-column-reverse":"flex-row"),u=x.computed(()=>({labels:t.dados.map(g=>g.rotulo),datasets:[{data:t.dados.map(g=>g.quantidade),backgroundColor:r.value,borderWidth:0,borderColor:"transparent"}]})),p=x.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 ai(a.value,{type:"polarArea",data:u.value,options:p.value})}return x.onMounted(()=>{m(),h=new ResizeObserver(([g])=>{c.value=g.contentRect.width<380}),h.observe(l.value)}),x.onBeforeUnmount(()=>{d&&d.destroy(),h&&h.disconnect()}),x.watch(()=>t.dados,()=>{m()},{deep:!0}),x.watch(()=>t.cor,()=>{m()}),x.watch(()=>t.corPaleta,()=>{m()}),(g,b)=>(x.openBlock(),x.createElementBlock("div",{class:x.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"}},[x.createElementVNode("div",null,[x.createElementVNode("p",{class:x.normalizeClass(["m-0 text-xs font-medium",n.value?"text-white":"text-gray-900"])},x.toDisplayString(i.titulo),3),i.subtitulo?(x.openBlock(),x.createElementBlock("p",Va,x.toDisplayString(i.subtitulo),1)):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"containerRef",ref:l,class:x.normalizeClass(["flex w-full h-full gap-3 align-items-center justify-content-between",f.value])},[x.createElementVNode("div",ja,[x.createElementVNode("div",$a,[x.createElementVNode("div",Ya,[b[0]||(b[0]=x.createElementVNode("span",{style:{width:"10px",height:"10px",flexShrink:0}},null,-1)),x.createElementVNode("span",{class:x.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-500"])},x.toDisplayString(i.label_rotulo),3)]),x.createElementVNode("span",{class:x.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-gray-500"])},x.toDisplayString(i.label_quantidade),3)]),(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(i.dados,(_,w)=>(x.openBlock(),x.createElementBlock("div",{key:w,class:"flex align-items-center justify-content-between"},[x.createElementVNode("div",Ua,[x.createElementVNode("span",{class:"border-circle",style:x.normalizeStyle({backgroundColor:r.value[w],width:"10px",height:"10px",flexShrink:0})},null,4),x.createElementVNode("span",{class:x.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-600"])},x.toDisplayString(_.rotulo),3)]),x.createElementVNode("span",{class:x.normalizeClass(["text-xs font-semibold",n.value?"text-white":"text-gray-900"])},x.toDisplayString(_.quantidade),3)]))),128))]),x.createElementVNode("div",Xa,[x.createElementVNode("canvas",{ref_key:"canvasRef",ref:a,width:"200",height:"200"},null,512)])],2)],2))}},Ka={install(i){i.component("NemesisCards",ci),i.component("NemesisPolar",Js)}};ot.Cards=ci,ot.Polar=Js,ot.default=Ka,Object.defineProperties(ot,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
3
|
+
`):i}function ba(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 Fs(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=Y(t.bodyFont),c=Y(t.titleFont),h=Y(t.footerFont),d=o.length,f=n.length,u=s.length,p=K(t.padding);let m=p.height,g=0,x=s.reduce((v,y)=>v+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 v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=u*v+(x-u)*l.lineHeight+(x-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let _=0;const k=function(v){g=Math.max(g,e.measureText(v).width+_)};return e.save(),e.font=c.string,I(i.title,k),e.font=l.string,I(i.beforeBody.concat(i.afterBody),k),_=t.displayColors?r+2+t.boxPadding:0,I(s,v=>{I(v.before,k),I(v.lines,k),I(v.after,k)}),_=0,e.font=h.string,I(i.footer,k),e.restore(),g+=p.width,{width:g,height:m}}function xa(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function _a(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 ya(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"),_a(c,i,t,e)&&(c="center"),c}function zs(i,t,e){const s=e.yAlign||t.yAlign||xa(i,e);return{xAlign:e.xAlign||t.xAlign||ya(i,t,e,s),yAlign:s}}function ka(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function wa(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Bs(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 p=ka(t,a);const m=wa(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,f)+n:a==="right"&&(p+=Math.max(d,u)+n),{x:et(p,0,s.width-t.width),y:et(m,0,s.height-t.height)}}function Pe(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 Hs(i){return rt([],ft(i))}function va(i,t,e){return St(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ns(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Vs={beforeTitle:ht,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:ht,beforeBody:ht,beforeLabel:ht,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 B(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:ht,afterBody:ht,beforeFooter:ht,footer:ht,afterFooter:ht};function q(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?Vs[t].call(e,s):n}class Ws extends Gt{static positioners=te;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 Zi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=va(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=rt(a,ft(n)),a=rt(a,ft(o)),a=rt(a,ft(r)),a}getBeforeBody(t,e){return Hs(q(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return I(t,o=>{const r={before:[],lines:[],after:[]},a=Ns(s,o);rt(r.before,ft(q(a,"beforeLabel",this,o))),rt(r.lines,q(a,"label",this,o)),rt(r.after,ft(q(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return Hs(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=rt(a,ft(n)),a=rt(a,ft(o)),a=rt(a,ft(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(ba(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=Ns(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=te[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=Fs(this,s),c=Object.assign({},a,l),h=zs(this.chart,s,c),d=Bs(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:p,height:m}=e;let g,x,_,k,v,y;return o==="center"?(v=u+m/2,n==="left"?(g=f,x=g-r,k=v+r,y=v-r):(g=f+p,x=g+r,k=v-r,y=v+r),_=g):(n==="left"?x=f+Math.max(l,h)+r:n==="right"?x=f+p-Math.max(c,d)-r:x=this.caretX,o==="top"?(k=u,v=k-r,g=x-r,_=x+r):(k=u+m,v=k+r,g=x+r,_=x-r),y=k),{x1:g,x2:x,x3:_,y1:k,y2:v,y3:y}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Rt(s.rtl,this.x,this.width);for(t.x=Pe(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=Y(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=Y(o.bodyFont),d=Pe(this,"left",o),f=n.x(d),u=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+u;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},g=n.leftForLtr(f,c)+c/2,x=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Bi(t,m,g,x),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Bi(t,m,g,x)}else{t.lineWidth=L(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),g=n.leftForLtr(n.xPlus(f,1),c-2),x=Lt(r.borderRadius);Object.values(x).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ge(t,{x:m,y:p,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ge(t,{x:g,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(g,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=Y(s.bodyFont);let f=d.lineHeight,u=0;const p=Rt(s.rtl,this.x,this.width),m=function(M){e.fillText(M,p.x(t.x+u),t.y+f/2),t.y+=f+o},g=p.textAlign(r);let x,_,k,v,y,w,S;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Pe(this,g,s),e.fillStyle=s.bodyColor,I(this.beforeBody,m),u=a&&g!=="right"?r==="center"?c/2+h:c+2+h:0,v=0,w=n.length;v<w;++v){for(x=n[v],_=this.labelTextColors[v],e.fillStyle=_,I(x.before,m),k=x.lines,a&&k.length&&(this._drawColorBox(e,t,v,p,s),f=Math.max(d.lineHeight,l)),y=0,S=k.length;y<S;++y)m(k[y]),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=Rt(s.rtl,this.x,this.width);for(t.x=Pe(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",r=Y(s.footerFont),e.fillStyle=s.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:f,bottomLeft:u,bottomRight:p}=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-p),e.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+u,l+h),e.quadraticCurveTo(a,l+h,a,l+h-u),r==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=te[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Fs(this,t),l=Object.assign({},r,this._size),c=zs(e,t,l),h=Bs(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),Ki(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=!oe(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||!oe(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=te[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}var Sa={id:"tooltip",_element:Ws,positioners:te,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:Vs},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 Ma(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=i,u=o||1,p=h-1,{min:m,max:g}=t,x=!B(r),_=!B(a),k=!B(c),v=(g-m)/(d+1);let y=wi((g-m)/p/u)*u,w,S,M,C;if(y<1e-14&&!x&&!_)return[{value:m},{value:g}];C=Math.ceil(g/y)-Math.floor(m/y),C>p&&(y=wi(C*y/p/u)*u),B(l)||(w=Math.pow(10,l),y=Math.ceil(y*w)/w),n==="ticks"?(S=Math.floor(m/y)*y,M=Math.ceil(g/y)*y):(S=m,M=g),x&&_&&o&&Fn((a-r)/o,y/1e3)?(C=Math.round(Math.min((a-r)/y,h)),y=(a-r)/C,S=r,M=a):k?(S=x?r:S,M=_?a:M,C=c-1,y=(M-S)/C):(C=(M-S)/y,he(C,Math.round(C),y/1e3)?C=Math.round(C):C=Math.ceil(C));const A=Math.max(vi(y),vi(S));w=Math.pow(10,B(l)?A:l),S=Math.round(S*w)/w,M=Math.round(M*w)/w;let P=0;for(x&&(f&&S!==r?(e.push({value:r}),S<r&&P++,he(Math.round((S+P*y)*w)/w,r,js(r,v,i))&&P++):S<r&&P++);P<C;++P){const D=Math.round((S+P*y)*w)/w;if(_&&D>a)break;e.push({value:D})}return _&&f&&M!==a?e.length&&he(e[e.length-1].value,a,js(a,v,i))?e[e.length-1].value=a:e.push({value:a}):(!_||M===a)&&e.push({value:M}),e}function js(i,t,{horizontal:e,minRotation:s}){const n=bt(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class $s extends Qt{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 B(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=ce(n),c=ce(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=Ma(n,o);return t.bounds==="ticks"&&zn(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 Ve(t,this.chart.options.locale,this.options.ticks.format)}}function li(i){const t=i.ticks;if(t.display&&i.display){const e=K(t.backdropPadding);return R(t.font&&t.font.size,N.font.size)+e.height}return 0}function Ca(i,t,e){return e=W(e)?e:[e],{w:io(i,t.string,e),h:e.length*t.lineHeight}}function Ys(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 Aa(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=Y(c.font),f=Ca(i.ctx,d,i._pointLabels[l]);s[l]=f;const u=Z(i.getIndexAngle(l)+a),p=Math.round(ze(u)),m=Ys(p,h.x,f.w,0,180),g=Ys(p,h.y,f.h,90,270);Pa(e,t,u,m,g)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Ta(i,s,n)}function Pa(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 Da(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(ze(Z(l.angle+j))),h=Ra(l.y,a.h,c),d=La(c),f=Ea(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 Oa(i,t){if(!t)return!0;const{left:e,top:s,right:n,bottom:o}=i;return!(Ot({x:e,y:s},t)||Ot({x:e,y:o},t)||Ot({x:n,y:s},t)||Ot({x:n,y:o},t))}function Ta(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:li(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=Da(i,h,l);s.push(d),a==="auto"&&(d.visible=Oa(d,c),d.visible&&(c=d))}return s}function La(i){return i===0||i===180?"center":i<180?"left":"right"}function Ea(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function Ra(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function Ia(i,t,e){const{left:s,top:n,right:o,bottom:r}=e,{backdropColor:a}=t;if(!B(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(p=>p!==0)?(i.beginPath(),ge(i,{x:h,y:d,w:f,h:u,radius:l}),i.fill()):i.fillRect(h,d,f,u)}}function Fa(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));Ia(e,r,o);const a=Y(r.font),{x:l,y:c,textAlign:h}=o;Tt(e,i._pointLabels[n],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Us(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,$);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 za(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(),Us(i,e,r,s),o.closePath(),o.stroke(),o.restore())}function Ba(i,t,e){return St(i,{label:e,index:t,type:"pointLabel"})}class Ha extends $s{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:Fi.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(li(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=tt(t)&&!isNaN(t)?t:0,this.max=tt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/li(this.options))}generateTickLabels(t){$s.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{const n=F(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?Aa(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=$/(this._pointLabels.length||1),s=this.options.startAngle||0;return Z(t*e+bt(s))}getDistanceFromCenterForValue(t){if(B(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(B(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 Ba(this.getContext(),t,s)}}getPointPosition(t,e,s=0){const n=this.getIndexAngle(t)-j+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(),Us(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&&Fa(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),p=o.setContext(f);za(this,u,l,r,p)}}),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=Y(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)}Tt(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const De={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(De);function Xs(i,t){return i-t}function Ks(i,t){if(B(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)),tt(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(de(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function qs(i,t,e,s){const n=G.length;for(let o=G.indexOf(i);o<n-1;++o){const r=De[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 Na(i,t,e,s,n){for(let o=G.length-1;o>=G.indexOf(e);o--){const r=G[o];if(De[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return G[e?G.indexOf(e):0]}function Va(i){for(let t=G.indexOf(i)+1,e=G.length;t<e;++t)if(De[G[t]].common)return G[t]}function Gs(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=Be(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Wa(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 Zs(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:Wa(i,s,n,e)}class Qs extends Qt{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 qo._date(t.adapters.date);n.init(e),Nt(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:Ks(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=tt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=tt(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=Vn(n,o,r);return this._unit=e.unit||(s.autoSkip?qs(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Na(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Va(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),Zs(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=et(e,0,r),s=et(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||qs(o.minUnit,e,s,this._getLabelCapacity(e)),a=R(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=de(l)||l===!0,h={};let d=e,f,u;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f<s;f=+t.add(f,a,r),u++)Gs(h,f,p);return(f===s||n.bounds==="ticks"||u===1)&&Gs(h,f,p),Object.keys(h).sort(Xs).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 F(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],f=s[e],u=c&&d&&f&&f.major;return this._adapter.format(t,n||(u?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=bt(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,Zs(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(Ks(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return jn(t.sort(Xs))}}function Oe(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}=He(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}=He(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 nl extends Qs{static id="timeseries";static defaults=Qs.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=Oe(e,this.min),this._tableRange=Oe(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(Oe(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Oe(this._table,s*this._tableRange+this._minPos,!0)}}const ja={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},$a={class:"flex flex-column gap-2 flex-1 w-full max-w-26rem"},Ya={class:"flex align-items-center justify-content-between gap-2 border-bottom-1 pb-1 surface-border"},Ua={class:"flex align-items-center gap-2"},Xa={class:"flex align-items-center gap-2"},Ka={class:"flex justify-content-center align-items-center mx-auto",style:{width:"200px",height:"200px","flex-shrink":"0"}},Js={__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){ai.register(Ko,Ha,ha,Sa,ma);const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},s=b.computed(()=>e[t.cor]??"bg-white"),n=b.computed(()=>t.cor==="dark");function o(g,x=7){const _=g.replace("#","");let k=parseInt(_.slice(0,2),16),v=parseInt(_.slice(2,4),16),y=parseInt(_.slice(4,6),16);k/=255,v/=255,y/=255;const w=Math.max(k,v,y),S=Math.min(k,v,y);let M,C,A=(w+S)/2;if(w===S)M=C=0;else{const O=w-S;switch(C=A>.5?O/(2-w-S):O/(w+S),w){case k:M=((v-y)/O+(v<y?6:0))/6;break;case v:M=((y-k)/O+2)/6;break;case y:M=((k-v)/O+4)/6;break}}const P=Math.max(.2,A-.3),V=(Math.min(.95,A+.35)-P)/(x-1);function U(O,E,T){const X=E*Math.min(T,1-T),H=at=>{const it=(at+O*12)%12,lt=T-X*Math.max(-1,Math.min(it-3,9-it,1));return Math.round(255*lt).toString(16).padStart(2,"0")};return`#${H(0)}${H(8)}${H(4)}`}return Array.from({length:x},(O,E)=>U(M,C,P+V*E))}const r=b.computed(()=>o(t.corPaleta,t.dados.length)),a=b.ref(null),l=b.ref(null),c=b.ref(!0);let h=null,d=null;const f=b.computed(()=>t.direcao==="vertical"?"flex-column-reverse":t.direcao==="horizontal"?"flex-row":c.value?"flex-column-reverse":"flex-row"),u=b.computed(()=>({labels:t.dados.map(g=>g.rotulo),datasets:[{data:t.dados.map(g=>g.quantidade),backgroundColor:r.value,borderWidth:0,borderColor:"transparent"}]})),p=b.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 ai(a.value,{type:"polarArea",data:u.value,options:p.value})}return b.onMounted(()=>{m(),h=new ResizeObserver(([g])=>{c.value=g.contentRect.width<380}),h.observe(l.value)}),b.onBeforeUnmount(()=>{d&&d.destroy(),h&&h.disconnect()}),b.watch(()=>t.dados,()=>{m()},{deep:!0}),b.watch(()=>t.cor,()=>{m()}),b.watch(()=>t.corPaleta,()=>{m()}),(g,x)=>(b.openBlock(),b.createElementBlock("div",{class:b.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"}},[b.createElementVNode("div",null,[b.createElementVNode("p",{class:b.normalizeClass(["m-0 text-xs font-medium",n.value?"text-white":"text-gray-900"])},b.toDisplayString(i.titulo),3),i.subtitulo?(b.openBlock(),b.createElementBlock("p",ja,b.toDisplayString(i.subtitulo),1)):b.createCommentVNode("",!0)]),b.createElementVNode("div",{ref_key:"containerRef",ref:l,class:b.normalizeClass(["flex w-full h-full gap-3 align-items-center justify-content-between",f.value])},[b.createElementVNode("div",$a,[b.createElementVNode("div",Ya,[b.createElementVNode("div",Ua,[x[0]||(x[0]=b.createElementVNode("span",{style:{width:"10px",height:"10px",flexShrink:0}},null,-1)),b.createElementVNode("span",{class:b.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-500"])},b.toDisplayString(i.label_rotulo),3)]),b.createElementVNode("span",{class:b.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-gray-500"])},b.toDisplayString(i.label_quantidade),3)]),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(i.dados,(_,k)=>(b.openBlock(),b.createElementBlock("div",{key:k,class:"flex align-items-center justify-content-between"},[b.createElementVNode("div",Xa,[b.createElementVNode("span",{class:"border-circle",style:b.normalizeStyle({backgroundColor:r.value[k],width:"10px",height:"10px",flexShrink:0})},null,4),b.createElementVNode("span",{class:b.normalizeClass(["text-xs font-medium",n.value?"text-white":"text-600"])},b.toDisplayString(_.rotulo),3)]),b.createElementVNode("span",{class:b.normalizeClass(["text-xs font-semibold",n.value?"text-white":"text-gray-900"])},b.toDisplayString(_.quantidade),3)]))),128))]),b.createElementVNode("div",Ka,[b.createElementVNode("canvas",{ref_key:"canvasRef",ref:a,width:"200",height:"200"},null,512)])],2)],2))}},qa={class:"w-full flex flex-row align-items-center justify-content-between"},Ga={class:"w-full"},Za={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},Qa={class:"flex w-full gap-3 justify-content-between flex-column",style:{flex:"1","min-height":"0"}},Ja={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},tl=["onMouseenter","onMousemove"],el={class:"flex gap-1",style:{width:"100%","margin-top":"4px"}},tn={__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"}},setup(i){const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},s=b.computed(()=>e[t.cor]??"bg-white"),n=b.computed(()=>t.cor==="dark"),o=b.computed(()=>t.cor==="dark"?"#252525":"#E9E9E9");function r(_,k=7){const v=_.replace("#","");let y=parseInt(v.slice(0,2),16),w=parseInt(v.slice(2,4),16),S=parseInt(v.slice(4,6),16);y/=255,w/=255,S/=255;const M=Math.max(y,w,S),C=Math.min(y,w,S);let A,P,D=(M+C)/2;if(M===C)A=P=0;else{const T=M-C;switch(P=D>.5?T/(2-M-C):T/(M+C),M){case y:A=((w-S)/T+(w<S?6:0))/6;break;case w:A=((S-y)/T+2)/6;break;case S:A=((y-w)/T+4)/6;break}}const V=Math.max(.2,D-.3),U=Math.min(.95,D+.35),O=k>1?(U-V)/(k-1):0;function E(T,X,H){const at=X*Math.min(H,1-H),it=lt=>{const yt=(lt+T*12)%12,ut=H-at*Math.max(-1,Math.min(yt-3,9-yt,1));return Math.round(255*ut).toString(16).padStart(2,"0")};return`#${it(0)}${it(8)}${it(4)}`}return Array.from({length:k},(T,X)=>E(A,P,V+O*X))}const a=b.computed(()=>r(t.corPaleta,t.dados.length)),l=b.computed(()=>Math.max(...t.dados.map(_=>_.quantidade),1)),c=b.ref(null),h=b.ref(80);let d=null;b.onMounted(()=>{d=new ResizeObserver(([_])=>{h.value=_.contentRect.height||80}),d.observe(c.value)}),b.onBeforeUnmount(()=>{d&&d.disconnect()});const f=b.ref(null),u=b.ref({visible:!1,x:0,y:0,text:""});function p(_,k){f.value=_,x(_,k)}function m(_,k){x(_,k)}function g(){f.value=null,u.value.visible=!1}function x(_,k){const v=t.dados[_],y=k.currentTarget.closest(".chart-container").getBoundingClientRect(),w=k.currentTarget.getBoundingClientRect();u.value={visible:!0,x:w.left-y.left+w.width/2,y:w.top-y.top-8,text:`${v.rotulo}: ${v.quantidade}`}}return(_,k)=>(b.openBlock(),b.createElementBlock("div",{class:b.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"}},[b.createElementVNode("div",qa,[b.createElementVNode("div",Ga,[b.createElementVNode("p",{class:b.normalizeClass(["m-0 text-xs font-medium",n.value?"text-white":"text-gray-900"])},b.toDisplayString(i.titulo),3),i.subtitulo?(b.openBlock(),b.createElementBlock("p",Za,b.toDisplayString(i.subtitulo),1)):b.createCommentVNode("",!0)]),b.renderSlot(_.$slots,"header-right")]),b.createElementVNode("div",Qa,[b.createElementVNode("div",null,[b.createElementVNode("h2",{class:b.normalizeClass(["m-0 text-3xl font-semibold",n.value?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},b.toDisplayString(i.valor),3),b.createElementVNode("p",Ja,b.toDisplayString(i.descricao),1)]),b.createElementVNode("div",{ref_key:"chartRef",ref:c,class:"chart-container",style:{position:"relative",width:"100%",flex:"1","min-height":"80px"}},[u.value.visible?(b.openBlock(),b.createElementBlock("div",{key:0,style:b.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"}])},b.toDisplayString(u.value.text),5)):b.createCommentVNode("",!0),b.createElementVNode("div",{class:"flex align-items-end gap-1",style:b.normalizeStyle([{width:"100%"},{height:h.value-20+"px"}])},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(i.dados,(v,y)=>(b.openBlock(),b.createElementBlock("div",{key:y,class:"flex-1",style:{display:"flex","align-items":"flex-end",height:"100%",cursor:"pointer"},onMouseenter:w=>p(y,w),onMousemove:w=>m(y,w),onMouseleave:g},[b.createElementVNode("div",{style:b.normalizeStyle({height:v.quantidade/l.value*100+"%",minHeight:"4px",width:"100%",backgroundColor:f.value===y?a.value[y]:o.value,borderRadius:"4px 4px 4px 4px",transition:"background-color 0.15s ease"})},null,4)],40,tl))),128))],4),b.createElementVNode("div",el,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(i.dados,(v,y)=>(b.openBlock(),b.createElementBlock("div",{key:y,class:"flex-1 text-center",style:b.normalizeStyle([{"font-size":"0.6rem",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"},{color:n.value?"#888":"#aaa"}])},b.toDisplayString(v.rotulo),5))),128))])],512)])],2))}},il={install(i){i.component("NemesisCards",ci),i.component("NemesisPolar",Js),i.component("NemesisCardColumn",tn)}};st.CardColumn=tn,st.Cards=ci,st.Polar=Js,st.default=il,Object.defineProperties(st,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|