@feedmepos/ui-library 0.0.1-alpha.13 → 0.0.1-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +0,0 @@
1
- (function(j,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(j=typeof globalThis<"u"?globalThis:j||self,d(j["feedmepos-ui-library"]={},j.Vue))})(this,function(j,d){"use strict";const Vf="";/*!
2
- * vue-router v4.2.5
3
- * (c) 2023 Eduardo San Martin Morote
4
- * @license MIT
5
- */var ti;(function(n){n.pop="pop",n.push="push"})(ti||(ti={}));var ei;(function(n){n.back="back",n.forward="forward",n.unknown=""})(ei||(ei={})),Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var ni;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(ni||(ni={})),Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),Symbol(process.env.NODE_ENV!=="production"?"router view depth":"");const jo=Symbol(process.env.NODE_ENV!=="production"?"router":""),Ho=Symbol(process.env.NODE_ENV!=="production"?"route location":"");Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function Yo(){return d.inject(jo)}function Uo(){return d.inject(Ho)}const Xo={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},qo=["onMouseenter"],Ko={key:0},Go=d.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(n){const t=n,e=Uo(),i=Yo();d.onMounted(async()=>{await i.isReady();const g=t.items.findIndex(m=>m.route==e.path);g!=-1&&!t.items[g].disabled&&(s.value=g)});const s=d.ref(-1),o=d.ref(-1),a=d.ref(" / "),r=d.ref("... /"),l=d.ref(!1),c=g=>s.value===g?"selected":o.value===g?"hovered":t.items[g].disabled?"disabled":"default",h=g=>{t.items[g].disabled||(s.value=g)},u=g=>g!=t.items.length-1,f=g=>!l.value&&t.items.length>5&&g>=2&&g<t.items.length-2,p=()=>{l.value=!l.value};return(g,m)=>{const b=d.resolveComponent("RouterLink");return d.openBlock(),d.createElementBlock("nav",null,[d.createElementVNode("ul",Xo,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(g.items,(_,y)=>(d.openBlock(),d.createElementBlock("li",{key:y,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:k=>o.value=y,onMouseleave:m[0]||(m[0]=k=>o.value=-1)},[f(y)?y===3&&!l.value?(d.openBlock(),d.createElementBlock("a",{key:1,onClick:p},d.toDisplayString(r.value),1)):d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(b,{key:0,class:d.normalizeClass(c(y)),to:_.disabled?"":_.route,onClick:k=>h(y)},{default:d.withCtx(()=>[d.createElementVNode("span",null,d.toDisplayString(_.label),1),u(y)?(d.openBlock(),d.createElementBlock("span",Ko,d.toDisplayString(a.value),1)):d.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,qo))),128))])])}}}),Rf="",Zo=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,Jo=/^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/,Qo=/^^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1(?:\.0*)?)\s*[)]$/,ta=/^hsl[(]\s*0*(?:[12]?\d{1,2}|3(?:[0-5]\d|60))\s*(?:\s*,\s*0*(?:\d\d?(?:\.\d+)?\s*%|\.\d+\s*%|100(?:\.0*)?\s*%)){2}\s*[)]$/,ea=/^hsla[(]\s*0*(?:[12]?\d{1,2}|3(?:[0-5]\d|60))\s*(?:\s*,\s*0*(?:\d\d?(?:\.\d+)?\s*%|\.\d+\s*%|100(?:\.0*)?\s*%)){2}\s*,\s*0*(?:\.\d+|1(?:\.0*)?)\s*[)]$/;function cn(n){return[Zo,Jo,Qo,ta,ea].some(t=>t.test(n))}const na=d.defineComponent({__name:"FmIcon",props:{name:{type:String,required:!0},color:{type:String,default:"black"},outline:{type:Boolean,default:!1},size:{type:String,default:"md"}},setup(n){const t=n,e=d.computed(()=>{const o=[],a={};return o.push(i()),o.push(s()),cn(t.color)?a.color=t.color:o.push(`text-fm-color-${t.color}`),{class:o.join(" "),style:a}});function i(){return`fm-icon--${t.outline?"outlined":"rounded"}`}function s(){return`fm-icon--${t.size}`}return(o,a)=>(d.openBlock(),d.createElementBlock("span",d.mergeProps(e.value,{class:"fm-icon"}),d.toDisplayString(t.name),17))}}),Nf="",ut=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},it=ut(na,[["__scopeId","data-v-88e86ba4"]]),ia=["disabled"],sa={key:1,class:"fm-typo-body-lg-700"},oa=d.defineComponent({__name:"FmButton",props:{variant:{type:String,default:"primary"},label:{type:String,default:void 0},icon:{type:String,default:void 0},size:{type:String,default:"lg"},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1}},setup(n){const t=n,e=d.ref(!1),i=d.computed(()=>`${s[t.variant]} ${t.disabled?"cursor-not-allowed":"cursor-pointer"}`),s={primary:"bg-fm-color-primary text-fm-color-typo-white",secondary:"bg-transparent",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white",tertiary:"bg-transparent text-fm-color-black",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white"};function o(a){e.value=a}return(a,r)=>{const l=d.resolveDirective("wave");return d.withDirectives((d.openBlock(),d.createElementBlock("button",{ref:"buttonEl",class:d.normalizeClass(`
6
- fm-btn rounded-lg
7
- ${i.value}
8
- fm-btn--${n.size}
9
- ${n.label?"":`fm-btn--${n.size}--just-icon`}
10
- fm-btn--${n.variant}
11
- ${n.disabled?"fm-btn--disabled":""}
12
- `),disabled:n.disabled,onMousedown:r[0]||(r[0]=()=>o(!0)),onMouseup:r[1]||(r[1]=()=>o(!1)),onMouseleave:r[2]||(r[2]=()=>o(!1))},[n.icon?(d.openBlock(),d.createBlock(it,{key:0,name:n.icon,outline:!e.value,color:n.disabled?"neutral-gray-200":"",size:"md"},null,8,["name","outline","color"])):d.createCommentVNode("",!0),n.label?(d.openBlock(),d.createElementBlock("span",sa,d.toDisplayString(n.label),1)):d.createCommentVNode("",!0)],42,ia)),[[l,!n.disabled]])}}}),If="",Pe=ut(oa,[["__scopeId","data-v-ffd3b0af"]]);/*!
13
- * @kurkle/color v0.3.2
14
- * https://github.com/kurkle/color#readme
15
- * (c) 2023 Jukka Kurkela
16
- * Released under the MIT License
17
- */function ie(n){return n+.5|0}const Dt=(n,t,e)=>Math.max(Math.min(n,e),t);function se(n){return Dt(ie(n*2.55),0,255)}function Et(n){return Dt(ie(n*255),0,255)}function yt(n){return Dt(ie(n/2.55)/100,0,1)}function ii(n){return Dt(ie(n*100),0,100)}const ft={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},dn=[..."0123456789ABCDEF"],aa=n=>dn[n&15],ra=n=>dn[(n&240)>>4]+dn[n&15],Oe=n=>(n&240)>>4===(n&15),la=n=>Oe(n.r)&&Oe(n.g)&&Oe(n.b)&&Oe(n.a);function ca(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&ft[n[1]]*17,g:255&ft[n[2]]*17,b:255&ft[n[3]]*17,a:t===5?ft[n[4]]*17:255}:(t===7||t===9)&&(e={r:ft[n[1]]<<4|ft[n[2]],g:ft[n[3]]<<4|ft[n[4]],b:ft[n[5]]<<4|ft[n[6]],a:t===9?ft[n[7]]<<4|ft[n[8]]:255})),e}const da=(n,t)=>n<255?t(n):"";function ha(n){var t=la(n)?aa:ra;return n?"#"+t(n.r)+t(n.g)+t(n.b)+da(n.a,t):void 0}const ua=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function si(n,t,e){const i=t*Math.min(e,1-e),s=(o,a=(o+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function fa(n,t,e){const i=(s,o=(s+n/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function pa(n,t,e){const i=si(n,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function ga(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function hn(n){const e=n.r/255,i=n.g/255,s=n.b/255,o=Math.max(e,i,s),a=Math.min(e,i,s),r=(o+a)/2;let l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=ga(e,i,s,h,o),l=l*60+.5),[l|0,c||0,r]}function un(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Et)}function fn(n,t,e){return un(si,n,t,e)}function ma(n,t,e){return un(pa,n,t,e)}function ba(n,t,e){return un(fa,n,t,e)}function oi(n){return(n%360+360)%360}function _a(n){const t=ua.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?se(+t[5]):Et(+t[5]));const s=oi(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=ma(s,o,a):t[1]==="hsv"?i=ba(s,o,a):i=fn(s,o,a),{r:i[0],g:i[1],b:i[2],a:e}}function ya(n,t){var e=hn(n);e[0]=oi(e[0]+t),e=fn(e),n.r=e[0],n.g=e[1],n.b=e[2]}function xa(n){if(!n)return;const t=hn(n),e=t[0],i=ii(t[1]),s=ii(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${yt(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const ai={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"},ri={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function ka(){const n={},t=Object.keys(ri),e=Object.keys(ai);let i,s,o,a,r;for(i=0;i<t.length;i++){for(a=r=t[i],s=0;s<e.length;s++)o=e[s],r=r.replace(o,ai[o]);o=parseInt(ri[a],16),n[r]=[o>>16&255,o>>8&255,o&255]}return n}let Be;function wa(n){Be||(Be=ka(),Be.transparent=[0,0,0,0]);const t=Be[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Sa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ma(n){const t=Sa.exec(n);let e=255,i,s,o;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?se(a):Dt(a*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?se(i):Dt(i,0,255)),s=255&(t[4]?se(s):Dt(s,0,255)),o=255&(t[6]?se(o):Dt(o,0,255)),{r:i,g:s,b:o,a:e}}}function Ca(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${yt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const pn=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Kt=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function va(n,t,e){const i=Kt(yt(n.r)),s=Kt(yt(n.g)),o=Kt(yt(n.b));return{r:Et(pn(i+e*(Kt(yt(t.r))-i))),g:Et(pn(s+e*(Kt(yt(t.g))-s))),b:Et(pn(o+e*(Kt(yt(t.b))-o))),a:n.a+e*(t.a-n.a)}}function Le(n,t,e){if(n){let i=hn(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=fn(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function li(n,t){return n&&Object.assign(t||{},n)}function ci(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Et(n[3]))):(t=li(n,{r:0,g:0,b:0,a:1}),t.a=Et(t.a)),t}function Da(n){return n.charAt(0)==="r"?Ma(n):_a(n)}class oe{constructor(t){if(t instanceof oe)return t;const e=typeof t;let i;e==="object"?i=ci(t):e==="string"&&(i=ca(t)||wa(t)||Da(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=li(this._rgb);return t&&(t.a=yt(t.a)),t}set rgb(t){this._rgb=ci(t)}rgbString(){return this._valid?Ca(this._rgb):void 0}hexString(){return this._valid?ha(this._rgb):void 0}hslString(){return this._valid?xa(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=i.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=va(this._rgb,t._rgb,e)),this}clone(){return new oe(this.rgb)}alpha(t){return this._rgb.a=Et(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ie(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 Le(this._rgb,2,t),this}darken(t){return Le(this._rgb,2,-t),this}saturate(t){return Le(this._rgb,1,t),this}desaturate(t){return Le(this._rgb,1,-t),this}rotate(t){return ya(this._rgb,t),this}}/*!
18
- * Chart.js v4.4.0
19
- * https://www.chartjs.org
20
- * (c) 2023 Chart.js Contributors
21
- * Released under the MIT License
22
- */function xt(){}const Ea=(()=>{let n=0;return()=>n++})();function I(n){return n===null||typeof n>"u"}function Y(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function N(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function K(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function dt(n,t){return K(n)?n:t}function V(n,t){return typeof n>"u"?t:n}const Pa=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,di=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function H(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function z(n,t,e,i){let s,o,a;if(Y(n))if(o=n.length,i)for(s=o-1;s>=0;s--)t.call(e,n[s],s);else for(s=0;s<o;s++)t.call(e,n[s],s);else if(N(n))for(a=Object.keys(n),o=a.length,s=0;s<o;s++)t.call(e,n[a[s]],a[s])}function Ae(n,t){let e,i,s,o;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Te(n){if(Y(n))return n.map(Te);if(N(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=Te(n[e[s]]);return t}return n}function hi(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Oa(n,t,e,i){if(!hi(n))return;const s=t[n],o=e[n];N(s)&&N(o)?ae(s,o,i):t[n]=Te(o)}function ae(n,t,e){const i=Y(t)?t:[t],s=i.length;if(!N(n))return n;e=e||{};const o=e.merger||Oa;let a;for(let r=0;r<s;++r){if(a=i[r],!N(a))continue;const l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],n,a,e)}return n}function re(n,t){return ae(n,t,{merger:Ba})}function Ba(n,t,e){if(!hi(n))return;const i=t[n],s=e[n];N(i)&&N(s)?re(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Te(s))}const ui={"":n=>n,x:n=>n.x,y:n=>n.y};function La(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Aa(n){const t=La(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Pt(n,t){return(ui[t]||(ui[t]=Aa(t)))(n)}function gn(n){return n.charAt(0).toUpperCase()+n.slice(1)}const le=n=>typeof n<"u",Ot=n=>typeof n=="function",fi=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Ta(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const U=Math.PI,X=2*U,Fa=X+U,Fe=Number.POSITIVE_INFINITY,Va=U/180,J=U/2,Vt=U/4,pi=U*2/3,Bt=Math.log10,mt=Math.sign;function ce(n,t,e){return Math.abs(n-t)<e}function gi(n){const t=Math.round(n);n=ce(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Bt(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Ra(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function Gt(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Na(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function mi(n,t,e){let i,s,o;for(i=0,s=n.length;i<s;i++)o=n[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function gt(n){return n*(U/180)}function mn(n){return n*(180/U)}function bi(n){if(!K(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function _i(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*U&&(o+=X),{angle:o,distance:s}}function bn(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Ia(n,t){return(n-t+Fa)%X-U}function ht(n){return(n%X+X)%X}function de(n,t,e,i){const s=ht(n),o=ht(t),a=ht(e),r=ht(o-s),l=ht(a-s),c=ht(s-o),h=ht(s-a);return s===o||s===a||i&&o===a||r>l&&c<h}function et(n,t,e){return Math.max(t,Math.min(e,n))}function $a(n){return et(n,-32768,32767)}function kt(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function _n(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,e(o)?s=o:i=o;return{lo:s,hi:i}}const wt=(n,t,e,i)=>_n(n,e,i?s=>{const o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),za=(n,t,e)=>_n(n,e,i=>n[i][t]>=e);function Wa(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const yi=["push","pop","shift","splice","unshift"];function ja(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),yi.forEach(e=>{const i="_onData"+gn(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...o)}),a}})})}function xi(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(yi.forEach(o=>{delete n[o]}),delete n._chartjs)}function ki(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const wi=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Si(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,wi.call(window,()=>{i=!1,n.apply(t,e)}))}}function Ha(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const yn=n=>n==="start"?"left":n==="end"?"right":"center",st=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Ya=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Mi(n,t,e){const i=t.length;let s=0,o=i;if(n._sorted){const{iScale:a,_parsed:r}=n,l=a.axis,{min:c,max:h,minDefined:u,maxDefined:f}=a.getUserBounds();u&&(s=et(Math.min(wt(r,l,c).lo,e?i:wt(t,l,a.getPixelForValue(c)).lo),0,i-1)),f?o=et(Math.max(wt(r,a.axis,h,!0).hi+1,e?0:wt(t,l,a.getPixelForValue(h),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function Ci(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),o}const Ve=n=>n===0||n===1,vi=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*X/e)),Di=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*X/e)+1,he={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*J)+1,easeOutSine:n=>Math.sin(n*J),easeInOutSine:n=>-.5*(Math.cos(U*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Ve(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Ve(n)?n:vi(n,.075,.3),easeOutElastic:n=>Ve(n)?n:Di(n,.075,.3),easeInOutElastic(n){return Ve(n)?n:n<.5?.5*vi(n*2,.1125,.45):.5+.5*Di(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-he.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?he.easeInBounce(n*2)*.5:he.easeOutBounce(n*2-1)*.5+.5};function xn(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ei(n){return xn(n)?n:new oe(n)}function kn(n){return xn(n)?n:new oe(n).saturate(.5).darken(.1).hexString()}const Ua=["x","y","borderWidth","radius","tension"],Xa=["color","borderColor","backgroundColor"];function qa(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:Xa},numbers:{type:"number",properties:Ua}}),n.describe("animations",{_fallback:"animation"}),n.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 Ka(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Pi=new Map;function Ga(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Pi.get(e);return i||(i=new Intl.NumberFormat(n,t),Pi.set(e,i)),i}function ue(n,t,e){return Ga(t,e).format(n)}const Oi={values(n){return Y(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,o=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Za(n,e)}const a=Bt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ue(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Bt(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Oi.numeric.call(this,n,t,e):""}};function Za(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Re={formatters:Oi};function Ja(n){n.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:Re.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Rt=Object.create(null),wn=Object.create(null);function fe(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const o=e[i];n=n[o]||(n[o]=Object.create(null))}return n}function Sn(n,t,e){return typeof t=="string"?ae(fe(n,t),e):ae(fe(n,""),t)}class Qa{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,s)=>kn(s.backgroundColor),this.hoverBorderColor=(i,s)=>kn(s.borderColor),this.hoverColor=(i,s)=>kn(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Sn(this,t,e)}get(t){return fe(this,t)}describe(t,e){return Sn(wn,t,e)}override(t,e){return Sn(Rt,t,e)}route(t,e,i,s){const o=fe(this,t),a=fe(this,i),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[s];return N(l)?Object.assign({},c,l):V(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var G=new Qa({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[qa,Ka,Ja]);function tr(n){return!n||I(n.size)||I(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Ne(n,t,e,i,s){let o=t[s];return o||(o=t[s]=n.measureText(s).width,e.push(s)),o>i&&(i=o),i}function er(n,t,e,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const r=e.length;let l,c,h,u,f;for(l=0;l<r;l++)if(u=e[l],u!=null&&!Y(u))a=Ne(n,s,o,a,u);else if(Y(u))for(c=0,h=u.length;c<h;c++)f=u[c],f!=null&&!Y(f)&&(a=Ne(n,s,o,a,f));n.restore();const p=o.length/2;if(p>e.length){for(l=0;l<p;l++)delete s[o[l]];o.splice(0,p)}return a}function Nt(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Bi(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function Mn(n,t,e,i){Li(n,t,e,i,null)}function Li(n,t,e,i,s){let o,a,r,l,c,h,u,f;const p=t.pointStyle,g=t.rotation,m=t.radius;let b=(g||0)*Va;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(b),n.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),n.restore();return}if(!(isNaN(m)||m<=0)){switch(n.beginPath(),p){default:s?n.ellipse(e,i,s/2,m,0,0,X):n.arc(e,i,m,0,X),n.closePath();break;case"triangle":h=s?s/2:m,n.moveTo(e+Math.sin(b)*h,i-Math.cos(b)*m),b+=pi,n.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*m),b+=pi,n.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*m),n.closePath();break;case"rectRounded":c=m*.516,l=m-c,a=Math.cos(b+Vt)*l,u=Math.cos(b+Vt)*(s?s/2-c:l),r=Math.sin(b+Vt)*l,f=Math.sin(b+Vt)*(s?s/2-c:l),n.arc(e-u,i-r,c,b-U,b-J),n.arc(e+f,i-a,c,b-J,b),n.arc(e+u,i+r,c,b,b+J),n.arc(e-f,i+a,c,b+J,b+U),n.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,h=s?s/2:l,n.rect(e-h,i-l,2*h,2*l);break}b+=Vt;case"rectRot":u=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),n.moveTo(e-u,i-r),n.lineTo(e+f,i-a),n.lineTo(e+u,i+r),n.lineTo(e-f,i+a),n.closePath();break;case"crossRot":b+=Vt;case"cross":u=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),n.moveTo(e-u,i-r),n.lineTo(e+u,i+r),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"star":u=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),n.moveTo(e-u,i-r),n.lineTo(e+u,i+r),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a),b+=Vt,u=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),n.moveTo(e-u,i-r),n.lineTo(e+u,i+r),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"line":a=s?s/2:Math.cos(b)*m,r=Math.sin(b)*m,n.moveTo(e-a,i-r),n.lineTo(e+a,i+r);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(b)*(s?s/2:m),i+Math.sin(b)*m);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function St(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Ie(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function $e(n){n.restore()}function nr(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;n.lineTo(o,t.y),n.lineTo(o,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function ir(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function sr(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),I(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function or(n,t,e,i,s){if(s.strikethrough||s.underline){const o=n.measureText(i),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,h),n.lineTo(r,h),n.stroke()}}function ar(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function It(n,t,e,i,s,o={}){const a=Y(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,sr(n,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&ar(n,o.backdrop),r&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),I(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(c,e,i,o.maxWidth)),n.fillText(c,e,i,o.maxWidth),or(n,e,i,c,o),i+=Number(s.lineHeight);n.restore()}function pe(n,t){const{x:e,y:i,w:s,h:o,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*U,U,!0),n.lineTo(e,i+o-a.bottomLeft),n.arc(e+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,U,J,!0),n.lineTo(e+s-a.bottomRight,i+o),n.arc(e+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,J,0,!0),n.lineTo(e+s,i+a.topRight),n.arc(e+s-a.topRight,i+a.topRight,a.topRight,0,-J,!0),n.lineTo(e+a.topLeft,i)}const rr=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,lr=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function cr(n,t){const e=(""+n).match(rr);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const dr=n=>+n||0;function Cn(n,t){const e={},i=N(t),s=i?Object.keys(t):t,o=N(n)?i?a=>V(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=dr(o(a));return e}function Ai(n){return Cn(n,{top:"y",right:"x",bottom:"y",left:"x"})}function $t(n){return Cn(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ot(n){const t=Ai(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function tt(n,t){n=n||{},t=t||G.font;let e=V(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=V(n.style,t.style);i&&!(""+i).match(lr)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:V(n.family,t.family),lineHeight:cr(V(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:V(n.weight,t.weight),string:""};return s.string=tr(s),s}function ge(n,t,e,i){let s=!0,o,a,r;for(o=0,a=n.length;o<a;++o)if(r=n[o],r!==void 0&&(t!==void 0&&typeof r=="function"&&(r=r(t),s=!1),e!==void 0&&Y(r)&&(r=r[e%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function hr(n,t,e){const{min:i,max:s}=n,o=di(t,(s-i)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(i,-Math.abs(o)),max:a(s,o)}}function Lt(n,t){return Object.assign(Object.create(n),t)}function vn(n,t=[""],e,i,s=()=>n[0]){const o=e||n;typeof i>"u"&&(i=Ni("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:r=>vn([r,...n],t,o,i)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete n[0][l],!0},get(r,l){return Fi(r,l,()=>yr(l,t,n,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,l){return Ii(r).includes(l)},ownKeys(r){return Ii(r)},set(r,l,c){const h=r._storage||(r._storage=s());return r[l]=h[l]=c,delete r._keys,!0}})}function Zt(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ti(n,i),setContext:o=>Zt(n,o,e,i),override:o=>Zt(n.override(o),t,e,i)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete n[a],!0},get(o,a,r){return Fi(o,a,()=>fr(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(o,a,r){return n[a]=r,delete o[a],!0}})}function Ti(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:Ot(e)?e:()=>e,isIndexable:Ot(i)?i:()=>i}}const ur=(n,t)=>n?n+gn(t):t,Dn=(n,t)=>N(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Fi(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function fr(n,t,e){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;let r=i[t];return Ot(r)&&a.isScriptable(t)&&(r=pr(t,r,n,e)),Y(r)&&r.length&&(r=gr(t,r,n,a.isIndexable)),Dn(t,r)&&(r=Zt(r,s,o&&o[t],a)),r}function pr(n,t,e,i){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=e;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let l=t(o,a||i);return r.delete(n),Dn(n,l)&&(l=En(s._scopes,s,n,l)),l}function gr(n,t,e,i){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&i(n))return t[o.index%t.length];if(N(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const u=En(c,s,n,h);t.push(Zt(u,o,a&&a[n],r))}}return t}function Vi(n,t,e){return Ot(n)?n(t,e):n}const mr=(n,t)=>n===!0?t:typeof n=="string"?Pt(t,n):void 0;function br(n,t,e,i,s){for(const o of t){const a=mr(e,o);if(a){n.add(a);const r=Vi(a._fallback,e,s);if(typeof r<"u"&&r!==e&&r!==i)return r}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function En(n,t,e,i){const s=t._rootScopes,o=Vi(t._fallback,e,i),a=[...n,...s],r=new Set;r.add(i);let l=Ri(r,a,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=Ri(r,a,o,l,i),l===null)?!1:vn(Array.from(r),[""],s,o,()=>_r(t,e,i))}function Ri(n,t,e,i,s){for(;e;)e=br(n,t,e,i,s);return e}function _r(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return Y(s)&&N(e)?e:s||{}}function yr(n,t,e,i){let s;for(const o of t)if(s=Ni(ur(o,n),e),typeof s<"u")return Dn(n,s)?En(e,i,n,s):s}function Ni(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Ii(n){let t=n._keys;return t||(t=n._keys=xr(n._scopes)),t}function xr(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function $i(n,t,e,i){const{iScale:s}=n,{key:o="r"}=this._parsing,a=new Array(i);let r,l,c,h;for(r=0,l=i;r<l;++r)c=r+e,h=t[c],a[r]={r:s.parse(Pt(h,o),c)};return a}const kr=Number.EPSILON||1e-14,Jt=(n,t)=>t<n.length&&!n[t].skip&&n[t],zi=n=>n==="x"?"y":"x";function wr(n,t,e,i){const s=n.skip?t:n,o=t,a=e.skip?t:e,r=bn(o,s),l=bn(a,o);let c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const u=i*c,f=i*h;return{previous:{x:o.x-u*(a.x-s.x),y:o.y-u*(a.y-s.y)},next:{x:o.x+f*(a.x-s.x),y:o.y+f*(a.y-s.y)}}}function Sr(n,t,e){const i=n.length;let s,o,a,r,l,c=Jt(n,0);for(let h=0;h<i-1;++h)if(l=c,c=Jt(n,h+1),!(!l||!c)){if(ce(t[h],0,kr)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[h]=s*a*t[h],e[h+1]=o*a*t[h])}}function Mr(n,t,e="x"){const i=zi(e),s=n.length;let o,a,r,l=Jt(n,0);for(let c=0;c<s;++c){if(a=r,r=l,l=Jt(n,c+1),!r)continue;const h=r[e],u=r[i];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${i}`]=u-o*t[c]),l&&(o=(l[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${i}`]=u+o*t[c])}}function Cr(n,t="x"){const e=zi(t),i=n.length,s=Array(i).fill(0),o=Array(i);let a,r,l,c=Jt(n,0);for(a=0;a<i;++a)if(r=l,l=c,c=Jt(n,a+1),!!l){if(c){const h=c[t]-l[t];s[a]=h!==0?(c[e]-l[e])/h:0}o[a]=r?c?mt(s[a-1])!==mt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}Sr(n,s,o),Mr(n,o,t)}function ze(n,t,e){return Math.max(Math.min(n,e),t)}function vr(n,t){let e,i,s,o,a,r=St(n[0],t);for(e=0,i=n.length;e<i;++e)a=o,o=r,r=e<i-1&&St(n[e+1],t),o&&(s=n[e],a&&(s.cp1x=ze(s.cp1x,t.left,t.right),s.cp1y=ze(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=ze(s.cp2x,t.left,t.right),s.cp2y=ze(s.cp2y,t.top,t.bottom)))}function Dr(n,t,e,i,s){let o,a,r,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Cr(n,s);else{let c=i?n[n.length-1]:n[0];for(o=0,a=n.length;o<a;++o)r=n[o],l=wr(c,r,n[Math.min(o+1,a-(i?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&vr(n,e)}function Wi(){return typeof window<"u"&&typeof document<"u"}function Pn(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function We(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const je=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Er(n,t){return je(n).getPropertyValue(t)}const Pr=["top","right","bottom","left"];function zt(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Pr[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Or=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Br(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i;let a=!1,r,l;if(Or(s,o,n.target))r=s,l=o;else{const c=t.getBoundingClientRect();r=i.clientX-c.left,l=i.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Wt(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=je(e),o=s.boxSizing==="border-box",a=zt(s,"padding"),r=zt(s,"border","width"),{x:l,y:c,box:h}=Br(n,e),u=a.left+(h&&r.left),f=a.top+(h&&r.top);let{width:p,height:g}=t;return o&&(p-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-u)/p*e.width/i),y:Math.round((c-f)/g*e.height/i)}}function Lr(n,t,e){let i,s;if(t===void 0||e===void 0){const o=Pn(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{const a=o.getBoundingClientRect(),r=je(o),l=zt(r,"border","width"),c=zt(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,i=We(r.maxWidth,o,"clientWidth"),s=We(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||Fe,maxHeight:s||Fe}}const He=n=>Math.round(n*10)/10;function Ar(n,t,e,i){const s=je(n),o=zt(s,"margin"),a=We(s.maxWidth,n,"clientWidth")||Fe,r=We(s.maxHeight,n,"clientHeight")||Fe,l=Lr(n,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const f=zt(s,"border","width"),p=zt(s,"padding");c-=p.width+f.width,h-=p.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,i?c/i:h-o.height),c=He(Math.min(c,a,l.maxWidth)),h=He(Math.min(h,r,l.maxHeight)),c&&!h&&(h=He(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,c=He(Math.floor(h*i))),{width:c,height:h}}function ji(n,t,e){const i=t||1,s=Math.floor(n.height*i),o=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==s||a.width!==o?(n.currentDevicePixelRatio=i,a.height=s,a.width=o,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Tr=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return n}();function Hi(n,t){const e=Er(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function jt(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Fr(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Vr(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},a=jt(n,s,e),r=jt(s,o,e),l=jt(o,t,e),c=jt(a,r,e),h=jt(r,l,e);return jt(c,h,e)}const Rr=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Nr=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Qt(n,t,e){return n?Rr(t,e):Nr()}function Yi(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function Ui(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Xi(n){return n==="angle"?{between:de,compare:Ia,normalize:ht}:{between:kt,compare:(t,e)=>t-e,normalize:t=>t}}function qi({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function Ir(n,t,e){const{property:i,start:s,end:o}=e,{between:a,normalize:r}=Xi(i),l=t.length;let{start:c,end:h,loop:u}=n,f,p;if(u){for(c+=l,h+=l,f=0,p=l;f<p&&a(r(t[c%l][i]),s,o);++f)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:u,style:n.style}}function Ki(n,t,e){if(!e)return[n];const{property:i,start:s,end:o}=e,a=t.length,{compare:r,between:l,normalize:c}=Xi(i),{start:h,end:u,loop:f,style:p}=Ir(n,t,e),g=[];let m=!1,b=null,_,y,k;const w=()=>l(s,k,_)&&r(s,k)!==0,x=()=>r(o,_)===0||l(o,k,_),C=()=>m||w(),v=()=>!m||x();for(let D=h,T=h;D<=u;++D)y=t[D%a],!y.skip&&(_=c(y[i]),_!==k&&(m=l(_,s,o),b===null&&C()&&(b=r(_,s)===0?D:T),b!==null&&v()&&(g.push(qi({start:b,end:D,loop:f,count:a,style:p})),b=null),T=D,k=_));return b!==null&&g.push(qi({start:b,end:u,loop:f,count:a,style:p})),g}function Gi(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const o=Ki(i[s],n.points,t);o.length&&e.push(...o)}return e}function $r(n,t,e,i){let s=0,o=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&n[o%t].skip;)o--;return o%=t,{start:s,end:o}}function zr(n,t,e,i){const s=n.length,o=[];let a=t,r=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?r.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%s,end:a%s,loop:i}),o}function Wr(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const o=!!n._loop,{start:a,end:r}=$r(e,s,o,i);if(i===!0)return Zi(n,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+s:r,c=!!n._fullLoop&&a===0&&r===s-1;return Zi(n,zr(e,a,l,c),e,t)}function Zi(n,t,e,i){return!i||!i.setContext||!e?t:jr(n,t,e,i)}function jr(n,t,e,i){const s=n._chart.getContext(),o=Ji(n.options),{_datasetIndex:a,options:{spanGaps:r}}=n,l=e.length,c=[];let h=o,u=t[0].start,f=u;function p(g,m,b,_){const y=r?-1:1;if(g!==m){for(g+=l;e[g%l].skip;)g-=y;for(;e[m%l].skip;)m+=y;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:b,style:_}),h=_,u=m%l)}}for(const g of t){u=r?u:g.start;let m=e[u%l],b;for(f=u+1;f<=g.end;f++){const _=e[f%l];b=Ji(i.setContext(Lt(s,{type:"segment",p0:m,p1:_,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),Hr(b,h)&&p(u,f-1,g.loop,h),m=_,h=b}u<f-1&&p(u,f-1,g.loop,h)}return c}function Ji(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Hr(n,t){if(!t)return!1;const e=[],i=function(s,o){return xn(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
23
- * Chart.js v4.4.0
24
- * https://www.chartjs.org
25
- * (c) 2023 Chart.js Contributors
26
- * Released under the MIT License
27
- */class Yr{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const o=e.listeners[s],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=wi.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,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,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Mt=new Yr;const Qi="transparent",Ur={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Ei(n||Qi),s=i.valid&&Ei(t||Qi);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Xr{constructor(t,e,i,s){const o=e[i];s=ge([t.to,s,o,t.from]);const a=ge([t.from,o,s]);this._active=!0,this._fn=t.fn||Ur[t.type||typeof a],this._easing=he[t.easing]||he.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=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ge([t.to,e,s,t.from]),this._from=ge([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<i),!this._active){this._target[s]=r,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,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 s=0;s<i.length;s++)i[s][e]()}}class ts{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!N(t))return;const e=Object.keys(G.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!N(o))return;const a={};for(const r of e)a[r]=o[r];(Y(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,a)})})}_animateOptions(t,e){const i=e.options,s=Kr(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&qr(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let u=o[c];const f=i.get(c);if(u)if(f&&u.active()){u.update(f,h,r);continue}else u.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=u=new Xr(f,t,c,h),s.push(u)}return s}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 qr(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=n[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Kr(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function es(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function Gr(n,t,e){if(e===!1)return!1;const i=es(n,e),s=es(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Zr(n){let t,e,i,s;return N(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function ns(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function is(n,t,e,i={}){const s=n.keys,o=i.mode==="single";let a,r,l,c;if(t!==null){for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(i.all)continue;break}c=n.values[l],K(c)&&(o||t===0||mt(t)===mt(c))&&(t+=c)}return t}}function Jr(n){const t=Object.keys(n),e=new Array(t.length);let i,s,o;for(i=0,s=t.length;i<s;++i)o=t[i],e[i]={x:o,y:n[o]};return e}function ss(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Qr(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function tl(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function el(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function os(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function as(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=i,l=o.axis,c=a.axis,h=Qr(o,a,i),u=t.length;let f;for(let p=0;p<u;++p){const g=t[p],{[l]:m,[c]:b}=g,_=g._stacks||(g._stacks={});f=_[c]=el(s,h,m),f[r]=b,f._top=os(f,a,!0,i.type),f._bottom=os(f,a,!1,i.type);const y=f._visualValues||(f._visualValues={});y[r]=b}}function On(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function nl(n,t){return Lt(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function il(n,t,e){return Lt(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function me(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const o=s._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 Bn=n=>n==="reset"||n==="none",rs=(n,t)=>t?n:Object.assign({},n),sl=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:ns(e,!0),values:null};class At{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=ss(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&&me(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(u,f,p,g)=>u==="x"?f:u==="r"?g:p,o=e.xAxisID=V(i.xAxisID,On(t,"x")),a=e.yAxisID=V(i.yAxisID,On(t,"y")),r=e.rAxisID=V(i.rAxisID,On(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),h=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),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&&xi(this._data,this),t._stacked&&me(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(N(e))this._data=Jr(e);else if(i!==e){if(i){xi(i,this);const s=this._cachedMeta;me(s),s._parsed=[]}e&&Object.isExtensible(e)&&ja(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 s=!1;this._dataCheck();const o=e._stacked;e._stacked=ss(e.vScale,e),e.stack!==i.stack&&(s=!0,me(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&as(this,e._parsed)}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:s}=this,{iScale:o,_stacked:a}=i,r=o.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,u,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{Y(s[t])?f=this.parseArrayData(i,s,t,e):N(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const p=()=>u[r]===null||c&&u[r]<c[r];for(h=0;h<e;++h)i._parsed[h+t]=u=f[h],l&&(p()&&(l=!1),c=u);i._sorted=l}a&&as(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),h=o===a,u=new Array(s);let f,p,g;for(f=0,p=s;f<p;++f)g=f+i,u[f]={[r]:h||o.parse(c[g],g),[l]:a.parse(e[g],g)};return u}parseArrayData(t,e,i,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,h,u;for(l=0,c=s;l<c;++l)h=l+i,u=e[h],r[l]={x:o.parse(u[0],h),y:a.parse(u[1],h)};return r}parseObjectData(t,e,i,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,u,f,p;for(h=0,u=s;h<u;++h)f=h+i,p=e[f],c[h]={x:o.parse(Pt(p,r),f),y:a.parse(Pt(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:ns(s,!0),values:e._stacks[t.axis]._visualValues};return is(r,a,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const o=i[e.axis];let a=o===null?NaN:o;const r=s&&i._stacks[e.axis];s&&r&&(s.values=r,a=is(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,a=s.length,r=this._getOtherScale(t),l=sl(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=tl(r);let f,p;function g(){p=s[f];const m=p[r.axis];return!K(p[t.axis])||h>m||u<m}for(f=0;f<a&&!(!g()&&(this.updateRangeFromParsed(c,t,p,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=e.length;s<o;++s)a=e[s][t.axis],K(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Zr(V(this.options.clip,Gr(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,c=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const u=s[h];u.hidden||(u.active&&c?a.push(u):u.draw(t,o))}for(h=0;h<a.length;++h)a[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 s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=il(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=nl(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&le(i);if(r)return rs(r,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),p=Object.keys(G.elements[t]),g=()=>this.getContext(i,s,e),m=c.resolveNamedOptions(f,p,g,u);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(rs(m,l))),m}_resolveAnimations(t,e,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(f,this.getContext(t,i,e))}const c=new ts(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Bn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:a}}updateElement(t,e,i,s){Bn(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Bn(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!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[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=i.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,i=!0){const s=this._cachedMeta,o=s.data,a=t+e;let r;const l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&me(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function ol(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=e.length;s<o;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=ki(i.sort((s,o)=>s-o))}return n._cache.$bar}function al(n){const t=n.iScale,e=ol(t,n.type);let i=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(le(r)&&(i=Math.min(i,Math.abs(a-r)||i)),r=a)};for(s=0,o=e.length;s<o;++s)a=t.getPixelForValue(e[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return i}function rl(n,t,e,i){const s=e.barThickness;let o,a;return I(s)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=s*i,a=1),{chunk:o/i,ratio:a,start:t.pixels[n]-o/2}}function ll(n,t,e,i){const s=t.pixels,o=s[n];let a=n>0?s[n-1]:null,r=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/i,ratio:e.barPercentage,start:c}}function cl(n,t,e,i){const s=e.parse(n[0],i),o=e.parse(n[1],i),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}function ls(n,t,e,i){return Y(n)?cl(n,t,e,i):t[e.axis]=e.parse(n,i),t}function cs(n,t,e,i){const s=n.iScale,o=n.vScale,a=s.getLabels(),r=s===o,l=[];let c,h,u,f;for(c=e,h=e+i;c<h;++c)f=t[c],u={},u[s.axis]=r||s.parse(a[c],c),l.push(ls(f,u,o,c));return l}function Ln(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function dl(n,t,e){return n!==0?mt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function hl(n){let t,e,i,s,o;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:i,reverse:t,top:s,bottom:o}}function ul(n,t,e,i){let s=t.borderSkipped;const o={};if(!s){n.borderSkipped=o;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:h}=hl(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=h:(o[ds(h,a,r,l)]=!0,s=c)),o[ds(s,a,r,l)]=!0,n.borderSkipped=o}function ds(n,t,e,i){return i?(n=fl(n,t,e),n=hs(n,e,t)):n=hs(n,t,e),n}function fl(n,t,e){return n===t?e:n===e?t:n}function hs(n,t,e){return n==="start"?t:n==="end"?e:n}function pl(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class gl extends At{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,s){return cs(t,e,i,s)}parseArrayData(t,e,i,s){return cs(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,h=a.axis==="x"?r:l,u=[];let f,p,g,m;for(f=i,p=i+s;f<p;++f)m=e[f],g={},g[o.axis]=o.parse(Pt(m,c),f),u.push(ls(Pt(m,h),g,a,f));return u}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);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:s}=e,o=this.getParsed(t),a=o._custom,r=Ln(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:r}}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,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(e,s);for(let p=e;p<e+i;p++){const g=this.getParsed(p),m=o||I(g[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,h),_=(g._stacks||{})[r.axis],y={horizontal:c,base:m.base,enableBorderRadius:!_||Ln(g._custom)||a===_._top||a===_._bottom,x:c?m.head:b.center,y:c?b.center:m.head,height:c?b.size:Math.abs(m.size),width:c?Math.abs(m.size):b.size};f&&(y.options=u||this.resolveDataElementOptions(p,t[p].active?"active":s));const k=y.options||t[p].options;ul(y,k,_,a),pl(y,k,h.ratio),this.updateElement(t[p],p,y,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=i.options.stacked,a=[],r=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(I(h)||isNaN(h))return!0};for(const l of s)if(!(e!==void 0&&r(l))&&((o===!1||a.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&a.push(l.stack),l.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let o,a;for(o=0,a=e.data.length;o<a;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const r=t.barThickness;return{min:r||al(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=Ln(c);let u=l[e.axis],f=0,p=i?this.applyStack(e,l,i):u,g,m;p!==u&&(f=p-u,p=u),h&&(u=c.barStart,p=c.barEnd-c.barStart,u!==0&&mt(u)!==mt(c.barEnd)&&(f=0),f+=u);const b=!I(o)&&!h?o:f;let _=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(f+p):g=_,m=g-_,Math.abs(m)<a){m=dl(m,e,r)*a,u===r&&(_-=m/2);const y=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),w=Math.min(y,k),x=Math.max(y,k);_=Math.max(Math.min(_,x),w),g=_+m,i&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(_))}if(_===e.getPixelForValue(r)){const y=mt(m)*e.getLineWidthForValue(r)/2;_+=y,m-=y}return{size:m,base:_,head:g,center:g+m/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,a=V(s.maxBarThickness,1/0);let r,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?ll(t,e,s,c):rl(t,e,s,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=h.start+h.chunk*u+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&i[o].draw(this._ctx)}}class ml extends At{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const o=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+i).radius;return o}parseArrayData(t,e,i,s){const o=super.parseArrayData(t,e,i,s);for(let a=0;a<o.length;a++){const r=e[i+a];o[a]._custom=V(r[2],this.resolveDataElementOptions(a+i).radius)}return o}parseObjectData(t,e,i,s){const o=super.parseObjectData(t,e,i,s);for(let a=0;a<o.length;a++){const r=e[i+a];o[a]._custom=V(r&&r.r&&+r.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+r+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=a.axis,u=r.axis;for(let f=e;f<e+i;f++){const p=t[f],g=!o&&this.getParsed(f),m={},b=m[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(g[h]),_=m[u]=o?r.getBasePixel():r.getPixelForValue(g[u]);m.skip=isNaN(b)||isNaN(_),c&&(m.options=l||this.resolveDataElementOptions(f,p.active?"active":s),o&&(m.options.radius=0)),this.updateElement(p,f,m,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=V(i&&i._custom,o),s}}function bl(n,t,e){let i=1,s=1,o=0,a=0;if(t<X){const r=n,l=r+t,c=Math.cos(r),h=Math.sin(r),u=Math.cos(l),f=Math.sin(l),p=(k,w,x)=>de(k,r,l,!0)?1:Math.max(w,w*e,x,x*e),g=(k,w,x)=>de(k,r,l,!0)?-1:Math.min(w,w*e,x,x*e),m=p(0,c,u),b=p(J,h,f),_=g(U,c,u),y=g(U+J,h,f);i=(m-_)/2,s=(b-y)/2,o=-(m+_)/2,a=-(b+y)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class An extends At{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;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},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,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(N(i[t])){const{key:l="value"}=this._parsing;o=c=>+Pt(i[c],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return gt(this.options.rotation-90)}_getCircumference(){return gt(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 s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(Pa(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=bl(u,h,l),b=(i.width-a)/f,_=(i.height-a)/p,y=Math.max(Math.min(b,_)/2,0),k=di(this.options.radius,y),w=Math.max(k*l,0),x=(k-w)/this._getVisibleDatasetWeightTotal();this.offsetX=g*k,this.offsetY=m*k,s.total=this.calculateTotal(),this.outerRadius=k-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/X)}updateElements(t,e,i,s){const o=s==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,h=(r.left+r.right)/2,u=(r.top+r.bottom)/2,f=o&&c.animateScale,p=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(e,s);let _=this._getRotation(),y;for(y=0;y<e;++y)_+=this._circumference(y,o);for(y=e;y<e+i;++y){const k=this._circumference(y,o),w=t[y],x={x:h+this.offsetX,y:u+this.offsetY,startAngle:_,endAngle:_+k,circumference:k,outerRadius:g,innerRadius:p};b&&(x.options=m||this.resolveDataElementOptions(y,w.active?"active":s)),_+=k,this.updateElement(w,y,x,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(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,s=i.data.labels||[],o=ue(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){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(V(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class _l extends At{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:s=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=Mi(e,s,a);this._drawStart=r,this._drawCount=l,Ci(e)&&(r=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(s,r,l,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,s),f=a.axis,p=r.axis,{spanGaps:g,segment:m}=this.options,b=Gt(g)?g:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none",y=e+i,k=t.length;let w=e>0&&this.getParsed(e-1);for(let x=0;x<k;++x){const C=t[x],v=_?C:{};if(x<e||x>=y){v.skip=!0;continue}const D=this.getParsed(x),T=I(D[p]),B=v[f]=a.getPixelForValue(D[f],x),O=v[p]=o||T?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,D,l):D[p],x);v.skip=isNaN(B)||isNaN(O)||T,v.stop=x>0&&Math.abs(D[f]-w[f])>b,m&&(v.parsed=D,v.raw=c.data[x]),u&&(v.options=h||this.resolveDataElementOptions(x,C.active?"active":s)),_||this.updateElement(C,x,v,s),w=D}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class us extends At{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=ue(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return $i.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,s){const o=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,f=c.getIndexAngle(0)-.5*U;let p=f,g;const m=360/this.countVisibleElements();for(g=0;g<e;++g)p+=this._computeAngle(g,s,m);for(g=e;g<e+i;g++){const b=t[g];let _=p,y=p+this._computeAngle(g,s,m),k=a.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=y,o&&(l.animateScale&&(k=0),l.animateRotate&&(_=y=f));const w={x:h,y:u,innerRadius:0,outerRadius:k,startAngle:_,endAngle:y,options:this.resolveDataElementOptions(g,b.active?"active":s)};this.updateElement(b,g,w,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?gt(this.resolveDataElementOptions(t,e).angle||i):0}}class yl extends An{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class xl extends At{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return $i.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(i,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=e;r<e+i;r++){const l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":s),h=o.getPointPositionForValue(r,this.getParsed(r).r),u=a?o.xCenter:h.x,f=a?o.yCenter:h.y,p={x:u,y:f,angle:h.angle,skip:isNaN(u)||isNaN(f),options:c};this.updateElement(l,r,p,s)}}}class kl extends At{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:i[t]||"",value:"("+r+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=Mi(e,i,s);if(this._drawStart=o,this._drawCount=a,Ci(e)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:l}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),u=this.getSharedOptions(h),f=this.includeOptions(s,u),p=a.axis,g=r.axis,{spanGaps:m,segment:b}=this.options,_=Gt(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||s==="none";let k=e>0&&this.getParsed(e-1);for(let w=e;w<e+i;++w){const x=t[w],C=this.getParsed(w),v=y?x:{},D=I(C[g]),T=v[p]=a.getPixelForValue(C[p],w),B=v[g]=o||D?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,C,l):C[g],w);v.skip=isNaN(T)||isNaN(B)||D,v.stop=w>0&&Math.abs(C[p]-k[p])>_,b&&(v.parsed=C,v.raw=c.data[w]),f&&(v.options=u||this.resolveDataElementOptions(w,x.active?"active":s)),y||this.updateElement(x,w,v,s),k=C}this.updateSharedOptions(u,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let l=e.length-1;l>=0;--l)r=Math.max(r,e[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,a)/2}}var wl=Object.freeze({__proto__:null,BarController:gl,BubbleController:ml,DoughnutController:An,LineController:_l,PieController:yl,PolarAreaController:us,RadarController:xl,ScatterController:kl});function Ht(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Tn{static override(t){Object.assign(Tn.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Ht()}parse(){return Ht()}format(){return Ht()}add(){return Ht()}diff(){return Ht()}startOf(){return Ht()}endOf(){return Ht()}}var Sl={_date:Tn};function Ml(n,t,e,i){const{controller:s,data:o,_sorted:a}=n,r=s._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const l=r._reversePixels?za:wt;if(i){if(s._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const u=l(o,t,e-h),f=l(o,t,e+h);return{lo:u.lo,hi:f.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function be(n,t,e,i,s){const o=n.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:h}=o[r],{lo:u,hi:f}=Ml(o[r],t,a,s);for(let p=u;p<=f;++p){const g=h[p];g.skip||i(g,c,p)}}}function Cl(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Fn(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||be(n,e,t,function(r,l,c){!s&&!St(r,n.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function vl(n,t,e,i){let s=[];function o(a,r,l){const{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:u}=_i(a,{x:t.x,y:t.y});de(u,c,h)&&s.push({element:a,datasetIndex:r,index:l})}return be(n,e,t,o),s}function Dl(n,t,e,i,s,o){let a=[];const r=Cl(e);let l=Number.POSITIVE_INFINITY;function c(h,u,f){const p=h.inRange(t.x,t.y,s);if(i&&!p)return;const g=h.getCenterPoint(s);if(!(!!o||n.isPointInArea(g))&&!p)return;const b=r(t,g);b<l?(a=[{element:h,datasetIndex:u,index:f}],l=b):b===l&&a.push({element:h,datasetIndex:u,index:f})}return be(n,e,t,c),a}function Vn(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?vl(n,t,e,s):Dl(n,t,e,i,s,o)}function fs(n,t,e,i,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return be(n,e,t,(l,c,h)=>{l[a](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,s))}),i&&!r?[]:o}var El={evaluateInteractionItems:be,modes:{index(n,t,e,i){const s=Wt(t,n),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?Fn(n,s,o,i,a):Vn(n,s,o,!1,i,a),l=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const h=r[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(n,t,e,i){const s=Wt(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?Fn(n,s,o,i,a):Vn(n,s,o,!1,i,a);if(r.length>0){const l=r[0].datasetIndex,c=n.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h})}return r},point(n,t,e,i){const s=Wt(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Fn(n,s,o,i,a)},nearest(n,t,e,i){const s=Wt(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Vn(n,s,o,e.intersect,i,a)},x(n,t,e,i){const s=Wt(t,n);return fs(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=Wt(t,n);return fs(n,s,"y",e.intersect,i)}}};const ps=["left","top","right","bottom"];function _e(n,t){return n.filter(e=>e.pos===t)}function gs(n,t){return n.filter(e=>ps.indexOf(e.pos)===-1&&e.box.axis===t)}function ye(n,t){return n.sort((e,i)=>{const s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Pl(n){const t=[];let e,i,s,o,a,r;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function Ol(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!ps.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Bl(n,t){const e=Ol(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=n.length;o<a;++o){r=n[o];const{fullSize:l}=r.box,c=e[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*i:l&&t.availableWidth,r.height=s):(r.width=i,r.height=h?h*s:l&&t.availableHeight)}return e}function Ll(n){const t=Pl(n),e=ye(t.filter(c=>c.box.fullSize),!0),i=ye(_e(t,"left"),!0),s=ye(_e(t,"right")),o=ye(_e(t,"top"),!0),a=ye(_e(t,"bottom")),r=gs(t,"x"),l=gs(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:_e(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function ms(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function bs(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function Al(n,t,e,i){const{pos:s,box:o}=e,a=n.maxPadding;if(!N(s)){e.size&&(n[s]-=e.size);const u=i[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?o.height:o.width),e.size=u.size/u.count,n[s]+=e.size}o.getPadding&&bs(a,o.getPadding());const r=Math.max(0,t.outerWidth-ms(a,n,"left","right")),l=Math.max(0,t.outerHeight-ms(a,n,"top","bottom")),c=r!==n.w,h=l!==n.h;return n.w=r,n.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Tl(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Fl(n,t){const e=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return i(n?["left","right"]:["top","bottom"])}function xe(n,t,e,i){const s=[];let o,a,r,l,c,h;for(o=0,a=n.length,c=0;o<a;++o){r=n[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Fl(r.horizontal,t));const{same:u,other:f}=Al(t,e,r,i);c|=u&&s.length,h=h||f,l.fullSize||s.push(r)}return c&&xe(s,t,e,i)||h}function Ye(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function _s(n,t,e,i){const s=e.padding;let{x:o,y:a}=t;for(const r of n){const l=r.box,c=i[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){const u=t.w*h,f=c.size||l.height;le(c.start)&&(a=c.start),l.fullSize?Ye(l,s.left,a,e.outerWidth-s.right-s.left,f):Ye(l,t.left+c.placed,a,u,f),c.start=a,c.placed+=u,a=l.bottom}else{const u=t.h*h,f=c.size||l.width;le(c.start)&&(o=c.start),l.fullSize?Ye(l,o,s.top,f,e.outerHeight-s.bottom-s.top):Ye(l,o,t.top+c.placed,f,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=a}var at={addBox(n,t){n.boxes||(n.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)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=ot(n.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=Ll(n.boxes),l=r.vertical,c=r.horizontal;z(n.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),f=Object.assign({},s);bs(f,ot(i));const p=Object.assign({maxPadding:f,w:o,h:a,x:s.left,y:s.top},s),g=Bl(l.concat(c),u);xe(r.fullSize,p,u,g),xe(l,p,u,g),xe(c,p,u,g)&&xe(l,p,u,g),Tl(p),_s(r.leftAndTop,p,u,g),p.x+=p.w,p.y+=p.h,_s(r.rightAndBottom,p,u,g),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},z(r.chartArea,m=>{const b=m.box;Object.assign(b,n.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class ys{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Vl extends ys{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ue="$chartjs",Rl={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xs=n=>n===null||n==="";function Nl(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[Ue]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",xs(s)){const o=Hi(n,"width");o!==void 0&&(n.width=o)}if(xs(i))if(n.style.height==="")n.height=n.width/(t||2);else{const o=Hi(n,"height");o!==void 0&&(n.height=o)}return n}const ks=Tr?{passive:!0}:!1;function Il(n,t,e){n.addEventListener(t,e,ks)}function $l(n,t,e){n.canvas.removeEventListener(t,e,ks)}function zl(n,t){const e=Rl[n.type]||n.type,{x:i,y:s}=Wt(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Xe(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Wl(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Xe(r.addedNodes,i),a=a&&!Xe(r.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function jl(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Xe(r.removedNodes,i),a=a&&!Xe(r.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ke=new Map;let ws=0;function Ss(){const n=window.devicePixelRatio;n!==ws&&(ws=n,ke.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Hl(n,t){ke.size||window.addEventListener("resize",Ss),ke.set(n,t)}function Yl(n){ke.delete(n),ke.size||window.removeEventListener("resize",Ss)}function Ul(n,t,e){const i=n.canvas,s=i&&Pn(i);if(!s)return;const o=Si((r,l)=>{const c=s.clientWidth;e(r,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(s),Hl(n,o),a}function Rn(n,t,e){e&&e.disconnect(),t==="resize"&&Yl(n)}function Xl(n,t,e){const i=n.canvas,s=Si(o=>{n.ctx!==null&&e(zl(o,n))},n);return Il(i,t,s),s}class ql extends ys{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Nl(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ue])return!1;const i=e[Ue].initial;["height","width"].forEach(o=>{const a=i[o];I(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Ue],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Wl,detach:jl,resize:Ul}[e]||Xl;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Rn,detach:Rn,resize:Rn}[e]||$l)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Ar(t,e,i,s)}isAttached(t){const e=Pn(t);return!!(e&&e.isConnected)}}function Kl(n){return!Wi()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Vl:ql}class Ct{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 Gt(this.x)&&Gt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function Gl(n,t){const e=n.options.ticks,i=Zl(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Ql(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return tc(t,c,o,a/s),c;const h=Jl(o,t,s);if(a>0){let u,f;const p=a>1?Math.round((l-r)/(a-1)):null;for(qe(t,c,h,I(p)?0:r-p,r),u=0,f=a-1;u<f;u++)qe(t,c,h,o[u],o[u+1]);return qe(t,c,h,l,I(p)?t.length:l+p),c}return qe(t,c,h),c}function Zl(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Jl(n,t,e){const i=ec(n),s=t.length/e;if(!i)return Math.max(s,1);const o=Ra(i);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function Ql(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function tc(n,t,e,i){let s=0,o=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===o&&(t.push(n[a]),s++,o=e[s*i])}function qe(n,t,e,i,s){const o=V(i,0),a=Math.min(V(s,n.length),n.length);let r=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),h=o;h<0;)r++,h=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===h&&(t.push(n[c]),r++,h=Math.round(o+r*e))}function ec(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const nc=n=>n==="left"?"right":n==="right"?"left":n,Ms=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Cs=(n,t)=>Math.min(t||n,n);function vs(n,t){const e=[],i=n.length/t,s=n.length;let o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function ic(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,a=n._endPixel,r=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-o,a-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-r||l>a+r)))return l}function sc(n,t){z(n,e=>{const i=e.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function we(n){return n.drawTicks?n.tickLength:0}function Ds(n,t){if(!n.display)return 0;const e=tt(n.font,t),i=ot(n.padding);return(Y(n.text)?n.text.length:1)*e.lineHeight+i.height}function oc(n,t){return Lt(n,{scale:t,type:"scale"})}function ac(n,t,e){return Lt(n,{tick:e,index:t,type:"tick"})}function rc(n,t,e){let i=yn(n);return(e&&t!=="right"||!e&&t==="right")&&(i=nc(i)),i}function lc(n,t,e,i){const{top:s,left:o,bottom:a,right:r,chart:l}=n,{chartArea:c,scales:h}=l;let u=0,f,p,g;const m=a-s,b=r-o;if(n.isHorizontal()){if(p=st(i,o,r),N(e)){const _=Object.keys(e)[0],y=e[_];g=h[_].getPixelForValue(y)+m-t}else e==="center"?g=(c.bottom+c.top)/2+m-t:g=Ms(n,e,t);f=r-o}else{if(N(e)){const _=Object.keys(e)[0],y=e[_];p=h[_].getPixelForValue(y)-b+t}else e==="center"?p=(c.left+c.right)/2-b+t:p=Ms(n,e,t);g=st(i,a,s),u=e==="left"?-J:J}return{titleX:p,titleY:g,maxWidth:f,rotation:u}}class Yt extends Ct{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:s}=this;return t=dt(t,Number.POSITIVE_INFINITY),e=dt(e,Number.NEGATIVE_INFINITY),i=dt(i,Number.POSITIVE_INFINITY),s=dt(s,Number.NEGATIVE_INFINITY),{min:dt(t,i),max:dt(e,s),minDefined:K(t),maxDefined:K(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:e,max:i};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),o||(i=Math.max(i,a.max));return e=o&&e>i?i:e,i=s&&e>i?e:i,{min:dt(e,dt(i,e)),max:dt(i,dt(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(){H(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.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=hr(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?vs(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Gl(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(){H(this.options.afterUpdate,[this])}beforeSetDimensions(){H(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(){H(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),H(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){H(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=H(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){H(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){H(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Cs(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,l,c;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),u=h.widest.width,f=h.highest.height,p=et(this.chart.width-u,0,this.maxWidth);r=t.offset?this.maxWidth/i:p/(i-1),u+6>r&&(r=p/(i-(t.offset?.5:1)),l=this.maxHeight-we(t.grid)-e.padding-Ds(t.title,this.chart.options.font),c=Math.sqrt(u*u+f*f),a=mn(Math.min(Math.asin(et((h.highest.height+6)/r,-1,1)),Math.asin(et(l/c,-1,1))-Math.asin(et(f/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){H(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){H(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Ds(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=we(o)+l):(t.height=this.maxHeight,t.width=we(o)+l),i.display&&this.ticks.length){const{first:c,last:h,widest:u,highest:f}=this._getLabelSizes(),p=i.padding*2,g=gt(this.labelRotation),m=Math.cos(g),b=Math.sin(g);if(r){const _=i.mirror?0:b*u.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+_+p)}else{const _=i.mirror?0:m*u.width+b*f.height;t.width=Math.min(this.maxWidth,t.width+_+p)}this._calculatePadding(c,h,b,m)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;l?c?(f=s*t.width,p=i*e.height):(f=i*t.height,p=s*e.width):o==="start"?p=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=e.width/2),this.paddingLeft=Math.max((f-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((p-u+a)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;o==="start"?(h=0,u=t.height):o==="end"&&(h=e.height,u=0),this.paddingTop=h+a,this.paddingBottom=u+a}}_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(){H(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++)I(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=vs(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Cs(e,i));let c=0,h=0,u,f,p,g,m,b,_,y,k,w,x;for(u=0;u<e;u+=l){if(g=t[u].label,m=this._resolveTickFontOptions(u),s.font=b=m.string,_=o[b]=o[b]||{data:{},gc:[]},y=m.lineHeight,k=w=0,!I(g)&&!Y(g))k=Ne(s,_.data,_.gc,k,g),w=y;else if(Y(g))for(f=0,p=g.length;f<p;++f)x=g[f],!I(x)&&!Y(x)&&(k=Ne(s,_.data,_.gc,k,x),w+=y);a.push(k),r.push(w),c=Math.max(k,c),h=Math.max(w,h)}sc(o,e);const C=a.indexOf(c),v=r.indexOf(h),D=T=>({width:a[T]||0,height:r[T]||0});return{first:D(0),last:D(e-1),widest:D(C),highest:D(v),widths:a,heights:r}}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 $a(this._alignToPixels?Nt(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=ac(this.getContext(),t,i))}return this.$context||(this.$context=oc(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=gt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*i>r*s?r/i:l/s:l*s<r*i?l/i:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),f=we(o),p=[],g=r.setContext(this.getContext()),m=g.display?g.width:0,b=m/2,_=function(S){return Nt(i,S,m)};let y,k,w,x,C,v,D,T,B,O,R,Q;if(a==="top")y=_(this.bottom),v=this.bottom-f,T=y-b,O=_(t.top)+b,Q=t.bottom;else if(a==="bottom")y=_(this.top),O=t.top,Q=_(t.bottom)-b,v=y+b,T=this.top+f;else if(a==="left")y=_(this.right),C=this.right-f,D=y-b,B=_(t.left)+b,R=t.right;else if(a==="right")y=_(this.left),B=t.left,R=_(t.right)-b,C=y+b,D=this.left+f;else if(e==="x"){if(a==="center")y=_((t.top+t.bottom)/2+.5);else if(N(a)){const S=Object.keys(a)[0],P=a[S];y=_(this.chart.scales[S].getPixelForValue(P))}O=t.top,Q=t.bottom,v=y+b,T=v+f}else if(e==="y"){if(a==="center")y=_((t.left+t.right)/2);else if(N(a)){const S=Object.keys(a)[0],P=a[S];y=_(this.chart.scales[S].getPixelForValue(P))}C=y-b,D=C-f,B=t.left,R=t.right}const L=V(s.ticks.maxTicksLimit,u),M=Math.max(1,Math.ceil(u/L));for(k=0;k<u;k+=M){const S=this.getContext(k),P=o.setContext(S),E=r.setContext(S),A=P.lineWidth,F=P.color,$=E.dash||[],W=E.dashOffset,q=P.tickWidth,Z=P.tickColor,nt=P.tickBorderDash||[],pt=P.tickBorderDashOffset;w=ic(this,k,l),w!==void 0&&(x=Nt(i,w,A),c?C=D=B=R=x:v=T=O=Q=x,p.push({tx1:C,ty1:v,tx2:D,ty2:T,x1:B,y1:O,x2:R,y2:Q,width:A,color:F,borderDash:$,borderDashOffset:W,tickWidth:q,tickColor:Z,tickBorderDash:nt,tickBorderDashOffset:pt}))}return this._ticksLength=u,this._borderValue=y,p}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:u}=o,f=we(i.grid),p=f+h,g=u?-h:p,m=-gt(this.labelRotation),b=[];let _,y,k,w,x,C,v,D,T,B,O,R,Q="middle";if(s==="top")C=this.bottom-g,v=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+g,v=this._getXAxisLabelAlignment();else if(s==="left"){const M=this._getYAxisLabelAlignment(f);v=M.textAlign,x=M.x}else if(s==="right"){const M=this._getYAxisLabelAlignment(f);v=M.textAlign,x=M.x}else if(e==="x"){if(s==="center")C=(t.top+t.bottom)/2+p;else if(N(s)){const M=Object.keys(s)[0],S=s[M];C=this.chart.scales[M].getPixelForValue(S)+p}v=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")x=(t.left+t.right)/2-p;else if(N(s)){const M=Object.keys(s)[0],S=s[M];x=this.chart.scales[M].getPixelForValue(S)}v=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const L=this._getLabelSizes();for(_=0,y=r.length;_<y;++_){k=r[_],w=k.label;const M=o.setContext(this.getContext(_));D=this.getPixelForTick(_)+o.labelOffset,T=this._resolveTickFontOptions(_),B=T.lineHeight,O=Y(w)?w.length:1;const S=O/2,P=M.color,E=M.textStrokeColor,A=M.textStrokeWidth;let F=v;a?(x=D,v==="inner"&&(_===y-1?F=this.options.reverse?"left":"right":_===0?F=this.options.reverse?"right":"left":F="center"),s==="top"?c==="near"||m!==0?R=-O*B+B/2:c==="center"?R=-L.highest.height/2-S*B+B:R=-L.highest.height+B/2:c==="near"||m!==0?R=B/2:c==="center"?R=L.highest.height/2-S*B:R=L.highest.height-O*B,u&&(R*=-1),m!==0&&!M.showLabelBackdrop&&(x+=B/2*Math.sin(m))):(C=D,R=(1-O)*B/2);let $;if(M.showLabelBackdrop){const W=ot(M.backdropPadding),q=L.heights[_],Z=L.widths[_];let nt=R-W.top,pt=0-W.left;switch(Q){case"middle":nt-=q/2;break;case"bottom":nt-=q;break}switch(v){case"center":pt-=Z/2;break;case"right":pt-=Z;break}$={left:pt,top:nt,width:Z+W.width,height:q+W.height,color:M.backdropColor}}b.push({label:w,font:T,textOffset:R,options:{rotation:m,color:P,strokeColor:E,strokeWidth:A,textAlign:F,textBaseline:Q,translation:[x,C],backdrop:$}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-gt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,h;return e==="left"?s?(h=this.right+o,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,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:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(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,a=s.length;o<a;++o){const l=s[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({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:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,u,f;this.isHorizontal()?(c=Nt(t,this.left,a)-a/2,h=Nt(t,this.right,r)+r/2,u=f=l):(u=Nt(t,this.top,a)-a/2,f=Nt(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,u),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Ie(i,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,h=a.textOffset;It(i,c,0,h,l,r)}s&&$e(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=tt(i.font),a=ot(i.padding),r=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||N(e)?(l+=a.bottom,Y(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:u,rotation:f}=lc(this,l,e,r);It(t,i.text,0,0,o,{color:i.color,maxWidth:u,rotation:f,textAlign:rc(r,e,s),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=V(t.grid&&t.grid.z,-1),s=V(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Yt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[i]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return tt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ke{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;hc(e)&&(i=this.register(e));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,cc(t,a,i),this.override&&G.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in G[s]&&(delete G[s][i],this.override&&delete Rt[i])}}function cc(n,t,e){const i=ae(Object.create(null),[e?G.get(e):{},G.get(t),n.defaults]);G.set(t,i),n.defaultRoutes&&dc(t,n.defaultRoutes),n.descriptors&&G.describe(t,n.descriptors)}function dc(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");G.route(o,s,l,r)})}function hc(n){return"id"in n&&"defaults"in n}class uc{constructor(){this.controllers=new Ke(At,"datasets",!0),this.elements=new Ke(Ct,"elements"),this.plugins=new Ke(Object,"plugins"),this.scales=new Ke(Yt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):z(s,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,i){const s=gn(t);H(i["before"+s],[],i),e[t](i),H(i["after"+s],[],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 s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var bt=new uc;class fc{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,s){s=s||{};for(const o of t){const a=o.plugin,r=a[i],l=[e,s,o.options];if(H(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){I(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,s=V(i.options&&i.options.plugins,{}),o=pc(i);return s===!1&&!e?[]:mc(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function pc(n){const t={},e=[],i=Object.keys(bt.plugins.items);for(let o=0;o<i.length;o++)e.push(bt.getPlugin(i[o]));const s=n.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function gc(n,t){return!t&&n===!1?null:n===!0?{}:n}function mc(n,{plugins:t,localIds:e},i,s){const o=[],a=n.getContext();for(const r of t){const l=r.id,c=gc(i[l],s);c!==null&&o.push({plugin:r,options:bc(n.config,{plugin:r,local:e[l]},c,a)})}return o}function bc(n,{plugin:t,local:e},i,s){const o=n.pluginScopeKeys(t),a=n.getOptionScopes(i,o);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Nn(n,t){const e=G.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function _c(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function yc(n,t){return n===t?"_index_":"_value_"}function Es(n){if(n==="x"||n==="y"||n==="r")return n}function xc(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function In(n,...t){if(Es(n))return n;for(const e of t){const i=e.axis||xc(e.position)||n.length>1&&Es(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Ps(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function kc(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Ps(n,"x",e[0])||Ps(n,"y",e[0])}return{}}function wc(n,t){const e=Rt[n.type]||{scales:{}},i=t.scales||{},s=Nn(n.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const r=i[a];if(!N(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=In(a,r,kc(a,n),G.scales[r.type]),c=yc(l,s),h=e.scales||{};o[a]=re(Object.create(null),[{axis:l},r,h[l],h[c]])}),n.data.datasets.forEach(a=>{const r=a.type||n.type,l=a.indexAxis||Nn(r,t),h=(Rt[r]||{}).scales||{};Object.keys(h).forEach(u=>{const f=_c(u,l),p=a[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),re(o[p],[{axis:f},i[p],h[u]])})}),Object.keys(o).forEach(a=>{const r=o[a];re(r,[G.scales[r.type],G.scale])}),o}function Os(n){const t=n.options||(n.options={});t.plugins=V(t.plugins,{}),t.scales=wc(n,t)}function Bs(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Sc(n){return n=n||{},n.data=Bs(n.data),Os(n),n}const Ls=new Map,As=new Set;function Ge(n,t){let e=Ls.get(n);return e||(e=t(),Ls.set(n,e),As.add(e)),e}const Se=(n,t,e)=>{const i=Pt(t,e);i!==void 0&&n.add(i)};class Mc{constructor(t){this._config=Sc(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=Bs(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(),Os(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ge(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ge(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ge(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Ge(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:o}=this,a=this._cachedScopes(t,i),r=a.get(e);if(r)return r;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>Se(l,t,u))),h.forEach(u=>Se(l,s,u)),h.forEach(u=>Se(l,Rt[o]||{},u)),h.forEach(u=>Se(l,G,u)),h.forEach(u=>Se(l,wn,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),As.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Rt[e]||{},G.datasets[e]||{},{type:e},G,wn]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Ts(this._resolverCache,t,s);let l=a;if(vc(a,e)){o.$shared=!1,i=Ot(i)?i():i;const c=this.createResolver(t,i,r);l=Zt(a,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Ts(this._resolverCache,t,i);return N(e)?Zt(o,e,void 0,s):o}}function Ts(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let o=i.get(s);return o||(o={resolver:vn(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,o)),o}const Cc=n=>N(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||Ot(n[e]),!1);function vc(n,t){const{isScriptable:e,isIndexable:i}=Ti(n);for(const s of t){const o=e(s),a=i(s),r=(a||o)&&n[s];if(o&&(Ot(r)||Cc(r))||a&&Y(r))return!0}return!1}var Dc="4.4.0";const Ec=["top","bottom","left","right","chartArea"];function Fs(n,t){return n==="top"||n==="bottom"||Ec.indexOf(n)===-1&&t==="x"}function Vs(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Rs(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),H(e&&e.onComplete,[n],t)}function Pc(n){const t=n.chart,e=t.options.animation;H(e&&e.onProgress,[n],t)}function Ns(n){return Wi()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ze={},Is=n=>{const t=Ns(n);return Object.values(Ze).filter(e=>e.canvas===t).pop()};function Oc(n,t,e){const i=Object.keys(n);for(const s of i){const o=+s;if(o>=t){const a=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=a)}}}function Bc(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Je(n,t,e){return n.options.clip?n[e]:t[e]}function Lc(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Je(e,t,"left"),right:Je(e,t,"right"),top:Je(i,t,"top"),bottom:Je(i,t,"bottom")}:t}class $n{static defaults=G;static instances=Ze;static overrides=Rt;static registry=bt;static version=Dc;static getChart=Is;static register(...t){bt.add(...t),$s()}static unregister(...t){bt.remove(...t),$s()}constructor(t,e){const i=this.config=new Mc(e),s=Ns(t),o=Is(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Kl(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Ea(),this.ctx=r,this.canvas=l,this.width=h,this.height=c,this._options=a,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 fc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ha(u=>this.update(u),a.resizeDelay||0),this._dataChanges=[],Ze[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Mt.listen(this,"complete",Rs),Mt.listen(this,"progress",Pc),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return I(t)?e&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return bt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ji(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Bi(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,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,ji(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),H(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};z(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=In(a,r),c=l==="r",h=l==="x";return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),z(o,a=>{const r=a.options,l=r.id,c=In(l,r),h=V(r.type,a.dtype);(r.position===void 0||Fs(r.position,c)!==Fs(a.dposition))&&(r.position=a.dposition),s[l]=!0;let u=null;if(l in i&&i[l].type===h)u=i[l];else{const f=bt.getScale(h);u=new f({id:l,type:h,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(r,t)}),z(s,(a,r)=>{a||delete i[r]}),z(i,a=>{at.configure(this,a,a.options),at.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Vs("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const o=e[i];let a=this.getDatasetMeta(i);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=r,a.indexAxis=o.indexAxis||Nn(r,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=bt.getController(r),{datasetElementType:c,dataElementType:h}=G.datasets[r];Object.assign(l,{dataElementType:bt.getElement(h),datasetElementType:c&&bt.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){z(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()),s=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 a=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:u}=this.getDatasetMeta(c),f=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(f),a=Math.max(+u.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||z(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Vs("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){z(this.scales,t=>{at.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!fi(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of e){const a=i==="_removeElements"?-o:o;Oc(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=i(0);for(let o=1;o<e;o++)if(!fi(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;at.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],z(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!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,Ot(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Mt.has(this)?this.attached&&!Mt.running(this)&&Mt.start(this):(this.draw(),Rs({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!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 s,o;for(s=0,o=e.length;s<o;++s){const a=e[s];(!t||a.visible)&&i.push(a)}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=t._clip,s=!i.disabled,o=Lc(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&Ie(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&$e(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return St(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=El.modes[e];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Lt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){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 s=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);le(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),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(),Bi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ze[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};z(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){z(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},z(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!Ae(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 s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),a=o(e,t),r=i?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:o}=this,a=e,r=this._getActiveElements(t,s,i,a),l=Ta(t),c=Bc(t,this._lastEvent,i,l);i&&(this._lastEvent=null,H(o.onHover,[t,r,this],this),l&&H(o.onClick,[t,r,this],this));const h=!Ae(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function $s(){return z($n.instances,n=>n._plugins.invalidate())}function Ac(n,t,e){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;n.beginPath(),n.arc(o,a,r,i-c,e+c),l>s?(c=s/l,n.arc(o,a,l,e+c,i-c,!0)):n.arc(o,a,s,e+J,i-J),n.closePath(),n.clip()}function Tc(n){return Cn(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Fc(n,t,e,i){const s=Tc(n.options.borderRadius),o=(e-t)/2,a=Math.min(o,i*t/2),r=l=>{const c=(e-Math.min(o,l))*i/2;return et(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:et(s.innerStart,0,a),innerEnd:et(s.innerEnd,0,a)}}function te(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Qe(n,t,e,i,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+i+e-c,0),f=h>0?h+i+e+c:0;let p=0;const g=s-l;if(i){const M=h>0?h-i:0,S=u>0?u-i:0,P=(M+S)/2,E=P!==0?g*P/(P+i):g;p=(g-E)/2}const m=Math.max(.001,g*u-e/U)/u,b=(g-m)/2,_=l+b+p,y=s-b-p,{outerStart:k,outerEnd:w,innerStart:x,innerEnd:C}=Fc(t,f,u,y-_),v=u-k,D=u-w,T=_+k/v,B=y-w/D,O=f+x,R=f+C,Q=_+x/O,L=y-C/R;if(n.beginPath(),o){const M=(T+B)/2;if(n.arc(a,r,u,T,M),n.arc(a,r,u,M,B),w>0){const A=te(D,B,a,r);n.arc(A.x,A.y,w,B,y+J)}const S=te(R,y,a,r);if(n.lineTo(S.x,S.y),C>0){const A=te(R,L,a,r);n.arc(A.x,A.y,C,y+J,L+Math.PI)}const P=(y-C/f+(_+x/f))/2;if(n.arc(a,r,f,y-C/f,P,!0),n.arc(a,r,f,P,_+x/f,!0),x>0){const A=te(O,Q,a,r);n.arc(A.x,A.y,x,Q+Math.PI,_-J)}const E=te(v,_,a,r);if(n.lineTo(E.x,E.y),k>0){const A=te(v,T,a,r);n.arc(A.x,A.y,k,_-J,T)}}else{n.moveTo(a,r);const M=Math.cos(T)*u+a,S=Math.sin(T)*u+r;n.lineTo(M,S);const P=Math.cos(B)*u+a,E=Math.sin(B)*u+r;n.lineTo(P,E)}n.closePath()}function Vc(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){Qe(n,t,e,i,l,s);for(let c=0;c<o;++c)n.fill();isNaN(r)||(l=a+(r%X||X))}return Qe(n,t,e,i,l,s),n.fill(),l}function Rc(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:u,borderDashOffset:f}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(u||[]),n.lineDashOffset=f,p?(n.lineWidth=c*2,n.lineJoin=h||"round"):(n.lineWidth=c,n.lineJoin=h||"bevel");let g=t.endAngle;if(o){Qe(n,t,e,i,g,s);for(let m=0;m<o;++m)n.stroke();isNaN(r)||(g=a+(r%X||X))}p&&Ac(n,t,g),o||(Qe(n,t,e,i,g,s),n.stroke())}class Nc extends Ct{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};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 s=this.getProps(["x","y"],i),{angle:o,distance:a}=_i(s,{x:t,y:e}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:h,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,g=V(u,l-r)>=X||de(o,r,l),m=kt(a,c+f,h+f);return g&&m}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(s+o)/2,u=(a+r+c+l)/2;return{x:e+Math.cos(h)*u,y:i+Math.sin(h)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,a=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 r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);const l=1-Math.sin(Math.min(U,i||0)),c=s*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,Vc(t,this,c,o,a),Rc(t,this,c,o,a),t.restore()}}function zs(n,t,e=t){n.lineCap=V(e.borderCapStyle,t.borderCapStyle),n.setLineDash(V(e.borderDash,t.borderDash)),n.lineDashOffset=V(e.borderDashOffset,t.borderDashOffset),n.lineJoin=V(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=V(e.borderWidth,t.borderWidth),n.strokeStyle=V(e.borderColor,t.borderColor)}function Ic(n,t,e){n.lineTo(e.x,e.y)}function $c(n){return n.stepped?nr:n.tension||n.cubicInterpolationMode==="monotone"?ir:Ic}function Ws(n,t,e={}){const i=n.length,{start:s=0,end:o=i-1}=e,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:i,start:l,loop:t.loop,ilen:c<l&&!h?i+c-l:c-l}}function zc(n,t,e,i){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=Ws(s,e,i),h=$c(o);let{move:u=!0,reverse:f}=i||{},p,g,m;for(p=0;p<=c;++p)g=s[(r+(f?c-p:p))%a],!g.skip&&(u?(n.moveTo(g.x,g.y),u=!1):h(n,m,g,f,o.stepped),m=g);return l&&(g=s[(r+(f?c:0))%a],h(n,m,g,f,o.stepped)),!!l}function Wc(n,t,e,i){const s=t.points,{count:o,start:a,ilen:r}=Ws(s,e,i),{move:l=!0,reverse:c}=i||{};let h=0,u=0,f,p,g,m,b,_;const y=w=>(a+(c?r-w:w))%o,k=()=>{m!==b&&(n.lineTo(h,b),n.lineTo(h,m),n.lineTo(h,_))};for(l&&(p=s[y(0)],n.moveTo(p.x,p.y)),f=0;f<=r;++f){if(p=s[y(f)],p.skip)continue;const w=p.x,x=p.y,C=w|0;C===g?(x<m?m=x:x>b&&(b=x),h=(u*h+w)/++u):(k(),n.lineTo(w,x),g=C,u=0,m=b=x),_=x}k()}function zn(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Wc:zc}function jc(n){return n.stepped?Fr:n.tension||n.cubicInterpolationMode==="monotone"?Vr:jt}function Hc(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),zs(n,t.options),n.stroke(s)}function Yc(n,t,e,i){const{segments:s,options:o}=t,a=zn(t);for(const r of s)zs(n,o,r.style),n.beginPath(),a(n,t,r,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Uc=typeof Path2D=="function";function Xc(n,t,e,i){Uc&&!t.options.segment?Hc(n,t,e,i):Yc(n,t,e,i)}class tn extends Ct{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 s=i.spanGaps?this._loop:this._fullLoop;Dr(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Wr(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,s=t[e],o=this.points,a=Gi(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=jc(i);let c,h;for(c=0,h=a.length;c<h;++c){const{start:u,end:f}=a[c],p=o[u],g=o[f];if(p===g){r.push(p);continue}const m=Math.abs((s-p[e])/(g[e]-p[e])),b=l(p,g,m,i.stepped);b[e]=t[e],r.push(b)}return r.length===1?r[0]:r}pathSegment(t,e,i){return zn(this)(t,this,e,i)}path(t,e,i){const s=this.segments,o=zn(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const r of s)a&=o(t,this,r,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Xc(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function js(n,t,e,i){const s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}class qc extends Ct{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 s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return js(this,t,"x",e)}inYRange(t,e){return js(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||!St(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Mn(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Hs(n,t){const{x:e,y:i,base:s,width:o,height:a}=n.getProps(["x","y","base","width","height"],t);let r,l,c,h,u;return n.horizontal?(u=a/2,r=Math.min(e,s),l=Math.max(e,s),c=i-u,h=i+u):(u=o/2,r=e-u,l=e+u,c=Math.min(i,s),h=Math.max(i,s)),{left:r,top:c,right:l,bottom:h}}function Tt(n,t,e,i){return n?0:et(t,e,i)}function Kc(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,o=Ai(i);return{t:Tt(s.top,o.top,0,e),r:Tt(s.right,o.right,0,t),b:Tt(s.bottom,o.bottom,0,e),l:Tt(s.left,o.left,0,t)}}function Gc(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=$t(s),a=Math.min(t,e),r=n.borderSkipped,l=i||N(s);return{topLeft:Tt(!l||r.top||r.left,o.topLeft,0,a),topRight:Tt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Tt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Tt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Zc(n){const t=Hs(n),e=t.right-t.left,i=t.bottom-t.top,s=Kc(n,e/2,i/2),o=Gc(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Wn(n,t,e,i){const s=t===null,o=e===null,r=n&&!(s&&o)&&Hs(n,i);return r&&(s||kt(t,r.left,r.right))&&(o||kt(e,r.top,r.bottom))}function Jc(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Qc(n,t){n.rect(t.x,t.y,t.w,t.h)}function jn(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,o=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+o,h:n.h+a,radius:n.radius}}class td extends Ct{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:s}}=this,{inner:o,outer:a}=Zc(this),r=Jc(a.radius)?pe:Qc;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,jn(a,e,o)),t.clip(),r(t,jn(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,jn(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Wn(this,t,e,i)}inXRange(t,e){return Wn(this,t,null,e)}inYRange(t,e){return Wn(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var ed=Object.freeze({__proto__:null,ArcElement:Nc,BarElement:td,LineElement:tn,PointElement:qc});const Hn=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Ys=Hn.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Us(n){return Hn[n%Hn.length]}function Xs(n){return Ys[n%Ys.length]}function nd(n,t){return n.borderColor=Us(t),n.backgroundColor=Xs(t),++t}function id(n,t){return n.backgroundColor=n.data.map(()=>Us(t++)),t}function sd(n,t){return n.backgroundColor=n.data.map(()=>Xs(t++)),t}function od(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof An?t=id(e,t):s instanceof us?t=sd(e,t):s&&(t=nd(e,t))}}function qs(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function ad(n){return n&&(n.borderColor||n.backgroundColor)}var rd={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:o}=s;if(!e.forceOverride&&(qs(i)||ad(s)||o&&qs(o)))return;const a=od(n);i.forEach(a)}};function ld(n,t,e,i,s){const o=s.samples||i;if(o>=e)return n.slice(t,t+e);const a=[],r=(e-2)/(o-2);let l=0;const c=t+e-1;let h=t,u,f,p,g,m;for(a[l++]=n[h],u=0;u<o-2;u++){let b=0,_=0,y;const k=Math.floor((u+1)*r)+1+t,w=Math.min(Math.floor((u+2)*r)+1,e)+t,x=w-k;for(y=k;y<w;y++)b+=n[y].x,_+=n[y].y;b/=x,_/=x;const C=Math.floor(u*r)+1+t,v=Math.min(Math.floor((u+1)*r)+1,e)+t,{x:D,y:T}=n[h];for(p=g=-1,y=C;y<v;y++)g=.5*Math.abs((D-b)*(n[y].y-T)-(D-n[y].x)*(_-T)),g>p&&(p=g,f=n[y],m=y);a[l++]=f,h=m}return a[l++]=n[c],a}function cd(n,t,e,i){let s=0,o=0,a,r,l,c,h,u,f,p,g,m;const b=[],_=t+e-1,y=n[t].x,w=n[_].x-y;for(a=t;a<t+e;++a){r=n[a],l=(r.x-y)/w*i,c=r.y;const x=l|0;if(x===h)c<g?(g=c,u=a):c>m&&(m=c,f=a),s=(o*s+r.x)/++o;else{const C=a-1;if(!I(u)&&!I(f)){const v=Math.min(u,f),D=Math.max(u,f);v!==p&&v!==C&&b.push({...n[v],x:s}),D!==p&&D!==C&&b.push({...n[D],x:s})}a>0&&C!==p&&b.push(n[C]),b.push(r),h=x,o=0,g=m=c,u=f=p=a}}return b}function Ks(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Gs(n){n.data.datasets.forEach(t=>{Ks(t)})}function dd(n,t){const e=t.length;let i=0,s;const{iScale:o}=n,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=et(wt(t,o.axis,a).lo,0,e-1)),c?s=et(wt(t,o.axis,r).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var hd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Gs(n);return}const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=n.getDatasetMeta(o),c=a||s.data;if(ge([r,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const h=n.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:u,count:f}=dd(l,c);const p=e.threshold||4*i;if(f<=p){Ks(s);return}I(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(e.algorithm){case"lttb":g=ld(c,u,f,i,e);break;case"min-max":g=cd(c,u,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(n){Gs(n)}};function ud(n,t,e){const i=n.segments,s=n.points,o=t.points,a=[];for(const r of i){let{start:l,end:c}=r;c=Un(l,c,s);const h=Yn(e,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:h,start:s[l],end:s[c]});continue}const u=Gi(t,h);for(const f of u){const p=Yn(e,o[f.start],o[f.end],f.loop),g=Ki(r,s,p);for(const m of g)a.push({source:m,target:f,start:{[e]:Zs(h,p,"start",Math.max)},end:{[e]:Zs(h,p,"end",Math.min)}})}}return a}function Yn(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=ht(s),o=ht(o)),{property:n,start:s,end:o}}function fd(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Un(a,r,s);const l=s[a],c=s[r];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 Un(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Zs(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Js(n,t){let e=[],i=!1;return Y(n)?(i=!0,e=n):e=fd(n,t),e.length?new tn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Qs(n){return n&&n.fill!==!1}function pd(n,t,e){let s=n[t].fill;const o=[t];let a;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!K(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function gd(n,t,e){const i=yd(n);if(N(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return K(s)&&Math.floor(s)===s?md(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function md(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function bd(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:N(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function _d(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:N(n)?i=n.value:i=t.getBaseValue(),i}function yd(n){const t=n.options,e=t.fill;let i=V(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function xd(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,a=i.points,r=kd(t,e);r.push(Js({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++)wd(s,a[h],r)}return new tn({points:s,options:{}})}function kd(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function wd(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=Sd(o,t,"x");if(!(!l||a&&r)){if(a)i.unshift(l);else if(n.push(l),!r)break}}n.push(...i)}function Sd(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],o=n.segments,a=n.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],u=a[h.start][e],f=a[h.end][e];if(kt(s,u,f)){r=s===u,l=s===f;break}}return{first:r,last:l,point:i}}class to{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:o,radius:a}=this;return e=e||{start:0,end:X},t.arc(s,o,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function Md(n){const{chart:t,fill:e,line:i}=n;if(K(e))return Cd(t,e);if(e==="stack")return xd(n);if(e==="shape")return!0;const s=vd(n);return s instanceof to?s:Js(s,i)}function Cd(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function vd(n){return(n.scale||{}).getPointPositionForValue?Ed(n):Dd(n)}function Dd(n){const{scale:t={},fill:e}=n,i=bd(e,t);if(K(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Ed(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,a=_d(e,t,o),r=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new to({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function Xn(n,t,e){const i=Md(t),{line:s,scale:o,axis:a}=t,r=s.options,l=r.fill,c=r.backgroundColor,{above:h=c,below:u=c}=l||{};i&&s.points.length&&(Ie(n,e),Pd(n,{line:s,target:i,above:h,below:u,area:e,scale:o,axis:a}),$e(n))}function Pd(n,t){const{line:e,target:i,above:s,below:o,area:a,scale:r}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&o!==s&&(eo(n,i,a.top),no(n,{line:e,target:i,color:s,scale:r,property:l}),n.restore(),n.save(),eo(n,i,a.bottom)),no(n,{line:e,target:i,color:o,scale:r,property:l}),n.restore()}function eo(n,t,e){const{segments:i,points:s}=t;let o=!0,a=!1;n.beginPath();for(const r of i){const{start:l,end:c}=r,h=s[l],u=s[Un(l,c,s)];o?(n.moveTo(h.x,h.y),o=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,r,{move:a}),a?n.closePath():n.lineTo(u.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function no(n,t){const{line:e,target:i,property:s,color:o,scale:a}=t,r=ud(e,i,s);for(const{source:l,target:c,start:h,end:u}of r){const{style:{backgroundColor:f=o}={}}=l,p=i!==!0;n.save(),n.fillStyle=f,Od(n,a,p&&Yn(s,h,u)),n.beginPath();const g=!!e.pathSegment(n,l);let m;if(p){g?n.closePath():io(n,i,u,s);const b=!!i.pathSegment(n,c,{move:g,reverse:!0});m=g&&b,m||io(n,i,h,s)}n.closePath(),n.fill(m?"evenodd":"nonzero"),n.restore()}}function Od(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:o,start:a,end:r}=e||{};o==="x"&&(n.beginPath(),n.rect(a,i,r-a,s-i),n.clip())}function io(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Bd={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<i;++a)o=n.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof tn&&(l={visible:n.isDatasetVisible(a),index:a,fill:gd(r,a,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=pd(s,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),i&&r.fill&&Xn(n.ctx,r,o))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Qs(o)&&Xn(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Qs(i)||e.drawTime!=="beforeDatasetDraw"||Xn(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const so=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Ld=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class oo extends Ct{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=H(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=tt(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=so(i,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+r;let u=t;o.textAlign="left",o.textBaseline="middle";let f=-1,p=-h;return this.legendItems.forEach((g,m)=>{const b=i+e/2+o.measureText(g.text).width;(m===0||c[c.length-1]+b+2*r>a)&&(u+=h,c[c.length-(m>0?0:1)]=0,p+=h,f++),l[m]={left:0,top:p,row:f,width:b,height:s},c[c.length-1]+=b+r}),u}_fitCols(t,e,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-t;let u=r,f=0,p=0,g=0,m=0;return this.legendItems.forEach((b,_)=>{const{itemWidth:y,itemHeight:k}=Ad(i,e,o,b,s);_>0&&p+k+2*r>h&&(u+=f+r,c.push({width:f,height:p}),g+=f+r,m++,f=p=0),l[_]={left:g,top:p,col:m,width:y,height:k},f=Math.max(f,y),p+=k+r}),u+=f,c.push({width:f,height:p}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,a=Qt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=st(i,this.left+s,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=st(i,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=st(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=st(i,this.top+t+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ie(t,this),this._draw(),$e(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=G.color,l=Qt(t.rtl,this.left,this.width),c=tt(a.font),{padding:h}=a,u=c.size,f=u/2;let p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:b}=so(a,u),_=function(C,v,D){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;s.save();const T=V(D.lineWidth,1);if(s.fillStyle=V(D.fillStyle,r),s.lineCap=V(D.lineCap,"butt"),s.lineDashOffset=V(D.lineDashOffset,0),s.lineJoin=V(D.lineJoin,"miter"),s.lineWidth=T,s.strokeStyle=V(D.strokeStyle,r),s.setLineDash(V(D.lineDash,[])),a.usePointStyle){const B={radius:m*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:T},O=l.xPlus(C,g/2),R=v+f;Li(s,B,O,R,a.pointStyleWidth&&g)}else{const B=v+Math.max((u-m)/2,0),O=l.leftForLtr(C,g),R=$t(D.borderRadius);s.beginPath(),Object.values(R).some(Q=>Q!==0)?pe(s,{x:O,y:B,w:g,h:m,radius:R}):s.rect(O,B,g,m),s.fill(),T!==0&&s.stroke()}s.restore()},y=function(C,v,D){It(s,D.text,C,v+b/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},k=this.isHorizontal(),w=this._computeTitleHeight();k?p={x:st(o,this.left+h,this.right-i[0]),y:this.top+h+w,line:0}:p={x:this.left+h,y:st(o,this.top+w+h,this.bottom-e[0].height),line:0},Yi(this.ctx,t.textDirection);const x=b+h;this.legendItems.forEach((C,v)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const D=s.measureText(C.text).width,T=l.textAlign(C.textAlign||(C.textAlign=a.textAlign)),B=g+f+D;let O=p.x,R=p.y;l.setWidth(this.width),k?v>0&&O+B+h>this.right&&(R=p.y+=x,p.line++,O=p.x=st(o,this.left+h,this.right-i[p.line])):v>0&&R+x>this.bottom&&(O=p.x=O+e[p.line].width+h,p.line++,R=p.y=st(o,this.top+w+h,this.bottom-e[p.line].height));const Q=l.x(O);if(_(Q,R,C),O=Ya(T,O+g+f,k?O+B:this.right,t.rtl),y(l.x(O),R,C),k)p.x+=B+h;else if(typeof C.text!="string"){const L=c.lineHeight;p.y+=ao(C,L)+h}else p.y+=x}),Ui(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=tt(e.font),s=ot(e.padding);if(!e.display)return;const o=Qt(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=i.size/2,c=s.top+l;let h,u=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,u=st(t.align,u,this.right-f);else{const g=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);h=c+st(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const p=st(r,u,u+f);a.textAlign=o.textAlign(yn(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,It(a,e.text,p,h,i)}_computeTitleHeight(){const t=this.options.title,e=tt(t.font),i=ot(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(kt(t,this.left,this.right)&&kt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],kt(t,s.left,s.left+s.width)&&kt(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Vd(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Ld(s,i);s&&!o&&H(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&H(e.onHover,[t,i,this],this)}else i&&H(e.onClick,[t,i,this],this)}}function Ad(n,t,e,i,s){const o=Td(i,n,t,e),a=Fd(s,i,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Td(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+i.measureText(s).width}function Fd(n,t,e){let i=n;return typeof t.text!="string"&&(i=ao(t,e)),i}function ao(n,t){const e=n.text?n.text.length:0;return t*e}function Vd(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Rd={id:"legend",_element:oo,start(n,t,e){const i=n.legend=new oo({ctx:n.ctx,options:e,chart:n});at.configure(n,i,e),at.addBox(n,i)},stop(n){at.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;at.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=ot(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:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class qn extends Ct{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=Y(i.text)?i.text.length:1;this._padding=ot(i.padding);const o=s*tt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,h,u;return this.isHorizontal()?(h=st(r,i,o),u=e+t,c=o-i):(a.position==="left"?(h=i+t,u=st(r,s,e),l=U*-.5):(h=o-t,u=st(r,e,s),l=U*.5),c=s-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=tt(e.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);It(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:yn(e.align),textBaseline:"middle",translation:[a,r]})}}function Nd(n,t){const e=new qn({ctx:n.ctx,options:t,chart:n});at.configure(n,e,t),at.addBox(n,e),n.titleBlock=e}var Id={id:"title",_element:qn,start(n,t,e){Nd(n,e)},stop(n){const t=n.titleBlock;at.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;at.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const en=new WeakMap;var $d={id:"subtitle",start(n,t,e){const i=new qn({ctx:n.ctx,options:e,chart:n});at.configure(n,i,e),at.addBox(n,i),en.set(n,i)},stop(n){at.removeBox(n,en.get(n)),en.delete(n)},beforeUpdate(n,t,e){const i=en.get(n);at.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Me={average(n){if(!n.length)return!1;let t,e,i=0,s=0,o=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const r=a.tooltipPosition();i+=r.x,s+=r.y,++o}}return{x:i/o,y:s/o}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=n.length;o<a;++o){const l=n[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=bn(t,c);h<s&&(s=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function _t(n,t){return t&&(Y(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function vt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
28
- `)>-1?n.split(`
29
- `):n}function zd(n,t){const{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:n,label:a,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function ro(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:a,boxHeight:r}=t,l=tt(t.bodyFont),c=tt(t.titleFont),h=tt(t.footerFont),u=o.length,f=s.length,p=i.length,g=ot(t.padding);let m=g.height,b=0,_=i.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(_+=n.beforeBody.length+n.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),_){const w=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;m+=p*w+(_-p)*l.lineHeight+(_-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let y=0;const k=function(w){b=Math.max(b,e.measureText(w).width+y)};return e.save(),e.font=c.string,z(n.title,k),e.font=l.string,z(n.beforeBody.concat(n.afterBody),k),y=t.displayColors?a+2+t.boxPadding:0,z(i,w=>{z(w.before,k),z(w.lines,k),z(w.after,k)}),y=0,e.font=h.string,z(n.footer,k),e.restore(),b+=g.width,{width:b,height:m}}function Wd(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function jd(n,t,e,i){const{x:s,width:o}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+o+a>t.width||n==="right"&&s-o-a<0)return!0}function Hd(n,t,e,i){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=n;let c="center";return i==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),jd(c,n,t,e)&&(c="center"),c}function lo(n,t,e){const i=e.yAlign||t.yAlign||Wd(n,e);return{xAlign:e.xAlign||t.xAlign||Hd(n,t,e,i),yAlign:i}}function Yd(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Ud(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function co(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=n,{xAlign:r,yAlign:l}=e,c=s+o,{topLeft:h,topRight:u,bottomLeft:f,bottomRight:p}=$t(a);let g=Yd(t,r);const m=Ud(t,l,c);return l==="center"?r==="left"?g+=c:r==="right"&&(g-=c):r==="left"?g-=Math.max(h,f)+s:r==="right"&&(g+=Math.max(u,p)+s),{x:et(g,0,i.width-t.width),y:et(m,0,i.height-t.height)}}function nn(n,t,e){const i=ot(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function ho(n){return _t([],vt(n))}function Xd(n,t,e){return Lt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function uo(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const fo={beforeTitle:xt,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:xt,beforeBody:xt,beforeLabel:xt,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return I(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:xt,afterBody:xt,beforeFooter:xt,footer:xt,afterFooter:xt};function rt(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?fo[t].call(e,i):s}class po extends Ct{static positioners=Me;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()),s=i.enabled&&e.options.animation&&i.animations,o=new ts(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Xd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=rt(i,"beforeTitle",this,t),o=rt(i,"title",this,t),a=rt(i,"afterTitle",this,t);let r=[];return r=_t(r,vt(s)),r=_t(r,vt(o)),r=_t(r,vt(a)),r}getBeforeBody(t,e){return ho(rt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return z(t,o=>{const a={before:[],lines:[],after:[]},r=uo(i,o);_t(a.before,vt(rt(r,"beforeLabel",this,o))),_t(a.lines,rt(r,"label",this,o)),_t(a.after,vt(rt(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return ho(rt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=rt(i,"beforeFooter",this,t),o=rt(i,"footer",this,t),a=rt(i,"afterFooter",this,t);let r=[];return r=_t(r,vt(s)),r=_t(r,vt(o)),r=_t(r,vt(a)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;l<c;++l)r.push(zd(this.chart,e[l]));return t.filter&&(r=r.filter((h,u,f)=>t.filter(h,u,f,i))),t.itemSort&&(r=r.sort((h,u)=>t.itemSort(h,u,i))),z(r,h=>{const u=uo(t.callbacks,h);s.push(rt(u,"labelColor",this,h)),o.push(rt(u,"labelPointStyle",this,h)),a.push(rt(u,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=Me[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=ro(this,i),c=Object.assign({},r,l),h=lo(this.chart,i,c),u=co(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const o=this.getCaretPosition(t,i,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=$t(r),{x:f,y:p}=t,{width:g,height:m}=e;let b,_,y,k,w,x;return o==="center"?(w=p+m/2,s==="left"?(b=f,_=b-a,k=w+a,x=w-a):(b=f+g,_=b+a,k=w-a,x=w+a),y=b):(s==="left"?_=f+Math.max(l,h)+a:s==="right"?_=f+g-Math.max(c,u)-a:_=this.caretX,o==="top"?(k=p,w=k-a,b=_-a,y=_+a):(k=p+m,w=k+a,b=_+a,y=_-a),x=k),{x1:b,x2:_,x3:y,y1:k,y2:w,y3:x}}drawTitle(t,e,i){const s=this.title,o=s.length;let a,r,l;if(o){const c=Qt(i.rtl,this.x,this.width);for(t.x=nn(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=tt(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,s,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,h=tt(o.bodyFont),u=nn(this,"left",o),f=s.x(u),p=l<h.lineHeight?(h.lineHeight-l)/2:0,g=e.y+p;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},b=s.leftForLtr(f,c)+c/2,_=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Mn(t,m,b,_),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Mn(t,m,b,_)}else{t.lineWidth=N(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const m=s.leftForLtr(f,c),b=s.leftForLtr(s.xPlus(f,1),c-2),_=$t(a.borderRadius);Object.values(_).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,pe(t,{x:m,y:g,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),pe(t,{x:b,y:g+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(b,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=i,u=tt(i.bodyFont);let f=u.lineHeight,p=0;const g=Qt(i.rtl,this.x,this.width),m=function(D){e.fillText(D,g.x(t.x+p),t.y+f/2),t.y+=f+o},b=g.textAlign(a);let _,y,k,w,x,C,v;for(e.textAlign=a,e.textBaseline="middle",e.font=u.string,t.x=nn(this,b,i),e.fillStyle=i.bodyColor,z(this.beforeBody,m),p=r&&b!=="right"?a==="center"?c/2+h:c+2+h:0,w=0,C=s.length;w<C;++w){for(_=s[w],y=this.labelTextColors[w],e.fillStyle=y,z(_.before,m),k=_.lines,r&&k.length&&(this._drawColorBox(e,t,w,g,i),f=Math.max(u.lineHeight,l)),x=0,v=k.length;x<v;++x)m(k[x]),f=u.lineHeight;z(_.after,m)}p=0,f=u.lineHeight,z(this.afterBody,m),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let a,r;if(o){const l=Qt(i.rtl,this.x,this.width);for(t.x=nn(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=tt(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:h}=i,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:g}=$t(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+u,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(r+c-f,l),e.quadraticCurveTo(r+c,l,r+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(r+c,l+h-g),e.quadraticCurveTo(r+c,l+h,r+c-g,l+h),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(r+p,l+h),e.quadraticCurveTo(r,l+h,r,l+h-p),a==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(r,l+u),e.quadraticCurveTo(r,l,r+u,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const a=Me[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=ro(this,t),l=Object.assign({},a,this._size),c=lo(e,t,l),h=co(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.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 s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=ot(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),Yi(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Ui(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!Ae(i,s),a=this._positionChanged(s,e);(o||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,i),r=this._positionChanged(a,t),l=e||!Ae(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e;const a=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:o}=this,a=Me[o.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}var qd={id:"tooltip",_element:po,positioners:Me,afterInit(n,t,e){e&&(n.tooltip=new po({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.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:(n,t)=>t.bodyFont.size,boxWidth:(n,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:fo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Kd=Object.freeze({__proto__:null,Colors:rd,Decimation:hd,Filler:Bd,Legend:Rd,SubTitle:$d,Title:Id,Tooltip:qd});const Gd=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Zd(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Gd(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const Jd=(n,t)=>n===null?null:et(Math.round(n),0,t);function go(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Qd extends Yt{static id="category";static defaults={ticks:{callback:go}};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:s,label:o}of e)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(I(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Zd(i,t,V(e,t),this._addedLabels),Jd(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return go.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 th(n,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:f}=n,p=o||1,g=h-1,{min:m,max:b}=t,_=!I(a),y=!I(r),k=!I(c),w=(b-m)/(u+1);let x=gi((b-m)/g/p)*p,C,v,D,T;if(x<1e-14&&!_&&!y)return[{value:m},{value:b}];T=Math.ceil(b/x)-Math.floor(m/x),T>g&&(x=gi(T*x/g/p)*p),I(l)||(C=Math.pow(10,l),x=Math.ceil(x*C)/C),s==="ticks"?(v=Math.floor(m/x)*x,D=Math.ceil(b/x)*x):(v=m,D=b),_&&y&&o&&Na((r-a)/o,x/1e3)?(T=Math.round(Math.min((r-a)/x,h)),x=(r-a)/T,v=a,D=r):k?(v=_?a:v,D=y?r:D,T=c-1,x=(D-v)/T):(T=(D-v)/x,ce(T,Math.round(T),x/1e3)?T=Math.round(T):T=Math.ceil(T));const B=Math.max(bi(x),bi(v));C=Math.pow(10,I(l)?B:l),v=Math.round(v*C)/C,D=Math.round(D*C)/C;let O=0;for(_&&(f&&v!==a?(e.push({value:a}),v<a&&O++,ce(Math.round((v+O*x)*C)/C,a,mo(a,w,n))&&O++):v<a&&O++);O<T;++O){const R=Math.round((v+O*x)*C)/C;if(y&&R>r)break;e.push({value:R})}return y&&f&&D!==r?e.length&&ce(e[e.length-1].value,r,mo(r,w,n))?e[e.length-1].value=r:e.push({value:r}):(!y||D===r)&&e.push({value:D}),e}function mo(n,t,{horizontal:e,minRotation:i}){const s=gt(i),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/o,a)}class sn extends Yt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return I(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:s,max:o}=this;const a=l=>s=e?s:l,r=l=>o=i?o:l;if(t){const l=mt(s),c=mt(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=th(s,o);return t.bounds==="ticks"&&mi(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ue(t,this.chart.options.locale,this.options.ticks.format)}}class eh extends sn{static id="linear";static defaults={ticks:{callback:Re.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?t:0,this.max=K(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=gt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Ce=n=>Math.floor(Bt(n)),Ut=(n,t)=>Math.pow(10,Ce(n)+t);function bo(n){return n/Math.pow(10,Ce(n))===1}function _o(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function nh(n,t){const e=t-n;let i=Ce(e);for(;_o(n,t,i)>10;)i++;for(;_o(n,t,i)<10;)i--;return Math.min(i,Ce(n))}function ih(n,{min:t,max:e}){t=dt(n.min,t);const i=[],s=Ce(t);let o=nh(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,h=Math.floor((t-l)/r/10)*r*10;let u=Math.floor((c-h)/Math.pow(10,o)),f=dt(n.min,Math.round((l+h+u*Math.pow(10,o))*a)/a);for(;f<e;)i.push({value:f,major:bo(f),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,a=o>=0?1:a),f=Math.round((l+h+u*Math.pow(10,o))*a)/a;const p=dt(n.max,f);return i.push({value:p,major:bo(p),significand:u}),i}class sh extends Yt{static id="logarithmic";static defaults={ticks:{callback:Re.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=sn.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return K(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?Math.max(0,t):null,this.max=K(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!K(this._userMin)&&(this.min=t===Ut(this.min,0)?Ut(this.min,-1):Ut(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=r=>i=t?i:r,a=r=>s=e?s:r;i===s&&(i<=0?(o(1),a(10)):(o(Ut(i,-1)),a(Ut(s,1)))),i<=0&&o(Ut(s,-1)),s<=0&&a(Ut(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=ih(e,this);return t.bounds==="ticks"&&mi(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":ue(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Bt(t),this._valueRange=Bt(this.max)-Bt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Bt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Kn(n){const t=n.ticks;if(t.display&&n.display){const e=ot(t.backdropPadding);return V(t.font&&t.font.size,G.font.size)+e.height}return 0}function oh(n,t,e){return e=Y(e)?e:[e],{w:er(n,t.string,e),h:e.length*t.lineHeight}}function yo(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function ah(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],o=n._pointLabels.length,a=n.options.pointLabels,r=a.centerPointLabels?U/o:0;for(let l=0;l<o;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const h=n.getPointPosition(l,n.drawingArea+s[l],r),u=tt(c.font),f=oh(n.ctx,u,n._pointLabels[l]);i[l]=f;const p=ht(n.getIndexAngle(l)+r),g=Math.round(mn(p)),m=yo(g,h.x,f.w,0,180),b=yo(g,h.y,f.h,90,270);rh(e,t,p,m,b)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=dh(n,i,s)}function rh(n,t,e,i,s){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,l=0;i.start<t.l?(r=(t.l-i.start)/o,n.l=Math.min(n.l,t.l-r)):i.end>t.r&&(r=(i.end-t.r)/o,n.r=Math.max(n.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function lh(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=e,l=n.getPointPosition(t,i+s+a,o),c=Math.round(mn(ht(l.angle+J))),h=fh(l.y,r.h,c),u=hh(c),f=uh(l.x,r.w,u);return{visible:!0,x:l.x,y:h,textAlign:u,left:f,top:h,right:f+r.w,bottom:h+r.h}}function ch(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;return!(St({x:e,y:i},t)||St({x:e,y:o},t)||St({x:s,y:i},t)||St({x:s,y:o},t))}function dh(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Kn(o)/2,additionalAngle:a?U/s:0};let c;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const u=lh(n,h,l);i.push(u),r==="auto"&&(u.visible=ch(u,c),u.visible&&(c=u))}return i}function hh(n){return n===0||n===180?"center":n<180?"left":"right"}function uh(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function fh(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function ph(n,t,e){const{left:i,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!I(r)){const l=$t(t.borderRadius),c=ot(t.backdropPadding);n.fillStyle=r;const h=i-c.left,u=s-c.top,f=o-i+c.width,p=a-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),pe(n,{x:h,y:u,w:f,h:p,radius:l}),n.fill()):n.fillRect(h,u,f,p)}}function gh(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const o=n._pointLabelItems[s];if(!o.visible)continue;const a=i.setContext(n.getPointLabelContext(s));ph(e,a,o);const r=tt(a.font),{x:l,y:c,textAlign:h}=o;It(e,n._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function xo(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,X);else{let o=n.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<i;a++)o=n.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function mh(n,t,e,i,s){const o=n.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!i||!r||!l||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash),o.lineDashOffset=s.dashOffset,o.beginPath(),xo(n,e,a,i),o.closePath(),o.stroke(),o.restore())}function bh(n,t,e){return Lt(n,{label:e,index:t,type:"pointLabel"})}class _h extends sn{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Re.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=ot(Kn(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=K(t)&&!isNaN(t)?t:0,this.max=K(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Kn(this.options))}generateTickLabels(t){sn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=H(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?ah(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=X/(this._pointLabels.length||1),i=this.options.startAngle||0;return ht(t*e+gt(i))}getDistanceFromCenterForValue(t){if(I(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(I(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return bh(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-J+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),xo(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,a=this._pointLabels.length;let r,l,c;if(e.pointLabels.display&&gh(this,a),s.display&&this.ticks.forEach((h,u)=>{if(u!==0){l=this.getDistanceFromCenterForValue(h.value);const f=this.getContext(u),p=s.setContext(f),g=o.setContext(f);mh(this,p,l,a,g)}}),i.display){for(t.save(),r=a-1;r>=0;r--){const h=i.setContext(this.getPointLabelContext(r)),{color:u,lineWidth:f}=h;!f||!u||(t.lineWidth=f,t.strokeStyle=u,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),h=tt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;const u=ot(c.backdropPadding);t.fillRect(-a/2-u.left,-o-h.size/2-u.top,a+u.width,h.size+u.height)}It(t,r.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const on={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}},lt=Object.keys(on);function ko(n,t){return n-t}function wo(n,t){if(I(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),K(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(Gt(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function So(n,t,e,i){const s=lt.length;for(let o=lt.indexOf(n);o<s-1;++o){const a=on[lt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=i)return lt[o]}return lt[s-1]}function yh(n,t,e,i,s){for(let o=lt.length-1;o>=lt.indexOf(e);o--){const a=lt[o];if(on[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return lt[e?lt.indexOf(e):0]}function xh(n){for(let t=lt.indexOf(n)+1,e=lt.length;t<e;++t)if(on[lt[t]].common)return lt[t]}function Mo(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=_n(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function kh(n,t,e,i){const s=n._adapter,o=+s.startOf(t[0].value,i),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,i))l=e[r],l>=0&&(t[l].major=!0);return t}function Co(n,t,e){const i=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,i.push({value:r,major:!1});return o===0||!e?i:kh(n,i,s,e)}class Gn extends Yt{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={}),s=this._adapter=new Sl._date(t.adapters.date);s.init(e),re(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:wo(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:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=K(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=K(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){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,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,r=Wa(s,o,a);return this._unit=e.unit||(i.autoSkip?So(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):yh(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:xh(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),Co(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=et(e,0,a),i=et(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||So(o.minUnit,e,i,this._getLabelCapacity(e)),r=V(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Gt(l)||l===!0,h={};let u=e,f,p;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":a),t.diff(i,e,a)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=u,p=0;f<i;f=+t.add(f,r,a),p++)Mo(h,f,g);return(f===i||s.bounds==="ticks"||p===1)&&Mo(h,f,g),Object.keys(h).sort(ko).map(m=>+m)}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 s=this.options.time.displayFormats,o=this._unit,a=e||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const o=this.options,a=o.ticks.callback;if(a)return H(a,[t,e,i],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&r[l],u=c&&r[c],f=i[e],p=c&&u&&f&&f.major;return this._adapter.format(t,s||(p?u:h))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){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,s=gt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*o+r*a,h:i*a+r*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,Co(this,[t],this._majorUnit),s),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[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 s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(wo(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ki(t.sort(ko))}}function an(n,t,e){let i=0,s=n.length-1,o,a,r,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=wt(n,"pos",t)),{pos:o,time:r}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=wt(n,"time",t)),{time:o,pos:r}=n[i],{time:a,pos:l}=n[s]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class wh extends Gn{static id="timeseries";static defaults=Gn.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=an(e,this.min),this._tableRange=an(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let a,r,l,c,h;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,r=s.length;a<r;++a)h=s[a+1],l=s[a-1],c=s[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-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((s,o)=>s-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(an(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return an(this._table,i*this._tableRange+this._minPos,!0)}}var Sh=Object.freeze({__proto__:null,CategoryScale:Qd,LinearScale:eh,LogarithmicScale:sh,RadialLinearScale:_h,TimeScale:Gn,TimeSeriesScale:wh});const Mh=[wl,ed,Kd,Sh];$n.register(...Mh);const Ch={class:"px-24 py-16"},vh={class:"flex flex-col gap-8"},Dh={class:"fm-color-typo-primary fm-typo-body-lg-400"},Eh={class:"fm-color-typo-secondary fm-typo-body-md-400"},Ph={class:"px-6"},Oh=d.defineComponent({__name:"FmLine",props:{name:{},paragraph:{},datasets:{},xAxis:{}},setup(n){const t=n,e=d.ref(null);let i=null;d.watch([()=>t.xAxis,()=>t.datasets],()=>{i&&(i.data.datasets=t.datasets,i.data.labels=t.xAxis.categories,i.update())});function s(c,h){const u=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(c);if(u)return`rgba(${parseInt(u[1],16)},${parseInt(u[2],16)},${parseInt(u[3],16)},${h})`;if(c.startsWith("rgb")){const f=c.split(",");if(f.length===3)return[...f.slice(0,2),f[2].replace(")",`,${h})`)].join(",");if(f.length===4)return[...f.slice(0,3),`${h})`].join(",")}return""}function o(c){const h=getComputedStyle(document.documentElement).getPropertyValue(`--${c}`)||c;return h.startsWith("rgb")||h.startsWith("#")?h:null}function a({context:c,color:h}){const{ctx:u,chartArea:f}=c.chart;if(!f)return;const p=u?.createLinearGradient(0,0,0,f.height);return p.addColorStop(0,s(h,.5)),p.addColorStop(1,s(h,0)),p}const r=d.computed(()=>({labels:t.xAxis.categories,datasets:t.datasets.map(c=>{const h=o(c.color)??"";return{...c,backgroundColor:h?u=>a({context:u,color:h}):"",borderColor:h,borderDash:c.dash?[5,5]:void 0,tension:.1}})}));function l(){e.value&&(i=new $n(e.value,{type:"line",data:r.value,options:{plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},beginAtZero:!0},y:{grid:{display:!0},beginAtZero:!0}},elements:{line:{borderWidth:1.5},point:{radius:0,hitRadius:30,hoverRadius:6,hoverBackgroundColor:"#FFFFFF",hoverBorderWidth:3}}}}))}return d.onMounted(()=>{l()}),(c,h)=>(d.openBlock(),d.createElementBlock("div",Ch,[d.createElementVNode("div",vh,[d.createElementVNode("div",Dh,d.toDisplayString(c.name),1),d.createElementVNode("div",Eh,d.toDisplayString(c.paragraph),1)]),d.createElementVNode("div",Ph,[d.createElementVNode("canvas",{ref_key:"canvas",ref:e},null,512)])]))}});var Bh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lh(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var vo={exports:{}};(function(n,t){(function(e,i){n.exports=i()})(Bh,function(){var e=1e3,i=6e4,s=36e5,o="millisecond",a="second",r="minute",l="hour",c="day",h="week",u="month",f="quarter",p="year",g="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var M=["th","st","nd","rd"],S=L%100;return"["+L+(M[(S-20)%10]||M[S]||M[0])+"]"}},k=function(L,M,S){var P=String(L);return!P||P.length>=M?L:""+Array(M+1-P.length).join(S)+L},w={s:k,z:function(L){var M=-L.utcOffset(),S=Math.abs(M),P=Math.floor(S/60),E=S%60;return(M<=0?"+":"-")+k(P,2,"0")+":"+k(E,2,"0")},m:function L(M,S){if(M.date()<S.date())return-L(S,M);var P=12*(S.year()-M.year())+(S.month()-M.month()),E=M.clone().add(P,u),A=S-E<0,F=M.clone().add(P+(A?-1:1),u);return+(-(P+(S-E)/(A?E-F:F-E))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:u,y:p,w:h,d:c,D:g,h:l,m:r,s:a,ms:o,Q:f}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},x="en",C={};C[x]=y;var v="$isDayjsObject",D=function(L){return L instanceof R||!(!L||!L[v])},T=function L(M,S,P){var E;if(!M)return x;if(typeof M=="string"){var A=M.toLowerCase();C[A]&&(E=A),S&&(C[A]=S,E=A);var F=M.split("-");if(!E&&F.length>1)return L(F[0])}else{var $=M.name;C[$]=M,E=$}return!P&&E&&(x=E),E||!P&&x},B=function(L,M){if(D(L))return L.clone();var S=typeof M=="object"?M:{};return S.date=L,S.args=arguments,new R(S)},O=w;O.l=T,O.i=D,O.w=function(L,M){return B(L,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var R=function(){function L(S){this.$L=T(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[v]=!0}var M=L.prototype;return M.parse=function(S){this.$d=function(P){var E=P.date,A=P.utc;if(E===null)return new Date(NaN);if(O.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var F=E.match(b);if(F){var $=F[2]-1||0,W=(F[7]||"0").substring(0,3);return A?new Date(Date.UTC(F[1],$,F[3]||1,F[4]||0,F[5]||0,F[6]||0,W)):new Date(F[1],$,F[3]||1,F[4]||0,F[5]||0,F[6]||0,W)}}return new Date(E)}(S),this.init()},M.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},M.$utils=function(){return O},M.isValid=function(){return this.$d.toString()!==m},M.isSame=function(S,P){var E=B(S);return this.startOf(P)<=E&&E<=this.endOf(P)},M.isAfter=function(S,P){return B(S)<this.startOf(P)},M.isBefore=function(S,P){return this.endOf(P)<B(S)},M.$g=function(S,P,E){return O.u(S)?this[P]:this.set(E,S)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(S,P){var E=this,A=!!O.u(P)||P,F=O.p(S),$=function(qt,ct){var Ft=O.w(E.$u?Date.UTC(E.$y,ct,qt):new Date(E.$y,ct,qt),E);return A?Ft:Ft.endOf(c)},W=function(qt,ct){return O.w(E.toDate()[qt].apply(E.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(ct)),E)},q=this.$W,Z=this.$M,nt=this.$D,pt="set"+(this.$u?"UTC":"");switch(F){case p:return A?$(1,0):$(31,11);case u:return A?$(1,Z):$(0,Z+1);case h:var Xt=this.$locale().weekStart||0,De=(q<Xt?q+7:q)-Xt;return $(A?nt-De:nt+(6-De),Z);case c:case g:return W(pt+"Hours",0);case l:return W(pt+"Minutes",1);case r:return W(pt+"Seconds",2);case a:return W(pt+"Milliseconds",3);default:return this.clone()}},M.endOf=function(S){return this.startOf(S,!1)},M.$set=function(S,P){var E,A=O.p(S),F="set"+(this.$u?"UTC":""),$=(E={},E[c]=F+"Date",E[g]=F+"Date",E[u]=F+"Month",E[p]=F+"FullYear",E[l]=F+"Hours",E[r]=F+"Minutes",E[a]=F+"Seconds",E[o]=F+"Milliseconds",E)[A],W=A===c?this.$D+(P-this.$W):P;if(A===u||A===p){var q=this.clone().set(g,1);q.$d[$](W),q.init(),this.$d=q.set(g,Math.min(this.$D,q.daysInMonth())).$d}else $&&this.$d[$](W);return this.init(),this},M.set=function(S,P){return this.clone().$set(S,P)},M.get=function(S){return this[O.p(S)]()},M.add=function(S,P){var E,A=this;S=Number(S);var F=O.p(P),$=function(Z){var nt=B(A);return O.w(nt.date(nt.date()+Math.round(Z*S)),A)};if(F===u)return this.set(u,this.$M+S);if(F===p)return this.set(p,this.$y+S);if(F===c)return $(1);if(F===h)return $(7);var W=(E={},E[r]=i,E[l]=s,E[a]=e,E)[F]||1,q=this.$d.getTime()+S*W;return O.w(q,this)},M.subtract=function(S,P){return this.add(-1*S,P)},M.format=function(S){var P=this,E=this.$locale();if(!this.isValid())return E.invalidDate||m;var A=S||"YYYY-MM-DDTHH:mm:ssZ",F=O.z(this),$=this.$H,W=this.$m,q=this.$M,Z=E.weekdays,nt=E.months,pt=E.meridiem,Xt=function(ct,Ft,Ee,ln){return ct&&(ct[Ft]||ct(P,A))||Ee[Ft].slice(0,ln)},De=function(ct){return O.s($%12||12,ct,"0")},qt=pt||function(ct,Ft,Ee){var ln=ct<12?"AM":"PM";return Ee?ln.toLowerCase():ln};return A.replace(_,function(ct,Ft){return Ft||function(Ee){switch(Ee){case"YY":return String(P.$y).slice(-2);case"YYYY":return O.s(P.$y,4,"0");case"M":return q+1;case"MM":return O.s(q+1,2,"0");case"MMM":return Xt(E.monthsShort,q,nt,3);case"MMMM":return Xt(nt,q);case"D":return P.$D;case"DD":return O.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return Xt(E.weekdaysMin,P.$W,Z,2);case"ddd":return Xt(E.weekdaysShort,P.$W,Z,3);case"dddd":return Z[P.$W];case"H":return String($);case"HH":return O.s($,2,"0");case"h":return De(1);case"hh":return De(2);case"a":return qt($,W,!0);case"A":return qt($,W,!1);case"m":return String(W);case"mm":return O.s(W,2,"0");case"s":return String(P.$s);case"ss":return O.s(P.$s,2,"0");case"SSS":return O.s(P.$ms,3,"0");case"Z":return F}return null}(ct)||F.replace(":","")})},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(S,P,E){var A,F=this,$=O.p(P),W=B(S),q=(W.utcOffset()-this.utcOffset())*i,Z=this-W,nt=function(){return O.m(F,W)};switch($){case p:A=nt()/12;break;case u:A=nt();break;case f:A=nt()/3;break;case h:A=(Z-q)/6048e5;break;case c:A=(Z-q)/864e5;break;case l:A=Z/s;break;case r:A=Z/i;break;case a:A=Z/e;break;default:A=Z}return E?A:O.a(A)},M.daysInMonth=function(){return this.endOf(u).$D},M.$locale=function(){return C[this.$L]},M.locale=function(S,P){if(!S)return this.$L;var E=this.clone(),A=T(S,P,!0);return A&&(E.$L=A),E},M.clone=function(){return O.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},L}(),Q=R.prototype;return B.prototype=Q,[["$ms",o],["$s",a],["$m",r],["$H",l],["$W",c],["$M",u],["$y",p],["$D",g]].forEach(function(L){Q[L[1]]=function(M){return this.$g(M,L[0],L[1])}}),B.extend=function(L,M){return L.$i||(L(M,R,B),L.$i=!0),B},B.locale=T,B.isDayjs=D,B.unix=function(L){return B(1e3*L)},B.en=C[x],B.Ls=C,B.p={},B})})(vo);var Ah=vo.exports;const ee=Lh(Ah),Th={class:"relative"},Fh={class:"w-full"},Vh={class:"flex h-10 justify-between p-2"},Rh={class:"fm-typo-body-lg-400"},Nh={class:"flex gap-1 items-center justify-center"},Ih={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},$h=["onClick"],zh=d.defineComponent({__name:"FmDatePicker",props:{label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=d.ref([]),s=d.ref(null),o=d.ref(!1),a=d.ref(ee()),r=d.ref(null),l=d.ref(null),c=m=>{s.value=m,t("update:modelValue",m.format("YYYY-MM-DD")),o.value=!1},h=()=>{i.value=[];const m=ee(a.value).startOf("month"),b=m.endOf("month"),_=m.month();let y=m.startOf("week"),k=[];for(;y.isBefore(b.endOf("week"));)y.day()===0&&k.length>0&&(i.value.push(k),k=[]),k.push({date:y,isCurrentMonth:y.month()===_}),y=y.add(1,"day");k.length>0&&i.value.push(k)},u=()=>{e.disabled||(o.value=!o.value,requestAnimationFrame(()=>{const m=r.value?.getBoundingClientRect();l.value.style.top=`${m.height+4}px`,l.value.style.left="0px"}))},f=m=>{const b=m.path||m.composedPath();for(const _ of b)if(_==r.value||_==l.value)return;o.value=!1},p=m=>{a.value=m?a.value.add(1,"month"):a.value.subtract(1,"month"),h()},g=d.computed(()=>Array.from(Array(7),(m,b)=>ee().day(b).format("ddd")));return d.onMounted(()=>{window.addEventListener("click",f),h()}),d.onUnmounted(()=>{window.removeEventListener("click",f)}),(m,b)=>(d.openBlock(),d.createElementBlock("div",Th,[d.createElementVNode("label",{ref_key:"buttonEl",ref:r,onClick:u},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},d.toDisplayString(e.label),3),d.createElementVNode("div",{class:d.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":s.value?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},d.toDisplayString(s.value?.format("D MMM YYYY")??"DD MM YYYY"),3)],2)],512),d.createElementVNode("div",{ref_key:"dropdownEl",ref:l,class:d.normalizeClass(["absolute bg-fm-color-white fm-calendar gap-6 p-3 rounded-lg shadow-light-neutral-300 w-[360px]",[o.value?"block":"hidden"]])},[d.createElementVNode("div",Fh,[d.createElementVNode("div",Vh,[d.createElementVNode("div",Rh,d.toDisplayString(a.value.format("MMMM YYYY")),1),d.createElementVNode("div",Nh,[d.createVNode(it,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[0]||(b[0]=()=>p(!1))}),d.createVNode(it,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[1]||(b[1]=()=>p(!0))})])]),d.createElementVNode("div",null,[d.createElementVNode("div",Ih,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(g.value,_=>(d.openBlock(),d.createElementBlock("div",{key:_,class:"fm-calendar__cell"},d.toDisplayString(_),1))),128))]),d.createElementVNode("div",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(_,y)=>(d.openBlock(),d.createElementBlock("div",{key:y,class:"fm-calendar__row fm-typo-body-lg-400"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(_,k=>(d.openBlock(),d.createElementBlock("div",{key:k.date.date(),class:"fm-calendar__cell"},[k.isCurrentMonth?(d.openBlock(),d.createElementBlock("button",{key:0,class:d.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":s.value===k.date}]),onClick:()=>c(k.date)},d.toDisplayString(k.date.date()),11,$h)):d.createCommentVNode("",!0)]))),128))]))),128))])])])],2)]))}}),$f="",Wh=ut(zh,[["__scopeId","data-v-2698ae54"]]),jh=n=>(d.pushScopeId("data-v-02a11da6"),n=n(),d.popScopeId(),n),Hh={class:"flex gap-1 items-center relative w-full"},Yh=jh(()=>d.createElementVNode("div",{class:"fm-typo-body-lg-400 h-6 mt-7 shrink-0 text-center text-fm-color-typo-primary w-6"}," to ",-1)),Uh={class:"w-full"},Xh={class:"flex h-10 justify-between p-2"},qh={class:"fm-typo-body-lg-400"},Kh={class:"flex gap-1 items-center justify-center"},Gh={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Zh=["onClick"],Jh=d.defineComponent({__name:"FmDateRangePicker",props:{label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=d.ref([]),s=d.ref({startDate:null,endDate:null}),o=d.ref(!1),a=d.ref(ee()),r=d.ref(null),l=d.ref(null),c=d.ref(null),h=_=>{if(s.value.startDate&&s.value.endDate){s.value={startDate:null,endDate:null},t("update:modelValue",{startDate:null,endDate:null});return}if(!s.value.startDate&&!s.value.endDate)s.value.startDate=_;else if(_.isBefore(s.value.startDate)){const y=s.value.startDate;s.value={startDate:_,endDate:y}}else s.value.endDate=_;t("update:modelValue",{startDate:s.value.startDate?.format("YYYY-MM-DD"),endDate:s.value.endDate?.format("YYYY-MM-DD")}),s.value.startDate&&s.value.endDate&&(o.value=!1)},u=()=>{i.value=[];const _=ee(a.value).startOf("month"),y=_.endOf("month"),k=_.month();let w=_.startOf("week"),x=[];for(;w.isBefore(y.endOf("week"));)w.day()===0&&x.length>0&&(i.value.push(x),x=[]),x.push({date:w,isCurrentMonth:w.month()===k}),w=w.add(1,"day");x.length>0&&i.value.push(x)},f=()=>{e.disabled||(o.value=!o.value,requestAnimationFrame(()=>{const _=r.value?.getBoundingClientRect();c.value.style.top=`${_.height+4}px`,c.value.style.left="0px"}))},p=_=>{const y=_.path||_.composedPath();for(const k of y)if(k==r.value||k==l.value||k==c.value)return;o.value=!1},g=_=>{a.value=_?a.value.add(1,"month"):a.value.subtract(1,"month"),u()},m=d.computed(()=>Array.from(Array(7),(_,y)=>ee().day(y).format("ddd"))),b=_=>({"fm-calendar__cell__button--selected":s.value.startDate?.isSame(_)&&!s.value.endDate||s.value.endDate?.isSame(_)&&!s.value.startDate,"fm-calendar__cell__button--selected-start":s.value.startDate?.isSame(_)&&s.value.endDate,"fm-calendar__cell__button--selected-end":s.value.endDate?.isSame(_)&&s.value.startDate,"fm-calendar__cell__button--selected-between":s.value.startDate&&s.value.endDate&&_.isAfter(s.value.startDate)&&_.isBefore(s.value.endDate)});return d.onMounted(()=>{window.addEventListener("click",p),u()}),d.onUnmounted(()=>{window.removeEventListener("click",p)}),(_,y)=>(d.openBlock(),d.createElementBlock("div",Hh,[d.createElementVNode("label",{ref_key:"startButtonEl",ref:r,class:"w-full",onClick:f},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},d.toDisplayString(e.label),3),d.createElementVNode("div",{class:d.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":s.value.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},d.toDisplayString(s.value.startDate?.format("D MMM YYYY")??"DD MM YYYY"),3)],2)],512),Yh,d.createElementVNode("label",{ref_key:"endButtonEl",ref:l,class:"w-full",onClick:f},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},d.toDisplayString(e.label),3),d.createElementVNode("div",{class:d.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":s.value.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},d.toDisplayString(s.value.endDate?.format("D MMM YYYY")??"DD MM YYYY"),3)],2)],512),d.createElementVNode("div",{ref_key:"dropdownEl",ref:c,class:d.normalizeClass(["absolute bg-fm-color-white fm-calendar gap-6 p-3 rounded-lg shadow-light-300 w-[360px]",[o.value?"block":"hidden"]])},[d.createElementVNode("div",Uh,[d.createElementVNode("div",Xh,[d.createElementVNode("div",qh,d.toDisplayString(a.value.format("MMMM YYYY")),1),d.createElementVNode("div",Kh,[d.createVNode(it,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:y[0]||(y[0]=()=>g(!1))}),d.createVNode(it,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:y[1]||(y[1]=()=>g(!0))})])]),d.createElementVNode("div",null,[d.createElementVNode("div",Gh,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,k=>(d.openBlock(),d.createElementBlock("div",{key:k,class:"fm-calendar__cell"},d.toDisplayString(k),1))),128))]),d.createElementVNode("div",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(k,w)=>(d.openBlock(),d.createElementBlock("div",{key:w,class:"fm-calendar__row fm-typo-body-lg-400"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(k,x=>(d.openBlock(),d.createElementBlock("div",{key:x.date.date(),class:"fm-calendar__cell"},[x.isCurrentMonth?(d.openBlock(),d.createElementBlock("button",{key:0,class:d.normalizeClass(["fm-calendar__cell__button",b(x.date)]),onClick:()=>h(x.date)},d.toDisplayString(x.date.date()),11,Zh)):d.createCommentVNode("",!0)]))),128))]))),128))])])])],2)]))}}),zf="",Qh=ut(Jh,[["__scopeId","data-v-02a11da6"]]),tu={class:"fm-checkbox"},eu={class:"fm-checkbox--wrapper"},nu={class:"fm-checkbox__input--container"},iu=["checked","disabled","indeterminate"],su={key:0,class:"fm-checkbox__label-container"},ou={class:"fm-typo-body-lg-400"},au={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Do=d.defineComponent({__name:"FmCheckbox",props:{modelValue:{type:Boolean},label:{},sublabel:{default:""},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=d.computed(()=>e.indeterminate?"remove":e.modelValue?"check_small":"");function s(){e.disabled||t("update:modelValue",!e.modelValue)}return(o,a)=>(d.openBlock(),d.createElementBlock("div",tu,[d.createElementVNode("label",eu,[d.createElementVNode("div",nu,[d.createElementVNode("input",{class:d.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":o.modelValue}),type:"checkbox",checked:e.modelValue,disabled:e.disabled,indeterminate:e.indeterminate,onClick:s},null,10,iu),e.indeterminate||e.modelValue?(d.openBlock(),d.createBlock(it,{key:0,class:"fm-checkbox__input--checkmark",name:i.value,size:"md",color:"#FFFFFF"},null,8,["name"])):d.createCommentVNode("",!0)]),e.label?(d.openBlock(),d.createElementBlock("div",su,[d.renderSlot(o.$slots,"label"),d.createElementVNode("div",ou,d.toDisplayString(e.label),1),e.sublabel?(d.openBlock(),d.createElementBlock("div",au,d.toDisplayString(e.sublabel),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)])]))}}),Wf="",ru={class:"fm-radio-btn"},lu={class:"fm-radio-btn__input--container"},cu=["value","disabled","checked"],du={class:"py-8"},hu={class:"fm-typo-body-lg-400"},uu={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},fu=d.defineComponent({__name:"FmRadio",props:{modelValue:{},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n){return(t,e)=>{const i=d.resolveDirective("wave");return d.openBlock(),d.createElementBlock("div",ru,[d.createElementVNode("label",{class:"cursor-pointer fm-radio-btn--wrapper",onClick:e[0]||(e[0]=s=>t.$emit("update:modelValue",t.value))},[d.withDirectives((d.openBlock(),d.createElementBlock("div",lu,[d.createElementVNode("input",{class:"fm-radio-btn__input--btn",type:"radio",value:t.value,disabled:t.disabled,checked:t.value===t.modelValue},null,8,cu)])),[[i,!t.disabled]]),d.createElementVNode("div",du,[d.renderSlot(t.$slots,"label",{},void 0,!0),d.createElementVNode("div",hu,d.toDisplayString(t.label),1),t.sublabel?(d.openBlock(),d.createElementBlock("div",uu,d.toDisplayString(t.sublabel),1)):d.createCommentVNode("",!0)])])])}}}),jf="",pu=ut(fu,[["__scopeId","data-v-f55cf769"]]),gu={class:"relative"},mu=d.defineComponent({__name:"FmDropdown",props:{isOpen:{type:Boolean,default:!1},placement:{default:"bottom-left"},disabled:{type:Boolean,default:!1}},emits:["dropdown-changed"],setup(n,{emit:t}){const e=n,i=d.ref(!1),s=d.ref(null),o=d.ref(null),a=()=>{e.disabled||(i.value=!i.value,requestAnimationFrame(()=>{const l=o.value?.getBoundingClientRect(),c=s.value?.getBoundingClientRect();e.placement.includes("bottom")?o.value.style.top=`${c.height+4}px`:e.placement.includes("top")&&(o.value.style.top=`${-l.height-4}px`),e.placement.includes("left")?o.value.style.left="0px":e.placement.includes("center")?o.value.style.left=`${c.width/2-l.width/2}px`:e.placement.includes("right")&&(o.value.style.right="0px")}),t("dropdown-changed",i.value))},r=l=>{if(!i.value)return;const c=l.path||l.composedPath();for(const h of c)if(h==s.value||h==o.value)return;i.value=!1,t("dropdown-changed",i.value)};return d.watch(()=>e.isOpen,l=>i.value=l),d.onMounted(()=>{i.value=e.isOpen,window.addEventListener("click",r)}),d.onUnmounted(()=>{window.removeEventListener("click",r)}),(l,c)=>(d.openBlock(),d.createElementBlock("div",gu,[d.createElementVNode("div",{ref_key:"buttonEl",ref:s,class:"fm-dropdown",onClick:a},[d.renderSlot(l.$slots,"dropdown-button",{},void 0,!0)],512),d.createElementVNode("div",{ref_key:"dropdownEl",ref:o,class:d.normalizeClass({"fm-dropdown__content":!0,"fm-dropdown__content--opened":i.value})},[d.renderSlot(l.$slots,"dropdown-content",{},void 0,!0)],2)]))}}),Hf="",Eo=ut(mu,[["__scopeId","data-v-11da7be1"]]),Yf="",bu={},_u={class:"fm-menu"};function yu(n,t){return d.openBlock(),d.createElementBlock("div",_u,[d.renderSlot(n.$slots,"default",{},void 0,!0)])}const Po=ut(bu,[["render",yu],["__scopeId","data-v-46812801"]]),xu={class:"fm-menu-item--left"},ku={key:0,class:"fm-menu-item--right"},wu=d.defineComponent({__name:"FmMenuItem",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},icon:{default:""},expandable:{type:Boolean,default:!1},hasCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dividerPlacement:{default:null}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=o=>{o.preventDefault(),!e.disabled&&t("update:modelValue",!e.modelValue)},s=()=>{t("update:modelValue",e.modelValue)};return(o,a)=>(d.openBlock(),d.createElementBlock("div",null,[d.createElementVNode("div",{class:d.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":o.modelValue&&!o.hasCheckbox,"fm-menu-item--disabled":o.disabled}),onClick:i},[d.createElementVNode("div",xu,[!o.hasCheckbox&&o.icon?(d.openBlock(),d.createBlock(it,{key:0,name:o.icon,size:"md",color:o.disabled?"#C7C7CC":o.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","color"])):d.createCommentVNode("",!0),o.hasCheckbox?(d.openBlock(),d.createBlock(Do,{key:1,"model-value":o.modelValue,name:"something",label:"",sublabel:"",value:"",indeterminate:!1,disabled:o.disabled,"onUpdate:modelValue":s,onClick:a[0]||(a[0]=r=>r.preventDefault())},null,8,["model-value","disabled"])):d.createCommentVNode("",!0),d.createElementVNode("div",null,[d.renderSlot(o.$slots,"label",{},void 0,!0),d.createElementVNode("div",{class:d.normalizeClass(`fm-typo-body-lg-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-primary"}`)},d.toDisplayString(o.label),3),o.sublabel?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(`fm-typo-body-md-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-secondary"}`)},d.toDisplayString(o.sublabel),3)):d.createCommentVNode("",!0)])]),o.expandable?(d.openBlock(),d.createElementBlock("div",ku,[d.createVNode(it,{name:"chevron_right",size:"md",color:o.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):d.createCommentVNode("",!0)],2)]))}}),Uf="",Oo=ut(wu,[["__scopeId","data-v-2c63be46"]]),Su={class:"fm-select"},Mu=d.defineComponent({__name:"FmSelect",props:{modelValue:{},label:{},items:{},disabled:{type:Boolean,default:!1},multiselect:{type:Boolean,default:!1},placement:{default:"bottom-left"},placeholder:{default:""}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=d.ref(!1),s=d.ref([]),o=(r,l)=>{if(e.multiselect){let c=[];r?(c=[...d.toRaw(e.modelValue),l.value],s.value=[...s.value,l]):(c=[...e.modelValue],c=c.filter(h=>JSON.stringify(d.toRaw(h))!==JSON.stringify(l.value)),s.value=s.value.filter(h=>h.label!==l.label)),t("update:modelValue",c)}else i.value=!1,s.value=[l],t("update:modelValue",l.value)},a=d.computed(()=>{const r=s.value.map(l=>l.label).join(", ");return r===""?e.placeholder:r});return(r,l)=>(d.openBlock(),d.createBlock(Eo,{disabled:r.disabled,"is-open":i.value,placement:r.placement,onDropdownChanged:l[0]||(l[0]=c=>i.value=c)},{"dropdown-button":d.withCtx(()=>[d.createElementVNode("div",Su,[d.createElementVNode("label",{class:d.normalizeClass({"cursor-not-allowed":r.disabled})},[d.renderSlot(r.$slots,"label",{},void 0,!0),d.createElementVNode("div",{class:d.normalizeClass({"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!r.disabled,"text-fm-color-typo-disabled":r.disabled})},d.toDisplayString(r.label),3),d.createElementVNode("div",{class:d.normalizeClass({"fm-select__container":!0,"fm-select__container--expanded":i.value,"fm-select__container--disabled":r.disabled})},[d.createElementVNode("div",{class:d.normalizeClass({"fm-typo-body-lg-400 w-full h-full overflow-hidden text-ellipsis whitespace-nowrap":!0,"text-fm-color-typo-tertiary":!r.modelValue,"text-fm-color-typo-primary":!!r.modelValue})},d.toDisplayString(a.value),3),d.createVNode(it,{name:i.value?"expand_less":"expand_more",size:"md",color:r.disabled?"#C7C7CC":"black"},null,8,["name","color"])],2)],2)])]),"dropdown-content":d.withCtx(()=>[d.createVNode(Po,{class:"w-[280px]"},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.items,c=>(d.openBlock(),d.createBlock(Oo,{key:c.value,"has-checkbox":r.multiselect,label:c.label,value:c.value,"model-value":s.value.map(h=>h.label).includes(c.label),"onUpdate:modelValue":h=>o(h,c)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))]),_:1})]),_:3},8,["disabled","is-open","placement"]))}}),Xf="",Cu=ut(Mu,[["__scopeId","data-v-fbd57494"]]),vu={class:"cursor-pointer fm-switch__container"},Du={key:0},Eu={class:"fm-typo-body-lg-400"},Pu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Ou={class:"fm-switch__input--container"},Bu=["checked","value","disabled"],Lu={key:1},Au={class:"fm-typo-body-lg-400"},Tu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Fu=d.defineComponent({__name:"FmSwitch",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},labelPlacement:{default:"left"},value:{},disabled:{type:Boolean,default:!1},showIcon:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=()=>{e.disabled||t("update:modelValue",!e.modelValue)};return(s,o)=>(d.openBlock(),d.createElementBlock("label",vu,[s.labelPlacement==="left"?(d.openBlock(),d.createElementBlock("div",Du,[d.renderSlot(s.$slots,"label",{},void 0,!0),d.createElementVNode("div",Eu,d.toDisplayString(s.label),1),s.sublabel?(d.openBlock(),d.createElementBlock("div",Pu,d.toDisplayString(s.sublabel),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),d.createElementVNode("div",Ou,[d.createElementVNode("input",{checked:s.modelValue,class:"fm-switch__input--btn",type:"checkbox",value:s.value,disabled:s.disabled,onClick:i},null,8,Bu),d.createElementVNode("div",{class:d.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":s.showIcon})},[s.showIcon?(d.openBlock(),d.createBlock(it,{key:0,name:s.modelValue?"check":"close",size:"sm",color:s.disabled?"#C7C7CC":s.modelValue?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):d.createCommentVNode("",!0)],2)]),s.labelPlacement==="right"?(d.openBlock(),d.createElementBlock("div",Lu,[d.createElementVNode("div",Au,d.toDisplayString(s.label),1),s.sublabel?(d.openBlock(),d.createElementBlock("div",Tu,d.toDisplayString(s.sublabel),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)]))}}),qf="",Vu=ut(Fu,[["__scopeId","data-v-77ad1e00"]]);function Ru(){const n=d.ref([]);function t(i,s){const o=[];if(s&&s.length>0)for(const a of s){const l=(typeof a=="function"?a:()=>a)(i);l!==!0&&o.push(l)}return n.value=o,n.value}return{validate:t,getErrorMessages:()=>n.value}}const Nu={class:"fm-text-field"},Iu={class:"fm-text-field--label"},$u=["value","inputMode","type","placeholder","required","minlength","maxlength","disabled","readOnly"],zu={class:"fm-color-typo-secondary fm-text-field__helper-container fm-typo-body-sm-400"},Wu={class:"fm-text-field__helper__icon"};var Bo=(n=>(n.required="*",n.optional="(optional)",n))(Bo||{}),Lo=(n=>(n.success="check_circle",n.warning="warning",n.error="error",n))(Lo||{}),Ao=(n=>(n.success="#34C759",n.warning="#FF9500",n.error="#FF3B30",n))(Ao||{});const ju=d.defineComponent({__name:"FmTextField",props:{label:{default:""},modelValue:{default:""},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{default:""},helperText:{default:""},minLength:{default:0},maxLength:{default:NaN},inputmode:{default:"text"},readonly:{type:Boolean,default:!1},inputState:{default:"default"},labelMark:{default:"none"},leadingIcon:{default:()=>({name:"",color:""})},trailingIcon:{default:()=>({name:"",color:""})},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=d.ref(!1),s=d.ref([]),{validate:o}=Ru(),a=r=>{const l=o(r.target.value,e.rules);s.value=l,t("update:modelValue",r.target.value)};return(r,l)=>(d.openBlock(),d.createElementBlock("label",Nu,[d.createElementVNode("div",null,[d.createElementVNode("div",Iu,[d.renderSlot(r.$slots,"label"),d.createElementVNode("span",{class:d.normalizeClass({"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!r.disabled,"text-fm-color-typo-disabled":r.disabled})},d.toDisplayString(r.label),3),r.labelMark!=="none"?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass({"fm-color-typo-tertiary fm-typo-body-md-400":r.labelMark==="optional","fm-color-typo-error fm-typo-body-lg-700":r.labelMark==="required"})},d.toDisplayString(Bo[r.labelMark]),3)):d.createCommentVNode("",!0)])]),d.createElementVNode("div",{class:d.normalizeClass({"fm-text-field__container":!0,"fm-text-field__container--focused":i.value,"fm-text-field__container--invalid":r.inputState==="error"&&!!r.modelValue,"fm-text-field__container--valid":r.inputState==="success"&&!!r.modelValue,"fm-text-field__container--warning":r.inputState==="warning","fm-text-field__container--disabled":r.disabled})},[d.renderSlot(r.$slots,"prepend"),r.leadingIcon.name?(d.openBlock(),d.createBlock(it,{key:0,name:r.leadingIcon.name,size:"md",color:r.leadingIcon.color??(r.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):d.createCommentVNode("",!0),d.createElementVNode("input",{class:d.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!r.disabled,"fm-color-typo-disabled":r.disabled}),value:r.modelValue,inputMode:r.inputmode,type:r.inputmode,placeholder:r.placeholder,required:r.required,minlength:r.minLength,maxlength:r.maxLength,disabled:r.disabled,readOnly:r.readonly,onInput:a,onFocus:l[0]||(l[0]=()=>i.value=!0),onBlur:l[1]||(l[1]=()=>i.value=!1)},null,42,$u),d.renderSlot(r.$slots,"append"),r.trailingIcon.name?(d.openBlock(),d.createBlock(it,{key:1,name:r.trailingIcon.name,size:"md",color:r.trailingIcon.color??(r.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):d.createCommentVNode("",!0)],2),d.createElementVNode("div",zu,[d.renderSlot(r.$slots,"helper-text"),d.createElementVNode("div",Wu,[r.inputState!=="default"&&r.modelValue?(d.openBlock(),d.createBlock(it,{key:0,name:Lo[r.inputState],size:"sm",color:Ao[r.inputState]},null,8,["name","color"])):d.createCommentVNode("",!0),d.createElementVNode("span",{class:d.normalizeClass({"fm-color-typo-success":r.inputState==="success"&&!!r.modelValue,"fm-color-typo-warning":r.inputState==="warning"&&!!r.modelValue,"fm-color-typo-error":r.inputState==="error"&&!!r.modelValue,"fm-color-typo-disabled":r.disabled})},[s.value.length>0?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(s.value,c=>(d.openBlock(),d.createElementBlock("div",{key:c},d.toDisplayString(c),1))),128)):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createTextVNode(d.toDisplayString(r.helperText),1)],64))],2)]),d.createElementVNode("div",{class:d.normalizeClass({"fm-color-typo-disabled":r.disabled})},d.toDisplayString(r.maxLength?`${r.modelValue.length} / ${r.maxLength}`:""),3)])]))}}),Kf="",Hu={class:"fm-textarea"},Yu={htmlFor:"{this.name}"},Uu={class:"fm-textarea--label"},Xu=["value","placeholder","required","minlength","maxlength","readOnly","disabled"],qu={class:"fm-color-typo-secondary fm-textarea__helper-container fm-typo-body-sm-400"},Ku={class:"fm-textarea__helper__icon"};var To=(n=>(n.required="*",n.optional="(optional)",n))(To||{}),Fo=(n=>(n.success="check_circle",n.warning="warning",n.error="error",n))(Fo||{}),Vo=(n=>(n.success="#34C759",n.warning="#FF9500",n.error="#FF3B30",n))(Vo||{});const Gu=d.defineComponent({__name:"FmTextarea",props:{label:{default:""},modelValue:{default:""},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{default:""},helperText:{default:""},minLength:{default:0},maxLength:{default:NaN},readonly:{type:Boolean,default:!1},inputState:{default:"default"},labelMark:{default:"none"}},emits:["update:modelValue"],setup(n,{emit:t}){const e=d.ref(!1),i=s=>{t("update:modelValue",s.target.value)};return(s,o)=>(d.openBlock(),d.createElementBlock("div",Hu,[d.createElementVNode("label",Yu,[d.createElementVNode("div",Uu,[d.renderSlot(s.$slots,"label"),d.createElementVNode("span",{class:d.normalizeClass({"fm-typo-body-lg-400":!0,"fm-color-typo-primary":!s.disabled,"fm-color-typo-disabled":s.disabled})},d.toDisplayString(s.label),3),s.labelMark!=="none"?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass({"fm-color-typo-tertiary fm-typo-body-md-400":s.labelMark==="optional","fm-color-typo-error fm-typo-body-lg-700":s.labelMark==="required"})},d.toDisplayString(To[s.labelMark]),3)):d.createCommentVNode("",!0)])]),d.createElementVNode("div",{class:d.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":e.value,"fm-textarea__container--invalid":s.inputState==="error"&&!!s.modelValue,"fm-textarea__container--valid":s.inputState==="success"&&!!s.modelValue,"fm-textarea__container--warning":s.inputState==="warning","fm-textarea__container--disabled":s.disabled})},[d.createElementVNode("textarea",{class:d.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!s.disabled,"fm-color-typo-disabled":s.disabled}),value:s.modelValue,placeholder:s.placeholder,required:s.required,minlength:s.minLength,maxlength:s.maxLength,readOnly:s.readonly,disabled:s.disabled,onInput:i,onFocus:o[0]||(o[0]=()=>e.value=!0),onBlur:o[1]||(o[1]=()=>e.value=!1)},null,42,Xu)],2),d.createElementVNode("div",qu,[d.renderSlot(s.$slots,"helper-text"),d.createElementVNode("div",Ku,[s.inputState!=="default"&&s.modelValue?(d.openBlock(),d.createBlock(it,{key:0,name:Fo[s.inputState],size:"sm",color:Vo[s.inputState]},null,8,["name","color"])):d.createCommentVNode("",!0),d.createElementVNode("span",{class:d.normalizeClass({"fm-color-typo-success":s.inputState==="success"&&!!s.modelValue,"fm-color-typo-warning":s.inputState==="warning"&&!!s.modelValue,"fm-color-typo-error":s.inputState==="error"&&!!s.modelValue,"fm-color-typo-disabled":s.disabled})},d.toDisplayString(s.helperText),3)]),d.createElementVNode("div",{class:d.normalizeClass({"fm-color-typo-disabled":s.disabled})},d.toDisplayString(s.maxLength?`${s.modelValue.length} / ${s.maxLength}`:""),3)])]))}}),Gf="",ne=n=>(d.pushScopeId("data-v-a720221d"),n=n(),d.popScopeId(),n),Zu={class:"items-start self-stretch"},Ju={class:"flex gap-3 hover:cursor-pointer items-start pl-1 pr-5 py-0 self-stretch"},Qu={key:0,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},tf=[ne(()=>d.createElementVNode("circle",{cx:"12",cy:"12",r:"11",stroke:"#AEAEB2","stroke-width":"2"},null,-1))],ef={key:1,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},nf=[ne(()=>d.createElementVNode("circle",{cx:"12",cy:"12",r:"10",fill:"#FF7823",stroke:"#FF7823","stroke-width":"4"},null,-1))],sf={key:2,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},of=[ne(()=>d.createElementVNode("path",{d:"M9.9998 13.6L15.8998 7.70005C16.0831 7.51672 16.3165 7.42505 16.5998 7.42505C16.8831 7.42505 17.1165 7.51672 17.2998 7.70005C17.4831 7.88338 17.5748 8.11672 17.5748 8.40005C17.5748 8.68338 17.4831 8.91672 17.2998 9.10005L10.6998 15.7C10.4998 15.9 10.2665 16 9.9998 16C9.73314 16 9.4998 15.9 9.2998 15.7L6.6998 13.1C6.51647 12.9167 6.4248 12.6834 6.4248 12.4C6.4248 12.1167 6.51647 11.8834 6.6998 11.7C6.88314 11.5167 7.11647 11.425 7.3998 11.425C7.68314 11.425 7.91647 11.5167 8.0998 11.7L9.9998 13.6Z",fill:"#FF7823"},null,-1)),ne(()=>d.createElementVNode("path",{d:"M1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12Z",stroke:"#FF7823","stroke-width":"2"},null,-1))],af={key:3,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},rf=[ne(()=>d.createElementVNode("path",{d:"M2.72479 21C2.54146 21 2.37479 20.9542 2.22479 20.8625C2.07479 20.7708 1.95812 20.65 1.87479 20.5C1.79146 20.35 1.74562 20.1875 1.73729 20.0125C1.72896 19.8375 1.77479 19.6667 1.87479 19.5L11.1248 3.5C11.2248 3.33333 11.354 3.20833 11.5123 3.125C11.6706 3.04167 11.8331 3 11.9998 3C12.1665 3 12.329 3.04167 12.4873 3.125C12.6456 3.20833 12.7748 3.33333 12.8748 3.5L22.1248 19.5C22.2248 19.6667 22.2706 19.8375 22.2623 20.0125C22.254 20.1875 22.2081 20.35 22.1248 20.5C22.0415 20.65 21.9248 20.7708 21.7748 20.8625C21.6248 20.9542 21.4581 21 21.2748 21H2.72479ZM4.44979 19H19.5498L11.9998 6L4.44979 19ZM11.9998 18C12.2831 18 12.5206 17.9042 12.7123 17.7125C12.904 17.5208 12.9998 17.2833 12.9998 17C12.9998 16.7167 12.904 16.4792 12.7123 16.2875C12.5206 16.0958 12.2831 16 11.9998 16C11.7165 16 11.479 16.0958 11.2873 16.2875C11.0956 16.4792 10.9998 16.7167 10.9998 17C10.9998 17.2833 11.0956 17.5208 11.2873 17.7125C11.479 17.9042 11.7165 18 11.9998 18ZM11.9998 15C12.2831 15 12.5206 14.9042 12.7123 14.7125C12.904 14.5208 12.9998 14.2833 12.9998 14V11C12.9998 10.7167 12.904 10.4792 12.7123 10.2875C12.5206 10.0958 12.2831 10 11.9998 10C11.7165 10 11.479 10.0958 11.2873 10.2875C11.0956 10.4792 10.9998 10.7167 10.9998 11V14C10.9998 14.2833 11.0956 14.5208 11.2873 14.7125C11.479 14.9042 11.7165 15 11.9998 15Z",fill:"#FF3B30"},null,-1))],lf={key:4,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},cf=[ne(()=>d.createElementVNode("circle",{cx:"12",cy:"12",r:"11",stroke:"#C7C7CC","stroke-width":"2"},null,-1))],df={class:"flex flex-1 flex-col fm-pi-content-container gap-1 items-start justify-center p-0"},hf=d.defineComponent({__name:"FmProgressIndicator",props:{titleText:{type:String,required:!0},supportingText:{type:String,default:void 0},status:{type:String,default:"default"},orientation:{type:String,default:"horizontal"}},emits:["validate-step"],setup(n,{emit:t}){const e=n,i=d.computed(()=>o[e.status]),s=d.computed(()=>a[e.status]),o={active:"text-fm-color-typo-primary",default:"text-fm-color-typo-secondary",error:"text-fm-color-typo-primary",completed:"text-fm-color-typo-primary",disabled:"text-fm-color-typo-disabled"},a={active:"bg-fm-color-primary",default:"bg-fm-color-neutral-gray-300",error:"bg-fm-color-neutral-gray-300",completed:"bg-fm-color-primary",disabled:"bg-fm-color-neutral-gray-300"};return(r,l)=>{const c=d.resolveDirective("wave");return d.withDirectives((d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(`flex gap-1 fm-pi-item-container fm-pi-item-container--${n.orientation}`),onClick:l[0]||(l[0]=d.withModifiers(h=>t("validate-step"),["stop"]))},[d.createElementVNode("div",Zu,[d.createElementVNode("div",{class:d.normalizeClass(`self-stretch fm-pi-item-line fm-pi-item-line--${n.orientation} ${s.value} `)},null,2)]),d.createElementVNode("div",Ju,[d.createElementVNode("div",null,[n.status==="default"?(d.openBlock(),d.createElementBlock("svg",Qu,tf)):d.createCommentVNode("",!0),n.status==="active"?(d.openBlock(),d.createElementBlock("svg",ef,nf)):d.createCommentVNode("",!0),n.status==="completed"?(d.openBlock(),d.createElementBlock("svg",sf,of)):d.createCommentVNode("",!0),n.status==="error"?(d.openBlock(),d.createElementBlock("svg",af,rf)):d.createCommentVNode("",!0),n.status==="disabled"?(d.openBlock(),d.createElementBlock("svg",lf,cf)):d.createCommentVNode("",!0)]),d.createElementVNode("div",df,[d.createElementVNode("span",{class:d.normalizeClass(["fm-typo-body-lg-400",i.value])},d.toDisplayString(n.titleText),3),d.createElementVNode("span",{class:d.normalizeClass(["fm-typo-body-sm-400 overflow-hidden text-ellipsis",n.status!=="disabled"?"text-fm-color-typo-secondary":"text-fm-color-typo-disabled"])},d.toDisplayString(n.supportingText),3)])])],2)),[[c]])}}}),ip="",Ro=ut(hf,[["__scopeId","data-v-a720221d"]]),uf={class:"flex gap-2 items-start justify-end p-0 self-stretch"},ff={key:0,class:"bg-white flex flex-col gap-5 p-6 w-1/3"},pf=d.defineComponent({__name:"FmProgressIndicatorGroup",props:{orientation:{type:String,default:"horizontal"},steps:{type:Array,required:!0},nextButtonLabel:{type:String,default:"Next"},previousButtonLabel:{type:String,default:"Back"},submitButtonLabel:{type:String,default:"Submit"}},setup(n){const t=n,e=d.ref([...t.steps]),i=d.computed(()=>e.value.length),s=d.ref(0),o=d.computed(()=>e.value[s.value]);d.onMounted(()=>{for(let u=0;u<i.value;u++)e.value[u].status=u===0?"active":"default"}),d.watch(s,async(u,f)=>{if(f!=i.value)if(u<i.value)e.value[u].status="active";else{const p=e.value[f].submitForm;p&&e.value.filter(m=>m.status==="error").length===0&&(s.value=0,p())}});const a=d.computed(()=>o.value.validateStep),r=d.computed(()=>{const u=o.value.validateStep;return u?u():!0}),l=u=>{a.value?r.value?(o.value.status="completed",s.value=u):o.value.status="error":c(u)},c=u=>{o.value.status="completed",s.value=u},h=d.computed(()=>{const u=o.value.validateStep;return u?!u():!1});return(u,f)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(`container--${n.orientation}`)},[d.createElementVNode("div",{class:d.normalizeClass(`flex justify-start fm-pi-container--${n.orientation}`)},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.value,(p,g)=>(d.openBlock(),d.createBlock(Ro,{key:g,orientation:n.orientation,"title-text":p.titleText,"supporting-text":p.supportingText,status:p.status,onValidateStep:m=>l(g)},null,8,["orientation","title-text","supporting-text","status","onValidateStep"]))),128))],2),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(Object.keys(u.$slots),p=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:p},[`step${s.value+1}`===p?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(`flex fm-pi-form--${n.orientation}`)},[d.createElementVNode("div",{class:d.normalizeClass(`bg-white flex flex-col gap-10 p-6 ${u.$slots.card?"w-2/3":"w-full"}`)},[d.createElementVNode("form",{class:"flex flex-col gap-2 p-0 self-stretch",onSubmit:f[1]||(f[1]=d.withModifiers(g=>l(s.value+1),["prevent"]))},[d.renderSlot(u.$slots,p,{class:"gap-0 items-start p-0 self-stretch"}),d.createElementVNode("div",uf,[p!="step1"?(d.openBlock(),d.createBlock(Pe,{key:0,type:"button",label:n.previousButtonLabel,variant:"tertiary",onClick:f[0]||(f[0]=d.withModifiers(g=>l(s.value-1),["stop"]))},null,8,["label"])):d.createCommentVNode("",!0),d.createVNode(Pe,{variant:"primary",disabled:h.value,label:s.value!=e.value.length-1?n.nextButtonLabel:n.submitButtonLabel,type:"submit"},null,8,["disabled","label"])])],32)],2),u.$slots.card?(d.openBlock(),d.createElementBlock("div",ff,[d.renderSlot(u.$slots,"card")])):d.createCommentVNode("",!0)],2)):d.createCommentVNode("",!0)],64))),128))],2))}}),sp="",gf={class:"flex"},mf={key:0,class:"mt-8"},bf=d.defineComponent({__name:"FmSnackbar",props:{title:{type:String,default:void 0},description:{type:String,default:void 0},variant:{type:String,default:"info"},dismissable:{type:Boolean,default:!1},action:{type:String,default:void 0},color:{type:String,default:void 0},bgColor:{type:String,default:void 0}},emits:["onDismiss","onAction"],setup(n,{emit:t}){const e=n,i=d.computed(()=>{switch(e.variant){case"info":return{icon:{name:"info",color:"system-info-300"},actionColor:"typo-info",bgColor:"system-info-100"};case"success":return{icon:{name:"check_circle",color:"system-success-300"},actionColor:"typo-success",bgColor:"system-success-100"};case"warning":return{icon:{name:"warning",color:"system-warning-300"},actionColor:"typo-warning",bgColor:"system-warning-100"};case"error":return{icon:{name:"error",color:"system-error-300"},actionColor:"typo-error",bgColor:"system-error-100"};case"neutral":return{actionColor:"primary",bgColor:"neutral-gray-100"};default:throw Error(`Unimplement snackbar variant ${e.variant}`)}}),s=d.computed(()=>e.title?{text:e.title,classes:"fm-typo-body-lg-700"}:{text:e.description,classes:""}),o=d.computed(()=>e.bgColor?cn(e.bgColor)?{style:{backgroundColor:e.bgColor}}:{class:`bg-fm-color-${e.bgColor}`}:{class:`bg-fm-color-${i.value.bgColor}`}),a=d.computed(()=>e.color?cn(e.color)?{style:{color:e.color}}:{class:`text-fm-color-${e.color}`}:{class:`text-fm-color-${i.value.actionColor}`});return(r,l)=>(d.openBlock(),d.createElementBlock("div",d.mergeProps(o.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[d.createElementVNode("div",gf,[i.value.icon?(d.openBlock(),d.createBlock(it,{key:0,name:i.value.icon.name,color:e.color??i.value.icon.color,class:"mr-12"},null,8,["name","color"])):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(`${s.value.classes} grow ellipsis`)},d.toDisplayString(s.value.text),3),e.dismissable?(d.openBlock(),d.createBlock(it,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:l[0]||(l[0]=()=>t("onDismiss"))})):d.createCommentVNode("",!0)]),e.title&&e.description?(d.openBlock(),d.createElementBlock("div",mf,d.toDisplayString(e.description),1)):d.createCommentVNode("",!0),d.renderSlot(r.$slots,"actions",{},()=>[e.action?(d.openBlock(),d.createElementBlock("div",d.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[d.createElementVNode("span",{class:"cursor-pointer",onClick:l[1]||(l[1]=()=>t("onAction"))},d.toDisplayString(e.action),1)],16)):d.createCommentVNode("",!0)],!0)],16))}}),op="",_f=ut(bf,[["__scopeId","data-v-b6db34bb"]]),yf={class:"inline-block relative"},xf={key:0},kf={class:"px-2 py-0"},wf={key:0,class:"fm-typo-body-xl-700"},Sf={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},Mf=d.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},beak:{default:"none"},titleText:{default:"Title"},contentText:{},actionButtons:{}},setup(n){const t=n,e=d.ref(!1),i=d.computed(()=>{const h={plain:{color:"#FFF",background:"#1C1C1E",boxShadow:"0 2px 4px rgba(0, 0, 0, 0)"},rich:{background:"#FFF",boxShadow:"0px 8px 16px 0px rgba(199, 199, 204, 0.24)"}},u={none:{top:"110%",left:"50%",transform:"translateX(-50%)"},top:{top:"110%",left:"50%",transform:"translateX(-50%)"},bottom:{bottom:"110%",left:"50%",transform:"translateX(-50%)"},left:{top:"50%",left:"104%",transform:"translateY(-50%)"},right:{top:"-95%",right:"104%"}};return{...h[t.variant],...u[t.beak],display:e.value?"block":"none"}}),s=d.computed(()=>{const h={none:{},top:{top:"110%",left:"45%",width:"23px",height:"23px"},bottom:{bottom:"110%",left:"45%",width:"23px",height:"23px"},left:{top:"40%",left:"102%",width:"8px",height:"8px"},right:{top:"30%",right:"102%",width:"8px",height:"8px"}},u={plain:{background:"#1C1C1E"},rich:{background:"#FFF"}};return{...h[t.beak],...u[t.variant]}}),o=d.ref(0),a=d.ref(0),r=()=>{clearTimeout(a.value),o.value=window.setTimeout(()=>e.value=!0,500)},l=()=>{clearTimeout(o.value),a.value=window.setTimeout(()=>e.value=!1,1500)},c=()=>{clearTimeout(a.value),e.value=!0};return(h,u)=>(d.openBlock(),d.createElementBlock("div",yf,[d.createElementVNode("span",{onMouseenter:r,onMouseleave:l},[d.renderSlot(h.$slots,"default")],32),e.value?(d.openBlock(),d.createElementBlock("div",xf,[d.createElementVNode("div",{class:"absolute rotate-45",style:d.normalizeStyle(s.value)},null,4),d.createElementVNode("div",{class:"absolute break-words max-w-xs overflow-hidden px-4 py-3 rounded-2xl w-max whitespace-normal z-50",style:d.normalizeStyle(i.value),onMouseenter:c,onMouseleave:l},[d.createElementVNode("div",kf,[h.variant=="rich"?(d.openBlock(),d.createElementBlock("div",wf,d.toDisplayString(h.titleText),1)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(h.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},d.toDisplayString(h.contentText),3)]),h.variant=="rich"?(d.openBlock(),d.createElementBlock("div",Sf,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(h.actionButtons,(f,p)=>(d.openBlock(),d.createElementBlock("div",{key:p},[d.createVNode(Pe,{label:f.label,onClick:f.handler},null,8,["label","onClick"])]))),128))])):d.createCommentVNode("",!0)],36)])):d.createCommentVNode("",!0)]))}}),No={directive:"wave",color:"currentColor",initialOpacity:.2,finalOpacity:.1,duration:.4,dissolveDuration:.15,easing:"ease-out",cancellationPeriod:75,trigger:"auto",tagName:"div"},Cf=n=>"config"in n&&"globalProperties"in n.config,vf=n=>{let t;return n==="vue2"?t=!1:n==="vue3"?t=!0:t=Cf(n),t?{mounted:"mounted",updated:"updated"}:{mounted:"inserted",updated:"componentUpdated"}},Io=n=>typeof n=="string"&&n!=="auto",$o=(n,t)=>{n.dataset.vWaveBoundary=Io(t)?t:"true"},Df=({borderTopLeftRadius:n,borderTopRightRadius:t,borderBottomLeftRadius:e,borderBottomRightRadius:i},s)=>{const o=document.createElement(s);return o.style.top="0",o.style.left="0",o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.position="absolute",o.style.borderRadius=`${n} ${t} ${i} ${e}`,o.style.overflow="hidden",o.style.pointerEvents="none",o.style.webkitMaskImage="-webkit-radial-gradient(white, black)",o},Ef=(n,t,e,i)=>{const s=document.createElement("div");return s.style.position="absolute",s.style.width=`${e}px`,s.style.height=`${e}px`,s.style.top=`${t}px`,s.style.left=`${n}px`,s.style.background=i.color,s.style.borderRadius="50%",s.style.opacity=`${i.initialOpacity}`,s.style.transform="translate(-50%,-50%) scale(0)",s.style.transition=`transform ${i.duration}s ${i.easing}, opacity ${i.duration}s ${i.easing}`,s};function rn(n,t,e,i){const s=n-e,o=t-i;return Math.sqrt(s*s+o*o)}function Pf(n,t,{width:e,height:i}){const s=rn(n,t,0,0),o=rn(n,t,e,0),a=rn(n,t,0,i),r=rn(n,t,e,i);return Math.max(s,o,a,r)}const Of=({x:n,y:t},{top:e,left:i})=>({x:n-i,y:t-e}),Zn="vWaveCountInternal";function Bf(n){const t=Jn(n);zo(n,t+1)}function Lf(n){const t=Jn(n);zo(n,t-1)}function zo(n,t){n.dataset[Zn]=t.toString()}function Jn(n){var t;return parseInt((t=n.dataset[Zn])!==null&&t!==void 0?t:"0",10)}function Af(n){delete n.dataset[Zn]}const Qn=(n,t,e)=>{const i=t.getBoundingClientRect(),s=window.getComputedStyle(t),{x:o,y:a}=Of(n,i),r=2.05*Pf(o,a,i),l=Df(s,e.tagName),c=Ef(o,a,r,e);Bf(t);let h="";s.position==="static"&&(t.style.position&&(h=t.style.position),t.style.position="relative"),l.appendChild(c),t.appendChild(l);let u=!1;const f=b=>{typeof b<"u"&&(document.removeEventListener("pointerup",f),document.removeEventListener("pointercancel",f)),u?p():u=!0},p=()=>{c.style.transition=`opacity ${e.dissolveDuration}s linear`,c.style.opacity="0",setTimeout(()=>{l.remove(),Lf(t),Jn(t)===0&&(Af(t),t.style.position=h)},e.dissolveDuration*1e3)};document.addEventListener("pointerup",f),document.addEventListener("pointercancel",f);const g=setTimeout(()=>{document.removeEventListener("pointercancel",m),requestAnimationFrame(()=>{c.style.transform="translate(-50%,-50%) scale(1)",c.style.opacity=`${e.finalOpacity}`,setTimeout(()=>f(),e.duration*1e3)})},e.cancellationPeriod),m=()=>{clearTimeout(g),l.remove(),document.removeEventListener("pointerup",f),document.removeEventListener("pointercancel",f),document.removeEventListener("pointercancel",m)};document.addEventListener("pointercancel",m)},ve=new WeakMap,Wo=(n={},t="vue3")=>{const e=Object.assign(Object.assign({},No),n),i=vf(t),s=r=>{const l=r.currentTarget.dataset.vWaveTrigger;document.querySelectorAll(`[data-v-wave-boundary="${l}"]`).forEach(h=>Qn(r,h,Object.assign(Object.assign({},e),ve.get(h))))},o={[i.mounted](r,{value:l={}}){var c;ve.set(r,l),$o(r,(c=l&&l.trigger)!==null&&c!==void 0?c:e.trigger),r.addEventListener("pointerdown",h=>{if(ve.get(r)===!1)return;const u=Object.assign(Object.assign({},e),ve.get(r));if(u.trigger===!1)return Qn(h,r,u);if(Io(u.trigger))return;const f=r.querySelector('[data-v-wave-trigger="true"]');!f&&u.trigger===!0||f&&!h.composedPath().includes(f)||Qn(h,r,u)})},[i.updated](r,{value:l={}}){var c;ve.set(r,l),$o(r,(c=l&&l.trigger)!==null&&c!==void 0?c:e.trigger)}},a={[i.mounted](r,{arg:l="true"}){r.dataset.vWaveTrigger=l,l!=="true"&&r.addEventListener("pointerdown",s)},[i.updated](r,{arg:l="true"}){r.dataset.vWaveTrigger=l,l==="true"?r.removeEventListener("pointerdown",s):r.addEventListener("pointerdown",s)}};return{wave:o,vWave:o,waveTrigger:a,vWaveTrigger:a}},Tf={install(n,t={}){if(this.installed)return;this.installed=!0;const e=Object.assign(Object.assign({},No),t),{vWave:i,vWaveTrigger:s}=Wo(e,n);n.directive(e.directive,i),n.directive(`${e.directive}-trigger`,s)},installed:!1,createLocalWaveDirective:Wo},Ff=n=>{n.use(Tf,{})};j.FmBreadcrumb=Go,j.FmButton=Pe,j.FmCheckbox=Do,j.FmDatePicker=Wh,j.FmDateRangePicker=Qh,j.FmDropdown=Eo,j.FmIcon=it,j.FmLineChart=Oh,j.FmMenu=Po,j.FmMenuItem=Oo,j.FmProgressIndicator=Ro,j.FmProgressIndicatorGroup=pf,j.FmRadio=pu,j.FmSelect=Cu,j.FmSnackbar=_f,j.FmSwitch=Vu,j.FmTextField=ju,j.FmTextarea=Gu,j.FmTooltip=Mf,j.uiPlugin=Ff,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});