1import{_ as xo}from"./DfQzjviO.js";import{e as zt,c as D,a as b,n as Qt,u as _,t as A,d as Q,i as tt,o as P,p as G,R as ys,S as bn,U as _o,x as yo,G as vo,L as ko,V as vs,J as wo,l as xn,W as _n,q as xe,m as qs,F as lt,r as bt,b as B,w as Z,y as So,E as Mo,X as Po}from"./DAkdLEaj.js";import{_ as Co,c as Os}from"./Ch-ghsjQ.js";import{u as Gs}from"./iN4FCMy5.js";import{a as Do}from"./PMiRrhY5.js";const Ao={class:"card p-4 relative overflow-hidden"},Oo={class:"flex items-center justify-between mb-2 relative"},To={class:"text-xs font-medium text-gray-500 uppercase tracking-wider"},Lo={class:"text-base"},Ro={class:"text-xl sm:text-2xl font-bold text-gray-900 relative"},Eo={class:"flex items-center justify-between mt-1.5 text-xs relative"},Io={key:0,class:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20"},Fo={key:1,class:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20"},zo={key:1,class:"text-gray-400"},Bo={key:2,class:"text-gray-400"},Wo=zt({__name:"KpiCard",props:{label:{},value:{},delta:{},prev:{},sub:{},tone:{},icon:{}},setup(s){const t=s,e=G(()=>({pink:"bg-pink-500",indigo:"bg-indigo-500",amber:"bg-amber-500",blue:"bg-blue-500",green:"bg-emerald-500",red:"bg-red-500",purple:"bg-purple-500"})[t.tone||"pink"]),i=G(()=>t.delta===void 0?"":t.delta>=0?"text-emerald-600":"text-red-600");return(n,o)=>(P(),D("div",Ao,[b("div",{class:Qt(["absolute top-0 right-0 w-16 h-16 rounded-full -translate-y-6 translate-x-6 opacity-10",_(e)])},null,2),b("div",Oo,[b("span",To,A(s.label),1),b("span",Lo,A(s.icon),1)]),b("div",Ro,A(s.value),1),b("div",Eo,[typeof s.delta=="number"?(P(),D("span",{key:0,class:Qt(["inline-flex items-center gap-0.5 font-semibold",_(i)])},[s.delta>=0?(P(),D("svg",Io,[...o[0]||(o[0]=[b("path",{d:"M10 3l7 7H3z"},null,-1)])])):(P(),D("svg",Fo,[...o[1]||(o[1]=[b("path",{d:"M10 17l-7-7h14z"},null,-1)])])),Q(" "+A(Math.abs(s.delta).toFixed(1))+"% ",1)],2)):tt("",!0),s.prev?(P(),D("span",zo,A(s.prev),1)):s.sub?(P(),D("span",Bo,A(s.sub),1)):tt("",!0)])]))}}),No={class:"card px-4 py-3"},Ho={class:"text-[11px] text-gray-500 uppercase tracking-wider truncate"},Vo={class:"text-lg font-bold text-gray-900 mt-0.5"},jo=zt({__name:"MiniStat",props:{label:{},value:{}},setup(s){return(t,e)=>(P(),D("div",No,[b("p",Ho,A(s.label),1),b("p",Vo,A(s.value),1)]))}});function Pe(s){return s+.5|0}const Tt=(s,t,e)=>Math.max(Math.min(s,e),t);function de(s){return Tt(Pe(s*2.55),0,255)}function It(s){return Tt(Pe(s*255),0,255)}function Ct(s){return Tt(Pe(s/2.55)/100,0,1)}function Js(s){return Tt(Pe(s*100),0,100)}const mt={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},ks=[..."0123456789ABCDEF"],$o=s=>ks[s&15],Yo=s=>ks[(s&240)>>4]+ks[s&15],Ae=s=>(s&240)>>4===(s&15),Uo=s=>Ae(s.r)&&Ae(s.g)&&Ae(s.b)&&Ae(s.a);function Xo(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&mt[s[1]]*17,g:255&mt[s[2]]*17,b:255&mt[s[3]]*17,a:t===5?mt[s[4]]*17:255}:(t===7||t===9)&&(e={r:mt[s[1]]<<4|mt[s[2]],g:mt[s[3]]<<4|mt[s[4]],b:mt[s[5]]<<4|mt[s[6]],a:t===9?mt[s[7]]<<4|mt[s[8]]:255})),e}const Ko=(s,t)=>s<255?t(s):"";function qo(s){var t=Uo(s)?$o:Yo;return s?"#"+t(s.r)+t(s.g)+t(s.b)+Ko(s.a,t):void 0}const Go=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function yn(s,t,e){const i=t*Math.min(e,1-e),n=(o,r=(o+s/30)%12)=>e-i*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Jo(s,t,e){const i=(n,o=(n+s/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function Zo(s,t,e){const i=yn(s,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function Qo(s,t,e,i,n){return s===n?(t-e)/i+(t<e?6:0):t===n?(e-s)/i+2:(s-t)/i+4}function Ts(s){const e=s.r/255,i=s.g/255,n=s.b/255,o=Math.max(e,i,n),r=Math.min(e,i,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=Qo(e,i,n,h,o),l=l*60+.5),[l|0,c||0,a]}function Ls(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(It)}function Rs(s,t,e){return Ls(yn,s,t,e)}function tr(s,t,e){return Ls(Zo,s,t,e)}function er(s,t,e){return Ls(Jo,s,t,e)}function vn(s){return(s%360+360)%360}function sr(s){const t=Go.exec(s);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?de(+t[5]):It(+t[5]));const n=vn(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=tr(n,o,r):t[1]==="hsv"?i=er(n,o,r):i=Rs(n,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function ir(s,t){var e=Ts(s);e[0]=vn(e[0]+t),e=Rs(e),s.r=e[0],s.g=e[1],s.b=e[2]}function nr(s){if(!s)return;const t=Ts(s),e=t[0],i=Js(t[1]),n=Js(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${Ct(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}const Zs={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"},Qs={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",K
vendor: 5,063 bytes, line 1
1ocTate:"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 or(){const s={},t=Object.keys(Qs),e=Object.keys(Zs);let i,n,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],n=0;n<e.length;n++)o=e[n],a=a.replace(o,Zs[o]);o=parseInt(Qs[r],16),s[a]=[o>>16&255,o>>8&255,o&255]}return s}let Oe;function rr(s){Oe||(Oe=or(),Oe.transparent=[0,0,0,0]);const t=Oe[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const ar=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function lr(s){const t=ar.exec(s);let e=255,i,n,o;if(t){if(t[7]!==i){const r=+t[7];e=t[8]?de(r):Tt(r*255,0,255)}return i=+t[1],n=+t[3],o=+t[5],i=255&(t[2]?de(i):Tt(i,0,255)),n=255&(t[4]?de(n):Tt(n,0,255)),o=255&(t[6]?de(o):Tt(o,0,255)),{r:i,g:n,b:o,a:e}}}function cr(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${Ct(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}const rs=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,Gt=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function hr(s,t,e){const i=Gt(Ct(s.r)),n=Gt(Ct(s.g)),o=Gt(Ct(s.b));return{r:It(rs(i+e*(Gt(Ct(t.r))-i))),g:It(rs(n+e*(Gt(Ct(t.g))-n))),b:It(rs(o+e*(Gt(Ct(t.b))-o))),a:s.a+e*(t.a-s.a)}}function Te(s,t,e){if(s){let i=Ts(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Rs(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function kn(s,t){return s&&Object.assign(t||{},s)}function ti(s){var t={r:0,g:0,b:0,a:255};return Array.isArray(s)?s.length>=3&&(t={r:s[0],g:s[1],b:s[2],a:255},s.length>3&&(t.a=It(s[3]))):(t=kn(s,{r:0,g:0,b:0,a:1}),t.a=It(t.a)),t}function dr(s){return s.charAt(0)==="r"?lr(s):sr(s)}class _e{constructor(t){if(t instanceof _e)return t;const e=typeof t;let i;e==="object"?i=ti(t):e==="string"&&(i=Xo(t)||rr(t)||dr(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=kn(this._rgb);return t&&(t.a=Ct(t.a)),t}set rgb(t){this._rgb=ti(t)}rgbString(){return this._valid?cr(this._rgb):void 0}hexString(){return this._valid?qo(this._rgb):void 0}hslString(){return this._valid?nr(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=i.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*n.r+.5,i.g=255&c*i.g+o*n.g+.5,i.b=255&c*i.b+o*n.b+.5,i.a=r*i.a+(1-r)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=hr(this._rgb,t._rgb,e)),this}clone(){return new _e(this.rgb)}alpha(t){return this._rgb.a=It(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Pe(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 Te(this._rgb,2,t),this}darken(t){return Te(this._rgb,2,-t),this}saturate(t){return Te(this._rgb,1,t),this}desaturate(t){return Te(this._rgb,1,-t),this}rotate(t){return ir(this._rgb,t),this}}function St(){}const ur=(()=>{let s=0;return()=>s++})();function H(s){return s==null}function et(s){if(Array.isArray&&Array.isArray(s))return!0;const t=Object.prototype.toString.call(s);
vendor: 4,301 bytes, line 1
1return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function W(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}function rt(s){return(typeof s=="number"||s instanceof Number)&&isFinite(+s)}function yt(s,t){return rt(s)?s:t}function I(s,t){return typeof s>"u"?t:s}const fr=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100:+s/t,wn=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function Y(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function V(s,t,e,i){let n,o,r;if(et(s))for(o=s.length,n=0;n<o;n++)t.call(e,s[n],n);else if(W(s))for(r=Object.keys(s),o=r.length,n=0;n<o;n++)t.call(e,s[r[n]],r[n])}function $e(s,t){let e,i,n,o;if(!s||!t||s.length!==t.length)return!1;for(e=0,i=s.length;e<i;++e)if(n=s[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Ye(s){if(et(s))return s.map(Ye);if(W(s)){const t=Object.create(null),e=Object.keys(s),i=e.length;let n=0;for(;n<i;++n)t[e[n]]=Ye(s[e[n]]);return t}return s}function Sn(s){return["__proto__","prototype","constructor"].indexOf(s)===-1}function gr(s,t,e,i){if(!Sn(s))return;const n=t[s],o=e[s];W(n)&&W(o)?ye(n,o,i):t[s]=Ye(o)}function ye(s,t,e){const i=et(t)?t:[t],n=i.length;if(!W(s))return s;e=e||{};const o=e.merger||gr;let r;for(let a=0;a<n;++a){if(r=i[a],!W(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],s,r,e)}return s}function ge(s,t){return ye(s,t,{merger:pr})}function pr(s,t,e){if(!Sn(s))return;const i=t[s],n=e[s];W(i)&&W(n)?ge(i,n):Object.prototype.hasOwnProperty.call(t,s)||(t[s]=Ye(n))}const ei={"":s=>s,x:s=>s.x,y:s=>s.y};function mr(s){const t=s.split("."),e=[];let i="";for(const n of t)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function br(s){const t=mr(s);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Xt(s,t){return(ei[t]||(ei[t]=br(t)))(s)}function Es(s){return s.charAt(0).toUpperCase()+s.slice(1)}const ve=s=>typeof s<"u",Ft=s=>typeof s=="function",si=(s,t)=>{if(s.size!==t.size)return!1;for(const e of s)if(!t.has(e))return!1;return!0};function xr(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}const j=Math.PI,X=2*j,_r=X+j,Ue=Number.POSITIVE_INFINITY,yr=j/180,st=j/2,Nt=j/4,ii=j*2/3,Mn=Math.log10,wt=Math.sign;function pe(s,t,e){return Math.abs(s-t)<e}function ni(s){const t=Math.round(s);s=pe(s,t,s/1e3)?t:s;const e=Math.pow(10,Math.floor(Mn(s))),i=s/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function vr(s){const t=[],e=Math.sqrt(s);let i;for(i=1;i<e;i++)s%i===0&&(t.push(i),t.push(s/i));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function kr(s){return typeof s=="symbol"||typeof s=="object"&&s!==null&&!(Symbol.toPrimitive in s||"toString"in s||"valueOf"in s)}function ke(s){return!kr(s)&&!isNaN(parseFloat(s))&&isFinite(s)}function wr(s,t){const e=Math.round(s);return e-t<=s&&e+t>=s}function Sr(s,t,e){let i,n,o;for(i=0,n=s.length;i<n;i++)o=s[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Dt(s){return s*(j/180)}function Mr(s){return s*(180/j)}function oi(s){if(!rt(s))return;let t=1,e=0;for(;Math.round(s*t)/t!==s;)t*=10,e++;return e}function Pn(s,t){const e=t.x-s.x,i=t.y-s.y,n=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*j&&(o+=X),{angle:o,distance:n}}function ws(s,t){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function Pr(s,t){return(s-t+_r)%X-j}function gt(s){return(s%X+X)%X}function we(s,t,e,i){const n=gt(s),o=gt(t),r=gt(e),a=gt(o-n),l=gt(r-n),c=gt(n-o),h=gt(n-r);return n===o||n===r||i&&o===r||a>l&&c<h}function ot(s,t,e){return Math.max(t,Math.min(e,s))}function Cr(s){return ot(s,-32768,32767)}function At(s,t,e,i=1e-6){return s>=Math.min(t,e)-i&&s<=Math.max(t,e)+i}function Is(s,t,e){e=e||(r=>s[r]<t);let i=s.length-1,n=0,o;for(;i-n>1;)o=n+i>>1,e(o)?n=o:i=o;return{lo:n,hi:i}}const Yt=(s,t,e,i)=>Is(s,e,i?n=>{const o=s[n][t];return o<e||o===e&&s[n+1][t]===e}:n=>s[n][t]<e),Dr=(s,t,e)=>Is(s,e,i=>s[i][t]>=e);function Ar(s,t,e){let i=0,n=s.length;for(;i<n&&s[i]<t;)i++;for(;n>i&&s[n-1]>e;)n--;return i>0||n<s.length?s.slice(i,n):s}const Cn=["push","pop","shift","splice","unshift"];function Or(s,t){if(s._chartjs){s._chartjs.listeners.push(t);return}Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}
vendor: 4,679 bytes, line 1
1),Cn.forEach(e=>{const i="_onData"+Es(e),n=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return s._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function ri(s,t){const e=s._chartjs;if(!e)return;const i=e.listeners,n=i.indexOf(t);n!==-1&&i.splice(n,1),!(i.length>0)&&(Cn.forEach(o=>{delete s[o]}),delete s._chartjs)}function Dn(s){const t=new Set(s);return t.size===s.length?s:Array.from(t)}const An=(function(){return typeof window>"u"?function(s){return s()}:window.requestAnimationFrame})();function On(s,t){let e=[],i=!1;return function(...n){e=n,i||(i=!0,An.call(window,()=>{i=!1,s.apply(t,e)}))}}function Tr(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}const Tn=s=>s==="start"?"left":s==="end"?"right":"center",ft=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,Lr=(s,t,e,i)=>s===(i?"left":"right")?e:s==="center"?(t+e)/2:t;function Rr(s,t,e){const i=t.length;let n=0,o=i;if(s._sorted){const{iScale:r,vScale:a,_parsed:l}=s,c=s.dataset&&s.dataset.options?s.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:m}=r.getUserBounds();if(f){if(n=Math.min(Yt(l,h,d).lo,e?i:Yt(t,h,r.getPixelForValue(d)).lo),c){const g=l.slice(0,n+1).reverse().findIndex(p=>!H(p[a.axis]));n-=Math.max(0,g)}n=ot(n,0,i-1)}if(m){let g=Math.max(Yt(l,r.axis,u,!0).hi+1,e?0:Yt(t,h,r.getPixelForValue(u),!0).hi+1);if(c){const p=l.slice(g-1).findIndex(x=>!H(x[a.axis]));g+=Math.max(0,p)}o=ot(g,n,i)-n}else o=i-n}return{start:n,count:o}}function Er(s){const{xScale:t,yScale:e,_scaleRanges:i}=s,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return s._scaleRanges=n,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,n),o}const Le=s=>s===0||s===1,ai=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*X/e)),li=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*X/e)+1,me={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>-s*(s-2),easeInOutQuad:s=>(s/=.5)<1?.5*s*s:-.5*(--s*(s-2)-1),easeInCubic:s=>s*s*s,easeOutCubic:s=>(s-=1)*s*s+1,easeInOutCubic:s=>(s/=.5)<1?.5*s*s*s:.5*((s-=2)*s*s+2),easeInQuart:s=>s*s*s*s,easeOutQuart:s=>-((s-=1)*s*s*s-1),easeInOutQuart:s=>(s/=.5)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2),easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>(s-=1)*s*s*s*s+1,easeInOutQuint:s=>(s/=.5)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2),easeInSine:s=>-Math.cos(s*st)+1,easeOutSine:s=>Math.sin(s*st),easeInOutSine:s=>-.5*(Math.cos(j*s)-1),easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:-Math.pow(2,-10*s)+1,easeInOutExpo:s=>Le(s)?s:s<.5?.5*Math.pow(2,10*(s*2-1)):.5*(-Math.pow(2,-10*(s*2-1))+2),easeInCirc:s=>s>=1?s:-(Math.sqrt(1-s*s)-1),easeOutCirc:s=>Math.sqrt(1-(s-=1)*s),easeInOutCirc:s=>(s/=.5)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1),easeInElastic:s=>Le(s)?s:ai(s,.075,.3),easeOutElastic:s=>Le(s)?s:li(s,.075,.3),easeInOutElastic(s){return Le(s)?s:s<.5?.5*ai(s*2,.1125,.45):.5+.5*li(s*2-1,.1125,.45)},easeInBack(s){return s*s*((1.70158+1)*s-1.70158)},easeOutBack(s){return(s-=1)*s*((1.70158+1)*s+1.70158)+1},easeInOutBack(s){let t=1.70158;return(s/=.5)<1?.5*(s*s*(((t*=1.525)+1)*s-t)):.5*((s-=2)*s*(((t*=1.525)+1)*s+t)+2)},easeInBounce:s=>1-me.easeOutBounce(1-s),easeOutBounce(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},easeInOutBounce:s=>s<.5?me.easeInBounce(s*2)*.5:me.easeOutBounce(s*2-1)*.5+.5};function Fs(s){if(s&&typeof s=="object"){const t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ci(s){return Fs(s)?s:new _e(s)}function as(s){return Fs(s)?s:new _e(s).saturate(.5).darken(.1).hexString()}const Ir=["x","y","borderWidth","radius","tension"],Fr=["color","borderColor","backgroundColor"];function zr(s){s.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),s.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),s.set("animations",{colors:{type:"color",properties:Fr},numbers:{type:"number",properties:Ir}}),s.describe("animations",{_fallback:"animation"}),s.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 Br(s){s.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const hi=new Map;function Wr(s,t){t=t||{};const e=s+JSON.stringify(t);let i=hi.get(e);
vendor: 21,441 bytes, line 1
1return i||(i=new Intl.NumberFormat(s,t),hi.set(e,i)),i}function zs(s,t,e){return Wr(t,e).format(s)}const Nr={values(s){return et(s)?s:""+s},numeric(s,t,e){if(s===0)return"0";const i=this.chart.options.locale;let n,o=s;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=Hr(s,e)}const r=Mn(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),zs(s,i,l)}};function Hr(s,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&s!==Math.floor(s)&&(e=s-Math.floor(s)),e}var Ln={formatters:Nr};function Vr(s){s.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:Ln.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.route("scale.ticks","color","","color"),s.route("scale.grid","color","","borderColor"),s.route("scale.border","color","","borderColor"),s.route("scale.title","color","","color"),s.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),s.describe("scales",{_fallback:"scale"}),s.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Kt=Object.create(null),Ss=Object.create(null);function be(s,t){if(!t)return s;const e=t.split(".");for(let i=0,n=e.length;i<n;++i){const o=e[i];s=s[o]||(s[o]=Object.create(null))}return s}function ls(s,t,e){return typeof t=="string"?ye(be(s,t),e):ye(be(s,""),t)}class jr{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=i=>i.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=(i,n)=>as(n.backgroundColor),this.hoverBorderColor=(i,n)=>as(n.borderColor),this.hoverColor=(i,n)=>as(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 ls(this,t,e)}get(t){return be(this,t)}describe(t,e){return ls(Ss,t,e)}override(t,e){return ls(Kt,t,e)}route(t,e,i,n){const o=be(this,t),r=be(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return W(l)?Object.assign({},c,l):I(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var K=new jr({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[zr,Br,Vr]);function $r(s){return!s||H(s.size)||H(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function di(s,t,e,i,n){let o=t[n];return o||(o=t[n]=s.measureText(n).width,e.push(n)),o>i&&(i=o),i}function Ht(s,t,e){const i=s.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*i)/i+n}function ui(s,t){!t&&!s||(t=t||s.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,s.width,s.height),t.restore())}function Ms(s,t,e,i){Rn(s,t,e,i,null)}function Rn(s,t,e,i,n){let o,r,a,l,c,h,d,u;const f=t.pointStyle,m=t.rotation,g=t.radius;let p=(m||0)*yr;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){s.save(),s.translate(e,i),s.rotate(p),s.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),s.restore();return}if(!(isNaN(g)||g<=0)){switch(s.beginPath(),f){default:n?s.ellipse(e,i,n/2,g,0,0,X):s.arc(e,i,g,0,X),s.closePath();break;case"triangle":h=n?n/2:g,s.moveTo(e+Math.sin(p)*h,i-Math.cos(p)*g),p+=ii,s.lineTo(e+Math.sin(p)*h,i-Math.cos(p)*g),p+=ii,s.lineTo(e+Math.sin(p)*h,i-Math.cos(p)*g),s.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(p+Nt)*l,d=Math.cos(p+Nt)*(n?n/2-c:l),a=Math.sin(p+Nt)*l,u=Math.sin(p+Nt)*(n?n/2-c:l),s.arc(e-d,i-a,c,p-j,p-st),s.arc(e+u,i-r,c,p-st,p),s.arc(e+d,i+a,c,p,p+st),s.arc(e-u,i+r,c,p+st,p+j),s.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,h=n?n/2:l,s.rect(e-h,i-l,2*h,2*l);break}p+=Nt;case"rectRot":d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,u=Math.sin(p)*(n?n/2:g),s.moveTo(e-d,i-a),s.lineTo(e+u,i-r),s.lineTo(e+d,i+a),s.lineTo(e-u,i+r),s.closePath();break;case"crossRot":p+=Nt;case"cross":d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,u=Math.sin(p)*(n?n/2:g),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r);break;case"star":d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,u=Math.sin(p)*(n?n/2:g),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r),p+=Nt,d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,u=Math.sin(p)*(n?n/2:g),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r);break;case"line":r=n?n/2:Math.cos(p)*g,a=Math.sin(p)*g,s.moveTo(e-r,i-a),s.lineTo(e+r,i+a);break;case"dash":s.moveTo(e,i),s.lineTo(e+Math.cos(p)*(n?n/2:g),i+Math.sin(p)*g);break;case!1:s.closePath();break}s.fill(),t.borderWidth>0&&s.stroke()}}function Se(s,t,e){return e=e||.5,!t||s&&s.x>t.left-e&&s.x<t.right+e&&s.y>t.top-e&&s.y<t.bottom+e}function Ze(s,t){s.save(),s.beginPath(),s.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),s.clip()}function Qe(s){s.restore()}function Yr(s,t,e,i,n){if(!t)return s.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;s.lineTo(o,t.y),s.lineTo(o,e.y)}else n==="after"!=!!i?s.lineTo(t.x,e.y):s.lineTo(e.x,t.y);s.lineTo(e.x,e.y)}function Ur(s,t,e,i){if(!t)return s.lineTo(e.x,e.y);s.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Xr(s,t){t.translation&&s.translate(t.translation[0],t.translation[1]),H(t.rotation)||s.rotate(t.rotation),t.color&&(s.fillStyle=t.color),t.textAlign&&(s.textAlign=t.textAlign),t.textBaseline&&(s.textBaseline=t.textBaseline)}function Kr(s,t,e,i,n){if(n.strikethrough||n.underline){const o=s.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;s.strokeStyle=s.fillStyle,s.beginPath(),s.lineWidth=n.decorationWidth||2,s.moveTo(r,h),s.lineTo(a,h),s.stroke()}}function qr(s,t){const e=s.fillStyle;s.fillStyle=t.color,s.fillRect(t.left,t.top,t.width,t.height),s.fillStyle=e}function Xe(s,t,e,i,n,o={}){const r=et(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(s.save(),s.font=n.string,Xr(s,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&qr(s,o.backdrop),a&&(o.strokeColor&&(s.strokeStyle=o.strokeColor),H(o.strokeWidth)||(s.lineWidth=o.strokeWidth),s.strokeText(c,e,i,o.maxWidth)),s.fillText(c,e,i,o.maxWidth),Kr(s,e,i,c,o),i+=Number(n.lineHeight);s.restore()}function Ke(s,t){const{x:e,y:i,w:n,h:o,radius:r}=t;s.arc(e+r.topLeft,i+r.topLeft,r.topLeft,1.5*j,j,!0),s.lineTo(e,i+o-r.bottomLeft),s.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,j,st,!0),s.lineTo(e+n-r.bottomRight,i+o),s.arc(e+n-r.bottomRight,i+o-r.bottomRight,r.bottomRight,st,0,!0),s.lineTo(e+n,i+r.topRight),s.arc(e+n-r.topRight,i+r.topRight,r.topRight,0,-st,!0),s.lineTo(e+r.topLeft,i)}const Gr=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Jr=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Zr(s,t){const e=(""+s).match(Gr);if(!e||e[1]==="normal")return t*1.2;switch(s=+e[2],e[3]){case"px":return s;case"%":s/=100;break}return t*s}const Qr=s=>+s||0;function Bs(s,t){const e={},i=W(t),n=i?Object.keys(t):t,o=W(s)?i?r=>I(s[r],s[t[r]]):r=>s[r]:()=>s;for(const r of n)e[r]=Qr(o(r));return e}function En(s){return Bs(s,{top:"y",right:"x",bottom:"y",left:"x"})}function te(s){return Bs(s,["topLeft","topRight","bottomLeft","bottomRight"])}function xt(s){const t=En(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function dt(s,t){s=s||{},t=t||K.font;let e=I(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=I(s.style,t.style);i&&!(""+i).match(Jr)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const n={family:I(s.family,t.family),lineHeight:Zr(I(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:I(s.weight,t.weight),string:""};return n.string=$r(n),n}function Re(s,t,e,i){let n,o,r;for(n=0,o=s.length;n<o;++n)if(r=s[n],r!==void 0&&r!==void 0)return r}function ta(s,t,e){const{min:i,max:n}=s,o=wn(t,(n-i)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(n,o)}}function qt(s,t){return Object.assign(Object.create(s),t)}function Ws(s,t=[""],e,i,n=()=>s[0]){const o=e||s;typeof i>"u"&&(i=Bn("_fallback",s));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:o,_fallback:i,_getTarget:n,override:a=>Ws([a,...s],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete s[0][l],!0},get(a,l){return Fn(a,l,()=>la(l,t,s,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(a,l){return gi(a).includes(l)},ownKeys(a){return gi(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function se(s,t,e,i){const n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:In(s,i),setContext:o=>se(s,o,e,i),override:o=>se(s.override(o),t,e,i)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete s[r],!0},get(o,r,a){return Fn(o,r,()=>sa(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(s,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,r)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(o,r){return Reflect.has(s,r)},ownKeys(){return Reflect.ownKeys(s)},set(o,r,a){return s[r]=a,delete o[r],!0}})}function In(s,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:n=t.allKeys}=s;return{allKeys:n,scriptable:e,indexable:i,isScriptable:Ft(e)?e:()=>e,isIndexable:Ft(i)?i:()=>i}}const ea=(s,t)=>s?s+Es(t):t,Ns=(s,t)=>W(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Fn(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t)||t==="constructor")return s[t];const i=e();return s[t]=i,i}function sa(s,t,e){const{_proxy:i,_context:n,_subProxy:o,_descriptors:r}=s;let a=i[t];return Ft(a)&&r.isScriptable(t)&&(a=ia(t,a,s,e)),et(a)&&a.length&&(a=na(t,a,s,r.isIndexable)),Ns(t,a)&&(a=se(a,n,o&&o[t],r)),a}function ia(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(s))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+s);a.add(s);let l=t(o,r||i);return a.delete(s),Ns(s,l)&&(l=Hs(n._scopes,n,s,l)),l}function na(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(s))return t[o.index%t.length];if(W(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Hs(c,n,s,h);t.push(se(d,o,r&&r[s],a))}}return t}function zn(s,t,e){return Ft(s)?s(t,e):s}const oa=(s,t)=>s===!0?t:typeof s=="string"?Xt(t,s):void 0;function ra(s,t,e,i,n){for(const o of t){const r=oa(e,o);if(r){s.add(r);const a=zn(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(r===!1&&typeof i<"u"&&e!==i)return null}return!1}function Hs(s,t,e,i){const n=t._rootScopes,o=zn(t._fallback,e,i),r=[...s,...n],a=new Set;a.add(i);let l=fi(a,r,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=fi(a,r,o,l,i),l===null)?!1:Ws(Array.from(a),[""],n,o,()=>aa(t,e,i))}function fi(s,t,e,i,n){for(;e;)e=ra(s,t,e,i,n);return e}function aa(s,t,e){const i=s._getTarget();t in i||(i[t]={});const n=i[t];return et(n)&&W(e)?e:n||{}}function la(s,t,e,i){let n;for(const o of t)if(n=Bn(ea(o,s),e),typeof n<"u")return Ns(s,n)?Hs(e,i,s,n):n}function Bn(s,t){for(const e of t){if(!e)continue;const i=e[s];if(typeof i<"u")return i}}function gi(s){let t=s._keys;return t||(t=s._keys=ca(s._scopes)),t}function ca(s){const t=new Set;for(const e of s)for(const i of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(i);return Array.from(t)}const ha=Number.EPSILON||1e-14,ie=(s,t)=>t<s.length&&!s[t].skip&&s[t],Wn=s=>s==="x"?"y":"x";function da(s,t,e,i){const n=s.skip?t:s,o=t,r=e.skip?t:e,a=ws(o,n),l=ws(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=i*c,u=i*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function ua(s,t,e){const i=s.length;let n,o,r,a,l,c=ie(s,0);for(let h=0;h<i-1;++h)if(l=c,c=ie(s,h+1),!(!l||!c)){if(pe(t[h],0,ha)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=n*r*t[h],e[h+1]=o*r*t[h])}}function fa(s,t,e="x"){const i=Wn(e),n=s.length;let o,r,a,l=ie(s,0);for(let c=0;c<n;++c){if(r=a,a=l,l=ie(s,c+1),!a)continue;const h=a[e],d=a[i];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${i}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${i}`]=d+o*t[c])}}function ga(s,t="x"){const e=Wn(t),i=s.length,n=Array(i).fill(0),o=Array(i);let r,a,l,c=ie(s,0);for(r=0;r<i;++r)if(a=l,l=c,c=ie(s,r+1),!!l){if(c){const h=c[t]-l[t];n[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?wt(n[r-1])!==wt(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}ua(s,n,o),fa(s,o,t)}function Ee(s,t,e){return Math.max(Math.min(s,e),t)}function pa(s,t){let e,i,n,o,r,a=Se(s[0],t);for(e=0,i=s.length;e<i;++e)r=o,o=a,a=e<i-1&&Se(s[e+1],t),o&&(n=s[e],r&&(n.cp1x=Ee(n.cp1x,t.left,t.right),n.cp1y=Ee(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=Ee(n.cp2x,t.left,t.right),n.cp2y=Ee(n.cp2y,t.top,t.bottom)))}function ma(s,t,e,i,n){let o,r,a,l;if(t.spanGaps&&(s=s.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")ga(s,n);else{let c=i?s[s.length-1]:s[0];for(o=0,r=s.length;o<r;++o)a=s[o],l=da(c,a,s[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&pa(s,e)}function Vs(){return typeof window<"u"&&typeof document<"u"}function js(s){let t=s.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function qe(s,t,e){let i;return typeof s=="string"?(i=parseInt(s,10),s.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=s,i}const ts=s=>s.ownerDocument.defaultView.getComputedStyle(s,null);function ba(s,t){return ts(s).getPropertyValue(t)}const xa=["top","right","bottom","left"];function Ut(s,t,e){const i={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=xa[n];i[o]=parseFloat(s[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const _a=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function ya(s,t){const e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:o}=i;let r=!1,a,l;if(_a(n,o,s.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function jt(s,t){if("native"in s)return s;const{canvas:e,currentDevicePixelRatio:i}=t,n=ts(e),o=n.boxSizing==="border-box",r=Ut(n,"padding"),a=Ut(n,"border","width"),{x:l,y:c,box:h}=ya(s,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:m}=t;return o&&(f-=r.width+a.width,m-=r.height+a.height),{x:Math.round((l-d)/f*e.width/i),y:Math.round((c-u)/m*e.height/i)}}function va(s,t,e){let i,n;if(t===void 0||e===void 0){const o=s&&js(s);if(!o)t=s.clientWidth,e=s.clientHeight;else{const r=o.getBoundingClientRect(),a=ts(o),l=Ut(a,"border","width"),c=Ut(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,i=qe(a.maxWidth,o,"clientWidth"),n=qe(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||Ue,maxHeight:n||Ue}}const Lt=s=>Math.round(s*10)/10;function ka(s,t,e,i){const n=ts(s),o=Ut(n,"margin"),r=qe(n.maxWidth,s,"clientWidth")||Ue,a=qe(n.maxHeight,s,"clientHeight")||Ue,l=va(s,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const u=Ut(n,"border","width"),f=Ut(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,i?c/i:h-o.height),c=Lt(Math.min(c,r,l.maxWidth)),h=Lt(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Lt(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,c=Lt(Math.floor(h*i))),{width:c,height:h}}function pi(s,t,e){const i=t||1,n=Lt(s.height*i),o=Lt(s.width*i);s.height=Lt(s.height),s.width=Lt(s.width);const r=s.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${s.height}px`,r.style.width=`${s.width}px`),s.currentDevicePixelRatio!==i||r.height!==n||r.width!==o?(s.currentDevicePixelRatio=i,r.height=n,r.width=o,s.ctx.setTransform(i,0,0,i,0,0),!0):!1}const wa=(function(){let s=!1;try{const t={get passive(){return s=!0,!1}};Vs()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return s})();function mi(s,t){const e=ba(s,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function $t(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:s.y+e*(t.y-s.y)}}function Sa(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:i==="middle"?e<.5?s.y:t.y:i==="after"?e<1?s.y:t.y:e>0?t.y:s.y}}function Ma(s,t,e,i){const n={x:s.cp2x,y:s.cp2y},o={x:t.cp1x,y:t.cp1y},r=$t(s,n,e),a=$t(n,o,e),l=$t(o,t,e),c=$t(r,a,e),h=$t(a,l,e);return $t(c,h,e)}const Pa=function(s,t){return{x(e){return s+s+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Ca=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,t){return s+t},leftForLtr(s,t){return s}}};function ee(s,t,e){return s?Pa(t,e):Ca()}function Nn(s,t){let e,i;(t==="ltr"||t==="rtl")&&(e=s.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),s.prevTextDirection=i)}function Hn(s,t){t!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",t[0],t[1]))}function Vn(s){return s==="angle"?{between:we,compare:Pr,normalize:gt}:{between:At,compare:(t,e)=>t-e,normalize:t=>t}}function bi({start:s,end:t,count:e,loop:i,style:n}){return{start:s%e,end:t%e,loop:i&&(t-s+1)%e===0,style:n}}function Da(s,t,e){const{property:i,start:n,end:o}=e,{between:r,normalize:a}=Vn(i),l=t.length;let{start:c,end:h,loop:d}=s,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&r(a(t[c%l][i]),n,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:s.style}}function jn(s,t,e){if(!e)return[s];const{property:i,start:n,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=Vn(i),{start:h,end:d,loop:u,style:f}=Da(s,t,e),m=[];let g=!1,p=null,x,v,S;const M=()=>l(n,S,x)&&a(n,S)!==0,k=()=>a(o,x)===0||l(o,S,x),T=()=>g||M(),C=()=>!g||k();for(let O=h,R=h;O<=d;++O)v=t[O%r],!v.skip&&(x=c(v[i]),x!==S&&(g=l(x,n,o),p===null&&T()&&(p=a(x,n)===0?O:R),p!==null&&C()&&(m.push(bi({start:p,end:O,loop:u,count:r,style:f})),p=null),R=O,S=x));return p!==null&&m.push(bi({start:p,end:d,loop:u,count:r,style:f})),m}function $n(s,t){const e=[],i=s.segments;for(let n=0;n<i.length;n++){const o=jn(i[n],s.points,t);o.length&&e.push(...o)}return e}function Aa(s,t,e,i){let n=0,o=t-1;if(e&&!i)for(;n<t&&!s[n].skip;)n++;for(;n<t&&s[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&s[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Oa(s,t,e,i){const n=s.length,o=[];let r=t,a=s[t],l;for(l=t+1;l<=e;++l){const c=s[l%n];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%n,end:(l-1)%n,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:i}),o}function Ta(s,t){const e=s.points,i=s.options.spanGaps,n=e.length;if(!n)return[];const o=!!s._loop,{start:r,end:a}=Aa(e,n,o,i);if(i===!0)return xi(s,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+n:a,c=!!s._fullLoop&&r===0&&a===n-1;return xi(s,Oa(e,r,l,c),e,t)}function xi(s,t,e,i){return!i||!i.setContext||!e?t:La(s,t,e,i)}function La(s,t,e,i){const n=s._chart.getContext(),o=_i(s.options),{_datasetIndex:r,options:{spanGaps:a}}=s,l=e.length,c=[];let h=o,d=t[0].start,u=d;function f(m,g,p,x){const v=a?-1:1;if(m!==g){for(m+=l;e[m%l].skip;)m-=v;for(;e[g%l].skip;)g+=v;m%l!==g%l&&(c.push({start:m%l,end:g%l,loop:p,style:x}),h=x,d=g%l)}}for(const m of t){d=a?d:m.start;let g=e[d%l],p;for(u=d+1;u<=m.end;u++){const x=e[u%l];p=_i(i.setContext(qt(n,{type:"segment",p0:g,p1:x,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),Ra(p,h)&&f(d,u-1,m.loop,h),g=x,h=p}d<u-1&&f(d,u-1,m.loop,h)}return c}function _i(s){return{backgroundColor:s.backgroundColor,borderCapStyle:s.borderCapStyle,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderJoinStyle:s.borderJoinStyle,borderWidth:s.borderWidth,borderColor:s.borderColor}}function Ra(s,t){if(!t)return!1;const e=[],i=function(n,o){return Fs(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(s,i)!==JSON.stringify(t,i)}function Ie(s,t,e){return s.options.clip?s[e]:t[e]}function Ea(s,t){const{xScale:e,yScale:i}=s;
1return e&&i?{left:Ie(e,t,"left"),right:Ie(e,t,"right"),top:Ie(i,t,"top"),bottom:Ie(i,t,"bottom")}:t}function Yn(s,t){const e=t._clip;if(e.disabled)return!1;const i=Ea(t,s.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?s.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?s.height:i.bottom+(e.bottom===!0?0:e.bottom)}}class Ia{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=An.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),o.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,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 i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Mt=new Ia;const yi="transparent",Fa={boolean(s,t,e){return e>.5?t:s},color(s,t,e){const i=ci(s||yi),n=i.valid&&ci(t||yi);
vendor: 19,319 bytes, line 1
1return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}};class za{constructor(t,e,i,n){const o=e[i];n=Re([t.to,n,o,t.from]);const r=Re([t.from,o,n]);this._active=!0,this._fn=t.fn||Fa[t.type||typeof r],this._easing=me[t.easing]||me.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Re([t.to,e,n,t.from]),this._from=Re([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<i),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}}class Un{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!W(t))return;const e=Object.keys(K.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!W(o))return;const r={};for(const a of e)r[a]=o[a];(et(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){const i=e.options,n=Wa(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&Ba(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=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 u=i.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new za(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return Mt.add(this._chart,i),!0}}function Ba(s,t){const e=[],i=Object.keys(t);for(let n=0;n<i.length;n++){const o=s[i[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Wa(s,t){if(!t)return;let e=s.options;if(!e){s.options=t;return}return e.$shared&&(s.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function vi(s,t){const e=s&&s.options||{},i=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:n,end:i?n:o}}function Na(s,t,e){if(e===!1)return!1;const i=vi(s,e),n=vi(t,e);return{top:n.end,right:i.end,bottom:n.start,left:i.start}}function Ha(s){let t,e,i,n;return W(s)?(t=s.top,e=s.right,i=s.bottom,n=s.left):t=e=i=n=s,{top:t,right:e,bottom:i,left:n,disabled:s===!1}}function Xn(s,t){const e=[],i=s._getSortedDatasetMetas(t);let n,o;for(n=0,o=i.length;n<o;++n)e.push(i[n].index);return e}function ki(s,t,e,i={}){const n=s.keys,o=i.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,i.all)continue;break}c=s.values[l],rt(c)&&(o||t===0||wt(t)===wt(c))&&(t+=c)}return!h&&!i.all?0:t}function Va(s,t){const{iScale:e,vScale:i}=t,n=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(s),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]:s[h]};return a}function cs(s,t){const e=s&&s.options.stacked;return e||e===void 0&&t.stack!==void 0}function ja(s,t,e){return`${s.id}.${t.id}.${e.stack||e.type}`}function $a(s){const{min:t,max:e,minDefined:i,maxDefined:n}=s.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function Ya(s,t,e){const i=s[t]||(s[t]={});return i[e]||(i[e]={})}function wi(s,t,e,i){for(const n of t.getMatchingVisibleMetas(i).reverse()){const o=s[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Si(s,t){const{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,h=ja(o,r,i),d=t.length;let u;for(let f=0;f<d;++f){const m=t[f],{[l]:g,[c]:p}=m,x=m._stacks||(m._stacks={});u=x[c]=Ya(n,h,g),u[a]=p,u._top=wi(u,r,!0,i.type),u._bottom=wi(u,r,!1,i.type);const v=u._visualValues||(u._visualValues={});v[a]=p}}function hs(s,t){const e=s.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Ua(s,t){return qt(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Xa(s,t,e){return qt(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function re(s,t){const e=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){t=t||s._parsed;for(const n of t){const o=n._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const ds=s=>s==="reset"||s==="none",Mi=(s,t)=>t?s:Object.assign({},s),Ka=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:Xn(e,!0),values:null};class es{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=cs(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&&re(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(d,u,f,m)=>d==="x"?u:d==="r"?m:f,o=e.xAxisID=I(i.xAxisID,hs(t,"x")),r=e.yAxisID=I(i.yAxisID,hs(t,"y")),a=e.rAxisID=I(i.rAxisID,hs(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&&ri(this._data,this),t._stacked&&re(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(W(e)){const n=this._cachedMeta;this._data=Va(e,n)}else if(i!==e){if(i){ri(i,this);const n=this._cachedMeta;re(n),n._parsed=[]}e&&Object.isExtensible(e)&&Or(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,i=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=cs(e.vScale,e),e.stack!==i.stack&&(n=!0,re(e),e.stack=i.stack),this._resyncElements(t),(n||o!==e._stacked)&&(Si(this,e._parsed),e._stacked=cs(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&e===n.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,d,u;if(this._parsing===!1)i._parsed=n,i._sorted=!0,u=n;else{et(n[t])?u=this.parseArrayData(i,n,t,e):W(n[t])?u=this.parseObjectData(i,n,t,e):u=this.parsePrimitiveData(i,n,t,e);const f=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)i._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);i._sorted=l}r&&Si(this,u)}parsePrimitiveData(t,e,i,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let u,f,m;for(u=0,f=n;u<f;++u)m=u+i,d[u]={[a]:h||o.parse(c[m],m),[l]:r.parse(e[m],m)};return d}parseArrayData(t,e,i,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+i,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,i,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,u,f;for(h=0,d=n;h<d;++h)u=h+i,f=e[u],c[h]={x:o.parse(Xt(f,a),u),y:r.parse(Xt(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Xn(n,!0),values:e._stacks[t.axis]._visualValues};return ki(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const o=i[e.axis];let r=o===null?NaN:o;const a=n&&i._stacks[e.axis];n&&a&&(n.values=a,r=ki(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,o=i._sorted&&t===i.iScale,r=n.length,a=this._getOtherScale(t),l=Ka(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=$a(a);let u,f;function m(){f=n[u];const g=f[a.axis];return!rt(f[t.axis])||h>g||d<g}for(u=0;u<r&&!(!m()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=r-1;u>=0;--u)if(!m()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],rt(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Ha(I(this.options.clip,Na(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.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 i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){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=Xa(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=Ua(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&ve(i);if(a)return Mi(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(K.elements[t]),m=()=>this.getContext(i,n,e),g=c.resolveNamedOptions(u,f,m,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(Mi(g,l))),g}_resolveAnimations(t,e,i){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),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,i,e))}const c=new Un(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||ds(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,n){ds(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ds(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=i.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,i=!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),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&re(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,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 i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function qa(s,t){if(!s._cache.$bar){const e=s.getMatchingVisibleMetas(t);let i=[];for(let n=0,o=e.length;n<o;n++)i=i.concat(e[n].controller.getAllParsedValues(s));s._cache.$bar=Dn(i.sort((n,o)=>n-o))}return s._cache.$bar}function Ga(s){const t=s.iScale,e=qa(t,s.type);let i=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(ve(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(n=0,o=e.length;n<o;++n)r=t.getPixelForValue(e[n]),l();for(a=void 0,n=0,o=t.ticks.length;n<o;++n)r=t.getPixelForTick(n),l();return i}function Ja(s,t,e,i){const n=e.barThickness;let o,r;return H(n)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=n*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[s]-o/2}}function Za(s,t,e,i){const n=t.pixels,o=n[s];let r=s>0?n[s-1]:null,a=s<n.length-1?n[s+1]:null;const l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:e.barPercentage,start:c}}function Qa(s,t,e,i){const n=e.parse(s[0],i),o=e.parse(s[1],i),r=Math.min(n,o),a=Math.max(n,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function Kn(s,t,e,i){return et(s)?Qa(s,t,e,i):t[e.axis]=e.parse(s,i),t}function Pi(s,t,e,i){const n=s.iScale,o=s.vScale,r=n.getLabels(),a=n===o,l=[];let c,h,d,u;for(c=e,h=e+i;c<h;++c)u=t[c],d={},d[n.axis]=a||n.parse(r[c],c),l.push(Kn(u,d,o,c));return l}function us(s){return s&&s.barStart!==void 0&&s.barEnd!==void 0}function tl(s,t,e){return s!==0?wt(s):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function el(s){let t,e,i,n,o;return s.horizontal?(t=s.base>s.x,e="left",i="right"):(t=s.base<s.y,e="bottom",i="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:i,reverse:t,top:n,bottom:o}}function sl(s,t,e,i){let n=t.borderSkipped;const o={};if(!n){s.borderSkipped=o;return}if(n===!0){s.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:h}=el(s);n==="middle"&&e&&(s.enableBorderRadius=!0,(e._top||0)===i?n=c:(e._bottom||0)===i?n=h:(o[Ci(h,r,a,l)]=!0,n=c)),o[Ci(n,r,a,l)]=!0,s.borderSkipped=o}function Ci(s,t,e,i){return i?(s=il(s,t,e),s=Di(s,e,t)):s=Di(s,t,e),s}function il(s,t,e){return s===t?e:s===e?t:s}function Di(s,t,e){return s==="start"?t:s==="end"?e:s}function nl(s,{inflateAmount:t},e){s.inflateAmount=t==="auto"?e===1?.33:0:t}class ol extends es{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return Pi(t,e,i,n)}parseArrayData(t,e,i,n){return Pi(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,h=r.axis==="x"?a:l,d=[];let u,f,m,g;for(u=i,f=i+n;u<f;++u)g=e[u],m={},m[o.axis]=o.parse(Xt(g,c),u),d.push(Kn(Xt(g,h),m,r,u));return d}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const o=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,o=this.getParsed(t),r=o._custom,a=us(r)?"["+r.start+", "+r.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const o=n==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+i;f++){const m=this.getParsed(f),g=o||H(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,h),x=(m._stacks||{})[a.axis],v={horizontal:c,base:g.base,enableBorderRadius:!x||us(m._custom)||r===x._top||r===x._bottom,x:c?g.head:p.center,y:c?p.center:g.head,height:c?p.size:Math.abs(g.size),width:c?Math.abs(g.size):p.size};u&&(v.options=d||this.resolveDataElementOptions(f,t[f].active?"active":n));const S=v.options||t[f].options;sl(v,S,x,r),nl(v,S,h.ratio),this.updateElement(t[f],f,v,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=i.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=h=>{const d=h._parsed.find(f=>
1f[i.axis]===l),u=d&&d[h.vScale.axis];if(H(u)||isNaN(u))return!0};for(const h of n)if(!(e!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[I(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const n=this._getStacks(t,i),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;o<r;++o)n.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=t.barThickness;return{min:a||Ga(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,h=us(c);let d=l[e.axis],u=0,f=i?this.applyStack(e,l,i):d,m,g;f!==d&&(u=f-d,f=d),h&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&wt(d)!==wt(c.barEnd)&&(u=0),u+=d);const p=!H(o)&&!h?o:u;let x=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(u+f):m=x,g=m-x,Math.abs(g)<r){g=tl(g,e,a)*r,d===a&&(x-=g/2);const v=e.getPixelForDecimal(0),S=e.getPixelForDecimal(1),M=Math.min(v,S),k=Math.max(v,S);x=Math.max(Math.min(x,k),M),m=x+g,i&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(m)-e.getValueForPixel(x))}if(x===e.getPixelForValue(a)){const v=wt(g)*e.getLineWidthForValue(a)/2;x+=v,g-=v}return{size:g,base:x,head:m,center:m+g/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,o=n.skipNull,r=I(n.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(e.grouped){const h=o?this._getStackCount(t):e.stackCount,d=n.barThickness==="flex"?Za(t,e,n,h*c):Ja(t,e,n,h*c),u=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(I(u,this.getFirstScaleIdForIndexAxis())),m=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+f;a=d.start+d.chunk*m+d.chunk/2,l=Math.min(r,d.chunk*d.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(r,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}function rl(s,t,e){let i=1,n=1,o=0,r=0;if(t<X){const a=s,l=a+t,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),u=Math.sin(l),f=(S,M,k)=>we(S,a,l,!0)?1:Math.max(M,M*e,k,k*e),m=(S,M,k)=>we(S,a,l,!0)?-1:Math.min(M,M*e,k,k*e),g=f(0,c,d),p=f(st,h,u),x=m(j,c,d),v=m(j+st,h,u);i=(g-x)/2,n=(p-v)/2,o=-(g+x)/2,r=-(p+v)/2}return{ratioX:i,ratioY:n,offsetX:o,offsetY:r}}class al extends es{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const d=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:n,pointStyle:i,borderRadius:r&&(a||d.borderRadius),index:c}}):[]}}
vendor: 5,085 bytes, line 1
1,onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=i;else{let o=l=>+i[l];if(W(i[t])){const{key:l="value"}=this._parsing;o=c=>+Xt(i[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)n._parsed[r]=o(r)}}_getRotation(){return Dt(this.options.rotation-90)}_getCircumference(){return Dt(this.options.circumference)}_getRotationExtents(){let t=X,e=-X;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const n=this.chart.getDatasetMeta(i).controller,o=n._getRotation(),r=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,n=this._cachedMeta,o=n.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(fr(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:m,offsetY:g}=rl(d,h,l),p=(i.width-r)/u,x=(i.height-r)/f,v=Math.max(Math.min(p,x)/2,0),S=wn(this.options.radius,v),M=Math.max(S*l,0),k=(S-M)/this._getVisibleDatasetWeightTotal();this.offsetX=m*S,this.offsetY=g*S,n.total=this.calculateTotal(),this.outerRadius=S-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/X)}updateElements(t,e,i,n){const o=n==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,d=(a.top+a.bottom)/2,u=o&&c.animateScale,f=u?0:this.innerRadius,m=u?0:this.outerRadius,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,n);let x=this._getRotation(),v;for(v=0;v<e;++v)x+=this._circumference(v,o);for(v=e;v<e+i;++v){const S=this._circumference(v,o),M=t[v],k={x:h+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+S,circumference:S,outerRadius:m,innerRadius:f};p&&(k.options=g||this.resolveDataElementOptions(v,M.active?"active":n)),x+=S,this.updateElement(M,v,k,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,n;for(n=0;n<e.length;n++){const o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?X*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=zs(e._parsed[t],i.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,o,r,a,l;if(!t){for(n=0,o=i.data.datasets.length;n<o;++n)if(i.isDatasetVisible(n)){r=i.getDatasetMeta(n),t=r.data,a=r.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)l=a.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const o=this.resolveDataElementOptions(i);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(I(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class ll extends es{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=Rr(e,n,r);this._drawStart=a,this._drawCount=l,Er(e)&&(a=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,i,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),u=r.axis,f=a.axis,{spanGaps:m,segment:g}=this.options,p=ke(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||n==="none",v=e+i,S=t.length;let M=e>0&&this.getParsed(e-1);for(let k=0;k<S;++k){const T=t[k],C=x?T:{};if(k<e||k>=v){C.skip=!0;continue}const O=this.getParsed(k),R=H(O[f]),F=C[u]=r.getPixelForValue(O[u],k),E=C[f]=o||R?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,O,l):O[f],k);
1C.skip=isNaN(F)||isNaN(E)||R,C.stop=k>0&&Math.abs(O[u]-M[u])>p,g&&(C.parsed=O,C.raw=c.data[k]),d&&(C.options=h||this.resolveDataElementOptions(k,T.active?"active":n)),x||this.updateElement(T,k,C,n),M=O}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function Vt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class $s{static override(t){Object.assign($s.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Vt()}parse(){return Vt()}format(){return Vt()}add(){return Vt()}diff(){return Vt()}startOf(){return Vt()}endOf(){return Vt()}}var cl={_date:$s};function hl(s,t,e,i){const{controller:n,data:o,_sorted:r}=s,a=n._cachedMeta.iScale,l=s.dataset&&s.dataset.options?s.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?Dr:Yt;if(i){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const u=c(o,t,e-d),f=c(o,t,e+d);return{lo:u.lo,hi:f.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:u}=s,f=u.slice(0,h.lo+1).reverse().findIndex(g=>!H(g[d.axis]));h.lo-=Math.max(0,f);const m=u.slice(h.hi).findIndex(g=>!H(g[d.axis]));h.hi+=Math.max(0,m)}return h}}return{lo:0,hi:o.length-1}}function ss(s,t,e,i,n){const o=s.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:u}=hl(o[a],t,r,n);for(let f=d;f<=u;++f){const m=h[f];m.skip||i(m,c,f)}}}function dl(s){const t=s.indexOf("x")!==-1,e=s.indexOf("y")!==-1;return function(i,n){const o=t?Math.abs(i.x-n.x):0,r=e?Math.abs(i.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function fs(s,t,e,i,n){const o=[];return!n&&!s.isPointInArea(t)||ss(s,e,t,function(a,l,c){!n&&!Se(a,s.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function ul(s,t,e,i){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:d}=Pn(r,{x:t.x,y:t.y});we(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return ss(s,e,t,o),n}function fl(s,t,e,i,n,o){let r=[];const a=dl(e);let l=Number.POSITIVE_INFINITY;function c(h,d,u){const f=h.inRange(t.x,t.y,n);if(i&&!f)return;const m=h.getCenterPoint(n);if(!(!!o||s.isPointInArea(m))&&!f)return;const p=a(t,m);p<l?(r=[{element:h,datasetIndex:d,index:u}],l=p):p===l&&r.push({element:h,datasetIndex:d,index:u})}return ss(s,e,t,c),r}function gs(s,t,e,i,n,o){return!o&&!s.isPointInArea(t)?[]:e==="r"&&!i?ul(s,t,e,n):fl(s,t,e,i,n,o)}function Ai(s,t,e,i,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return ss(s,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))}),i&&!a?[]:o}var gl={modes:{index(s,t,e,i){const n=jt(t,s),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?fs(s,n,o,i,r):gs(s,n,o,!1,i,r),l=[];return a.length?(s.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(s,t,e,i){const n=jt(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?fs(s,n,o,i,r):gs(s,n,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=s.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(s,t,e,i){const n=jt(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;return fs(s,n,o,i,r)},nearest(s,t,e,i){const n=jt(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;return gs(s,n,o,e.intersect,i,r)},x(s,t,e,i){const n=jt(t,s);return Ai(s,n,"x",e.intersect,i)},y(s,t,e,i){const n=jt(t,s);return Ai(s,n,"y",e.intersect,i)}}};const qn=["left","top","right","bottom"];function ae(s,t){return s.filter(e=>e.pos===t)}function Oi(s,t){return s.filter(e=>qn.indexOf(e.pos)===-1&&e.box.axis===t)}function le(s,t){return s.sort((e,i)=>{const n=t?i:e,o=t?e:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function pl(s){const t=[];let e,i,n,o,r,a;for(e=0,i=(s||[]).length;e<i;++e)n=s[e],{position:o,options:{stack:r,stackWeight:a=1}}
vendor: 4,135 bytes, line 1
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 ml(s){const t={};for(const e of s){const{stack:i,pos:n,stackWeight:o}=e;if(!i||!qn.includes(n))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function bl(s,t){const e=ml(s),{vBoxMaxWidth:i,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=s.length;o<r;++o){a=s[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*i:l&&t.availableWidth,a.height=n):(a.width=i,a.height=h?h*n:l&&t.availableHeight)}return e}function xl(s){const t=pl(s),e=le(t.filter(c=>c.box.fullSize),!0),i=le(ae(t,"left"),!0),n=le(ae(t,"right")),o=le(ae(t,"top"),!0),r=le(ae(t,"bottom")),a=Oi(t,"x"),l=Oi(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:ae(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function Ti(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function Gn(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function _l(s,t,e,i){const{pos:n,box:o}=e,r=s.maxPadding;if(!W(n)){e.size&&(s[n]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,s[n]+=e.size}o.getPadding&&Gn(r,o.getPadding());const a=Math.max(0,t.outerWidth-Ti(r,s,"left","right")),l=Math.max(0,t.outerHeight-Ti(r,s,"top","bottom")),c=a!==s.w,h=l!==s.h;return s.w=a,s.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function yl(s){const t=s.maxPadding;function e(i){const n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function vl(s,t){const e=t.maxPadding;function i(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 i(s?["left","right"]:["top","bottom"])}function ue(s,t,e,i){const n=[];let o,r,a,l,c,h;for(o=0,r=s.length,c=0;o<r;++o){a=s[o],l=a.box,l.update(a.width||t.w,a.height||t.h,vl(a.horizontal,t));const{same:d,other:u}=_l(t,e,a,i);c|=d&&n.length,h=h||u,l.fullSize||n.push(a)}return c&&ue(n,t,e,i)||h}function Fe(s,t,e,i,n){s.top=e,s.left=t,s.right=t+i,s.bottom=e+n,s.width=i,s.height=n}function Li(s,t,e,i){const n=e.padding;let{x:o,y:r}=t;for(const a of s){const l=a.box,c=i[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,u=c.size||l.height;ve(c.start)&&(r=c.start),l.fullSize?Fe(l,n.left,r,e.outerWidth-n.right-n.left,u):Fe(l,t.left+c.placed,r,d,u),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,u=c.size||l.width;ve(c.start)&&(o=c.start),l.fullSize?Fe(l,o,n.top,u,e.outerHeight-n.bottom-n.top):Fe(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var Rt={addBox(s,t){s.boxes||(s.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)}}]},s.boxes.push(t)},removeBox(s,t){const e=s.boxes?s.boxes.indexOf(t):-1;e!==-1&&s.boxes.splice(e,1)},configure(s,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(s,t,e,i){if(!s)return;const n=xt(s.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=xl(s.boxes),l=a.vertical,c=a.horizontal;V(s.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);Gn(u,xt(i));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),m=bl(l.concat(c),d);ue(a.fullSize,f,d,m),ue(l,f,d,m),ue(c,f,d,m)&&ue(l,f,d,m),yl(f),Li(a.leftAndTop,f,d,m),f.x+=f.w,f.y+=f.h,Li(a.rightAndBottom,f,d,m),s.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},V(a.chartArea,g=>{const p=g.box;Object.assign(p,s.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Jn{acquireContext(t,e){}releaseContext(t){return!1}
vendor: 5,036 bytes, line 1
1addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class kl extends Jn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ve="$chartjs",wl={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ri=s=>s===null||s==="";function Sl(s,t){const e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[Ve]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ri(n)){const o=mi(s,"width");o!==void 0&&(s.width=o)}if(Ri(i))if(s.style.height==="")s.height=s.width/(t||2);else{const o=mi(s,"height");o!==void 0&&(s.height=o)}return s}const Zn=wa?{passive:!0}:!1;function Ml(s,t,e){s&&s.addEventListener(t,e,Zn)}function Pl(s,t,e){s&&s.canvas&&s.canvas.removeEventListener(t,e,Zn)}function Cl(s,t){const e=wl[s.type]||s.type,{x:i,y:n}=jt(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function Ge(s,t){for(const e of s)if(e===t||e.contains(t))return!0}function Dl(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ge(a.addedNodes,i),r=r&&!Ge(a.removedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Al(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ge(a.removedNodes,i),r=r&&!Ge(a.addedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Me=new Map;let Ei=0;function Qn(){const s=window.devicePixelRatio;s!==Ei&&(Ei=s,Me.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function Ol(s,t){Me.size||window.addEventListener("resize",Qn),Me.set(s,t)}function Tl(s){Me.delete(s),Me.size||window.removeEventListener("resize",Qn)}function Ll(s,t,e){const i=s.canvas,n=i&&js(i);if(!n)return;const o=On((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),Ol(s,o),r}function ps(s,t,e){e&&e.disconnect(),t==="resize"&&Tl(s)}function Rl(s,t,e){const i=s.canvas,n=On(o=>{s.ctx!==null&&e(Cl(o,s))},s);return Ml(i,t,n),n}class El extends Jn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Sl(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ve])return!1;const i=e[Ve].initial;["height","width"].forEach(o=>{const r=i[o];H(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=i.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Ve],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Dl,detach:Al,resize:Ll}[e]||Rl;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:ps,detach:ps,resize:ps}[e]||Pl)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return ka(t,e,i,n)}isAttached(t){const e=t&&js(t);return!!(e&&e.isConnected)}}function Il(s){return!Vs()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?kl:El}class Bt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ke(this.x)&&ke(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(o=>{n[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),n}}function Fl(s,t){const e=s.options.ticks,i=zl(s),n=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Wl(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Nl(t,c,o,r/n),c;const h=Bl(o,t,n);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(ze(t,c,h,H(f)?0:a-f,a),d=0,u=r-1;d<u;d++)ze(t,c,h,o[d],o[d+1]);return ze(t,c,h,l,H(f)?t.length:l+f),c}return ze(t,c,h),c}function zl(s){const t=s.options.offset,e=s._tickSize(),i=s._length/e+(t?0:1),n=s._maxLength/e;return Math.floor(Math.min(i,n))}function Bl(s,t,e){const i=Hl(s),n=t.length/e;if(!i)return Math.max(n,1);const o=vr(i);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 Wl(s){const t=[];let e,i;for(e=0,i=s.length;e<i;e++)s[e].major&&t.push(e);return t}function Nl(s,t,e,i){let n=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<s.length;r++)r===o&&(t.push(s[r]),n++,o=e[n*i])}function ze(s,t,e,i,n){const o=I(i,0),r=Math.min(I(n,s.length),s.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-i,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(s[c]),a++,h=Math.round(o+a*e))}function Hl(s){const t=s.length;let e,i;if(t<2)return!1;for(i=s[0],e=1;e<t;++e)if(s[e]-s[e-1]!==i)return!1;return i}const Vl=s=>
vendor: 37,593 bytes, line 1
1s==="left"?"right":s==="right"?"left":s,Ii=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,Fi=(s,t)=>Math.min(t||s,s);function zi(s,t){const e=[],i=s.length/t,n=s.length;let o=0;for(;o<n;o+=i)e.push(s[Math.floor(o)]);return e}function jl(s,t,e){const i=s.ticks.length,n=Math.min(t,i-1),o=s._startPixel,r=s._endPixel,a=1e-6;let l=s.getPixelForTick(n),c;if(!(e&&(i===1?c=Math.max(l-o,r-l):t===0?c=(s.getPixelForTick(1)-l)/2:c=(l-s.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function $l(s,t){V(s,e=>{const i=e.gc,n=i.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[i[o]];i.splice(0,n)}})}function ce(s){return s.drawTicks?s.tickLength:0}function Bi(s,t){if(!s.display)return 0;const e=dt(s.font,t),i=xt(s.padding);return(et(s.text)?s.text.length:1)*e.lineHeight+i.height}function Yl(s,t){return qt(s,{scale:t,type:"scale"})}function Ul(s,t,e){return qt(s,{tick:e,index:t,type:"tick"})}function Xl(s,t,e){let i=Tn(s);return(e&&t!=="right"||!e&&t==="right")&&(i=Vl(i)),i}function Kl(s,t,e,i){const{top:n,left:o,bottom:r,right:a,chart:l}=s,{chartArea:c,scales:h}=l;let d=0,u,f,m;const g=r-n,p=a-o;if(s.isHorizontal()){if(f=ft(i,o,a),W(e)){const x=Object.keys(e)[0],v=e[x];m=h[x].getPixelForValue(v)+g-t}else e==="center"?m=(c.bottom+c.top)/2+g-t:m=Ii(s,e,t);u=a-o}else{if(W(e)){const x=Object.keys(e)[0],v=e[x];f=h[x].getPixelForValue(v)-p+t}else e==="center"?f=(c.left+c.right)/2-p+t:f=Ii(s,e,t);m=ft(i,r,n),d=e==="left"?-st:st}return{titleX:f,titleY:m,maxWidth:u,rotation:d}}class ne extends Bt{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:i,_suggestedMax:n}=this;return t=yt(t,Number.POSITIVE_INFINITY),e=yt(e,Number.NEGATIVE_INFINITY),i=yt(i,Number.POSITIVE_INFINITY),n=yt(n,Number.NEGATIVE_INFINITY),{min:yt(t,i),max:yt(e,n),minDefined:rt(t),maxDefined:rt(e)}}getMinMax(t){let{min:e,max:i,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:i};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||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=n&&e>i?e:i,{min:yt(e,yt(i,e)),max:yt(i,yt(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){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(){Y(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ta(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?zi(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Fl(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Y(this.options.afterUpdate,[this])}beforeSetDimensions(){Y(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(){Y(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Y(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Y(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,o;for(i=0,n=t.length;i<n;i++)o=t[i],o.label=Y(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){Y(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Y(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Fi(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||i<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=ot(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-ce(t.grid)-e.padding-Bi(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Mr(Math.min(Math.asin(ot((h.highest.height+6)/a,-1,1)),Math.asin(ot(l/c,-1,1))-Math.asin(ot(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){Y(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Y(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Bi(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=ce(o)+l):(t.height=this.maxHeight,t.width=ce(o)+l),i.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=i.padding*2,m=Dt(this.labelRotation),g=Math.cos(m),p=Math.sin(m);if(a){const x=i.mirror?0:p*d.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+x+f)}else{const x=i.mirror?0:g*d.width+p*u.height;t.width=Math.min(this.maxWidth,t.width+x+f)}this._calculatePadding(c,h,p,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,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 u=0,f=0;l?c?(u=n*t.width,f=i*e.height):(u=i*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Y(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,i;for(e=0,i=t.length;e<i;e++)H(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=zi(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Fi(e,i));let c=0,h=0,d,u,f,m,g,p,x,v,S,M,k;for(d=0;d<e;d+=l){if(m=t[d].label,g=this._resolveTickFontOptions(d),n.font=p=g.string,x=o[p]=o[p]||{data:{},gc:[]},v=g.lineHeight,S=M=0,!H(m)&&!et(m))S=di(n,x.data,x.gc,S,m),M=v;else if(et(m))for(u=0,f=m.length;u<f;++u)k=m[u],!H(k)&&!et(k)&&(S=di(n,x.data,x.gc,S,k),M+=v);r.push(S),a.push(M),c=Math.max(S,c),h=Math.max(M,h)}$l(o,e);const T=r.indexOf(c),C=a.indexOf(h),O=R=>({width:r[R]||0,height:a[R]||0});return{first:O(0),last:O(e-1),widest:O(T),highest:O(C),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 Cr(this._alignToPixels?Ht(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 i=e[t];return i.$context||(i.$context=Ul(this.getContext(),t,i))}return this.$context||(this.$context=Yl(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Dt(this.labelRotation),i=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*i>a*n?a/i:l/n:l*n<a*i?l/i:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=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),u=ce(o),f=[],m=a.setContext(this.getContext()),g=m.display?m.width:0,p=g/2,x=function($){return Ht(i,$,g)};let v,S,M,k,T,C,O,R,F,E,z,q;if(r==="top")v=x(this.bottom),C=this.bottom-u,R=v-p,E=x(t.top)+p,q=t.bottom;else if(r==="bottom")v=x(this.top),E=t.top,q=x(t.bottom)-p,C=v+p,R=this.top+u;else if(r==="left")v=x(this.right),T=this.right-u,O=v-p,F=x(t.left)+p,z=t.right;else if(r==="right")v=x(this.left),F=t.left,z=x(t.right)-p,T=v+p,O=this.left+u;else if(e==="x"){if(r==="center")v=x((t.top+t.bottom)/2+.5);else if(W(r)){const $=Object.keys(r)[0],U=r[$];v=x(this.chart.scales[$].getPixelForValue(U))}E=t.top,q=t.bottom,C=v+p,R=C+u}else if(e==="y"){if(r==="center")v=x((t.left+t.right)/2);else if(W(r)){const $=Object.keys(r)[0],U=r[$];v=x(this.chart.scales[$].getPixelForValue(U))}T=v-p,O=T-u,F=t.left,z=t.right}const nt=I(n.ticks.maxTicksLimit,d),N=Math.max(1,Math.ceil(d/nt));for(S=0;S<d;S+=N){const $=this.getContext(S),U=o.setContext($),ut=a.setContext($),it=U.lineWidth,Ot=U.color,_t=ut.dash||[],L=ut.dashOffset,y=U.tickWidth,J=U.tickColor,pt=U.tickBorderDash||[],at=U.tickBorderDashOffset;M=jl(this,S,l),M!==void 0&&(k=Ht(i,M,it),c?T=O=F=z=k:C=R=E=q=k,f.push({tx1:T,ty1:C,tx2:O,ty2:R,x1:F,y1:E,x2:z,y2:q,width:it,color:Ot,borderDash:_t,borderDashOffset:L,tickWidth:y,tickColor:J,tickBorderDash:pt,tickBorderDashOffset:at}))}return this._ticksLength=d,this._borderValue=v,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=ce(i.grid),f=u+h,m=d?-h:f,g=-Dt(this.labelRotation),p=[];let x,v,S,M,k,T,C,O,R,F,E,z,q="middle";if(n==="top")T=this.bottom-m,C=this._getXAxisLabelAlignment();else if(n==="bottom")T=this.top+m,C=this._getXAxisLabelAlignment();else if(n==="left"){const N=this._getYAxisLabelAlignment(u);C=N.textAlign,k=N.x}else if(n==="right"){const N=this._getYAxisLabelAlignment(u);C=N.textAlign,k=N.x}else if(e==="x"){if(n==="center")T=(t.top+t.bottom)/2+f;else if(W(n)){const N=Object.keys(n)[0],$=n[N];T=this.chart.scales[N].getPixelForValue($)+f}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")k=(t.left+t.right)/2-f;else if(W(n)){const N=Object.keys(n)[0],$=n[N];k=this.chart.scales[N].getPixelForValue($)}C=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?q="top":l==="end"&&(q="bottom"));const nt=this._getLabelSizes();for(x=0,v=a.length;x<v;++x){S=a[x],M=S.label;const N=o.setContext(this.getContext(x));O=this.getPixelForTick(x)+o.labelOffset,R=this._resolveTickFontOptions(x),F=R.lineHeight,E=et(M)?M.length:1;const $=E/2,U=N.color,ut=N.textStrokeColor,it=N.textStrokeWidth;let Ot=C;r?(k=O,C==="inner"&&(x===v-1?Ot=this.options.reverse?"left":"right":x===0?Ot=this.options.reverse?"right":"left":Ot="center"),n==="top"?c==="near"||g!==0?z=-E*F+F/2:c==="center"?z=-nt.highest.height/2-$*F+F:z=-nt.highest.height+F/2:c==="near"||g!==0?z=F/2:c==="center"?z=nt.highest.height/2-$*F:z=nt.highest.height-E*F,d&&(z*=-1),g!==0&&!N.showLabelBackdrop&&(k+=F/2*Math.sin(g))):(T=O,z=(1-E)*F/2);let _t;if(N.showLabelBackdrop){const L=xt(N.backdropPadding),y=nt.heights[x],J=nt.widths[x];let pt=z-L.top,at=0-L.left;switch(q){case"middle":pt-=y/2;break;case"bottom":pt-=y;break}switch(C){case"center":at-=J/2;break;case"right":at-=J;break;case"inner":x===v-1?at-=J:x>0&&(at-=J/2);break}_t={left:at,top:pt,width:J+L.width,height:y+L.height,color:N.backdropColor}}p.push({label:M,font:R,textOffset:z,options:{rotation:g,color:U,strokeColor:ut,strokeWidth:it,textAlign:Ot,textBaseline:q,translation:[k,T],backdrop:_t}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Dt(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:i,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,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;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:i,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,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,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=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:i,grid:n}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,u;this.isHorizontal()?(c=Ht(t,this.left,r)-r/2,h=Ht(t,this.right,a)+a/2,d=u=l):(d=Ht(t,this.top,r)-r/2,u=Ht(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,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,n=this._computeLabelArea();n&&Ze(i,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;Xe(i,c,0,h,l,a)}n&&Qe(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=dt(i.font),r=xt(i.padding),a=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||W(e)?(l+=r.bottom,et(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=Kl(this,l,e,a);Xe(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:Xl(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,i=I(t.grid&&t.grid.z,-1),n=I(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ne.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,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(),i=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[i]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return dt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Be{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Jl(e)&&(i=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,ql(t,r,i),this.override&&K.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in K[n]&&(delete K[n][i],this.override&&delete Kt[i])}}function ql(s,t,e){const i=ye(Object.create(null),[e?K.get(e):{},K.get(t),s.defaults]);K.set(t,i),s.defaultRoutes&&Gl(t,s.defaultRoutes),s.descriptors&&K.describe(t,s.descriptors)}function Gl(s,t){Object.keys(t).forEach(e=>{const i=e.split("."),n=i.pop(),o=[s].concat(i).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");K.route(o,n,l,a)})}function Jl(s){return"id"in s&&"defaults"in s}class Zl{constructor(){this.controllers=new Be(es,"datasets",!0),this.elements=new Be(Bt,"elements"),this.plugins=new Be(Object,"plugins"),this.scales=new Be(ne,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{const o=i||this._getRegistryForType(n);i||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):V(n,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){const n=Es(t);Y(i["before"+n],[],i),e[t](i),Y(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var kt=new Zl;class Ql{constructor(){this._init=void 0}notify(t,e,i,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,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,e,i,n){n=n||{};for(const o of t){const r=o.plugin,a=r[i],l=[e,n,o.options];if(Y(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){H(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 i=t&&t.config,n=I(i.options&&i.options.plugins,{}),o=tc(i);return n===!1&&!e?[]:sc(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function tc(s){const t={},e=[],i=Object.keys(kt.plugins.items);for(let o=0;o<i.length;o++)e.push(kt.getPlugin(i[o]));const n=s.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 ec(s,t){return!t&&s===!1?null:s===!0?{}:s}function sc(s,{plugins:t,localIds:e},i,n){const o=[],r=s.getContext();for(const a of t){const l=a.id,c=ec(i[l],n);c!==null&&o.push({plugin:a,options:ic(s.config,{plugin:a,local:e[l]},c,r)})}return o}function ic(s,{plugin:t,local:e},i,n){const o=s.pluginScopeKeys(t),r=s.getOptionScopes(i,o);return e&&t.defaults&&r.push(t.defaults),s.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ps(s,t){const e=K.datasets[s]||{};return((t.datasets||{})[s]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function nc(s,t){let e=s;return s==="_index_"?e=t:s==="_value_"&&(e=t==="x"?"y":"x"),e}function oc(s,t){return s===t?"_index_":"_value_"}function Wi(s){if(s==="x"||s==="y"||s==="r")return s}function rc(s){if(s==="top"||s==="bottom")return"x";if(s==="left"||s==="right")return"y"}function Cs(s,...t){if(Wi(s))return s;for(const e of t){const i=e.axis||rc(e.position)||s.length>1&&Wi(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function Ni(s,t,e){if(e[t+"AxisID"]===s)return{axis:t}}function ac(s,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(e.length)return Ni(s,"x",e[0])||Ni(s,"y",e[0])}return{}}function lc(s,t){const e=Kt[s.type]||{scales:{}},i=t.scales||{},n=Ps(s.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!W(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=Cs(r,a,ac(r,s),K.scales[a.type]),c=oc(l,n),h=e.scales||{};o[r]=ge(Object.create(null),[{axis:l},a,h[l],h[c]])}),s.data.datasets.forEach(r=>{const a=r.type||s.type,l=r.indexAxis||Ps(a,t),h=(Kt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=nc(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),ge(o[f],[{axis:u},i[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];ge(a,[K.scales[a.type],K.scale])}),o}function to(s){const t=s.options||(s.options={});t.plugins=I(t.plugins,{}),t.scales=lc(s,t)}function eo(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function cc(s){return s=s||{},s.data=eo(s.data),to(s),s}const Hi=new Map,so=new Set;function We(s,t){let e=Hi.get(s);return e||(e=t(),Hi.set(s,e),so.add(e)),e}const he=(s,t,e)=>{const i=Xt(t,e);i!==void 0&&s.add(i)};class hc{constructor(t){this._config=cc(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=eo(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(),to(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return We(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return We(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return We(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return We(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>he(l,t,d))),h.forEach(d=>he(l,n,d)),h.forEach(d=>he(l,Kt[o]||{},d)),h.forEach(d=>he(l,K,d)),h.forEach(d=>he(l,Ss,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),so.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Kt[e]||{},K.datasets[e]||{},{type:e},K,Ss]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Vi(this._resolverCache,t,n);let l=r;if(uc(r,e)){o.$shared=!1,i=Ft(i)?i():i;const c=this.createResolver(t,i,a);l=se(r,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Vi(this._resolverCache,t,i);return W(e)?se(o,e,void 0,n):o}}function Vi(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));const n=e.join();let o=i.get(n);return o||(o={resolver:Ws(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,o)),o}const dc=s=>W(s)&&Object.getOwnPropertyNames(s).some(t=>Ft(s[t]));function uc(s,t){const{isScriptable:e,isIndexable:i}=In(s);for(const n of t){const o=e(n),r=i(n),a=(r||o)&&s[n];if(o&&(Ft(a)||dc(a))||r&&et(a))return!0}return!1}var fc="4.5.1";const gc=["top","bottom","left","right","chartArea"];function ji(s,t){return s==="top"||s==="bottom"||gc.indexOf(s)===-1&&t==="x"}function $i(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function Yi(s){const t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Y(e&&e.onComplete,[s],t)}function pc(s){const t=s.chart,e=t.options.animation;Y(e&&e.onProgress,[s],t)}function io(s){return Vs()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const je={},Ui=s=>{const t=io(s);return Object.values(je).filter(e=>e.canvas===t).pop()};function mc(s,t,e){const i=Object.keys(s);for(const n of i){const o=+n;if(o>=t){const r=s[n];delete s[n],(e>0||o>t)&&(s[o+e]=r)}}}function bc(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}let oe=class{static defaults=K;static instances=je;static overrides=Kt;static registry=kt;static version=fc;static getChart=Ui;static register(...t){kt.add(...t),Xi()}static unregister(...t){kt.remove(...t),Xi()}constructor(t,e){const i=this.config=new hc(e),n=io(t),o=Ui(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=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Il(n)),this.platform.updateConfig(i);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=ur(),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 Ql,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Tr(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],je[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Mt.listen(this,"complete",Yi),Mt.listen(this,"progress",pc),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return H(t)?e&&o?o:n?i/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 kt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():pi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ui(this.canvas,this.ctx),this}stop(){return Mt.stop(this),this}resize(t,e){Mt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,pi(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),Y(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};V(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=Cs(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),V(o,r=>{const a=r.options,l=a.id,c=Cs(l,a),h=I(a.type,r.dtype);(a.position===void 0||ji(a.position,c)!==ji(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in i&&i[l].type===h)d=i[l];else{const u=kt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),V(n,(r,a)=>{r||delete i[a]}),V(i,r=>{Rt.configure(this,r,r.options),Rt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,o)=>n.index-o.index),i>e){for(let n=e;n<i;++n)this._destroyDatasetMeta(n);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort($i("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const o=e[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||Ps(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const l=kt.getController(a),{datasetElementType:c,dataElementType:h}=K.datasets[a];Object.assign(l,{dataElementType:kt.getElement(h),datasetElementType:c&&kt.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){V(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 i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.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),u=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),n||V(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort($i("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){V(this.scales,t=>{Rt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!si(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of e){const r=i==="_removeElements"?-o:o;mc(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=i(0);for(let o=1;o<e;o++)if(!si(n,i(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;Rt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],V(this.boxes,n=>{i&&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,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Ft(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Mt.has(this)?this.attached&&!Mt.running(this)&&Mt.start(this):(this.draw(),Yi({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,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,i=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&i.push(r)}return i}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,i={meta:t,index:t.index,cancelable:!0},n=Yn(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(n&&Ze(e,n),t.controller.draw(),n&&Qe(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Se(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const o=gl.modes[e];return typeof o=="function"?o(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.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},i.push(n)),n}getContext(){return this.$context||(this.$context=qt(null,{chart:this,type:"chart"}))}
1getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);ve(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),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(),Mt.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(),ui(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete je[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,i=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};V(this.options.events,o=>i(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(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(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){V(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},V(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"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||[],i=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}});!$e(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){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=i?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 i={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",i,n)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,i,r),l=xr(t),c=bc(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Y(o.onHover,[t,a,this],this),l&&Y(o.onClick,[t,a,this],this));const h=!$e(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}};function Xi(){return V(oe.instances,s=>s._plugins.invalidate())}function xc(s,t,e){const{startAngle:i,x:n,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,gt(i-e));if(s.beginPath(),s.arc(n,o,r-c/2,i+d/2,e-d/2),a>0){const u=Math.min(c/a,gt(i-e));s.arc(n,o,a+c/2,e-u/2,i+u/2,!0)}else{const u=Math.min(c/2,r*gt(i-e));if(h==="round")s.arc(n,o,u,e-j/2,i+j/2,!0);else if(h==="bevel"){const f=2*u*u,m=-f*Math.cos(e+j/2)+n,g=-f*Math.sin(e+j/2)+o,p=f*Math.cos(i+j/2)+n,x=f*Math.sin(i+j/2)+o;s.lineTo(m,g),s.lineTo(p,x)}}s.closePath(),s.moveTo(0,0),s.rect(0,0,s.canvas.width,s.canvas.height),s.clip("evenodd")}function _c(s,t,e){const{startAngle:i,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;
vendor: 4,098 bytes, line 1
1let c=n/a;s.beginPath(),s.arc(o,r,a,i-c,e+c),l>n?(c=n/l,s.arc(o,r,l,e+c,i-c,!0)):s.arc(o,r,n,e+st,i-st),s.closePath(),s.clip()}function yc(s){return Bs(s,["outerStart","outerEnd","innerStart","innerEnd"])}function vc(s,t,e,i){const n=yc(s.options.borderRadius),o=(e-t)/2,r=Math.min(o,i*t/2),a=l=>{const c=(e-Math.min(o,l))*i/2;return ot(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:ot(n.innerStart,0,r),innerEnd:ot(n.innerEnd,0,r)}}function Jt(s,t,e,i){return{x:e+s*Math.cos(t),y:i+s*Math.sin(t)}}function Je(s,t,e,i,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+i+e-c,0),u=h>0?h+i+e+c:0;let f=0;const m=n-l;if(i){const N=h>0?h-i:0,$=d>0?d-i:0,U=(N+$)/2,ut=U!==0?m*U/(U+i):m;f=(m-ut)/2}const g=Math.max(.001,m*d-e/j)/d,p=(m-g)/2,x=l+p+f,v=n-p-f,{outerStart:S,outerEnd:M,innerStart:k,innerEnd:T}=vc(t,u,d,v-x),C=d-S,O=d-M,R=x+S/C,F=v-M/O,E=u+k,z=u+T,q=x+k/E,nt=v-T/z;if(s.beginPath(),o){const N=(R+F)/2;if(s.arc(r,a,d,R,N),s.arc(r,a,d,N,F),M>0){const it=Jt(O,F,r,a);s.arc(it.x,it.y,M,F,v+st)}const $=Jt(z,v,r,a);if(s.lineTo($.x,$.y),T>0){const it=Jt(z,nt,r,a);s.arc(it.x,it.y,T,v+st,nt+Math.PI)}const U=(v-T/u+(x+k/u))/2;if(s.arc(r,a,u,v-T/u,U,!0),s.arc(r,a,u,U,x+k/u,!0),k>0){const it=Jt(E,q,r,a);s.arc(it.x,it.y,k,q+Math.PI,x-st)}const ut=Jt(C,x,r,a);if(s.lineTo(ut.x,ut.y),S>0){const it=Jt(C,R,r,a);s.arc(it.x,it.y,S,x-st,R)}}else{s.moveTo(r,a);const N=Math.cos(R)*d+r,$=Math.sin(R)*d+a;s.lineTo(N,$);const U=Math.cos(F)*d+r,ut=Math.sin(F)*d+a;s.lineTo(U,ut)}s.closePath()}function kc(s,t,e,i,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Je(s,t,e,i,l,n);for(let c=0;c<o;++c)s.fill();isNaN(a)||(l=r+(a%X||X))}return Je(s,t,e,i,l,n),s.fill(),l}function wc(s,t,e,i,n){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,m=l.borderAlign==="inner";if(!c)return;s.setLineDash(d||[]),s.lineDashOffset=u,m?(s.lineWidth=c*2,s.lineJoin=h||"round"):(s.lineWidth=c,s.lineJoin=h||"bevel");let g=t.endAngle;if(o){Je(s,t,e,i,g,n);for(let p=0;p<o;++p)s.stroke();isNaN(a)||(g=r+(a%X||X))}m&&_c(s,t,g),l.selfJoin&&g-r>=j&&f===0&&h!=="miter"&&xc(s,t,g),o||(Je(s,t,e,i,g,n),s.stroke())}class Sc extends Bt{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,i){const n=this.getProps(["x","y"],i),{angle:o,distance:r}=Pn(n,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,f=I(d,l-a),m=we(o,a,l)&&a!==l,g=f>=X||m,p=At(r,c+u,h+u);return g&&p}getCenterPoint(t){const{x:e,y:i,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:i+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>X?Math.floor(i/X):0,i===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(j,i||0)),c=n*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,kc(t,this,c,o,r),wc(t,this,c,o,r),t.restore(
vendor: 5,513 bytes, line 1
1)}}function no(s,t,e=t){s.lineCap=I(e.borderCapStyle,t.borderCapStyle),s.setLineDash(I(e.borderDash,t.borderDash)),s.lineDashOffset=I(e.borderDashOffset,t.borderDashOffset),s.lineJoin=I(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=I(e.borderWidth,t.borderWidth),s.strokeStyle=I(e.borderColor,t.borderColor)}function Mc(s,t,e){s.lineTo(e.x,e.y)}function Pc(s){return s.stepped?Yr:s.tension||s.cubicInterpolationMode==="monotone"?Ur:Mc}function oo(s,t,e={}){const i=s.length,{start:n=0,end:o=i-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=n<r&&o<r||n>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!h?i+c-l:c-l}}function Cc(s,t,e,i){const{points:n,options:o}=t,{count:r,start:a,loop:l,ilen:c}=oo(n,e,i),h=Pc(o);let{move:d=!0,reverse:u}=i||{},f,m,g;for(f=0;f<=c;++f)m=n[(a+(u?c-f:f))%r],!m.skip&&(d?(s.moveTo(m.x,m.y),d=!1):h(s,g,m,u,o.stepped),g=m);return l&&(m=n[(a+(u?c:0))%r],h(s,g,m,u,o.stepped)),!!l}function Dc(s,t,e,i){const n=t.points,{count:o,start:r,ilen:a}=oo(n,e,i),{move:l=!0,reverse:c}=i||{};let h=0,d=0,u,f,m,g,p,x;const v=M=>(r+(c?a-M:M))%o,S=()=>{g!==p&&(s.lineTo(h,p),s.lineTo(h,g),s.lineTo(h,x))};for(l&&(f=n[v(0)],s.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[v(u)],f.skip)continue;const M=f.x,k=f.y,T=M|0;T===m?(k<g?g=k:k>p&&(p=k),h=(d*h+M)/++d):(S(),s.lineTo(M,k),m=T,d=0,g=p=k),x=k}S()}function Ds(s){const t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Dc:Cc}function Ac(s){return s.stepped?Sa:s.tension||s.cubicInterpolationMode==="monotone"?Ma:$t}function Oc(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),no(s,t.options),s.stroke(n)}function Tc(s,t,e,i){const{segments:n,options:o}=t,r=Ds(t);for(const a of n)no(s,o,a.style),s.beginPath(),r(s,t,a,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}const Lc=typeof Path2D=="function";function Rc(s,t,e,i){Lc&&!t.options.segment?Oc(s,t,e,i):Tc(s,t,e,i)}class is extends Bt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;ma(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ta(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,r=$n(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=Ac(i);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:u}=r[c],f=o[d],m=o[u];if(f===m){a.push(f);continue}const g=Math.abs((n-f[e])/(m[e]-f[e])),p=l(f,m,g,i.stepped);p[e]=t[e],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Ds(this)(t,this,e,i)}path(t,e,i){const n=this.segments,o=Ds(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const a of n)r&=o(t,this,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Rc(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Ki(s,t,e,i){const n=s.options,{[e]:o}=s.getProps([e],i);return Math.abs(t-o)<n.radius+n.hitRadius}class Ec extends Bt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return Ki(this,t,"x",e)}inYRange(t,e){return Ki(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Se(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Ms(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function ro(s,t){const{x:e,y:i,base:n,width:o,height:r}=s.getProps(["x","y","base","width","height"],t);let a,l,c,h,d;return s.horizontal?(d=r/2,a=Math.min(e,n),l=Math.max(e,n),c=i-d,h=i+d):(d=o/2,a=e-d,l=e+d,c=Math.min(i,n),h=Math.max(i,n)),{left:a,top:c,right:l,bottom:h}}function Et(s,t,e,i){return s?0:ot(t,e,i)}function Ic(s,t,e){const i=s.options.borderWidth,n=s.borderSkipped,o=En(i);
vendor: 4,089 bytes, line 1
1return{t:Et(n.top,o.top,0,e),r:Et(n.right,o.right,0,t),b:Et(n.bottom,o.bottom,0,e),l:Et(n.left,o.left,0,t)}}function Fc(s,t,e){const{enableBorderRadius:i}=s.getProps(["enableBorderRadius"]),n=s.options.borderRadius,o=te(n),r=Math.min(t,e),a=s.borderSkipped,l=i||W(n);return{topLeft:Et(!l||a.top||a.left,o.topLeft,0,r),topRight:Et(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Et(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Et(!l||a.bottom||a.right,o.bottomRight,0,r)}}function zc(s){const t=ro(s),e=t.right-t.left,i=t.bottom-t.top,n=Ic(s,e/2,i/2),o=Fc(s,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:i-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function ms(s,t,e,i){const n=t===null,o=e===null,a=s&&!(n&&o)&&ro(s,i);return a&&(n||At(t,a.left,a.right))&&(o||At(e,a.top,a.bottom))}function Bc(s){return s.topLeft||s.topRight||s.bottomLeft||s.bottomRight}function Wc(s,t){s.rect(t.x,t.y,t.w,t.h)}function bs(s,t,e={}){const i=s.x!==e.x?-t:0,n=s.y!==e.y?-t:0,o=(s.x+s.w!==e.x+e.w?t:0)-i,r=(s.y+s.h!==e.y+e.h?t:0)-n;return{x:s.x+i,y:s.y+n,w:s.w+o,h:s.h+r,radius:s.radius}}class Nc extends Bt{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:o,outer:r}=zc(this),a=Bc(r.radius)?Ke:Wc;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,bs(r,e,o)),t.clip(),a(t,bs(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,bs(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return ms(this,t,e,i)}inXRange(t,e){return ms(this,t,null,e)}inYRange(t,e){return ms(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?i:(i+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}function Hc(s,t,e){const i=s.segments,n=s.points,o=t.points,r=[];for(const a of i){let{start:l,end:c}=a;c=ns(l,c,n);const h=As(e,n[l],n[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:n[l],end:n[c]});continue}const d=$n(t,h);for(const u of d){const f=As(e,o[u.start],o[u.end],u.loop),m=jn(a,n,f);for(const g of m)r.push({source:g,target:u,start:{[e]:qi(h,f,"start",Math.max)},end:{[e]:qi(h,f,"end",Math.min)}})}}return r}function As(s,t,e,i){if(i)return;let n=t[s],o=e[s];return s==="angle"&&(n=gt(n),o=gt(o)),{property:s,start:n,end:o}}function Vc(s,t){const{x:e=null,y:i=null}=s||{},n=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=ns(r,a,n);const l=n[r],c=n[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function ns(s,t,e){for(;t>s;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function qi(s,t,e,i){return s&&t?i(s[e],t[e]):s?s[e]:t?t[e]:0}function ao(s,t){let e=[],i=!1;return et(s)?(i=!0,e=s):e=Vc(s,t),e.length?new is({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Gi(s){return s&&s.fill!==!1}function jc(s,t,e){let n=s[t].fill;const o=[t];let r;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!rt(n))return n;if(r=s[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function $c(s,t,e){const i=Kc(s);if(W(i))return isNaN(i.value)?!1:i;let n=parseFloat(i);return rt(n)&&Math.floor(n)===n?Yc(i[0],t,n,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Yc(s,t,e,i){return(s==="-"||s==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Uc(s,t){let e=null;return s==="start"?e=t.bottom:s==="end"?e=t.top:W(s)?e=t.getPixelForValue(s.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Xc(s,t,e){let i;
1return s==="start"?i=e:s==="end"?i=t.options.reverse?t.min:t.max:W(s)?i=s.value:i=t.getBaseValue(),i}function Kc(s){const t=s.options,e=t.fill;let i=I(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function qc(s){const{scale:t,index:e,line:i}=s,n=[],o=i.segments,r=i.points,a=Gc(t,e);a.push(ao({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)Jc(n,r[h],a)}return new is({points:n,options:{}})}function Gc(s,t){const e=[],i=s.getMatchingVisibleMetas("line");for(let n=0;n<i.length;n++){const o=i[n];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Jc(s,t,e){const i=[];for(let n=0;n<e.length;n++){const o=e[n],{first:r,last:a,point:l}=Zc(o,t,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(s.push(l),!a)break}}s.push(...i)}function Zc(s,t,e){const i=s.interpolate(t,e);if(!i)return{};const n=i[e],o=s.segments,r=s.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],d=r[h.start][e],u=r[h.end][e];if(At(n,d,u)){a=n===d,l=n===u;break}}return{first:a,last:l,point:i}}class lo{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:o,radius:r}=this;return e=e||{start:0,end:X},t.arc(n,o,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:i+Math.sin(o)*n,angle:o}}}function Qc(s){const{chart:t,fill:e,line:i}=s;if(rt(e))return th(t,e);if(e==="stack")return qc(s);if(e==="shape")return!0;const n=eh(s);return n instanceof lo?n:ao(n,i)}function th(s,t){const e=s.getDatasetMeta(t);return e&&s.isDatasetVisible(t)?e.dataset:null}function eh(s){return(s.scale||{}).getPointPositionForValue?ih(s):sh(s)}function sh(s){const{scale:t={},fill:e}=s,i=Uc(e,t);if(rt(i)){const n=t.isHorizontal();return{x:n?i:null,y:n?null:i}}return null}function ih(s){const{scale:t,fill:e}=s,i=t.options,n=t.getLabels().length,o=i.reverse?t.max:t.min,r=Xc(e,t,o),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new lo({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<n;++l)a.push(t.getPointPositionForValue(l,r));return a}function xs(s,t,e){const i=Qc(t),{chart:n,index:o,line:r,scale:a,axis:l}=t,c=r.options,h=c.fill,d=c.backgroundColor,{above:u=d,below:f=d}=h||{},m=n.getDatasetMeta(o),g=Yn(n,m);i&&r.points.length&&(Ze(s,e),nh(s,{line:r,target:i,above:u,below:f,area:e,scale:a,axis:l,clip:g}),Qe(s))}function nh(s,t){const{line:e,target:i,above:n,below:o,area:r,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;s.save();let h=o;o!==n&&(c==="x"?(Ji(s,i,r.top),_s(s,{line:e,target:i,color:n,scale:a,property:c,clip:l}),s.restore(),s.save(),Ji(s,i,r.bottom)):c==="y"&&(Zi(s,i,r.left),_s(s,{line:e,target:i,color:o,scale:a,property:c,clip:l}),s.restore(),s.save(),Zi(s,i,r.right),h=n)),_s(s,{line:e,target:i,color:h,scale:a,property:c,clip:l}),s.restore()}function Ji(s,t,e){const{segments:i,points:n}=t;let o=!0,r=!1;s.beginPath();for(const a of i){const{start:l,end:c}=a,h=n[l],d=n[ns(l,c,n)];o?(s.moveTo(h.x,h.y),o=!1):(s.lineTo(h.x,e),s.lineTo(h.x,h.y)),r=!!t.pathSegment(s,a,{move:r}),r?s.closePath():s.lineTo(d.x,e)}s.lineTo(t.first().x,e),s.closePath(),s.clip()}function Zi(s,t,e){const{segments:i,points:n}=t;let o=!0,r=!1;s.beginPath();for(const a of i){const{start:l,end:c}=a,h=n[l],d=n[ns(l,c,n)];o?(s.moveTo(h.x,h.y),o=!1):(s.lineTo(e,h.y),s.lineTo(h.x,h.y)),r=!!t.pathSegment(s,a,{move:r}),r?s.closePath():s.lineTo(e,d.y)}s.lineTo(e,t.first().y),s.closePath(),s.clip()}function _s(s,t){const{line:e,target:i,property:n,color:o,scale:r,clip:a}=t,l=Hc(e,i,n);for(const{source:c,target:h,start:d,end:u}of l){const{style:{backgroundColor:f=o}={}}=c,m=i!==!0;s.save(),s.fillStyle=f,oh(s,r,a,m&&As(n,d,u)),s.beginPath();const g=!!e.pathSegment(s,c);let p;if(m){g?s.closePath():Qi(s,i,u,n);const x=!!i.pathSegment(s,h,{move:g,reverse:!0});p=g&&x,p||Qi(s,i,d,n)}s.closePath(),s.fill(p?"evenodd":"nonzero"),s.restore()}}function oh(s,t,e,i){const n=t.chart.chartArea,{property:o,start:r,end:a}=i||{};if(o==="x"||o==="y"){let l,c,h,d;o==="x"?(l=r,c=n.top,h=a,d=n.bottom):(l=n.left,c=r,h=n.right,d=a),s.beginPath(),e&&(l=Math.max(l,e.left),h=Math.min(h,e.right),c=Math.max(c,e.to
vendor: 34,670 bytes, lines 1-3
1p),d=Math.min(d,e.bottom)),s.rect(l,c,h-l,d-c),s.clip()}}function Qi(s,t,e,i){const n=t.interpolate(e,i);n&&s.lineTo(n.x,n.y)}var rh={id:"filler",afterDatasetsUpdate(s,t,e){const i=(s.data.datasets||[]).length,n=[];let o,r,a,l;for(r=0;r<i;++r)o=s.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof is&&(l={visible:s.isDatasetVisible(r),index:r,fill:$c(a,r,i),chart:s,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,n.push(l);for(r=0;r<i;++r)l=n[r],!(!l||l.fill===!1)&&(l.fill=jc(n,r,e.propagate))},beforeDraw(s,t,e){const i=e.drawTime==="beforeDraw",n=s.getSortedVisibleDatasetMetas(),o=s.chartArea;for(let r=n.length-1;r>=0;--r){const a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&xs(s.ctx,a,o))}},beforeDatasetsDraw(s,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=s.getSortedVisibleDatasetMetas();for(let n=i.length-1;n>=0;--n){const o=i[n].$filler;Gi(o)&&xs(s.ctx,o,s.chartArea)}},beforeDatasetDraw(s,t,e){const i=t.meta.$filler;!Gi(i)||e.drawTime!=="beforeDatasetDraw"||xs(s.ctx,i,s.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const tn=(s,t)=>{let{boxHeight:e=t,boxWidth:i=t}=s;return s.usePointStyle&&(e=Math.min(e,t),i=s.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},ah=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index;class en extends Bt{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,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Y(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,n)=>t.sort(i,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 i=t.labels,n=dt(i.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=tn(i,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,i,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 u=-1,f=-h;return this.legendItems.forEach((m,g)=>{const p=i+e/2+o.measureText(m.text).width;(g===0||c[c.length-1]+p+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,f+=h,u++),l[g]={left:0,top:f,row:u,width:p,height:n},c[c.length-1]+=p+a}),d}_fitCols(t,e,i,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,m=0,g=0;return this.legendItems.forEach((p,x)=>{const{itemWidth:v,itemHeight:S}=lh(i,e,o,p,n);x>0&&f+S+2*a>h&&(d+=u+a,c.push({width:u,height:f}),m+=u+a,g++,u=f=0),l[x]={left:m,top:f,col:g,width:v,height:S},u=Math.max(u,v),f+=S+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:o}}=this,r=ee(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ft(i,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=ft(i,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=ft(i,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=ft(i,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;Ze(t,this),this._draw(),Qe(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:o,labels:r}=t,a=K.color,l=ee(t.rtl,this.left,this.width),c=dt(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:m,boxHeight:g,itemHeight:p}=tn(r,d),x=function(T,C,O){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;n.save();const R=I(O.lineWidth,1);if(n.fillStyle=I(O.fillStyle,a),n.lineCap=I(O.lineCap,"butt"),n.lineDashOffset=I(O.lineDashOffset,0),n.lineJoin=I(O.lineJoin,"miter"),n.lineWidth=R,n.strokeStyle=I(O.strokeStyle,a),n.setLineDash(I(O.lineDash,[])),r.usePointStyle){const F={radius:g*Math.SQRT2/2,pointStyle:O.pointStyle,rotation:O.rotation,borderWidth:R},E=l.xPlus(T,m/2),z=C+u;Rn(n,F,E,z,r.pointStyleWidth&&m)}else{const F=C+Math.max((d-g)/2,0),E=l.leftForLtr(T,m),z=te(O.borderRadius);n.beginPath(),Object.values(z).some(q=>q!==0)?Ke(n,{x:E,y:F,w:m,h:g,radius:z}):n.rect(E,F,m,g),n.fill(),R!==0&&n.stroke()}n.restore()},v=function(T,C,O){Xe(n,O.text,T,C+p/2,c,{strikethrough:O.hidden,textAlign:l.textAlign(O.textAlign)})},S=this.isHorizontal(),M=this._computeTitleHeight();S?f={x:ft(o,this.left+h,this.right-i[0]),y:this.top+h+M,line:0}:f={x:this.left+h,y:ft(o,this.top+M+h,this.bottom-e[0].height),line:0},Nn(this.ctx,t.textDirection);const k=p+h;this.legendItems.forEach((T,C)=>{n.strokeStyle=T.fontColor,n.fillStyle=T.fontColor;const O=n.measureText(T.text).width,R=l.textAlign(T.textAlign||(T.textAlign=r.textAlign)),F=m+u+O;let E=f.x,z=f.y;l.setWidth(this.width),S?C>0&&E+F+h>this.right&&(z=f.y+=k,f.line++,E=f.x=ft(o,this.left+h,this.right-i[f.line])):C>0&&z+k>this.bottom&&(E=f.x=E+e[f.line].width+h,f.line++,z=f.y=ft(o,this.top+M+h,this.bottom-e[f.line].height));const q=l.x(E);if(x(q,z,T),E=Lr(R,E+m+u,S?E+F:this.right,t.rtl),v(l.x(E),z,T),S)f.x+=F+h;else if(typeof T.text!="string"){const nt=c.lineHeight;f.y+=co(T,nt)+h}else f.y+=k}),Hn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=dt(e.font),n=xt(e.padding);if(!e.display)return;const o=ee(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=ft(t.align,d,this.right-u);else{const m=this.columnSizes.reduce((g,p)=>Math.max(g,p.height),0);h=c+ft(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const f=ft(a,d,d+u);r.textAlign=o.textAlign(Tn(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Xe(r,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=dt(t.font),i=xt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,o;if(At(t,this.left,this.right)&&At(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(n=o[i],At(t,n.left,n.left+n.width)&&At(e,n.top,n.top+n.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!dh(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=ah(n,i);n&&!o&&Y(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!o&&Y(e.onHover,[t,i,this],this)}else i&&Y(e.onClick,[t,i,this],this)}}function lh(s,t,e,i,n){const o=ch(i,s,t,e),r=hh(n,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function ch(s,t,e,i){let n=s.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+i.measureText(n).width}function hh(s,t,e){let i=s;return typeof t.text!="string"&&(i=co(t,e)),i}function co(s,t){const e=s.text?s.text.length:0;return t*e}function dh(s,t){return!!((s==="mousemove"||s==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(s==="click"||s==="mouseup"))}var Ys={id:"legend",_element:en,start(s,t,e){const i=s.legend=new en({ctx:s.ctx,options:e,chart:s});Rt.configure(s,i,e),Rt.addBox(s,i)},stop(s){Rt.removeBox(s,s.legend),delete s.legend},beforeUpdate(s,t,e){const i=s.legend;Rt.configure(s,i,e),i.options=e},afterUpdate(s){const t=s.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(s,t){t.replay||s.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(s,t,e){const i=t.datasetIndex,n=e.chart;n.isDatasetVisible(i)?(n.hide(i),t.hidden=!0):(n.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:s=>s.chart.options.color,boxWidth:40,padding:10,generateLabels(s){const t=s.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=s.legend.options;return s._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=xt(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:i||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}};const fe={average(s){if(!s.length)return!1;let t,e,i=new Set,n=0,o=0;for(t=0,e=s.length;t<e;++t){const a=s[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),n+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:n/o}},nearest(s,t){if(!s.length)return!1;let e=t.x,i=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=s.length;o<r;++o){const l=s[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=ws(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function vt(s,t){return t&&(et(t)?Array.prototype.push.apply(s,t):s.push(t)),s}function Pt(s){return(typeof s=="string"||s instanceof String)&&s.indexOf(` 2`)>-1?s.split(` 3`):s}function uh(s,t){const{element:e,datasetIndex:i,index:n}=t,o=s.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:s,label:r,parsed:o.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function sn(s,t){const e=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:r,boxHeight:a}=t,l=dt(t.bodyFont),c=dt(t.titleFont),h=dt(t.footerFont),d=o.length,u=n.length,f=i.length,m=xt(t.padding);let g=m.height,p=0,x=i.reduce((M,k)=>M+k.before.length+k.lines.length+k.after.length,0);if(x+=s.beforeBody.length+s.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const M=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*M+(x-f)*l.lineHeight+(x-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let v=0;const S=function(M){p=Math.max(p,e.measureText(M).width+v)};return e.save(),e.font=c.string,V(s.title,S),e.font=l.string,V(s.beforeBody.concat(s.afterBody),S),v=t.displayColors?r+2+t.boxPadding:0,V(i,M=>{V(M.before,S),V(M.lines,S),V(M.after,S)}),v=0,e.font=h.string,V(s.footer,S),e.restore(),p+=m.width,{width:p,height:g}}function fh(s,t){const{y:e,height:i}=t;return e<i/2?"top":e>s.height-i/2?"bottom":"center"}function gh(s,t,e,i){const{x:n,width:o}=i,r=e.caretSize+e.caretPadding;if(s==="left"&&n+o+r>t.width||s==="right"&&n-o-r<0)return!0}function ph(s,t,e,i){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=s;let c="center";return i==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),gh(c,s,t,e)&&(c="center"),c}function nn(s,t,e){const i=e.yAlign||t.yAlign||fh(s,e);return{xAlign:e.xAlign||t.xAlign||ph(s,t,e,i),yAlign:i}}function mh(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function bh(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function on(s,t,e,i){const{caretSize:n,caretPadding:o,cornerRadius:r}=s,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=te(r);let m=mh(t,a);const g=bh(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(h,u)+n:a==="right"&&(m+=Math.max(d,f)+n),{x:ot(m,0,i.width-t.width),y:ot(g,0,i.height-t.height)}}function Ne(s,t,e){const i=xt(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function rn(s){return vt([],Pt(s))}function xh(s,t,e){return qt(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function an(s,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}const ho={beforeTitle:St,title(s){if(s.length>0){const t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:St,beforeBody:St,beforeLabel:St,label(s){if(this&&this.options&&this.options.mode==="dataset")return s.label+": "+s.formattedValue||s.formattedValue;let t=s.dataset.label||"";t&&(t+=": ");const e=s.formattedValue;return H(e)||(t+=e),t},labelColor(s){const e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.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(s){const e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:St,afterBody:St,beforeFooter:St,footer:St,afterFooter:St};function ct(s,t,e,i){const n=s[t].call(e,i);return typeof n>"u"?ho[t].call(e,i):n}class ln extends Bt{static positioners=fe;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,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,o=new Un(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=xh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=ct(i,"beforeTitle",this,t),o=ct(i,"title",this,t),r=ct(i,"afterTitle",this,t);let a=[];return a=vt(a,Pt(n)),a=vt(a,Pt(o)),a=vt(a,Pt(r)),a}getBeforeBody(t,e){return rn(ct(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return V(t,o=>{const r={before:[],lines:[],after:[]},a=an(i,o);vt(r.before,Pt(ct(a,"beforeLabel",this,o))),vt(r.lines,ct(a,"label",this,o)),vt(r.after,Pt(ct(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return rn(ct(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=ct(i,"beforeFooter",this,t),o=ct(i,"footer",this,t),r=ct(i,"afterFooter",this,t);let a=[];return a=vt(a,Pt(n)),a=vt(a,Pt(o)),a=vt(a,Pt(r)),a}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(uh(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,u)=>t.filter(h,d,u,i))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,i))),V(a,h=>{const d=an(t.callbacks,h);n.push(ct(d,"labelColor",this,h)),o.push(ct(d,"labelPointStyle",this,h)),r.push(ct(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=fe[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=sn(this,i),c=Object.assign({},a,l),h=nn(this.chart,i,c),d=on(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const o=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=te(a),{x:u,y:f}=t,{width:m,height:g}=e;let p,x,v,S,M,k;return o==="center"?(M=f+g/2,n==="left"?(p=u,x=p-r,S=M+r,k=M-r):(p=u+m,x=p+r,S=M-r,k=M+r),v=p):(n==="left"?x=u+Math.max(l,h)+r:n==="right"?x=u+m-Math.max(c,d)-r:x=this.caretX,o==="top"?(S=f,M=S-r,p=x-r,v=x+r):(S=f+g,M=S+r,p=x+r,v=x-r),k=S),{x1:p,x2:x,x3:v,y1:S,y2:M,y3:k}}drawTitle(t,e,i){const n=this.title,o=n.length;let r,a,l;if(o){const c=ee(i.rtl,this.x,this.width);for(t.x=Ne(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=dt(i.titleFont),a=i.titleSpacing,e.fillStyle=i.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+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,n,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,h=dt(o.bodyFont),d=Ne(this,"left",o),u=n.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,m=e.y+f;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=n.leftForLtr(u,c)+c/2,x=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ms(t,g,p,x),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Ms(t,g,p,x)}else{t.lineWidth=W(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const g=n.leftForLtr(u,c),p=n.leftForLtr(n.xPlus(u,1),c-2),x=te(r.borderRadius);Object.values(x).some(v=>v!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Ke(t,{x:g,y:m,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Ke(t,{x:p,y:m+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,m,c,l),t.strokeRect(g,m,c,l),t.fillStyle=r.backgroundColor,t.fillRect(p,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,d=dt(i.bodyFont);let u=d.lineHeight,f=0;const m=ee(i.rtl,this.x,this.width),g=function(O){e.fillText(O,m.x(t.x+f),t.y+u/2),t.y+=u+o},p=m.textAlign(r);let x,v,S,M,k,T,C;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Ne(this,p,i),e.fillStyle=i.bodyColor,V(this.beforeBody,g),f=a&&p!=="right"?r==="center"?c/2+h:c+2+h:0,M=0,T=n.length;M<T;++M){for(x=n[M],v=this.labelTextColors[M],e.fillStyle=v,V(x.before,g),S=x.lines,a&&S.length&&(this._drawColorBox(e,t,M,m,i),u=Math.max(d.lineHeight,l)),k=0,C=S.length;k<C;++k)g(S[k]),u=d.lineHeight;V(x.after,g)}f=0,u=d.lineHeight,V(this.afterBody,g),t.y-=o}drawFooter(t,e,i){const n=this.footer,o=n.length;let r,a;if(o){const l=ee(i.rtl,this.x,this.width);for(t.x=Ne(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",r=dt(i.footerFont),e.fillStyle=i.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+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:m}=te(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,i,n),e.lineTo(a+c-u,l),e.quadraticCurveTo(a+c,l,a+c,l+u),r==="center"&&o==="right"&&this.drawCaret(t,e,i,n),e.lineTo(a+c,l+h-m),e.quadraticCurveTo(a+c,l+h,a+c-m,l+h),r==="bottom"&&this.drawCaret(t,e,i,n),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="left"&&this.drawCaret(t,e,i,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,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const r=fe[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=sn(this,t),l=Object.assign({},r,this._size),c=nn(e,t,l),h=on(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 i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=xt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),Nn(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Hn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=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=!$e(i,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!$e(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,i,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,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,r=fe[o.position].call(this,t,e);return r!==!1&&(i!==r.x||n!==r.y)}}var Us={id:"tooltip",_element:ln,positioners:fe,afterInit(s,t,e){e&&(s.tooltip=new ln({chart:s,options:e}))},beforeUpdate(s,t,e){s.tooltip&&s.tooltip.initialize(e)},reset(s,t,e){s.tooltip&&s.tooltip.initialize(e)},afterDraw(s){const t=s.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(s.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",e)}},afterEvent(s,t){if(s.tooltip){const e=t.replay;s.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:(s,t)=>t.bodyFont.size,boxWidth:(s,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:ho},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const _h=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function yh(s,t,e,i){const n=s.indexOf(t);if(n===-1)return _h(s,t,e,i);const o=s.lastIndexOf(t);return n!==o?e:n}const vh=(s,t)=>s===null?null:ot(Math.round(s),0,t);function cn(s){const t=this.getLabels();return s>=0&&s<t.length?t[s]:s}class uo extends ne{static id="category";static defaults={ticks:{callback:cn}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:n,label:o}of e)i[n]===o&&i.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(H(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:yh(i,t,I(e,t),this._addedLabels),vh(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return cn.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function kh(s,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=s,f=o||1,m=h-1,{min:g,max:p}=t,x=!H(r),v=!H(a),S=!H(c),M=(p-g)/(d+1);let k=ni((p-g)/m/f)*f,T,C,O,R;if(k<1e-14&&!x&&!v)return[{value:g},{value:p}];R=Math.ceil(p/k)-Math.floor(g/k),R>m&&(k=ni(R*k/m/f)*f),H(l)||(T=Math.pow(10,l),k=Math.ceil(k*T)/T),n==="ticks"?(C=Math.floor(g/k)*k,O=Math.ceil(p/k)*k):(C=g,O=p),x&&v&&o&&wr((a-r)/o,k/1e3)?(R=Math.round(Math.min((a-r)/k,h)),k=(a-r)/R,C=r,O=a):S?(C=x?r:C,O=v?a:O,R=c-1,k=(O-C)/R):(R=(O-C)/k,pe(R,Math.round(R),k/1e3)?R=Math.round(R):R=Math.ceil(R));const F=Math.max(oi(k),oi(C));T=Math.pow(10,H(l)?F:l),C=Math.round(C*T)/T,O=Math.round(O*T)/T;let E=0;for(x&&(u&&C!==r?(e.push({value:r}),C<r&&E++,pe(Math.round((C+E*k)*T)/T,r,hn(r,M,s))&&E++):C<r&&E++);E<R;++E){const z=Math.round((C+E*k)*T)/T;if(v&&z>a)break;e.push({value:z})}return v&&u&&O!==a?e.length&&pe(e[e.length-1].value,a,hn(a,M,s))?e[e.length-1].value=a:e.push({value:a}):(!v||O===a)&&e.push({value:O}),e}function hn(s,t,{horizontal:e,minRotation:i}){const n=Dt(i),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+s).length;return Math.min(t/o,r)}class wh extends ne{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 H(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=i?o:l;if(t){const l=wt(n),c=wt(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:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} 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 i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=kh(n,o);return t.bounds==="ticks"&&Sr(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return zs(t,this.chart.options.locale,this.options.ticks.format)}}class fo extends wh{static id="linear";static defaults={ticks:{callback:Ln.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=rt(t)?t:0,this.max=rt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Dt(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const os={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}},ht=Object.keys(os);function dn(s,t){return s-t}function un(s,t){if(H(t))return null;const e=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),rt(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(ke(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function fn(s,t,e,i){const n=ht.length;for(let o=ht.indexOf(s);o<n-1;++o){const r=os[ht[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return ht[o]}return ht[n-1]}function Sh(s,t,e,i,n){for(let o=ht.length-1;o>=ht.indexOf(e);o--){const r=ht[o];if(os[r].common&&s._adapter.diff(n,i,r)>=t-1)return r}return ht[e?ht.indexOf(e):0]}function Mh(s){for(let t=ht.indexOf(s)+1,e=ht.length;t<e;++t)if(os[ht[t]].common)return ht[t]}function gn(s,t,e){if(!e)s[t]=!0;else if(e.length){const{lo:i,hi:n}=Is(e,t),o=e[i]>=t?e[i]:e[n];s[o]=!0}}function Ph(s,t,e,i){const n=s._adapter,o=+n.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function pn(s,t,e){const i=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,i.push({value:a,major:!1});return o===0||!e?i:Ph(s,i,n,e)}class mn extends ne{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 i=t.time||(t.time={}),n=this._adapter=new cl._date(t.adapters.date);n.init(e),ge(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:un(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=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=rt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),o=rt(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+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,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n=i.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=Ar(n,o,r);return this._unit=e.unit||(i.autoSkip?fn(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Sh(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Mh(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),pn(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=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?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=ot(e,0,r),i=ot(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,o=n.time,r=o.unit||fn(o.minUnit,e,i,this._getLabelCapacity(e)),a=I(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=ke(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const m=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;
3u<i;u=+t.add(u,a,r),f++)gn(h,u,m);return(u===i||n.bounds==="ticks"||f===1)&&gn(h,u,m),Object.keys(h).sort(dn).map(g=>+g)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.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,i,n){const o=this.options,r=o.ticks.callback;if(r)return Y(r,[t,e,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=i[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++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,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=Dt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,pn(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,i;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,i=n.length;e<i;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(un(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Dn(t.sort(dn))}}function He(s,t,e){let i=0,n=s.length-1,o,r,a,l;e?(t>=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=Yt(s,"pos",t)),{pos:o,time:a}=s[i],{pos:r,time:l}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=Yt(s,"time",t)),{time:o,pos:a}=s[i],{time:r,pos:l}=s[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class If extends mn{static id="timeseries";static defaults=mn.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=He(e,this.min),this._tableRange=He(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=i&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:i,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 i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(He(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return He(this._table,i*this._tableRange+this._minPos,!0)}}const go={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Ch={ariaLabel:{type:String},ariaDescribedby:{type:String}},Dh={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...go,...Ch},Ah=_o[0]==="2"?(s,t)=>Object.assign(s,{attrs:t}):(s,t)=>Object.assign(s,t);function Zt(s){return _n(s)?vs(s):s}function Oh(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;return _n(t)?new Proxy(s,{}):s}function Th(s,t){const e=s.options;
3e&&t&&Object.assign(e,t)}function po(s,t){s.labels=t}function mo(s,t,e){const i=[];s.datasets=t.map(n=>{const o=s.datasets.find(r=>r[e]===n[e]);return!o||!n.data||i.includes(o)?{...n}:(i.push(o),Object.assign(o,n),o)})}function Lh(s,t){const e={labels:[],datasets:[]};return po(e,s.labels),mo(e,s.datasets,t),e}const Rh=zt({props:Dh,setup(s,t){let{expose:e,slots:i}=t;const n=xn(null),o=bn(null);e({chart:o});const r=()=>{if(!n.value)return;const{type:c,data:h,options:d,plugins:u,datasetIdKey:f}=s,m=Lh(h,f),g=Oh(m,h);o.value=new oe(n.value,{type:c,data:g,options:{...d},plugins:u})},a=()=>{const c=vs(o.value);c&&(s.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},s.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(s.updateMode)};return yo(r),vo(a),ko([()=>s.options,()=>s.data],(c,h)=>{let[d,u]=c,[f,m]=h;const g=vs(o.value);if(!g)return;let p=!1;if(d){const x=Zt(d),v=Zt(f);x&&x!==v&&(Th(g,x),p=!0)}if(u){const x=Zt(u.labels),v=Zt(m.labels),S=Zt(u.datasets),M=Zt(m.datasets);x!==v&&(po(g.config.data,x),p=!0),S&&S!==M&&(mo(g.config.data,S,s.datasetIdKey),p=!0)}p&&wo(()=>{l(g)})},{deep:!0}),()=>ys("canvas",{role:"img","aria-label":s.ariaLabel,"aria-describedby":s.ariaDescribedby,ref:n},[ys("p",{},[i.default?i.default():""])])}});function Xs(s,t){return oe.register(t),zt({props:go,setup(e,i){let{expose:n}=i;const o=bn(null),r=a=>{o.value=a?.chart};return n({chart:o}),()=>ys(Rh,Ah({ref:r},{type:s,...e}))}})}const Eh=Xs("bar",ol),Ih=Xs("doughnut",al),Fh=Xs("line",ll),zh=zt({__name:"ChartLine.client",props:{labels:{},series:{},prefix:{},yLabel:{}},setup(s){oe.register(uo,fo,Ec,is,rh,Us,Ys);const t=s,e=G(()=>({labels:t.labels,datasets:t.series.map(n=>({label:n.label,data:n.data,borderColor:n.color,backgroundColor:n.color+"22",tension:.35,fill:n.fill??!0,pointRadius:0,pointHoverRadius:4,borderWidth:2}))})),i=G(()=>({responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:t.series.length>1,position:"bottom",labels:{boxWidth:10,boxHeight:10,usePointStyle:!0}},tooltip:{callbacks:{label:n=>`${n.dataset.label}: ${t.prefix||""}${Number(n.raw).toLocaleString()}`}}},scales:{x:{grid:{display:!1},ticks:{font:{size:10},maxRotation:0,autoSkipPadding:12}},y:{grid:{color:"#f1f5f9"},ticks:{font:{size:10},callback:n=>`${t.prefix||""}${Number(n).toLocaleString()}`}}}}));return(n,o)=>(P(),xe(_(Fh),{data:_(e),options:_(i)},null,8,["data","options"]))}}),Bh=zt({__name:"ChartDoughnut.client",props:{labels:{},data:{},colors:{},prefix:{}},setup(s){oe.register(Sc,Us,Ys);const t=s,e=["#db2777","#61003E","#f59e0b","#3b82f6","#10b981","#8b5cf6","#ef4444","#0ea5e9"],i=G(()=>({labels:t.labels,datasets:[{data:t.data,backgroundColor:t.colors||e.slice(0,t.labels.length),borderWidth:2,borderColor:"#fff"}]})),n=G(()=>({responsive:!0,maintainAspectRatio:!1,cutout:"62%",plugins:{legend:{position:"bottom",labels:{boxWidth:10,boxHeight:10,usePointStyle:!0,font:{size:11}}},tooltip:{callbacks:{label:o=>{const r=o.dataset.data.reduce((l,c)=>l+c,0)||1,a=(Number(o.raw)/r*100).toFixed(1);return`${o.label}: ${t.prefix||""}${Number(o.raw).toLocaleString()} (${a}%)`}}}}}));return(o,r)=>(P(),xe(_(Ih),{data:_(i),options:_(n)},null,8,["data","options"]))}}),Wh=zt({__name:"ChartBar.client",props:{labels:{},data:{},color:{},prefix:{},horizontal:{type:Boolean}},setup(s){oe.register(uo,fo,Nc,Us,Ys);const t=s,e=G(()=>({labels:t.labels,datasets:[{data:t.data,backgroundColor:t.color||"#db2777",borderRadius:6,maxBarThickness:36}]})),i=G(()=>({responsive:!0,maintainAspectRatio:!1,indexAxis:t.horizontal?"y":"x",plugins:{legend:{display:!1},tooltip:{callbacks:{label:n=>`${t.prefix||""}${Number(n.raw).toLocaleString()}`}}},scales:{x:{grid:{display:!!t.horizontal,color:"#f1f5f9"},ticks:{font:{size:10},callback:(n,o)=>{if(t.horizontal)return`${t.prefix||""}${Number(n).toLocaleString()}`;const r=String(t.labels[o]??"");return r.length>14?r.slice(0,12)+"â¦":r}}},y:{grid:{color:"#f1f5f9"},ticks:{font:{size:10},callback:(n,o)=>{if(!t.horizontal)return`${t.prefix||""}${Number(n).toLocaleString()}`;const r=String(t.labels[o]??"");return r.length>18?r.slice(0,16)+"â¦":r}}}}}));return(n,o)=>(P(),xe(_(Eh),{data:_(e),options:_(i)},null,8,["data","options"]))}}),Nh=Os(zh),Hh=Os(Bh),Vh=Os(Wh),jh={class:"space-y-6"},$h={class:"flex items-end justify-between gap-4 flex-wrap"},Yh={class:"text-sm text-gray-500 mt-0.5"},Uh={key:0,class:"text-gray-300"},Xh={class:"flex items-center gap-2"},Kh={class:"inline-flex bg-white border border-gray-200 rounded-xl p-1 shadow-sm"},qh=["onClick"],Gh=["disabled"],Jh={key:0,class:"rounded-xl bg-amber-50 border border-amber-200 px-4 py-3 flex items-center justify-between"},Zh={class:"flex items-center gap-2 text-sm text-amber-800"},Qh={key:1,class:"rounded-xl bg-red-50 border border-red-200 overflow-hidden"},td={class:"px-4 py-3 flex items-center justify-between"},ed={class:"flex items-center gap-2 text-sm text-red-800"},sd={class:"flex items-center gap-3"},id={key:0,class:"border-t border-red-200 divide-y divide-red-100"},nd={class:"shrink-0 font-semibold px-1.5 py-0.5 rounded-full bg-red-100 text-red-700 uppercase tracking-wide"},od={class:"font-mono text-red-800 truncate"},rd=["title"],ad={class:"shrink-0 text-red-400 whitespace-nowrap ml-auto"},ld={key:2,class:"grid grid-cols-2 lg:grid-cols-6 gap-3"}
3,cd={class:"grid grid-cols-2 lg:grid-cols-6 gap-3"},hd={class:"grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-7 gap-3"},dd={key:0,class:"card p-5"},ud={class:"flex items-start justify-between gap-4 flex-wrap"},fd={class:"flex items-center gap-3"},gd={class:"text-xs text-gray-400"},pd={class:"mt-4"},md={class:"text-3xl font-bold text-gray-900"},bd={class:"text-sm text-gray-500 mt-0.5"},xd={key:0,class:"text-gray-400"},_d={key:0,class:"text-xs text-amber-600 mt-1.5"},yd={key:1,class:"text-xs text-amber-600 mt-1.5"},vd={key:2,class:"mt-4 pt-4 border-t border-gray-100"},kd={class:"space-y-2.5"},wd={class:"flex items-baseline justify-between gap-3 mb-1"},Sd=["title"],Md={class:"text-sm font-medium text-gray-900 whitespace-nowrap"},Pd={class:"text-xs font-normal text-gray-400"},Cd={class:"h-1.5 rounded-full bg-gray-100 overflow-hidden"},Dd={key:1,class:"text-sm text-gray-500"},Ad={key:0,class:"text-xs text-red-600 mt-1.5"},Od={key:1,class:"text-xs text-gray-400 mt-1"},Td={key:2,class:"text-xs text-gray-400 mt-1"},Ld={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},Rd={class:"card p-5 lg:col-span-2"},Ed={class:"flex items-center justify-between mb-3"},Id={class:"text-xs text-gray-400"},Fd={class:"h-72"},zd={class:"card p-5"},Bd={class:"flex items-center justify-between mb-3"},Wd={class:"text-xs text-gray-400"},Nd={key:0,class:"h-72"},Hd={key:1,class:"h-72 flex items-center justify-center text-sm text-gray-400"},Vd={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},jd={class:"card p-5 lg:col-span-2"},$d={class:"h-56"},Yd={class:"card p-5"},Ud={key:0,class:"h-56"},Xd={key:1,class:"h-56 flex items-center justify-center text-sm text-gray-400"},Kd={class:"grid grid-cols-1 lg:grid-cols-2 gap-4"},qd={class:"card p-5"},Gd={class:"flex items-center justify-between mb-3"},Jd={key:0,class:"h-64"},Zd={key:1,class:"h-64 flex items-center justify-center text-sm text-gray-400"},Qd={class:"card p-5"},tu={class:"flex items-center justify-between mb-3"},eu={key:0,class:"overflow-y-auto max-h-64"},su={class:"w-full text-sm"},iu={class:"divide-y divide-gray-50"},nu={class:"py-2"},ou={class:"text-xs text-gray-400"},ru={class:"text-right text-gray-700"},au={class:"text-right font-semibold text-gray-900"},lu={key:1,class:"h-64 flex items-center justify-center text-sm text-gray-400"},cu={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},hu={class:"card p-5"},du={key:0,class:"space-y-2"},uu={class:"px-2 py-0.5 bg-pink-50 text-[#db2777] font-mono rounded"},fu={class:"flex items-center gap-3"},gu={class:"text-gray-500"},pu={class:"font-semibold text-gray-900"},mu={key:1,class:"text-center text-sm text-gray-400 py-8"},bu={class:"card p-5"},xu={key:0,class:"h-48"},_u={key:1,class:"text-center text-sm text-gray-400 py-8"},yu={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},vu={class:"card lg:col-span-2 overflow-hidden"},ku={class:"px-5 py-4 border-b border-gray-100 flex items-center justify-between"},wu={key:0,class:"w-full text-sm"},Su={class:"divide-y divide-gray-50"},Mu=["onClick"],Pu={class:"px-5 py-3 font-medium text-gray-900 truncate max-w-[200px]"},Cu={class:"px-5 py-3 text-gray-500 hidden sm:table-cell"},Du={class:"px-5 py-3 text-gray-700"},Au={class:"px-5 py-3 text-right font-semibold text-gray-900"},Ou={key:1,class:"px-5 py-12 text-center text-sm text-gray-400"},Tu={class:"card overflow-hidden"},Lu={class:"divide-y divide-gray-50 max-h-[28rem] overflow-y-auto"},Ru={class:"flex-1 min-w-0"},Eu={class:"text-sm font-medium text-gray-900 truncate"},Iu={class:"text-xs text-gray-400 truncate"},Fu={class:"text-right shrink-0"},zu={key:0,class:"text-sm font-semibold text-gray-900"},Bu={key:1,class:"text-xs uppercase tracking-wider text-gray-400"},Wu={class:"text-[11px] text-gray-400"},Nu={key:0,class:"px-5 py-12 text-center text-sm text-gray-400"},Hu={class:"card overflow-hidden"},Vu={class:"px-5 py-4 border-b border-gray-100 flex items-center justify-between"},ju={key:0,class:"text-xs text-gray-400"},$u={key:0,class:"px-5 py-8 text-center text-sm text-gray-400"},Yu={key:1,class:"px-5 py-8 text-center text-sm text-gray-400"},Uu={key:2,class:"divide-y divide-gray-50 max-h-96 overflow-y-auto"},Xu={class:"w-7 h-7 rounded-full flex items-center justify-center text-xs shrink-0 bg-gray-100 text-gray-600"},Ku={class:"flex-1 min-w-0"},qu={class:"flex items-center gap-2 flex-wrap"},Gu={class:"text-sm text-gray-800 truncate"},Ju={key:0,class:"text-gray-500 font-normal"},Zu={class:"text-xs text-gray-400 mt-0.5"},Qu={class:"text-right shrink-0"},tf={class:"text-[11px] text-gray-400 whitespace-nowrap"},ef={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"},sf={class:"card p-5"},nf={class:"flex items-center justify-between mb-3"},of={class:"text-3xl font-bold text-gray-900 mb-2"},rf={class:"space-y-1.5 text-xs"},af={class:"flex justify-between"},lf={class:"font-semibold text-amber-600"},cf={class:"flex justify-between"},hf={class:"font-semibold text-blue-600"},df={class:"flex justify-between"},uf={class:"font-semibold text-gray-600"},ff={class:"flex justify-between border-t border-gray-100 pt-1.5 mt-1.5"},gf={class:"font-semibold text-purple-600"},pf={class:"card p-5"},mf={class:"font-semibold text-gray-900 mb-3"},bf={class:"text-3xl font-bold text-gray-900 mb-2"},xf={class:"space-y-1.5 text-xs"},_f={class:"text-gray-500 capitalize"},yf={class:"font-semibold text-gray-900"},vf={key:0,class:"text-gray-400 text-center py-3"},kf={class:"card p-5"},wf={class:"h-32"},Sf={class:"card p-5"},Mf={key:0,class:"space-y-1.5 text-sm"},Pf={class:"text-gray-700 truncate"},Cf={class:"font-semibold text-gray-900"},Df={key:1,class:"text-center text-sm text-gray-400 py-6"},Ff=zt({__name:"index",async setup(s){let t,e;const i=[{value:"7d",label:"7 days"},{value:"30d",label:"30 days"},{value:"90d",label:"90 days"},{value:"12m",label:"12 months"}],n=xn("30d"),{data:o,pending:r,refresh:a}=([t,e]=qs(()=>Gs("/api/admin/dashboard",{query:G(()=>({range:n.value})),watch:[n],key:"admin-dashboard"},"$duOI1b_J0S")),t=await t,e(),t),l=new Date().toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric",timeZone:"America/Los_Angeles"}),c=G(()=>o.value?.generatedAt?_t(o.value.generatedAt):""),h=G(()=>i.find(L=>L.value===n.value)?.label||""),d=G(()=>o.value?.kpis??{}),u=G(()=>o.value?.totals??{}),f=G(()=>o.value?.breakdowns??{revenueByType:[],orderStatus:[],paymentMethod:[],userRoles:[],cities:[]}),m=G(()=>o.value?.topLists??{events:[],vendors:[],coupons:[]}),g=G(()=>o.value?.emailBounces??{bouncedUsers:0,recentEvents:[]}),p=G(()=>o.value?.tvImpressions??null),x=G(()=>p.value?.breakdown??[]),v=G(()=>x.value.reduce((L,y)=>Math.max(L,y.impressions),0));function S(L){const y=Number(p.value?.total||0);return y?Math.round(L/y*100):0}function M(L){const y=v.value;return y?Math.max(2,Math.round(L/y*100)):0}
3function k(L){return Number(L||0).toLocaleString("en-US")}function T(L){const y=Number(L||0);return y>=1e6?(y/1e6).toFixed(1).replace(/\.0$/,"")+"M":y>=1e3?(y/1e3).toFixed(1).replace(/\.0$/,"")+"K":y.toLocaleString("en-US")}function C(L){const y=Number(L||0);return y>=1e6?(y/1e6).toFixed(1)+"M":y>=1e4?(y/1e3).toFixed(1)+"k":y.toLocaleString("en-US",{maximumFractionDigits:2})}function O(L){return{paid:"#10b981",pending:"#f59e0b",failed:"#ef4444",refunded:"#6b7280"}[L]||"#94a3b8"}function R(L){return{stripe:"Stripe",card:"Credit Card",store_credit:"Store credit",cash:"Cash",unknown:"Other"}[L]||L}function F(L){return{order:"ð",signup:"ð¤",support:"ð¬"}[L]||"â¢"}function E(L){return{order:"bg-pink-100 text-[#db2777]",signup:"bg-blue-100 text-blue-600",support:"bg-purple-100 text-purple-600"}[L]||"bg-gray-100 text-gray-600"}const{data:z,pending:q}=([t,e]=qs(()=>Gs("/api/admin/audit-logs/feed",{key:"admin-changelog"},"$Tj6x-n5jjU")),t=await t,e(),t),nt=G(()=>z.value?.logs??[]);function N(L){return{order:"Order",booth_license:"Booth License",booth_subscriber:"Booth Subscriber",event:"Event",user:"User"}[L]||L}function $(L){return{order:"ð¦",booth_license:"ðª",booth_subscriber:"ð¤",event:"ðª",user:"ð¤"}[L]||"ð"}function U(L){return L.entityType==="order"?`/admin/orders?id=${L.entityId}`:L.entityType==="booth_license"||L.entityType==="booth_subscriber"?`/admin/booth-licenses/subscribers/${L.entityId}`:L.entityType==="event"?`/admin/events/${L.entityId}`:L.entityType==="user"?`/admin/users/${L.entityId}`:null}function ut(L){return{create:"Created",update:"Updated",delete:"Deleted",delete_permanent:"Deleted",status_change:"Status",seats_change:"Booth",cancel:"Cancelled",refund:"Refund",store_credit:"Credit",password_reset:"Password",payment_confirmed:"Paid",charge_failed:"Charge Failed",abandoned:"Abandoned",dispute:"Dispute",auto_released:"Auto-released"}[L]||L}function it(L){return"inline-block px-1.5 py-0.5 rounded text-[10px] font-bold uppercase tracking-wide shrink-0 "+({create:"bg-green-100 text-green-700",update:"bg-blue-100 text-blue-700",delete:"bg-red-100 text-red-700",delete_permanent:"bg-red-100 text-red-700",cancel:"bg-red-100 text-red-700",refund:"bg-amber-100 text-amber-700",store_credit:"bg-purple-100 text-purple-700",status_change:"bg-blue-100 text-blue-700",seats_change:"bg-pink-100 text-[#db2777]",password_reset:"bg-gray-200 text-gray-700",payment_confirmed:"bg-green-100 text-green-700",charge_failed:"bg-red-100 text-red-700",abandoned:"bg-orange-100 text-orange-700",dispute:"bg-red-100 text-red-700",auto_released:"bg-indigo-100 text-indigo-700"}[L]||"bg-gray-100 text-gray-700")}const Ot=Do;function _t(L){if(!L)return"";const y=(Date.now()-new Date(L).getTime())/1e3;return y<60?"just now":y<3600?`${Math.floor(y/60)}m ago`:y<86400?`${Math.floor(y/3600)}h ago`:`${Math.floor(y/86400)}d ago`}return(L,y)=>{const J=xo,pt=Wo,at=jo,Ks=Nh,Wt=Co,Ce=Hh,bo=Vh;return P(),D("div",jh,[b("div",$h,[b("div",null,[y[1]||(y[1]=b("h1",{class:"text-2xl font-bold text-gray-900"},"Dashboard",-1)),b("p",Yh,[Q(A(_(l)),1),_(o)?(P(),D("span",Uh," · refreshed "+A(_(c)),1)):tt("",!0)])]),b("div",Xh,[b("div",Kh,[(P(),D(lt,null,bt(i,w=>b("button",{key:w.value,onClick:De=>n.value=w.value,class:Qt(["px-3 py-1.5 text-xs font-semibold rounded-lg transition-colors",_(n)===w.value?"bg-[#db2777] text-white":"text-gray-600 hover:bg-gray-50"])},A(w.label),11,qh)),64))]),b("button",{onClick:y[0]||(y[0]=()=>_(a)()),disabled:_(r),class:"px-3 py-2 text-xs font-semibold bg-white border border-gray-200 rounded-xl text-gray-700 hover:bg-gray-50 disabled:opacity-50 shadow-sm flex items-center gap-1.5"},[(P(),D("svg",{class:Qt(["w-3.5 h-3.5",{"animate-spin":_(r)}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...y[2]||(y[2]=[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2)),y[3]||(y[3]=Q(" Refresh ",-1))],8,Gh)])]),_(u)?.pendingApprovals?(P(),D("div",Jh,[b("div",Zh,[y[4]||(y[4]=b("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})],-1)),b("span",null,[b("strong",null,A(_(u).pendingApprovals),1),Q(" user"+A(_(u).pendingApprovals>1?"s":"")+" waiting for approval",1)])]),B(J,{to:"/admin/users",class:"text-xs text-amber-700 font-semibold hover:underline"},{default:Z(()=>[...y[5]||(y[5]=[Q("Review â",-1)])]),_:1})])):tt("",!0),_(g)?.bouncedUsers>0?(P(),D("div",Qh,[b("div",td,[b("div",ed,[y[6]||(y[6]=b("svg",{class:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})],-1)),b("span",null,[b("strong",null,A(_(g).bouncedUsers),1),Q(" user"+A(_(g).bouncedUsers>1?"s have":" has")+" a bounced email address",1)])]),b("div",sd,[B(J,{to:"/admin/users?bounced=bounced",class:"text-xs text-red-700 font-semibold hover:underline"},{default:Z(()=>[...y[7]||(y[7]=[Q("View users â",-1)])]),_:1}),B(J,{to:"/admin/email/delivery",class:"text-xs text-red-700 font-semibold hover:underline"},{default:Z(()=>[...y[8]||(y[8]=[Q("Delivery log â",-1)])]),_:1})])]),_(g).recentEvents?.length?(P(),D("div",id,[(P(!0),D(lt,null,bt(_(g).recentEvents,w=>(P(),D("div",{key:w.id,class:"px-4 py-2 flex items-center gap-3 text-xs"},[b("span",nd,A(w.event),1),b("span",od,A(w.email),1),w.reason?(P(),D("span",{key:0,class:"text-red-500 truncate flex-1",title:w.reason},A(w.reason),9,rd)):tt("",!0),b("span",ad,A(_t(w.occurredAt)),1)]))),128))])):tt("",!0)])):tt("",!0),_(r)&&!_(o)?(P(),D("div",ld,[(P(),D(lt,null,bt(6,w=>b("div",{key:w,class:"card p-5 h-28 animate-pulse"},[...y[9]||(y[9]=[b("div",{class:"h-2 bg-gray-200 rounded w-1/2 mb-3"},null,-1),b("div",{class:"h-7 bg-gray-200 rounded w-1/3"},null,-1)])])),64))])):tt("",!0),_(o)?(P(),D(lt,{key:3},[b("div",cd,[B(pt,{label:"Revenue",value:`$${C(_(d).revenue.period)}`,delta:_(d).revenue.delta,prev:`$${C(_(d).revenue.prev)} prev`,tone:"pink",icon:"ð°"},null,8,["value","delta","prev"]),B(pt,{label:"Orders",value:_(d).orders.period,delta:_(d).orders.delta,prev:`${_(d).orders.prev} prev`,tone:"indigo",icon:"ð¦"},null,8,["value","delta","prev"]),B(pt,{label:"Tickets sold",value:_(d).ticketsSold.period,delta:_(d).ticketsSold.delta,prev:`${_(d).ticketsSold.prev} prev`,tone:"amber",icon:"ðï¸"},null,8,["value","delta","prev"]),B(pt,{label:"New signups",value:_(d).signups.period,delta:_(d).signups.delta,prev:`${_(d).signups.prev} prev`,tone:"blue",icon:"ð¥"},null,8,["value","delta","prev"]),B(pt,{label:"Avg order",value:`$${C(_(d).aov.period)}`,delta:_(d).aov.delta,prev:`$${C(_(d).aov.prev)} prev`,tone:"green",icon:"ð§®"},null,8,["value","delta","prev"]),B(pt,{label:"Refunds",value:`$${C(_(d).refunds.period)}`,sub:`${_(d).refunds.count}
3 txn`,tone:"red",icon:"â©ï¸"},null,8,["value","sub"])]),b("div",hd,[B(at,{label:"Total users",value:_(u).users},null,8,["value"]),B(at,{label:"Total events",value:_(u).events},null,8,["value"]),B(at,{label:"Total orders",value:_(u).orders},null,8,["value"]),B(at,{label:"All-time revenue",value:`$${C(_(u).revenueLifetime)}`},null,8,["value"]),B(at,{label:"Active booth subs",value:_(u).activeBoothSubs},null,8,["value"]),B(at,{label:"Upcoming events",value:_(u).upcomingEvents},null,8,["value"]),B(at,{label:"Outstanding credit",value:`$${C(_(u).outstandingStoreCredit)}`},null,8,["value"])]),_(p)?(P(),D("div",dd,[b("div",ud,[b("div",fd,[y[11]||(y[11]=b("div",{class:"w-11 h-11 rounded-xl bg-purple-100 text-purple-700 flex items-center justify-center text-xl shrink-0"},"ðº",-1)),b("div",null,[y[10]||(y[10]=b("h2",{class:"font-semibold text-gray-900"},"TV commercial impressions",-1)),b("p",gd," Connected-TV airings across LA · "+A(_(p).lifetime?"all-time":`last ${_(p).windowDays} days`),1)])]),B(J,{to:"/admin/settings?tab=integrations",class:"text-xs text-[#db2777] hover:underline whitespace-nowrap self-center"},{default:Z(()=>[...y[12]||(y[12]=[Q("Configure â",-1)])]),_:1})]),b("div",pd,[_(p).total!==null&&_(p).total>0?(P(),D(lt,{key:0},[b("div",md,A(k(_(p).total)),1),b("p",bd,[Q(" â "+A(T(_(p).total))+" impressions ",1),_(p).updatedAt?(P(),D("span",xd," · updated "+A(_t(_(p).updatedAt)),1)):tt("",!0)]),_(p).lifetime&&_(p).backfillComplete===!1?(P(),D("p",_d," Building lifetime total⦠"+A(_(p).backfillDone)+"/"+A(_(p).backfillTotal)+" windows fetched (the rest fill in on the next scheduled refreshes). ",1)):tt("",!0),_(p).lastError?(P(),D("p",yd,"Last refresh had an issue: "+A(_(p).lastError),1)):tt("",!0),_(x).length>1?(P(),D("div",vd,[y[13]||(y[13]=b("p",{class:"text-xs font-medium text-gray-400 uppercase tracking-wide mb-2.5"},"By campaign",-1)),b("div",kd,[(P(!0),D(lt,null,bt(_(x),w=>(P(),D("div",{key:w.campaign},[b("div",wd,[b("span",{class:"text-sm text-gray-700 truncate",title:w.campaign},A(w.campaign),9,Sd),b("span",Md,[Q(A(k(w.impressions))+" ",1),b("span",Pd,"· "+A(S(w.impressions))+"%",1)])]),b("div",Cd,[b("div",{class:"h-full rounded-full bg-purple-500",style:So({width:`${M(w.impressions)}%`})},null,4)])]))),128))])])):tt("",!0)],64)):_(p).configured?(P(),D(lt,{key:2},[y[16]||(y[16]=b("p",{class:"text-sm text-gray-500"},"No impressions yet.",-1)),_(p).lastError?(P(),D("p",Ad,"Last error: "+A(_(p).lastError),1)):_(p).lifetime&&_(p).backfillComplete===!1?(P(),D("p",Od," Building lifetime total⦠"+A(_(p).backfillDone)+"/"+A(_(p).backfillTotal)+" windows fetched. ",1)):(P(),D("p",Td,"Waiting for the first scheduled refresh."))],64)):(P(),D("p",Dd,[y[15]||(y[15]=Q("Not connected. ",-1)),B(J,{to:"/admin/settings?tab=integrations",class:"text-[#db2777] hover:underline font-medium"},{default:Z(()=>[...y[14]||(y[14]=[Q("Add your Vibe campaign settings â",-1)])]),_:1})]))])])):tt("",!0),b("div",Ld,[b("div",Rd,[b("div",Ed,[y[17]||(y[17]=b("h2",{class:"font-semibold text-gray-900"},"Revenue & orders",-1)),b("div",Id,A(_(h)),1)]),b("div",Fd,[B(Wt,null,{fallback:Z(()=>[...y[18]||(y[18]=[b("div",{class:"h-full bg-gray-50 rounded-xl animate-pulse"},null,-1)])]),default:Z(()=>[B(Ks,{labels:_(o).series.labels,series:[{label:"Revenue",data:_(o).series.revenue,color:"#db2777"},{label:"Orders",data:_(o).series.orders,color:"#3b82f6",fill:!1}],prefix:""},null,8,["labels","series"])]),_:1})])]),b("div",zd,[b("div",Bd,[y[19]||(y[19]=b("h2",{class:"font-semibold text-gray-900"},"Revenue by source",-1)),b("span",Wd,A(_(h)),1)]),_(f).revenueByType.length?(P(),D("div",Nd,[B(Wt,null,{default:Z(()=>[B(Ce,{labels:_(f).revenueByType.map(w=>w.source),data:_(f).revenueByType.map(w=>Math.round(w.revenue)),prefix:"$"},null,8,["labels","data"])]),_:1})])):(P(),D("div",Hd,"No paid orders yet"))])]),b("div",Vd,[b("div",jd,[y[20]||(y[20]=b("h2",{class:"font-semibold text-gray-900 mb-3"},"New signups",-1)),b("div",$d,[B(Wt,null,{default:Z(()=>[B(Ks,{labels:_(o).series.labels,series:[{label:"Signups",data:_(o).series.signups,color:"#8b5cf6"}]},null,8,["labels","series"])]),_:1})])]),b("div",Yd,[y[21]||(y[21]=b("h2",{class:"font-semibold text-gray-900 mb-3"},"Order status",-1)),_(f).orderStatus.length?(P(),D("div",Ud,[B(Wt,null,{default:Z(()=>[B(Ce,{labels:_(f).orderStatus.map(w=>w.status),data:_(f).orderStatus.map(w=>w.count),colors:_(f).orderStatus.map(w=>O(w.status))},null,8,["labels","data","colors"])]),_:1})])):(P(),D("div",Xd,"No orders this period"))])]),b("div",Kd,[b("div",qd,[b("div",Gd,[y[23]||(y[23]=b("h2",{class:"font-semibold text-gray-900"},"Top events by revenue",-1)),B(J,{to:"/admin/events",class:"text-xs text-[#db2777] hover:underline"},{default:Z(()=>[...y[22]||(y[22]=[Q("All events â",-1)])]),_:1})]),_(m).events.length?(P(),D("div",Jd,[B(Wt,null,{default:Z(()=>[B(bo,{labels:_(m).events.map(w=>w.title),data:_(m).events.map(w=>Math.round(w.revenue)),color:"#db2777",prefix:"$",horizontal:!0},null,8,["labels","data"])]),_:1})])):(P(),D("div",Zd,"No event sales in this period"))]),b("div",Qd,[b("div",tu,[y[25]||(y[25]=b("h2",{class:"font-semibold text-gray-900"}
3,"Top vendors (booth licenses)",-1)),B(J,{to:"/admin/booth-licenses",class:"text-xs text-[#db2777] hover:underline"},{default:Z(()=>[...y[24]||(y[24]=[Q("All licenses â",-1)])]),_:1})]),_(m).vendors.length?(P(),D("div",eu,[b("table",su,[y[26]||(y[26]=b("thead",{class:"text-xs text-gray-400 uppercase tracking-wider sticky top-0 bg-white"},[b("tr",null,[b("th",{class:"text-left pb-2 font-medium"},"Vendor"),b("th",{class:"text-right font-medium"},"Licenses"),b("th",{class:"text-right font-medium"},"Revenue")])],-1)),b("tbody",iu,[(P(!0),D(lt,null,bt(_(m).vendors,w=>(P(),D("tr",{key:w.id,class:"hover:bg-gray-50"},[b("td",nu,[B(J,{to:`/admin/users/${w.id}`,class:"font-medium text-gray-900 hover:text-[#db2777]"},{default:Z(()=>[Q(A(w.name||"â"),1)]),_:2},1032,["to"]),b("p",ou,A(w.email),1)]),b("td",ru,A(w.activeLicenses),1),b("td",au,"$"+A(C(w.revenue)),1)]))),128))])])])):(P(),D("div",lu,"No active booth subscribers yet"))])]),b("div",cu,[b("div",hu,[y[27]||(y[27]=b("h2",{class:"font-semibold text-gray-900 mb-3"},"Coupon usage",-1)),_(m).coupons.length?(P(),D("div",du,[(P(!0),D(lt,null,bt(_(m).coupons,w=>(P(),D("div",{key:w.code,class:"flex items-center justify-between text-sm"},[b("code",uu,A(w.code),1),b("div",fu,[b("span",gu,A(w.uses)+" uses",1),b("span",pu,"â$"+A(C(w.discount)),1)])]))),128))])):(P(),D("div",mu,"No coupons redeemed"))]),b("div",bu,[y[28]||(y[28]=b("h2",{class:"font-semibold text-gray-900 mb-3"},"Payment methods",-1)),_(f).paymentMethod.length?(P(),D("div",xu,[B(Wt,null,{default:Z(()=>[B(Ce,{labels:_(f).paymentMethod.map(w=>R(w.method)),data:_(f).paymentMethod.map(w=>w.count)},null,8,["labels","data"])]),_:1})])):(P(),D("div",_u,"No paid orders"))])]),b("div",yu,[b("div",vu,[b("div",ku,[y[30]||(y[30]=b("h2",{class:"font-semibold text-gray-900"},"Upcoming events",-1)),B(J,{to:"/admin/events",class:"text-xs text-[#db2777] hover:underline"},{default:Z(()=>[...y[29]||(y[29]=[Q("All â",-1)])]),_:1})]),_(o).upcomingEvents.length?(P(),D("table",wu,[y[31]||(y[31]=b("thead",{class:"bg-gray-50 text-xs uppercase tracking-wider text-gray-500"},[b("tr",null,[b("th",{class:"text-left px-5 py-2 font-medium"},"Event"),b("th",{class:"text-left px-5 py-2 font-medium hidden sm:table-cell"},"Venue"),b("th",{class:"text-left px-5 py-2 font-medium"},"Starts"),b("th",{class:"text-right px-5 py-2 font-medium"},"Sold")])],-1)),b("tbody",Su,[(P(!0),D(lt,null,bt(_(o).upcomingEvents,w=>(P(),D("tr",{key:w.id,class:"hover:bg-gray-50 cursor-pointer",onClick:De=>("navigateTo"in L?L.navigateTo:_(Mo))(`/admin/events/${w.id}`)},[b("td",Pu,A(w.title),1),b("td",Cu,A(w.venue||"â"),1),b("td",Du,A(_(Ot)(w.startDate)),1),b("td",Au,A(w.sold),1)],8,Mu))),128))])])):(P(),D("div",Ou,"No upcoming events scheduled"))]),b("div",Tu,[y[32]||(y[32]=b("div",{class:"px-5 py-4 border-b border-gray-100 flex items-center justify-between"},[b("h2",{class:"font-semibold text-gray-900"},"Activity feed")],-1)),b("ul",Lu,[(P(!0),D(lt,null,bt(_(o).activity,w=>(P(),D("li",{key:`${w.type}-${w.id}`,class:"px-5 py-3 flex items-start gap-3"},[b("div",{class:Qt(["w-7 h-7 rounded-full flex items-center justify-center text-xs shrink-0",E(w.type)])},A(F(w.type)),3),b("div",Ru,[b("p",Eu,A(w.title),1),b("p",Iu,A(w.subtitle),1)]),b("div",Fu,[w.amount!==null?(P(),D("p",zu,"$"+A(C(w.amount)),1)):(P(),D("p",Bu,A(w.status),1)),b("p",Wu,A(_t(w.at)),1)])]))),128)),_(o).activity.length?tt("",!0):(P(),D("li",Nu,"No activity yet"))])])]),b("div",Hu,[b("div",Vu,[y[33]||(y[33]=b("h2",{class:"font-semibold text-gray-900"},"Change Log",-1)),_(q)?(P(),D("span",ju,"Loadingâ¦")):tt("",!0)]),_(q)&&!_(nt).length?(P(),D("div",$u," Loading⦠")):_(nt).length?(P(),D("ul",Uu,[(P(!0),D(lt,null,bt(_(nt),w=>(P(),D("li",{key:w.id,class:"px-5 py-3 flex items-start gap-3"},[b("div",Xu,A($(w.entityType)),1),b("div",Ku,[b("div",qu,[b("span",{class:Qt(it(w.action))},A(ut(w.action)),3),b("span",Gu,[(P(),xe(Po(U(w)?"NuxtLink":"span"),{to:U(w)||void 0,class:"font-medium hover:text-[#db2777]"},{default:Z(()=>[Q(A(N(w.entityType)),1)]),_:2},1032,["to"])),w.summary?(P(),D("span",Ju," â "+A(w.summary),1)):tt("",!0)])]),b("p",Zu,A(w.actorName||w.actorEmail||"System"),1)]),b("div",Qu,[b("p",tf,A(_t(w.createdAt)),1)])]))),128))])):(P(),D("div",Yu," No changes recorded yet. "))]),b("div",ef,[b("div",sf,[b("div",nf,[y[35]||(y[35]=b("h2",{class:"font-semibold text-gray-900"},"Support tickets",-1)),B(J,{to:"/admin/support-tickets",class:"text-xs text-[#db2777] hover:underline"},{default:Z(()=>[...y[34]||(y[34]=[Q("â",-1)])]),_:1})]),b("div",of,A(_(o).support.total),1),b("div",rf,[b("div",af,[y[36]||(y[36]=b("span",{class:"text-gray-500"},"Open",-1)),b("span",lf,A(_(o).support.byStatus.open||0),1)]),b("div",cf,[y[37]||(y[37]=b("span",{class:"text-gray-500"},"Pending",-1)),b("span",hf,A(_(o).support.byStatus.pending||0),1)]),b("div",df,[y[38]||(y[38]=b("span",{class:"text-gray-500"},"Closed",-1)),b("span",uf,A(_(o).support.byStatus.closed||0),1)]),b("div",ff,[y[39]||(y[39]=b("span",{class:"text-gray-500"},"From voice agent",-1)),b("span",gf,A(_(o).support.bySource.elevenlabs||0),1)])])]),b("div",pf,[b("h2",mf,"SMS ("+A(_(h).toLowerCase())+")",1),b("div",bf,A(_(o).sms.total),1),b("div",xf,[(P(!0),D(lt,null,bt(_(o).sms.byStatus,(w,De)=>(P(),D("div",{key:De,class:"flex justify-between"},[b("span",_f,A(De),1),b("span",yf,A(w),1)]))),128)),_(o).sms.total?tt("",!0):(P(),D("div",vf,"No messages this period"))])]),b("div",kf,[y[40]||(y[40]=b("h2",{class:"font-semibold text-gray-900 mb-3"},"User roles",-1)),b("div",wf,[B(Wt,null,{default:Z(()=>[_(f).userRoles.length?(P(),xe(Ce,{key:0,labels:_(f).userRoles.map(w=>w.role),data:_(f).userRoles.map(w=>w.count)},null,8,["labels","data"])):tt("",!0)]),_:1})])]),b("div",Sf,[y[41]||(y[41]=b("h2",{class:"font-semibold text-gray-900 mb-3"},"Venue cities",-1)),_(f).cities.length?(P(),D("div",Mf,[(P(!0),D(lt,null,bt(_(f).cities,w=>(P(),D("div",{key:w.city,class:"flex items-center justify-between"},[b("span",Pf,A(w.city),1),b("span",Cf,A(w.count),1)]))),128))])):(P(),D("div",Df,"No venues yet"))])])],64)):tt("",!0)])}}});
3export{Ff as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.