@feedmepos/ui-library 0.0.1-alpha.13 → 0.0.1-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/form/stepper-field/FmStepperField.vue.d.ts +3 -2
- package/dist/components/form/text-field/FmTextField.vue.d.ts +3 -3
- package/dist/components/form/textarea/FmTextarea.vue.d.ts +3 -3
- package/dist/components/menu/dropdown/FmDropdown.vue.d.ts +4 -1
- package/dist/components/time-picker/FmTimeInput.vue.d.ts +23 -0
- package/dist/components/time-picker/FmTimePicker.vue.d.ts +19 -0
- package/dist/components/time-picker/TimeInput.vue.d.ts +34 -0
- package/dist/components/time-picker/timePicker.d.ts +5 -0
- package/dist/components/tooltip/FmTooltip.vue.d.ts +14 -3
- package/dist/federation/FmButton-03ae1e8a.css +1 -0
- package/dist/federation/FmDropdown-137cddb0.css +1 -0
- package/dist/federation/FmMenu-f935d8e3.css +1 -0
- package/dist/federation/FmProgressIndicator-c06d2e53.css +1 -0
- package/dist/federation/FmTextField.vue_vue_type_style_index_0_lang-b155f367.js +1 -0
- package/dist/federation/FmTooltip.vue_vue_type_script_setup_true_lang-cbd2513f.js +1 -0
- package/dist/federation/{__federation_expose_FmButton-71bb9d18.js → __federation_expose_FmButton-abda9755.js} +2 -2
- package/dist/federation/__federation_expose_FmDropdown-fdebd8a7.js +1 -0
- package/dist/federation/{__federation_expose_FmMenu-ed4b43e0.js → __federation_expose_FmMenu-05aa2ec1.js} +1 -1
- package/dist/federation/__federation_expose_FmProgressIndicator-cff3f271.js +1 -0
- package/dist/federation/__federation_expose_FmProgressIndicatorGroup-3171e386.js +1 -0
- package/dist/federation/{__federation_expose_FmSelect-1855f320.js → __federation_expose_FmSelect-ed1bc773.js} +1 -1
- package/dist/federation/{__federation_expose_FmTextField-48c256e7.js → __federation_expose_FmTextField-33449819.js} +1 -1
- package/dist/federation/{__federation_expose_FmTooltip-61035ccf.js → __federation_expose_FmTooltip-a5c52c54.js} +1 -1
- package/dist/federation/__federation_fn_import.js +1 -1
- package/dist/federation/__federation_shared_vue-3342c658.js +1 -0
- package/dist/federation/feedmepos-ui-components.js +1 -1
- package/dist/federation/index-2011f8f3.css +1 -0
- package/dist/federation/index-63087e9d.js +11 -0
- package/dist/federation/reactivity.esm-bundler-99588556.js +1 -0
- package/dist/feedmepos-ui-library.js +12051 -0
- package/dist/feedmepos-ui-library.umd.cjs +29 -0
- package/dist/style.css +1 -1
- package/dist/tailwind-plugin.js +5 -3
- package/package.json +4 -3
- package/dist/federation/FmButton-bd6d2e4b.css +0 -1
- package/dist/federation/FmDropdown-7ce00217.css +0 -1
- package/dist/federation/FmMenu-a00148e7.css +0 -1
- package/dist/federation/FmProgressIndicator-298ef84b.css +0 -1
- package/dist/federation/FmProgressIndicatorGroup-58d5cb90.css +0 -1
- package/dist/federation/FmProgressIndicatorGroup.vue_vue_type_style_index_0_lang-243ecd13.js +0 -1
- package/dist/federation/FmTextField.vue_vue_type_style_index_0_lang-473d3f81.js +0 -1
- package/dist/federation/FmTooltip.vue_vue_type_script_setup_true_lang-7b39efc3.js +0 -1
- package/dist/federation/__federation_expose_FmDropdown-604d6b6a.js +0 -1
- package/dist/federation/__federation_expose_FmProgressIndicator-07af3c15.js +0 -1
- package/dist/federation/__federation_expose_FmProgressIndicatorGroup-c3359ab1.js +0 -1
- package/dist/federation/__federation_shared_vue-7b8990b1.js +0 -1
- package/dist/federation/index-0fb0d627.css +0 -1
- package/dist/federation/index-13778968.js +0 -11
- package/dist/feedmepos-ui-library.es.js +0 -11225
- package/dist/feedmepos-ui-library.umd.js +0 -29
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var sg=Object.defineProperty;var og=(z,h,re)=>h in z?sg(z,h,{enumerable:!0,configurable:!0,writable:!0,value:re}):z[h]=re;var P=(z,h,re)=>(og(z,typeof h!="symbol"?h+"":h,re),re);(function(z,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],h):(z=typeof globalThis<"u"?globalThis:z||self,h(z["feedmepos-ui-library"]={},z.Vue))})(this,function(z,h){var Yn;"use strict";const re="";/*!
|
|
2
|
+
* vue-router v4.2.5
|
|
3
|
+
* (c) 2023 Eduardo San Martin Morote
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/var qi;(function(n){n.pop="pop",n.push="push"})(qi||(qi={}));var Ki;(function(n){n.back="back",n.forward="forward",n.unknown=""})(Ki||(Ki={})),Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var Gi;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(Gi||(Gi={})),Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),Symbol(process.env.NODE_ENV!=="production"?"router view depth":"");const qa=Symbol(process.env.NODE_ENV!=="production"?"router":""),Ka=Symbol(process.env.NODE_ENV!=="production"?"route location":"");Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function Ga(){return h.inject(qa)}function Za(){return h.inject(Ka)}const Ja={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},Qa=["onMouseenter"],tr={key:0},er=h.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(n){const t=n,e=Za(),i=Ga();h.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=h.ref(-1),o=h.ref(-1),a=h.ref(" / "),r=h.ref("... /"),l=h.ref(!1),c=g=>s.value===g?"selected":o.value===g?"hovered":t.items[g].disabled?"disabled":"default",d=g=>{t.items[g].disabled||(s.value=g)},f=g=>g!=t.items.length-1,u=g=>!l.value&&t.items.length>5&&g>=2&&g<t.items.length-2,p=()=>{l.value=!l.value};return(g,m)=>{const b=h.resolveComponent("RouterLink");return h.openBlock(),h.createElementBlock("nav",null,[h.createElementVNode("ul",Ja,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(g.items,(y,_)=>(h.openBlock(),h.createElementBlock("li",{key:_,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:k=>o.value=_,onMouseleave:m[0]||(m[0]=k=>o.value=-1)},[u(_)?_===3&&!l.value?(h.openBlock(),h.createElementBlock("a",{key:1,onClick:p},h.toDisplayString(r.value),1)):h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(b,{key:0,class:h.normalizeClass(c(_)),to:y.disabled?"":y.route,onClick:k=>d(_)},{default:h.withCtx(()=>[h.createElementVNode("span",null,h.toDisplayString(y.label),1),f(_)?(h.openBlock(),h.createElementBlock("span",tr,h.toDisplayString(a.value),1)):h.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,Qa))),128))])])}}}),ag="",nr=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,ir=/^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}[)]$/,sr=/^^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*[)]$/,or=/^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*[)]$/,ar=/^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 Xn(n){return[nr,ir,sr,or,ar].some(t=>t.test(n))}const rr=h.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=h.computed(()=>{const o=[],a={};return o.push(i()),o.push(s()),Xn(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)=>(h.openBlock(),h.createElementBlock("span",h.mergeProps(e.value,{class:"fm-icon"}),h.toDisplayString(t.name),17))}}),rg="",pt=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},st=pt(rr,[["__scopeId","data-v-88e86ba4"]]),lr=["disabled"],cr={key:1,class:"fm-typo-body-lg-700"},dr=h.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=h.ref(!1),i=h.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-primary",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=h.resolveDirective("wave");return h.withDirectives((h.openBlock(),h.createElementBlock("button",{ref:"buttonEl",class:h.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?(h.openBlock(),h.createBlock(st,{key:0,name:n.icon,outline:!e.value,color:n.disabled?"neutral-gray-200":"",size:"md"},null,8,["name","outline","color"])):h.createCommentVNode("",!0),n.label?(h.openBlock(),h.createElementBlock("span",cr,h.toDisplayString(n.label),1)):h.createCommentVNode("",!0)],42,lr)),[[l,!n.disabled]])}}}),lg="",tn=pt(dr,[["__scopeId","data-v-d31f278f"]]);/*!
|
|
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 _e(n){return n+.5|0}const Lt=(n,t,e)=>Math.max(Math.min(n,e),t);function xe(n){return Lt(_e(n*2.55),0,255)}function Ft(n){return Lt(_e(n*255),0,255)}function St(n){return Lt(_e(n/2.55)/100,0,1)}function Zi(n){return Lt(_e(n*100),0,100)}const gt={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},qn=[..."0123456789ABCDEF"],hr=n=>qn[n&15],fr=n=>qn[(n&240)>>4]+qn[n&15],en=n=>(n&240)>>4===(n&15),ur=n=>en(n.r)&&en(n.g)&&en(n.b)&&en(n.a);function pr(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255>[n[1]]*17,g:255>[n[2]]*17,b:255>[n[3]]*17,a:t===5?gt[n[4]]*17:255}:(t===7||t===9)&&(e={r:gt[n[1]]<<4|gt[n[2]],g:gt[n[3]]<<4|gt[n[4]],b:gt[n[5]]<<4|gt[n[6]],a:t===9?gt[n[7]]<<4|gt[n[8]]:255})),e}const gr=(n,t)=>n<255?t(n):"";function mr(n){var t=ur(n)?hr:fr;return n?"#"+t(n.r)+t(n.g)+t(n.b)+gr(n.a,t):void 0}const br=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ji(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 yr(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 _r(n,t,e){const i=Ji(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 xr(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 Kn(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,d;return o!==a&&(d=o-a,c=r>.5?d/(2-o-a):d/(o+a),l=xr(e,i,s,d,o),l=l*60+.5),[l|0,c||0,r]}function Gn(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Ft)}function Zn(n,t,e){return Gn(Ji,n,t,e)}function kr(n,t,e){return Gn(_r,n,t,e)}function wr(n,t,e){return Gn(yr,n,t,e)}function Qi(n){return(n%360+360)%360}function vr(n){const t=br.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?xe(+t[5]):Ft(+t[5]));const s=Qi(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=kr(s,o,a):t[1]==="hsv"?i=wr(s,o,a):i=Zn(s,o,a),{r:i[0],g:i[1],b:i[2],a:e}}function Sr(n,t){var e=Kn(n);e[0]=Qi(e[0]+t),e=Zn(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Mr(n){if(!n)return;const t=Kn(n),e=t[0],i=Zi(t[1]),s=Zi(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${St(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const ts={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"},es={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 Cr(){const n={},t=Object.keys(es),e=Object.keys(ts);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,ts[o]);o=parseInt(es[a],16),n[r]=[o>>16&255,o>>8&255,o&255]}return n}let nn;function Dr(n){nn||(nn=Cr(),nn.transparent=[0,0,0,0]);const t=nn[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Er=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Pr(n){const t=Er.exec(n);let e=255,i,s,o;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?xe(a):Lt(a*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?xe(i):Lt(i,0,255)),s=255&(t[4]?xe(s):Lt(s,0,255)),o=255&(t[6]?xe(o):Lt(o,0,255)),{r:i,g:s,b:o,a:e}}}function Or(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${St(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Jn=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,le=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Ar(n,t,e){const i=le(St(n.r)),s=le(St(n.g)),o=le(St(n.b));return{r:Ft(Jn(i+e*(le(St(t.r))-i))),g:Ft(Jn(s+e*(le(St(t.g))-s))),b:Ft(Jn(o+e*(le(St(t.b))-o))),a:n.a+e*(t.a-n.a)}}function sn(n,t,e){if(n){let i=Kn(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Zn(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function ns(n,t){return n&&Object.assign(t||{},n)}function is(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=Ft(n[3]))):(t=ns(n,{r:0,g:0,b:0,a:1}),t.a=Ft(t.a)),t}function Br(n){return n.charAt(0)==="r"?Pr(n):vr(n)}class ke{constructor(t){if(t instanceof ke)return t;const e=typeof t;let i;e==="object"?i=is(t):e==="string"&&(i=pr(t)||Dr(t)||Br(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ns(this._rgb);return t&&(t.a=St(t.a)),t}set rgb(t){this._rgb=is(t)}rgbString(){return this._valid?Or(this._rgb):void 0}hexString(){return this._valid?mr(this._rgb):void 0}hslString(){return this._valid?Mr(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=Ar(this._rgb,t._rgb,e)),this}clone(){return new ke(this.rgb)}alpha(t){return this._rgb.a=Ft(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=_e(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 sn(this._rgb,2,t),this}darken(t){return sn(this._rgb,2,-t),this}saturate(t){return sn(this._rgb,1,t),this}desaturate(t){return sn(this._rgb,1,-t),this}rotate(t){return Sr(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 Mt(){}const Tr=(()=>{let n=0;return()=>n++})();function I(n){return n===null||typeof n>"u"}function X(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){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Z(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function ht(n,t){return Z(n)?n:t}function N(n,t){return typeof n>"u"?t:n}const Lr=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,ss=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Y(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function H(n,t,e,i){let s,o,a;if(X(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))for(a=Object.keys(n),o=a.length,s=0;s<o;s++)t.call(e,n[a[s]],a[s])}function on(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 an(n){if(X(n))return n.map(an);if($(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=an(n[e[s]]);return t}return n}function os(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Fr(n,t,e,i){if(!os(n))return;const s=t[n],o=e[n];$(s)&&$(o)?we(s,o,i):t[n]=an(o)}function we(n,t,e){const i=X(t)?t:[t],s=i.length;if(!$(n))return n;e=e||{};const o=e.merger||Fr;let a;for(let r=0;r<s;++r){if(a=i[r],!$(a))continue;const l=Object.keys(a);for(let c=0,d=l.length;c<d;++c)o(l[c],n,a,e)}return n}function ve(n,t){return we(n,t,{merger:Vr})}function Vr(n,t,e){if(!os(n))return;const i=t[n],s=e[n];$(i)&&$(s)?ve(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=an(s))}const as={"":n=>n,x:n=>n.x,y:n=>n.y};function Rr(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 Nr(n){const t=Rr(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Vt(n,t){return(as[t]||(as[t]=Nr(t)))(n)}function Qn(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Se=n=>typeof n<"u",Rt=n=>typeof n=="function",rs=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function $r(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const q=Math.PI,K=2*q,Ir=K+q,rn=Number.POSITIVE_INFINITY,zr=q/180,tt=q/2,Ut=q/4,ls=q*2/3,Nt=Math.log10,xt=Math.sign;function Me(n,t,e){return Math.abs(n-t)<e}function cs(n){const t=Math.round(n);n=Me(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Nt(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Wr(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 ce(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Hr(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function ds(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 yt(n){return n*(q/180)}function ti(n){return n*(180/q)}function hs(n){if(!Z(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function fs(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*q&&(o+=K),{angle:o,distance:s}}function ei(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function jr(n,t){return(n-t+Ir)%K-q}function ft(n){return(n%K+K)%K}function Ce(n,t,e,i){const s=ft(n),o=ft(t),a=ft(e),r=ft(o-s),l=ft(a-s),c=ft(s-o),d=ft(s-a);return s===o||s===a||i&&o===a||r>l&&c<d}function nt(n,t,e){return Math.max(t,Math.min(e,n))}function Yr(n){return nt(n,-32768,32767)}function Ct(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function ni(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 Dt=(n,t,e,i)=>ni(n,e,i?s=>{const o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),Ur=(n,t,e)=>ni(n,e,i=>n[i][t]>=e);function Xr(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 us=["push","pop","shift","splice","unshift"];function qr(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),us.forEach(e=>{const i="_onData"+Qn(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 ps(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)&&(us.forEach(o=>{delete n[o]}),delete n._chartjs)}function gs(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const ms=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function bs(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,ms.call(window,()=>{i=!1,n.apply(t,e)}))}}function Kr(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const ii=n=>n==="start"?"left":n==="end"?"right":"center",ot=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Gr=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function ys(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:d,minDefined:f,maxDefined:u}=a.getUserBounds();f&&(s=nt(Math.min(Dt(r,l,c).lo,e?i:Dt(t,l,a.getPixelForValue(c)).lo),0,i-1)),u?o=nt(Math.max(Dt(r,a.axis,d,!0).hi+1,e?0:Dt(t,l,a.getPixelForValue(d),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function _s(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 ln=n=>n===0||n===1,xs=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*K/e)),ks=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*K/e)+1,De={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*tt)+1,easeOutSine:n=>Math.sin(n*tt),easeInOutSine:n=>-.5*(Math.cos(q*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=>ln(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=>ln(n)?n:xs(n,.075,.3),easeOutElastic:n=>ln(n)?n:ks(n,.075,.3),easeInOutElastic(n){return ln(n)?n:n<.5?.5*xs(n*2,.1125,.45):.5+.5*ks(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-De.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?De.easeInBounce(n*2)*.5:De.easeOutBounce(n*2-1)*.5+.5};function si(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ws(n){return si(n)?n:new ke(n)}function oi(n){return si(n)?n:new ke(n).saturate(.5).darken(.1).hexString()}const Zr=["x","y","borderWidth","radius","tension"],Jr=["color","borderColor","backgroundColor"];function Qr(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:Jr},numbers:{type:"number",properties:Zr}}),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 tl(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const vs=new Map;function el(n,t){t=t||{};const e=n+JSON.stringify(t);let i=vs.get(e);return i||(i=new Intl.NumberFormat(n,t),vs.set(e,i)),i}function Ee(n,t,e){return el(t,e).format(n)}const Ss={values(n){return X(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=nl(n,e)}const a=Nt(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),Ee(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Nt(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Ss.numeric.call(this,n,t,e):""}};function nl(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 cn={formatters:Ss};function il(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:cn.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 Xt=Object.create(null),ai=Object.create(null);function Pe(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 ri(n,t,e){return typeof t=="string"?we(Pe(n,t),e):we(Pe(n,""),t)}class sl{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)=>oi(s.backgroundColor),this.hoverBorderColor=(i,s)=>oi(s.borderColor),this.hoverColor=(i,s)=>oi(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 ri(this,t,e)}get(t){return Pe(this,t)}describe(t,e){return ri(ai,t,e)}override(t,e){return ri(Xt,t,e)}route(t,e,i,s){const o=Pe(this,t),a=Pe(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 $(l)?Object.assign({},c,l):N(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var J=new sl({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Qr,tl,il]);function ol(n){return!n||I(n.size)||I(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function dn(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 al(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,d,f,u;for(l=0;l<r;l++)if(f=e[l],f!=null&&!X(f))a=dn(n,s,o,a,f);else if(X(f))for(c=0,d=f.length;c<d;c++)u=f[c],u!=null&&!X(u)&&(a=dn(n,s,o,a,u));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 qt(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 Ms(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function li(n,t,e,i){Cs(n,t,e,i,null)}function Cs(n,t,e,i,s){let o,a,r,l,c,d,f,u;const p=t.pointStyle,g=t.rotation,m=t.radius;let b=(g||0)*zr;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,K):n.arc(e,i,m,0,K),n.closePath();break;case"triangle":d=s?s/2:m,n.moveTo(e+Math.sin(b)*d,i-Math.cos(b)*m),b+=ls,n.lineTo(e+Math.sin(b)*d,i-Math.cos(b)*m),b+=ls,n.lineTo(e+Math.sin(b)*d,i-Math.cos(b)*m),n.closePath();break;case"rectRounded":c=m*.516,l=m-c,a=Math.cos(b+Ut)*l,f=Math.cos(b+Ut)*(s?s/2-c:l),r=Math.sin(b+Ut)*l,u=Math.sin(b+Ut)*(s?s/2-c:l),n.arc(e-f,i-r,c,b-q,b-tt),n.arc(e+u,i-a,c,b-tt,b),n.arc(e+f,i+r,c,b,b+tt),n.arc(e-u,i+a,c,b+tt,b+q),n.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,d=s?s/2:l,n.rect(e-d,i-l,2*d,2*l);break}b+=Ut;case"rectRot":f=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(s?s/2:m),n.moveTo(e-f,i-r),n.lineTo(e+u,i-a),n.lineTo(e+f,i+r),n.lineTo(e-u,i+a),n.closePath();break;case"crossRot":b+=Ut;case"cross":f=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(s?s/2:m),n.moveTo(e-f,i-r),n.lineTo(e+f,i+r),n.moveTo(e+u,i-a),n.lineTo(e-u,i+a);break;case"star":f=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(s?s/2:m),n.moveTo(e-f,i-r),n.lineTo(e+f,i+r),n.moveTo(e+u,i-a),n.lineTo(e-u,i+a),b+=Ut,f=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(s?s/2:m),n.moveTo(e-f,i-r),n.lineTo(e+f,i+r),n.moveTo(e+u,i-a),n.lineTo(e-u,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 Et(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 hn(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function fn(n){n.restore()}function rl(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 ll(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 cl(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 dl(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,d=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,d),n.lineTo(r,d),n.stroke()}}function hl(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Kt(n,t,e,i,s,o={}){const a=X(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,cl(n,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&hl(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),dl(n,e,i,c,o),i+=Number(s.lineHeight);n.restore()}function Oe(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*q,q,!0),n.lineTo(e,i+o-a.bottomLeft),n.arc(e+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,q,tt,!0),n.lineTo(e+s-a.bottomRight,i+o),n.arc(e+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,tt,0,!0),n.lineTo(e+s,i+a.topRight),n.arc(e+s-a.topRight,i+a.topRight,a.topRight,0,-tt,!0),n.lineTo(e+a.topLeft,i)}const fl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ul=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function pl(n,t){const e=(""+n).match(fl);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 gl=n=>+n||0;function ci(n,t){const e={},i=$(t),s=i?Object.keys(t):t,o=$(n)?i?a=>N(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=gl(o(a));return e}function Ds(n){return ci(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Gt(n){return ci(n,["topLeft","topRight","bottomLeft","bottomRight"])}function at(n){const t=Ds(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function et(n,t){n=n||{},t=t||J.font;let e=N(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=N(n.style,t.style);i&&!(""+i).match(ul)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:N(n.family,t.family),lineHeight:pl(N(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:N(n.weight,t.weight),string:""};return s.string=ol(s),s}function Ae(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&&X(r)&&(r=r[e%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function ml(n,t,e){const{min:i,max:s}=n,o=ss(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 $t(n,t){return Object.assign(Object.create(n),t)}function di(n,t=[""],e,i,s=()=>n[0]){const o=e||n;typeof i>"u"&&(i=Bs("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:r=>di([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 Ps(r,l,()=>Sl(l,t,n,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,l){return Ts(r).includes(l)},ownKeys(r){return Ts(r)},set(r,l,c){const d=r._storage||(r._storage=s());return r[l]=d[l]=c,delete r._keys,!0}})}function de(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Es(n,i),setContext:o=>de(n,o,e,i),override:o=>de(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 Ps(o,a,()=>yl(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 Es(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:Rt(e)?e:()=>e,isIndexable:Rt(i)?i:()=>i}}const bl=(n,t)=>n?n+Qn(t):t,hi=(n,t)=>$(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ps(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function yl(n,t,e){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;let r=i[t];return Rt(r)&&a.isScriptable(t)&&(r=_l(t,r,n,e)),X(r)&&r.length&&(r=xl(t,r,n,a.isIndexable)),hi(t,r)&&(r=de(r,s,o&&o[t],a)),r}function _l(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),hi(n,l)&&(l=fi(s._scopes,s,n,l)),l}function xl(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($(t[0])){const l=t,c=s._scopes.filter(d=>d!==l);t=[];for(const d of l){const f=fi(c,s,n,d);t.push(de(f,o,a&&a[n],r))}}return t}function Os(n,t,e){return Rt(n)?n(t,e):n}const kl=(n,t)=>n===!0?t:typeof n=="string"?Vt(t,n):void 0;function wl(n,t,e,i,s){for(const o of t){const a=kl(e,o);if(a){n.add(a);const r=Os(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 fi(n,t,e,i){const s=t._rootScopes,o=Os(t._fallback,e,i),a=[...n,...s],r=new Set;r.add(i);let l=As(r,a,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=As(r,a,o,l,i),l===null)?!1:di(Array.from(r),[""],s,o,()=>vl(t,e,i))}function As(n,t,e,i,s){for(;e;)e=wl(n,t,e,i,s);return e}function vl(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return X(s)&&$(e)?e:s||{}}function Sl(n,t,e,i){let s;for(const o of t)if(s=Bs(bl(o,n),e),typeof s<"u")return hi(n,s)?fi(e,i,n,s):s}function Bs(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Ts(n){let t=n._keys;return t||(t=n._keys=Ml(n._scopes)),t}function Ml(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 Ls(n,t,e,i){const{iScale:s}=n,{key:o="r"}=this._parsing,a=new Array(i);let r,l,c,d;for(r=0,l=i;r<l;++r)c=r+e,d=t[c],a[r]={r:s.parse(Vt(d,o),c)};return a}const Cl=Number.EPSILON||1e-14,he=(n,t)=>t<n.length&&!n[t].skip&&n[t],Fs=n=>n==="x"?"y":"x";function Dl(n,t,e,i){const s=n.skip?t:n,o=t,a=e.skip?t:e,r=ei(o,s),l=ei(a,o);let c=r/(r+l),d=l/(r+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const f=i*c,u=i*d;return{previous:{x:o.x-f*(a.x-s.x),y:o.y-f*(a.y-s.y)},next:{x:o.x+u*(a.x-s.x),y:o.y+u*(a.y-s.y)}}}function El(n,t,e){const i=n.length;let s,o,a,r,l,c=he(n,0);for(let d=0;d<i-1;++d)if(l=c,c=he(n,d+1),!(!l||!c)){if(Me(t[d],0,Cl)){e[d]=e[d+1]=0;continue}s=e[d]/t[d],o=e[d+1]/t[d],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[d]=s*a*t[d],e[d+1]=o*a*t[d])}}function Pl(n,t,e="x"){const i=Fs(e),s=n.length;let o,a,r,l=he(n,0);for(let c=0;c<s;++c){if(a=r,r=l,l=he(n,c+1),!r)continue;const d=r[e],f=r[i];a&&(o=(d-a[e])/3,r[`cp1${e}`]=d-o,r[`cp1${i}`]=f-o*t[c]),l&&(o=(l[e]-d)/3,r[`cp2${e}`]=d+o,r[`cp2${i}`]=f+o*t[c])}}function Ol(n,t="x"){const e=Fs(t),i=n.length,s=Array(i).fill(0),o=Array(i);let a,r,l,c=he(n,0);for(a=0;a<i;++a)if(r=l,l=c,c=he(n,a+1),!!l){if(c){const d=c[t]-l[t];s[a]=d!==0?(c[e]-l[e])/d:0}o[a]=r?c?xt(s[a-1])!==xt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}El(n,s,o),Pl(n,o,t)}function un(n,t,e){return Math.max(Math.min(n,e),t)}function Al(n,t){let e,i,s,o,a,r=Et(n[0],t);for(e=0,i=n.length;e<i;++e)a=o,o=r,r=e<i-1&&Et(n[e+1],t),o&&(s=n[e],a&&(s.cp1x=un(s.cp1x,t.left,t.right),s.cp1y=un(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=un(s.cp2x,t.left,t.right),s.cp2y=un(s.cp2y,t.top,t.bottom)))}function Bl(n,t,e,i,s){let o,a,r,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Ol(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=Dl(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&&Al(n,e)}function Vs(){return typeof window<"u"&&typeof document<"u"}function ui(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function pn(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 gn=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Tl(n,t){return gn(n).getPropertyValue(t)}const Ll=["top","right","bottom","left"];function Zt(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Ll[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Fl=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Vl(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i;let a=!1,r,l;if(Fl(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 Jt(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=gn(e),o=s.boxSizing==="border-box",a=Zt(s,"padding"),r=Zt(s,"border","width"),{x:l,y:c,box:d}=Vl(n,e),f=a.left+(d&&r.left),u=a.top+(d&&r.top);let{width:p,height:g}=t;return o&&(p-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-f)/p*e.width/i),y:Math.round((c-u)/g*e.height/i)}}function Rl(n,t,e){let i,s;if(t===void 0||e===void 0){const o=ui(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{const a=o.getBoundingClientRect(),r=gn(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=pn(r.maxWidth,o,"clientWidth"),s=pn(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||rn,maxHeight:s||rn}}const mn=n=>Math.round(n*10)/10;function Nl(n,t,e,i){const s=gn(n),o=Zt(s,"margin"),a=pn(s.maxWidth,n,"clientWidth")||rn,r=pn(s.maxHeight,n,"clientHeight")||rn,l=Rl(n,t,e);let{width:c,height:d}=l;if(s.boxSizing==="content-box"){const u=Zt(s,"border","width"),p=Zt(s,"padding");c-=p.width+u.width,d-=p.height+u.height}return c=Math.max(0,c-o.width),d=Math.max(0,i?c/i:d-o.height),c=mn(Math.min(c,a,l.maxWidth)),d=mn(Math.min(d,r,l.maxHeight)),c&&!d&&(d=mn(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&d>l.height&&(d=l.height,c=mn(Math.floor(d*i))),{width:c,height:d}}function Rs(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 $l=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 Ns(n,t){const e=Tl(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Qt(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Il(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 zl(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},a=Qt(n,s,e),r=Qt(s,o,e),l=Qt(o,t,e),c=Qt(a,r,e),d=Qt(r,l,e);return Qt(c,d,e)}const Wl=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}}},Hl=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function fe(n,t,e){return n?Wl(t,e):Hl()}function $s(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 Is(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function zs(n){return n==="angle"?{between:Ce,compare:jr,normalize:ft}:{between:Ct,compare:(t,e)=>t-e,normalize:t=>t}}function Ws({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 jl(n,t,e){const{property:i,start:s,end:o}=e,{between:a,normalize:r}=zs(i),l=t.length;let{start:c,end:d,loop:f}=n,u,p;if(f){for(c+=l,d+=l,u=0,p=l;u<p&&a(r(t[c%l][i]),s,o);++u)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:f,style:n.style}}function Hs(n,t,e){if(!e)return[n];const{property:i,start:s,end:o}=e,a=t.length,{compare:r,between:l,normalize:c}=zs(i),{start:d,end:f,loop:u,style:p}=jl(n,t,e),g=[];let m=!1,b=null,y,_,k;const w=()=>l(s,k,y)&&r(s,k)!==0,x=()=>r(o,y)===0||l(o,k,y),C=()=>m||w(),M=()=>!m||x();for(let D=d,L=d;D<=f;++D)_=t[D%a],!_.skip&&(y=c(_[i]),y!==k&&(m=l(y,s,o),b===null&&C()&&(b=r(y,s)===0?D:L),b!==null&&M()&&(g.push(Ws({start:b,end:D,loop:u,count:a,style:p})),b=null),L=D,k=y));return b!==null&&g.push(Ws({start:b,end:f,loop:u,count:a,style:p})),g}function js(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const o=Hs(i[s],n.points,t);o.length&&e.push(...o)}return e}function Yl(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 Ul(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 Xl(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const o=!!n._loop,{start:a,end:r}=Yl(e,s,o,i);if(i===!0)return Ys(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 Ys(n,Ul(e,a,l,c),e,t)}function Ys(n,t,e,i){return!i||!i.setContext||!e?t:ql(n,t,e,i)}function ql(n,t,e,i){const s=n._chart.getContext(),o=Us(n.options),{_datasetIndex:a,options:{spanGaps:r}}=n,l=e.length,c=[];let d=o,f=t[0].start,u=f;function p(g,m,b,y){const _=r?-1:1;if(g!==m){for(g+=l;e[g%l].skip;)g-=_;for(;e[m%l].skip;)m+=_;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:b,style:y}),d=y,f=m%l)}}for(const g of t){f=r?f:g.start;let m=e[f%l],b;for(u=f+1;u<=g.end;u++){const y=e[u%l];b=Us(i.setContext($t(s,{type:"segment",p0:m,p1:y,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Kl(b,d)&&p(f,u-1,g.loop,d),m=y,d=b}f<u-1&&p(f,u-1,g.loop,d)}return c}function Us(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Kl(n,t){if(!t)return!1;const e=[],i=function(s,o){return si(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 Gl{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=ms.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 Pt=new Gl;const Xs="transparent",Zl={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=ws(n||Xs),s=i.valid&&ws(t||Xs);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Jl{constructor(t,e,i,s){const o=e[i];s=Ae([t.to,s,o,t.from]);const a=Ae([t.from,o,s]);this._active=!0,this._fn=t.fn||Zl[t.type||typeof a],this._easing=De[t.easing]||De.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=Ae([t.to,e,s,t.from]),this._from=Ae([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 qs{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!$(t))return;const e=Object.keys(J.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!$(o))return;const a={};for(const r of e)a[r]=o[r];(X(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,a)})})}_animateOptions(t,e){const i=e.options,s=tc(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&Ql(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 d=e[c];let f=o[c];const u=i.get(c);if(f)if(u&&f.active()){f.update(u,d,r);continue}else f.cancel();if(!u||!u.duration){t[c]=d;continue}o[c]=f=new Jl(u,t,c,d),s.push(f)}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 Pt.add(this._chart,i),!0}}function Ql(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 tc(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 Ks(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 ec(n,t,e){if(e===!1)return!1;const i=Ks(n,e),s=Ks(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function nc(n){let t,e,i,s;return $(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 Gs(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 Zs(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],Z(c)&&(o||t===0||xt(t)===xt(c))&&(t+=c)}return t}}function ic(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 Js(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function sc(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function oc(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 ac(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Qs(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 to(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,d=sc(o,a,i),f=t.length;let u;for(let p=0;p<f;++p){const g=t[p],{[l]:m,[c]:b}=g,y=g._stacks||(g._stacks={});u=y[c]=ac(s,d,m),u[r]=b,u._top=Qs(u,a,!0,i.type),u._bottom=Qs(u,a,!1,i.type);const _=u._visualValues||(u._visualValues={});_[r]=b}}function pi(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function rc(n,t){return $t(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function lc(n,t,e){return $t(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Be(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 gi=n=>n==="reset"||n==="none",eo=(n,t)=>t?n:Object.assign({},n),cc=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Gs(e,!0),values:null};class _t{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=Js(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&&Be(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(f,u,p,g)=>f==="x"?u:f==="r"?g:p,o=e.xAxisID=N(i.xAxisID,pi(t,"x")),a=e.yAxisID=N(i.yAxisID,pi(t,"y")),r=e.rAxisID=N(i.rAxisID,pi(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),d=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(d)}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&&ps(this._data,this),t._stacked&&Be(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if($(e))this._data=ic(e);else if(i!==e){if(i){ps(i,this);const s=this._cachedMeta;Be(s),s._parsed=[]}e&&Object.isExtensible(e)&&qr(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=Js(e.vScale,e),e.stack!==i.stack&&(s=!0,Be(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&to(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],d,f,u;if(this._parsing===!1)i._parsed=s,i._sorted=!0,u=s;else{X(s[t])?u=this.parseArrayData(i,s,t,e):$(s[t])?u=this.parseObjectData(i,s,t,e):u=this.parsePrimitiveData(i,s,t,e);const p=()=>f[r]===null||c&&f[r]<c[r];for(d=0;d<e;++d)i._parsed[d+t]=f=u[d],l&&(p()&&(l=!1),c=f);i._sorted=l}a&&to(this,u)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),d=o===a,f=new Array(s);let u,p,g;for(u=0,p=s;u<p;++u)g=u+i,f[u]={[r]:d||o.parse(c[g],g),[l]:a.parse(e[g],g)};return f}parseArrayData(t,e,i,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,d,f;for(l=0,c=s;l<c;++l)d=l+i,f=e[d],r[l]={x:o.parse(f[0],d),y:a.parse(f[1],d)};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 d,f,u,p;for(d=0,f=s;d<f;++d)u=d+i,p=e[u],c[d]={x:o.parse(Vt(p,r),u),y:a.parse(Vt(p,l),u)};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:Gs(s,!0),values:e._stacks[t.axis]._visualValues};return Zs(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=Zs(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=cc(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=oc(r);let u,p;function g(){p=s[u];const m=p[r.axis];return!Z(p[t.axis])||d>m||f<m}for(u=0;u<a&&!(!g()&&(this.updateRangeFromParsed(c,t,p,l),o));++u);if(o){for(u=a-1;u>=0;--u)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],Z(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=nc(N(this.options.clip,ec(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 d;for(i.dataset&&i.dataset.draw(t,o,r,l),d=r;d<r+l;++d){const f=s[d];f.hidden||(f.active&&c?a.push(f):f.draw(t,o))}for(d=0;d<a.length;++d)a[d].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=lc(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=rc(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&&Se(i);if(r)return eo(r,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),f=s?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),d),p=Object.keys(J.elements[t]),g=()=>this.getContext(i,s,e),m=c.resolveNamedOptions(u,p,g,f);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(eo(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 d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,e),u=d.getOptionScopes(this.getDataset(),f);l=d.createResolver(u,this.getContext(t,i,e))}const c=new qs(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||gi(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){gi(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!gi(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&&Be(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])}}P(_t,"defaults",{}),P(_t,"datasetElementType",null),P(_t,"dataElementType",null);function dc(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=gs(i.sort((s,o)=>s-o))}return n._cache.$bar}function hc(n){const t=n.iScale,e=dc(t,n.type);let i=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(Se(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 fc(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 uc(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 pc(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 no(n,t,e,i){return X(n)?pc(n,t,e,i):t[e.axis]=e.parse(n,i),t}function io(n,t,e,i){const s=n.iScale,o=n.vScale,a=s.getLabels(),r=s===o,l=[];let c,d,f,u;for(c=e,d=e+i;c<d;++c)u=t[c],f={},f[s.axis]=r||s.parse(a[c],c),l.push(no(u,f,o,c));return l}function mi(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function gc(n,t,e){return n!==0?xt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function mc(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 bc(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:d}=mc(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=d:(o[so(d,a,r,l)]=!0,s=c)),o[so(s,a,r,l)]=!0,n.borderSkipped=o}function so(n,t,e,i){return i?(n=yc(n,t,e),n=oo(n,e,t)):n=oo(n,t,e),n}function yc(n,t,e){return n===t?e:n===e?t:n}function oo(n,t,e){return n==="start"?t:n==="end"?e:n}function _c(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class bn extends _t{parsePrimitiveData(t,e,i,s){return io(t,e,i,s)}parseArrayData(t,e,i,s){return io(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,d=a.axis==="x"?r:l,f=[];let u,p,g,m;for(u=i,p=i+s;u<p;++u)m=e[u],g={},g[o.axis]=o.parse(Vt(m,c),u),f.push(no(Vt(m,d),g,a,u));return f}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=mi(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(),d=this._getRuler(),{sharedOptions:f,includeOptions:u}=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,d),y=(g._stacks||{})[r.axis],_={horizontal:c,base:m.base,enableBorderRadius:!y||mi(g._custom)||a===y._top||a===y._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};u&&(_.options=f||this.resolveDataElementOptions(p,t[p].active?"active":s));const k=_.options||t[p].options;bc(_,k,y,a),_c(_,k,d.ratio),this.updateElement(t[p],p,_,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),d=c&&c[l.vScale.axis];if(I(d)||isNaN(d))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||hc(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,d=mi(c);let f=l[e.axis],u=0,p=i?this.applyStack(e,l,i):f,g,m;p!==f&&(u=p-f,p=f),d&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&xt(f)!==xt(c.barEnd)&&(u=0),u+=f);const b=!I(o)&&!d?o:u;let y=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(u+p):g=y,m=g-y,Math.abs(m)<a){m=gc(m,e,r)*a,f===r&&(y-=m/2);const _=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),w=Math.min(_,k),x=Math.max(_,k);y=Math.max(Math.min(y,x),w),g=y+m,i&&!d&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(y))}if(y===e.getPixelForValue(r)){const _=xt(m)*e.getLineWidthForValue(r)/2;y+=_,m-=_}return{size:m,base:y,head:g,center:g+m/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,a=N(s.maxBarThickness,1/0);let r,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,d=s.barThickness==="flex"?uc(t,e,s,c):fc(t,e,s,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=d.start+d.chunk*f+d.chunk/2,l=Math.min(a,d.chunk*d.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)}}P(bn,"id","bar"),P(bn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(bn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class yn extends _t{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=N(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=N(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),d=a.axis,f=r.axis;for(let u=e;u<e+i;u++){const p=t[u],g=!o&&this.getParsed(u),m={},b=m[d]=o?a.getPixelForDecimal(.5):a.getPixelForValue(g[d]),y=m[f]=o?r.getBasePixel():r.getPixelForValue(g[f]);m.skip=isNaN(b)||isNaN(y),c&&(m.options=l||this.resolveDataElementOptions(u,p.active?"active":s),o&&(m.options.radius=0)),this.updateElement(p,u,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+=N(i&&i._custom,o),s}}P(yn,"id","bubble"),P(yn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(yn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function xc(n,t,e){let i=1,s=1,o=0,a=0;if(t<K){const r=n,l=r+t,c=Math.cos(r),d=Math.sin(r),f=Math.cos(l),u=Math.sin(l),p=(k,w,x)=>Ce(k,r,l,!0)?1:Math.max(w,w*e,x,x*e),g=(k,w,x)=>Ce(k,r,l,!0)?-1:Math.min(w,w*e,x,x*e),m=p(0,c,f),b=p(tt,d,u),y=g(q,c,f),_=g(q+tt,d,u);i=(m-y)/2,s=(b-_)/2,o=-(m+y)/2,a=-(b+_)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class te extends _t{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($(i[t])){const{key:l="value"}=this._parsing;o=c=>+Vt(i[c],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return yt(this.options.rotation-90)}_getCircumference(){return yt(this.options.circumference)}_getRotationExtents(){let t=K,e=-K;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(Lr(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:u,ratioY:p,offsetX:g,offsetY:m}=xc(f,d,l),b=(i.width-a)/u,y=(i.height-a)/p,_=Math.max(Math.min(b,y)/2,0),k=ss(this.options.radius,_),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/K)}updateElements(t,e,i,s){const o=s==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,d=(r.left+r.right)/2,f=(r.top+r.bottom)/2,u=o&&c.animateScale,p=u?0:this.innerRadius,g=u?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(e,s);let y=this._getRotation(),_;for(_=0;_<e;++_)y+=this._circumference(_,o);for(_=e;_<e+i;++_){const k=this._circumference(_,o),w=t[_],x={x:d+this.offsetX,y:f+this.offsetY,startAngle:y,endAngle:y+k,circumference:k,outerRadius:g,innerRadius:p};b&&(x.options=m||this.resolveDataElementOptions(_,w.active?"active":s)),y+=k,this.updateElement(w,_,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)?K*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Ee(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(N(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(te,"id","doughnut"),P(te,"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"}),P(te,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(te,"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()}}}});class _n extends _t{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}=ys(e,s,a);this._drawStart=r,this._drawCount=l,_s(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:d,includeOptions:f}=this._getSharedOptions(e,s),u=a.axis,p=r.axis,{spanGaps:g,segment:m}=this.options,b=ce(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||s==="none",_=e+i,k=t.length;let w=e>0&&this.getParsed(e-1);for(let x=0;x<k;++x){const C=t[x],M=y?C:{};if(x<e||x>=_){M.skip=!0;continue}const D=this.getParsed(x),L=I(D[p]),T=M[u]=a.getPixelForValue(D[u],x),A=M[p]=o||L?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,D,l):D[p],x);M.skip=isNaN(T)||isNaN(A)||L,M.stop=x>0&&Math.abs(D[u]-w[u])>b,m&&(M.parsed=D,M.raw=c.data[x]),f&&(M.options=d||this.resolveDataElementOptions(x,C.active?"active":s)),y||this.updateElement(C,x,M,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()}}P(_n,"id","line"),P(_n,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(_n,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Te extends _t{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=Ee(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return Ls.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,d=c.xCenter,f=c.yCenter,u=c.getIndexAngle(0)-.5*q;let p=u,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 y=p,_=p+this._computeAngle(g,s,m),k=a.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=_,o&&(l.animateScale&&(k=0),l.animateRotate&&(y=_=u));const w={x:d,y:f,innerRadius:0,outerRadius:k,startAngle:y,endAngle:_,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)?yt(this.resolveDataElementOptions(t,e).angle||i):0}}P(Te,"id","polarArea"),P(Te,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(Te,"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}}});class bi extends te{}P(bi,"id","pie"),P(bi,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class xn extends _t{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 Ls.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),d=o.getPointPositionForValue(r,this.getParsed(r).r),f=a?o.xCenter:d.x,u=a?o.yCenter:d.y,p={x:f,y:u,angle:d.angle,skip:isNaN(f)||isNaN(u),options:c};this.updateElement(l,r,p,s)}}}P(xn,"id","radar"),P(xn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(xn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class kn extends _t{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}=ys(e,i,s);if(this._drawStart=o,this._drawCount=a,_s(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,d=this.resolveDataElementOptions(e,s),f=this.getSharedOptions(d),u=this.includeOptions(s,f),p=a.axis,g=r.axis,{spanGaps:m,segment:b}=this.options,y=ce(m)?m:Number.POSITIVE_INFINITY,_=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),M=_?x:{},D=I(C[g]),L=M[p]=a.getPixelForValue(C[p],w),T=M[g]=o||D?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,C,l):C[g],w);M.skip=isNaN(L)||isNaN(T)||D,M.stop=w>0&&Math.abs(C[p]-k[p])>y,b&&(M.parsed=C,M.raw=c.data[w]),u&&(M.options=f||this.resolveDataElementOptions(w,x.active?"active":s)),_||this.updateElement(x,w,M,s),k=C}this.updateSharedOptions(f,s,d)}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}}P(kn,"id","scatter"),P(kn,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(kn,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var kc=Object.freeze({__proto__:null,BarController:bn,BubbleController:yn,DoughnutController:te,LineController:_n,PieController:bi,PolarAreaController:Te,RadarController:xn,ScatterController:kn});function ee(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class yi{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(yi.prototype,t)}init(){}formats(){return ee()}parse(){return ee()}format(){return ee()}add(){return ee()}diff(){return ee()}startOf(){return ee()}endOf(){return ee()}}var wc={_date:yi};function vc(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?Ur:Dt;if(i){if(s._sharedOptions){const c=o[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=l(o,t,e-d),u=l(o,t,e+d);return{lo:f.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Le(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:d}=o[r],{lo:f,hi:u}=vc(o[r],t,a,s);for(let p=f;p<=u;++p){const g=d[p];g.skip||i(g,c,p)}}}function Sc(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 _i(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||Le(n,e,t,function(r,l,c){!s&&!Et(r,n.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function Mc(n,t,e,i){let s=[];function o(a,r,l){const{startAngle:c,endAngle:d}=a.getProps(["startAngle","endAngle"],i),{angle:f}=fs(a,{x:t.x,y:t.y});Ce(f,c,d)&&s.push({element:a,datasetIndex:r,index:l})}return Le(n,e,t,o),s}function Cc(n,t,e,i,s,o){let a=[];const r=Sc(e);let l=Number.POSITIVE_INFINITY;function c(d,f,u){const p=d.inRange(t.x,t.y,s);if(i&&!p)return;const g=d.getCenterPoint(s);if(!(!!o||n.isPointInArea(g))&&!p)return;const b=r(t,g);b<l?(a=[{element:d,datasetIndex:f,index:u}],l=b):b===l&&a.push({element:d,datasetIndex:f,index:u})}return Le(n,e,t,c),a}function xi(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?Mc(n,t,e,s):Cc(n,t,e,i,s,o)}function ao(n,t,e,i,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return Le(n,e,t,(l,c,d)=>{l[a](t[e],s)&&(o.push({element:l,datasetIndex:c,index:d}),r=r||l.inRange(t.x,t.y,s))}),i&&!r?[]:o}var Dc={evaluateInteractionItems:Le,modes:{index(n,t,e,i){const s=Jt(t,n),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?_i(n,s,o,i,a):xi(n,s,o,!1,i,a),l=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const d=r[0].index,f=c.data[d];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:d})}),l):[]},dataset(n,t,e,i){const s=Jt(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?_i(n,s,o,i,a):xi(n,s,o,!1,i,a);if(r.length>0){const l=r[0].datasetIndex,c=n.getDatasetMeta(l).data;r=[];for(let d=0;d<c.length;++d)r.push({element:c[d],datasetIndex:l,index:d})}return r},point(n,t,e,i){const s=Jt(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return _i(n,s,o,i,a)},nearest(n,t,e,i){const s=Jt(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return xi(n,s,o,e.intersect,i,a)},x(n,t,e,i){const s=Jt(t,n);return ao(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=Jt(t,n);return ao(n,s,"y",e.intersect,i)}}};const ro=["left","top","right","bottom"];function Fe(n,t){return n.filter(e=>e.pos===t)}function lo(n,t){return n.filter(e=>ro.indexOf(e.pos)===-1&&e.box.axis===t)}function Ve(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 Ec(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 Pc(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!ro.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 Oc(n,t){const e=Pc(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],d=c&&r.stackWeight/c.weight;r.horizontal?(r.width=d?d*i:l&&t.availableWidth,r.height=s):(r.width=i,r.height=d?d*s:l&&t.availableHeight)}return e}function Ac(n){const t=Ec(n),e=Ve(t.filter(c=>c.box.fullSize),!0),i=Ve(Fe(t,"left"),!0),s=Ve(Fe(t,"right")),o=Ve(Fe(t,"top"),!0),a=Ve(Fe(t,"bottom")),r=lo(t,"x"),l=lo(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Fe(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function co(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function ho(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 Bc(n,t,e,i){const{pos:s,box:o}=e,a=n.maxPadding;if(!$(s)){e.size&&(n[s]-=e.size);const f=i[e.stack]||{size:0,count:1};f.size=Math.max(f.size,e.horizontal?o.height:o.width),e.size=f.size/f.count,n[s]+=e.size}o.getPadding&&ho(a,o.getPadding());const r=Math.max(0,t.outerWidth-co(a,n,"left","right")),l=Math.max(0,t.outerHeight-co(a,n,"top","bottom")),c=r!==n.w,d=l!==n.h;return n.w=r,n.h=l,e.horizontal?{same:c,other:d}:{same:d,other:c}}function Tc(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 Lc(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 Re(n,t,e,i){const s=[];let o,a,r,l,c,d;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,Lc(r.horizontal,t));const{same:f,other:u}=Bc(t,e,r,i);c|=f&&s.length,d=d||u,l.fullSize||s.push(r)}return c&&Re(s,t,e,i)||d}function wn(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 fo(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},d=r.stackWeight/c.weight||1;if(r.horizontal){const f=t.w*d,u=c.size||l.height;Se(c.start)&&(a=c.start),l.fullSize?wn(l,s.left,a,e.outerWidth-s.right-s.left,u):wn(l,t.left+c.placed,a,f,u),c.start=a,c.placed+=f,a=l.bottom}else{const f=t.h*d,u=c.size||l.width;Se(c.start)&&(o=c.start),l.fullSize?wn(l,o,s.top,u,e.outerHeight-s.bottom-s.top):wn(l,o,t.top+c.placed,u,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=a}var rt={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=at(n.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=Ac(n.boxes),l=r.vertical,c=r.horizontal;H(n.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const d=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),u=Object.assign({},s);ho(u,at(i));const p=Object.assign({maxPadding:u,w:o,h:a,x:s.left,y:s.top},s),g=Oc(l.concat(c),f);Re(r.fullSize,p,f,g),Re(l,p,f,g),Re(c,p,f,g)&&Re(l,p,f,g),Tc(p),fo(r.leftAndTop,p,f,g),p.x+=p.w,p.y+=p.h,fo(r.rightAndBottom,p,f,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},H(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 uo{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 Fc extends uo{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const vn="$chartjs",Vc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},po=n=>n===null||n==="";function Rc(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[vn]={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",po(s)){const o=Ns(n,"width");o!==void 0&&(n.width=o)}if(po(i))if(n.style.height==="")n.height=n.width/(t||2);else{const o=Ns(n,"height");o!==void 0&&(n.height=o)}return n}const go=$l?{passive:!0}:!1;function Nc(n,t,e){n.addEventListener(t,e,go)}function $c(n,t,e){n.canvas.removeEventListener(t,e,go)}function Ic(n,t){const e=Vc[n.type]||n.type,{x:i,y:s}=Jt(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Sn(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function zc(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Sn(r.addedNodes,i),a=a&&!Sn(r.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Wc(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Sn(r.removedNodes,i),a=a&&!Sn(r.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ne=new Map;let mo=0;function bo(){const n=window.devicePixelRatio;n!==mo&&(mo=n,Ne.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Hc(n,t){Ne.size||window.addEventListener("resize",bo),Ne.set(n,t)}function jc(n){Ne.delete(n),Ne.size||window.removeEventListener("resize",bo)}function Yc(n,t,e){const i=n.canvas,s=i&&ui(i);if(!s)return;const o=bs((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,d=l.contentRect.height;c===0&&d===0||o(c,d)});return a.observe(s),Hc(n,o),a}function ki(n,t,e){e&&e.disconnect(),t==="resize"&&jc(n)}function Uc(n,t,e){const i=n.canvas,s=bs(o=>{n.ctx!==null&&e(Ic(o,n))},n);return Nc(i,t,s),s}class Xc extends uo{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Rc(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[vn])return!1;const i=e[vn].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[vn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:zc,detach:Wc,resize:Yc}[e]||Uc;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:ki,detach:ki,resize:ki}[e]||$c)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Nl(t,e,i,s)}isAttached(t){const e=ui(t);return!!(e&&e.isConnected)}}function qc(n){return!Vs()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Fc:Xc}let Ot=(Yn=class{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ce(this.x)&&ce(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}},P(Yn,"defaults",{}),P(Yn,"defaultRoutes"),Yn);function Kc(n,t){const e=n.options.ticks,i=Gc(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Jc(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return Qc(t,c,o,a/s),c;const d=Zc(o,t,s);if(a>0){let f,u;const p=a>1?Math.round((l-r)/(a-1)):null;for(Mn(t,c,d,I(p)?0:r-p,r),f=0,u=a-1;f<u;f++)Mn(t,c,d,o[f],o[f+1]);return Mn(t,c,d,l,I(p)?t.length:l+p),c}return Mn(t,c,d),c}function Gc(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 Zc(n,t,e){const i=td(n),s=t.length/e;if(!i)return Math.max(s,1);const o=Wr(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 Jc(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Qc(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 Mn(n,t,e,i,s){const o=N(i,0),a=Math.min(N(s,n.length),n.length);let r=0,l,c,d;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),d=o;d<0;)r++,d=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===d&&(t.push(n[c]),r++,d=Math.round(o+r*e))}function td(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 ed=n=>n==="left"?"right":n==="right"?"left":n,yo=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,_o=(n,t)=>Math.min(t||n,n);function xo(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 nd(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 id(n,t){H(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 $e(n){return n.drawTicks?n.tickLength:0}function ko(n,t){if(!n.display)return 0;const e=et(n.font,t),i=at(n.padding);return(X(n.text)?n.text.length:1)*e.lineHeight+i.height}function sd(n,t){return $t(n,{scale:t,type:"scale"})}function od(n,t,e){return $t(n,{tick:e,index:t,type:"tick"})}function ad(n,t,e){let i=ii(n);return(e&&t!=="right"||!e&&t==="right")&&(i=ed(i)),i}function rd(n,t,e,i){const{top:s,left:o,bottom:a,right:r,chart:l}=n,{chartArea:c,scales:d}=l;let f=0,u,p,g;const m=a-s,b=r-o;if(n.isHorizontal()){if(p=ot(i,o,r),$(e)){const y=Object.keys(e)[0],_=e[y];g=d[y].getPixelForValue(_)+m-t}else e==="center"?g=(c.bottom+c.top)/2+m-t:g=yo(n,e,t);u=r-o}else{if($(e)){const y=Object.keys(e)[0],_=e[y];p=d[y].getPixelForValue(_)-b+t}else e==="center"?p=(c.left+c.right)/2-b+t:p=yo(n,e,t);g=ot(i,a,s),f=e==="left"?-tt:tt}return{titleX:p,titleY:g,maxWidth:u,rotation:f}}class ne extends Ot{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=ht(t,Number.POSITIVE_INFINITY),e=ht(e,Number.NEGATIVE_INFINITY),i=ht(i,Number.POSITIVE_INFINITY),s=ht(s,Number.NEGATIVE_INFINITY),{min:ht(t,i),max:ht(e,s),minDefined:Z(t),maxDefined:Z(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:ht(e,ht(i,e)),max:ht(i,ht(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Y(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero: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=ml(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?xo(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Kc(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Y(this.options.afterUpdate,[this])}beforeSetDimensions(){Y(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Y(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Y(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Y(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=Y(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){Y(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Y(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=_o(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 d=this._getLabelSizes(),f=d.widest.width,u=d.highest.height,p=nt(this.chart.width-f,0,this.maxWidth);r=t.offset?this.maxWidth/i:p/(i-1),f+6>r&&(r=p/(i-(t.offset?.5:1)),l=this.maxHeight-$e(t.grid)-e.padding-ko(t.title,this.chart.options.font),c=Math.sqrt(f*f+u*u),a=ti(Math.min(Math.asin(nt((d.highest.height+6)/r,-1,1)),Math.asin(nt(l/c,-1,1))-Math.asin(nt(u/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){Y(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Y(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=ko(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=$e(o)+l):(t.height=this.maxHeight,t.width=$e(o)+l),i.display&&this.ticks.length){const{first:c,last:d,widest:f,highest:u}=this._getLabelSizes(),p=i.padding*2,g=yt(this.labelRotation),m=Math.cos(g),b=Math.sin(g);if(r){const y=i.mirror?0:b*f.width+m*u.height;t.height=Math.min(this.maxHeight,t.height+y+p)}else{const y=i.mirror?0:m*f.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+y+p)}this._calculatePadding(c,d,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 d=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,p=0;l?c?(u=s*t.width,p=i*e.height):(u=i*t.height,p=s*e.width):o==="start"?p=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,p=e.width/2),this.paddingLeft=Math.max((u-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((p-f+a)*this.width/(this.width-f),0)}else{let d=e.height/2,f=t.height/2;o==="start"?(d=0,f=t.height):o==="end"&&(d=e.height,f=0),this.paddingTop=d+a,this.paddingBottom=f+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(){Y(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)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=xo(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/_o(e,i));let c=0,d=0,f,u,p,g,m,b,y,_,k,w,x;for(f=0;f<e;f+=l){if(g=t[f].label,m=this._resolveTickFontOptions(f),s.font=b=m.string,y=o[b]=o[b]||{data:{},gc:[]},_=m.lineHeight,k=w=0,!I(g)&&!X(g))k=dn(s,y.data,y.gc,k,g),w=_;else if(X(g))for(u=0,p=g.length;u<p;++u)x=g[u],!I(x)&&!X(x)&&(k=dn(s,y.data,y.gc,k,x),w+=_);a.push(k),r.push(w),c=Math.max(k,c),d=Math.max(w,d)}id(o,e);const C=a.indexOf(c),M=r.indexOf(d),D=L=>({width:a[L]||0,height:r[L]||0});return{first:D(0),last:D(e-1),widest:D(C),highest:D(M),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 Yr(this._alignToPixels?qt(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=od(this.getContext(),t,i))}return this.$context||(this.$context=sd(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=yt(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(),f=this.ticks.length+(l?1:0),u=$e(o),p=[],g=r.setContext(this.getContext()),m=g.display?g.width:0,b=m/2,y=function(v){return qt(i,v,m)};let _,k,w,x,C,M,D,L,T,A,V,U;if(a==="top")_=y(this.bottom),M=this.bottom-u,L=_-b,A=y(t.top)+b,U=t.bottom;else if(a==="bottom")_=y(this.top),A=t.top,U=y(t.bottom)-b,M=_+b,L=this.top+u;else if(a==="left")_=y(this.right),C=this.right-u,D=_-b,T=y(t.left)+b,V=t.right;else if(a==="right")_=y(this.left),T=t.left,V=y(t.right)-b,C=_+b,D=this.left+u;else if(e==="x"){if(a==="center")_=y((t.top+t.bottom)/2+.5);else if($(a)){const v=Object.keys(a)[0],E=a[v];_=y(this.chart.scales[v].getPixelForValue(E))}A=t.top,U=t.bottom,M=_+b,L=M+u}else if(e==="y"){if(a==="center")_=y((t.left+t.right)/2);else if($(a)){const v=Object.keys(a)[0],E=a[v];_=y(this.chart.scales[v].getPixelForValue(E))}C=_-b,D=C-u,T=t.left,V=t.right}const B=N(s.ticks.maxTicksLimit,f),S=Math.max(1,Math.ceil(f/B));for(k=0;k<f;k+=S){const v=this.getContext(k),E=o.setContext(v),O=r.setContext(v),F=E.lineWidth,R=E.color,W=O.dash||[],j=O.dashOffset,G=E.tickWidth,Q=E.tickColor,it=E.tickBorderDash||[],bt=E.tickBorderDashOffset;w=nd(this,k,l),w!==void 0&&(x=qt(i,w,F),c?C=D=T=V=x:M=L=A=U=x,p.push({tx1:C,ty1:M,tx2:D,ty2:L,x1:T,y1:A,x2:V,y2:U,width:F,color:R,borderDash:W,borderDashOffset:j,tickWidth:G,tickColor:Q,tickBorderDash:it,tickBorderDashOffset:bt}))}return this._ticksLength=f,this._borderValue=_,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:d,mirror:f}=o,u=$e(i.grid),p=u+d,g=f?-d:p,m=-yt(this.labelRotation),b=[];let y,_,k,w,x,C,M,D,L,T,A,V,U="middle";if(s==="top")C=this.bottom-g,M=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+g,M=this._getXAxisLabelAlignment();else if(s==="left"){const S=this._getYAxisLabelAlignment(u);M=S.textAlign,x=S.x}else if(s==="right"){const S=this._getYAxisLabelAlignment(u);M=S.textAlign,x=S.x}else if(e==="x"){if(s==="center")C=(t.top+t.bottom)/2+p;else if($(s)){const S=Object.keys(s)[0],v=s[S];C=this.chart.scales[S].getPixelForValue(v)+p}M=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")x=(t.left+t.right)/2-p;else if($(s)){const S=Object.keys(s)[0],v=s[S];x=this.chart.scales[S].getPixelForValue(v)}M=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?U="top":l==="end"&&(U="bottom"));const B=this._getLabelSizes();for(y=0,_=r.length;y<_;++y){k=r[y],w=k.label;const S=o.setContext(this.getContext(y));D=this.getPixelForTick(y)+o.labelOffset,L=this._resolveTickFontOptions(y),T=L.lineHeight,A=X(w)?w.length:1;const v=A/2,E=S.color,O=S.textStrokeColor,F=S.textStrokeWidth;let R=M;a?(x=D,M==="inner"&&(y===_-1?R=this.options.reverse?"left":"right":y===0?R=this.options.reverse?"right":"left":R="center"),s==="top"?c==="near"||m!==0?V=-A*T+T/2:c==="center"?V=-B.highest.height/2-v*T+T:V=-B.highest.height+T/2:c==="near"||m!==0?V=T/2:c==="center"?V=B.highest.height/2-v*T:V=B.highest.height-A*T,f&&(V*=-1),m!==0&&!S.showLabelBackdrop&&(x+=T/2*Math.sin(m))):(C=D,V=(1-A)*T/2);let W;if(S.showLabelBackdrop){const j=at(S.backdropPadding),G=B.heights[y],Q=B.widths[y];let it=V-j.top,bt=0-j.left;switch(U){case"middle":it-=G/2;break;case"bottom":it-=G;break}switch(M){case"center":bt-=Q/2;break;case"right":bt-=Q;break}W={left:bt,top:it,width:Q+j.width,height:G+j.height,color:S.backdropColor}}b.push({label:w,font:L,textOffset:V,options:{rotation:m,color:E,strokeColor:O,strokeWidth:F,textAlign:R,textBaseline:U,translation:[x,C],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-yt(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,d;return e==="left"?s?(d=this.right+o,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-r,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d=this.left)):e==="right"?s?(d=this.left+o,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+r,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_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,d)=>{!d.width||!d.color||(i.save(),i.lineWidth=d.width,i.strokeStyle=d.color,i.setLineDash(d.borderDash||[]),i.lineDashOffset=d.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,d,f,u;this.isHorizontal()?(c=qt(t,this.left,a)-a/2,d=qt(t,this.right,r)+r/2,f=u=l):(f=qt(t,this.top,a)-a/2,u=qt(t,this.bottom,r)+r/2,c=d=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,f),e.lineTo(d,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&hn(i,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,d=a.textOffset;Kt(i,c,0,d,l,r)}s&&fn(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=et(i.font),a=at(i.padding),r=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||$(e)?(l+=a.bottom,X(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:d,maxWidth:f,rotation:u}=rd(this,l,e,r);Kt(t,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:u,textAlign:ad(r,e,s),textBaseline:"middle",translation:[c,d]})}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=N(t.grid&&t.grid.z,-1),s=N(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ne.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z: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 et(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Cn{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;dd(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,ld(t,a,i),this.override&&J.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 J[s]&&(delete J[s][i],this.override&&delete Xt[i])}}function ld(n,t,e){const i=we(Object.create(null),[e?J.get(e):{},J.get(t),n.defaults]);J.set(t,i),n.defaultRoutes&&cd(t,n.defaultRoutes),n.descriptors&&J.describe(t,n.descriptors)}function cd(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(".");J.route(o,s,l,r)})}function dd(n){return"id"in n&&"defaults"in n}class hd{constructor(){this.controllers=new Cn(_t,"datasets",!0),this.elements=new Cn(Ot,"elements"),this.plugins=new Cn(Object,"plugins"),this.scales=new Cn(ne,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):H(s,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,i){const s=Qn(t);Y(i["before"+s],[],i),e[t](i),Y(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 kt=new hd;class fd{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(Y(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=N(i.options&&i.options.plugins,{}),o=ud(i);return s===!1&&!e?[]:gd(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 ud(n){const t={},e=[],i=Object.keys(kt.plugins.items);for(let o=0;o<i.length;o++)e.push(kt.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 pd(n,t){return!t&&n===!1?null:n===!0?{}:n}function gd(n,{plugins:t,localIds:e},i,s){const o=[],a=n.getContext();for(const r of t){const l=r.id,c=pd(i[l],s);c!==null&&o.push({plugin:r,options:md(n.config,{plugin:r,local:e[l]},c,a)})}return o}function md(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 wi(n,t){const e=J.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function bd(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function yd(n,t){return n===t?"_index_":"_value_"}function wo(n){if(n==="x"||n==="y"||n==="r")return n}function _d(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function vi(n,...t){if(wo(n))return n;for(const e of t){const i=e.axis||_d(e.position)||n.length>1&&wo(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function vo(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function xd(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 vo(n,"x",e[0])||vo(n,"y",e[0])}return{}}function kd(n,t){const e=Xt[n.type]||{scales:{}},i=t.scales||{},s=wi(n.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const r=i[a];if(!$(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=vi(a,r,xd(a,n),J.scales[r.type]),c=yd(l,s),d=e.scales||{};o[a]=ve(Object.create(null),[{axis:l},r,d[l],d[c]])}),n.data.datasets.forEach(a=>{const r=a.type||n.type,l=a.indexAxis||wi(r,t),d=(Xt[r]||{}).scales||{};Object.keys(d).forEach(f=>{const u=bd(f,l),p=a[u+"AxisID"]||u;o[p]=o[p]||Object.create(null),ve(o[p],[{axis:u},i[p],d[f]])})}),Object.keys(o).forEach(a=>{const r=o[a];ve(r,[J.scales[r.type],J.scale])}),o}function So(n){const t=n.options||(n.options={});t.plugins=N(t.plugins,{}),t.scales=kd(n,t)}function Mo(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function wd(n){return n=n||{},n.data=Mo(n.data),So(n),n}const Co=new Map,Do=new Set;function Dn(n,t){let e=Co.get(n);return e||(e=t(),Co.set(n,e),Do.add(e)),e}const Ie=(n,t,e)=>{const i=Vt(t,e);i!==void 0&&n.add(i)};class vd{constructor(t){this._config=wd(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=Mo(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(),So(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Dn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Dn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Dn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Dn(`${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(d=>{t&&(l.add(t),d.forEach(f=>Ie(l,t,f))),d.forEach(f=>Ie(l,s,f)),d.forEach(f=>Ie(l,Xt[o]||{},f)),d.forEach(f=>Ie(l,J,f)),d.forEach(f=>Ie(l,ai,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Do.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Xt[e]||{},J.datasets[e]||{},{type:e},J,ai]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Eo(this._resolverCache,t,s);let l=a;if(Md(a,e)){o.$shared=!1,i=Rt(i)?i():i;const c=this.createResolver(t,i,r);l=de(a,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Eo(this._resolverCache,t,i);return $(e)?de(o,e,void 0,s):o}}function Eo(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:di(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,o)),o}const Sd=n=>$(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||Rt(n[e]),!1);function Md(n,t){const{isScriptable:e,isIndexable:i}=Es(n);for(const s of t){const o=e(s),a=i(s),r=(a||o)&&n[s];if(o&&(Rt(r)||Sd(r))||a&&X(r))return!0}return!1}var Cd="4.4.0";const Dd=["top","bottom","left","right","chartArea"];function Po(n,t){return n==="top"||n==="bottom"||Dd.indexOf(n)===-1&&t==="x"}function Oo(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Ao(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Y(e&&e.onComplete,[n],t)}function Ed(n){const t=n.chart,e=t.options.animation;Y(e&&e.onProgress,[n],t)}function Bo(n){return Vs()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const En={},To=n=>{const t=Bo(n);return Object.values(En).filter(e=>e.canvas===t).pop()};function Pd(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 Od(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Pn(n,t,e){return n.options.clip?n[e]:t[e]}function Ad(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Pn(e,t,"left"),right:Pn(e,t,"right"),top:Pn(i,t,"top"),bottom:Pn(i,t,"bottom")}:t}class At{static register(...t){kt.add(...t),Lo()}static unregister(...t){kt.remove(...t),Lo()}constructor(t,e){const i=this.config=new vd(e),s=Bo(t),o=To(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||qc(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,d=l&&l.width;if(this.id=Tr(),this.ctx=r,this.canvas=l,this.width=d,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 fd,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Kr(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],En[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Pt.listen(this,"complete",Ao),Pt.listen(this,"progress",Ed),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 kt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Rs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ms(this.canvas,this.ctx),this}stop(){return Pt.stop(this),this}resize(t,e){Pt.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,Rs(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),Y(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};H(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=vi(a,r),c=l==="r",d=l==="x";return{options:r,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),H(o,a=>{const r=a.options,l=r.id,c=vi(l,r),d=N(r.type,a.dtype);(r.position===void 0||Po(r.position,c)!==Po(a.dposition))&&(r.position=a.dposition),s[l]=!0;let f=null;if(l in i&&i[l].type===d)f=i[l];else{const u=kt.getScale(d);f=new u({id:l,type:d,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(r,t)}),H(s,(a,r)=>{a||delete i[r]}),H(i,a=>{rt.configure(this,a,a.options),rt.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(Oo("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||wi(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=kt.getController(r),{datasetElementType:c,dataElementType:d}=J.datasets[r];Object.assign(l,{dataElementType:kt.getElement(d),datasetElementType:c&&kt.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){H(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,d=this.data.datasets.length;c<d;c++){const{controller:f}=this.getDatasetMeta(c),u=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(u),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||H(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Oo("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){H(this.scales,t=>{rt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!rs(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;Pd(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(!rs(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;rt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],H(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,Rt(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&&(Pt.has(this)?this.attached&&!Pt.running(this)&&Pt.start(this):(this.draw(),Ao({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=Ad(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&hn(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&&fn(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Et(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=Dc.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=$t(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);Se(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(),Pt.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(),Ms(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete En[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)};H(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(){H(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},H(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}});!on(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(d=>!c.some(f=>d.datasetIndex===f.datasetIndex&&d.index===f.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=$r(t),c=Od(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Y(o.onHover,[t,r,this],this),l&&Y(o.onClick,[t,r,this],this));const d=!on(r,s);return(d||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,d}_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)}}P(At,"defaults",J),P(At,"instances",En),P(At,"overrides",Xt),P(At,"registry",kt),P(At,"version",Cd),P(At,"getChart",To);function Lo(){return H(At.instances,n=>n._plugins.invalidate())}function Bd(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+tt,i-tt),n.closePath(),n.clip()}function Td(n){return ci(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Ld(n,t,e,i){const s=Td(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 nt(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:nt(s.innerStart,0,a),innerEnd:nt(s.innerEnd,0,a)}}function ue(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function On(n,t,e,i,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:d}=t,f=Math.max(t.outerRadius+i+e-c,0),u=d>0?d+i+e+c:0;let p=0;const g=s-l;if(i){const S=d>0?d-i:0,v=f>0?f-i:0,E=(S+v)/2,O=E!==0?g*E/(E+i):g;p=(g-O)/2}const m=Math.max(.001,g*f-e/q)/f,b=(g-m)/2,y=l+b+p,_=s-b-p,{outerStart:k,outerEnd:w,innerStart:x,innerEnd:C}=Ld(t,u,f,_-y),M=f-k,D=f-w,L=y+k/M,T=_-w/D,A=u+x,V=u+C,U=y+x/A,B=_-C/V;if(n.beginPath(),o){const S=(L+T)/2;if(n.arc(a,r,f,L,S),n.arc(a,r,f,S,T),w>0){const F=ue(D,T,a,r);n.arc(F.x,F.y,w,T,_+tt)}const v=ue(V,_,a,r);if(n.lineTo(v.x,v.y),C>0){const F=ue(V,B,a,r);n.arc(F.x,F.y,C,_+tt,B+Math.PI)}const E=(_-C/u+(y+x/u))/2;if(n.arc(a,r,u,_-C/u,E,!0),n.arc(a,r,u,E,y+x/u,!0),x>0){const F=ue(A,U,a,r);n.arc(F.x,F.y,x,U+Math.PI,y-tt)}const O=ue(M,y,a,r);if(n.lineTo(O.x,O.y),k>0){const F=ue(M,L,a,r);n.arc(F.x,F.y,k,y-tt,L)}}else{n.moveTo(a,r);const S=Math.cos(L)*f+a,v=Math.sin(L)*f+r;n.lineTo(S,v);const E=Math.cos(T)*f+a,O=Math.sin(T)*f+r;n.lineTo(E,O)}n.closePath()}function Fd(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){On(n,t,e,i,l,s);for(let c=0;c<o;++c)n.fill();isNaN(r)||(l=a+(r%K||K))}return On(n,t,e,i,l,s),n.fill(),l}function Vd(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:f,borderDashOffset:u}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(f||[]),n.lineDashOffset=u,p?(n.lineWidth=c*2,n.lineJoin=d||"round"):(n.lineWidth=c,n.lineJoin=d||"bevel");let g=t.endAngle;if(o){On(n,t,e,i,g,s);for(let m=0;m<o;++m)n.stroke();isNaN(r)||(g=a+(r%K||K))}p&&Bd(n,t,g),o||(On(n,t,e,i,g,s),n.stroke())}class ze extends Ot{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(this,"startAngle");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,e&&Object.assign(this,e)}inRange(e,i,s){const o=this.getProps(["x","y"],s),{angle:a,distance:r}=fs(o,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:f,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),p=(this.options.spacing+this.options.borderWidth)/2,m=N(u,c-l)>=K||Ce(a,l,c),b=Ct(r,d+p,f+p);return m&&b}getCenterPoint(e){const{x:i,y:s,startAngle:o,endAngle:a,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:d}=this.options,f=(o+a)/2,u=(r+l+d+c)/2;return{x:i+Math.cos(f)*u,y:s+Math.sin(f)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,o=(i.offset||0)/4,a=(i.spacing||0)/2,r=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>K?Math.floor(s/K):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(q,s||0)),d=o*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Fd(e,this,d,a,r),Vd(e,this,d,a,r),e.restore()}}P(ze,"id","arc"),P(ze,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),P(ze,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(ze,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Fo(n,t,e=t){n.lineCap=N(e.borderCapStyle,t.borderCapStyle),n.setLineDash(N(e.borderDash,t.borderDash)),n.lineDashOffset=N(e.borderDashOffset,t.borderDashOffset),n.lineJoin=N(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=N(e.borderWidth,t.borderWidth),n.strokeStyle=N(e.borderColor,t.borderColor)}function Rd(n,t,e){n.lineTo(e.x,e.y)}function Nd(n){return n.stepped?rl:n.tension||n.cubicInterpolationMode==="monotone"?ll:Rd}function Vo(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),d=s<a&&o<a||s>r&&o>r;return{count:i,start:l,loop:t.loop,ilen:c<l&&!d?i+c-l:c-l}}function $d(n,t,e,i){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=Vo(s,e,i),d=Nd(o);let{move:f=!0,reverse:u}=i||{},p,g,m;for(p=0;p<=c;++p)g=s[(r+(u?c-p:p))%a],!g.skip&&(f?(n.moveTo(g.x,g.y),f=!1):d(n,m,g,u,o.stepped),m=g);return l&&(g=s[(r+(u?c:0))%a],d(n,m,g,u,o.stepped)),!!l}function Id(n,t,e,i){const s=t.points,{count:o,start:a,ilen:r}=Vo(s,e,i),{move:l=!0,reverse:c}=i||{};let d=0,f=0,u,p,g,m,b,y;const _=w=>(a+(c?r-w:w))%o,k=()=>{m!==b&&(n.lineTo(d,b),n.lineTo(d,m),n.lineTo(d,y))};for(l&&(p=s[_(0)],n.moveTo(p.x,p.y)),u=0;u<=r;++u){if(p=s[_(u)],p.skip)continue;const w=p.x,x=p.y,C=w|0;C===g?(x<m?m=x:x>b&&(b=x),d=(f*d+w)/++f):(k(),n.lineTo(w,x),g=C,f=0,m=b=x),y=x}k()}function Si(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Id:$d}function zd(n){return n.stepped?Il:n.tension||n.cubicInterpolationMode==="monotone"?zl:Qt}function Wd(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Fo(n,t.options),n.stroke(s)}function Hd(n,t,e,i){const{segments:s,options:o}=t,a=Si(t);for(const r of s)Fo(n,o,r.style),n.beginPath(),a(n,t,r,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const jd=typeof Path2D=="function";function Yd(n,t,e,i){jd&&!t.options.segment?Wd(n,t,e,i):Hd(n,t,e,i)}class It extends Ot{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;Bl(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=Xl(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=js(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=zd(i);let c,d;for(c=0,d=a.length;c<d;++c){const{start:f,end:u}=a[c],p=o[f],g=o[u];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 Si(this)(t,this,e,i)}path(t,e,i){const s=this.segments,o=Si(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(),Yd(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(It,"id","line"),P(It,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(It,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(It,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Ro(n,t,e,i){const s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}class An extends Ot{constructor(e){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const o=this.options,{x:a,y:r}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(i-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,i){return Ro(this,e,"x",i)}inYRange(e,i){return Ro(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Et(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,li(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(An,"id","point"),P(An,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(An,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function No(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,d,f;return n.horizontal?(f=a/2,r=Math.min(e,s),l=Math.max(e,s),c=i-f,d=i+f):(f=o/2,r=e-f,l=e+f,c=Math.min(i,s),d=Math.max(i,s)),{left:r,top:c,right:l,bottom:d}}function zt(n,t,e,i){return n?0:nt(t,e,i)}function Ud(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,o=Ds(i);return{t:zt(s.top,o.top,0,e),r:zt(s.right,o.right,0,t),b:zt(s.bottom,o.bottom,0,e),l:zt(s.left,o.left,0,t)}}function Xd(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=Gt(s),a=Math.min(t,e),r=n.borderSkipped,l=i||$(s);return{topLeft:zt(!l||r.top||r.left,o.topLeft,0,a),topRight:zt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:zt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:zt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function qd(n){const t=No(n),e=t.right-t.left,i=t.bottom-t.top,s=Ud(n,e/2,i/2),o=Xd(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 Mi(n,t,e,i){const s=t===null,o=e===null,r=n&&!(s&&o)&&No(n,i);return r&&(s||Ct(t,r.left,r.right))&&(o||Ct(e,r.top,r.bottom))}function Kd(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Gd(n,t){n.rect(t.x,t.y,t.w,t.h)}function Ci(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 Bn extends Ot{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}=qd(this),r=Kd(a.radius)?Oe:Gd;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,Ci(a,e,o)),t.clip(),r(t,Ci(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,Ci(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Mi(this,t,e,i)}inXRange(t,e){return Mi(this,t,null,e)}inYRange(t,e){return Mi(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}}P(Bn,"id","bar"),P(Bn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(Bn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Zd=Object.freeze({__proto__:null,ArcElement:ze,BarElement:Bn,LineElement:It,PointElement:An});const Di=["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)"],$o=Di.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Io(n){return Di[n%Di.length]}function zo(n){return $o[n%$o.length]}function Jd(n,t){return n.borderColor=Io(t),n.backgroundColor=zo(t),++t}function Qd(n,t){return n.backgroundColor=n.data.map(()=>Io(t++)),t}function th(n,t){return n.backgroundColor=n.data.map(()=>zo(t++)),t}function eh(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof te?t=Qd(e,t):s instanceof Te?t=th(e,t):s&&(t=Jd(e,t))}}function Wo(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function nh(n){return n&&(n.borderColor||n.backgroundColor)}var ih={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&&(Wo(i)||nh(s)||o&&Wo(o)))return;const a=eh(n);i.forEach(a)}};function sh(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 d=t,f,u,p,g,m;for(a[l++]=n[d],f=0;f<o-2;f++){let b=0,y=0,_;const k=Math.floor((f+1)*r)+1+t,w=Math.min(Math.floor((f+2)*r)+1,e)+t,x=w-k;for(_=k;_<w;_++)b+=n[_].x,y+=n[_].y;b/=x,y/=x;const C=Math.floor(f*r)+1+t,M=Math.min(Math.floor((f+1)*r)+1,e)+t,{x:D,y:L}=n[d];for(p=g=-1,_=C;_<M;_++)g=.5*Math.abs((D-b)*(n[_].y-L)-(D-n[_].x)*(y-L)),g>p&&(p=g,u=n[_],m=_);a[l++]=u,d=m}return a[l++]=n[c],a}function oh(n,t,e,i){let s=0,o=0,a,r,l,c,d,f,u,p,g,m;const b=[],y=t+e-1,_=n[t].x,w=n[y].x-_;for(a=t;a<t+e;++a){r=n[a],l=(r.x-_)/w*i,c=r.y;const x=l|0;if(x===d)c<g?(g=c,f=a):c>m&&(m=c,u=a),s=(o*s+r.x)/++o;else{const C=a-1;if(!I(f)&&!I(u)){const M=Math.min(f,u),D=Math.max(f,u);M!==p&&M!==C&&b.push({...n[M],x:s}),D!==p&&D!==C&&b.push({...n[D],x:s})}a>0&&C!==p&&b.push(n[C]),b.push(r),d=x,o=0,g=m=c,f=u=p=a}}return b}function Ho(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 jo(n){n.data.datasets.forEach(t=>{Ho(t)})}function ah(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=nt(Dt(t,o.axis,a).lo,0,e-1)),c?s=nt(Dt(t,o.axis,r).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var rh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){jo(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(Ae([r,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=n.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||n.options.parsing)return;let{start:f,count:u}=ah(l,c);const p=e.threshold||4*i;if(u<=p){Ho(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=sh(c,f,u,i,e);break;case"min-max":g=oh(c,f,u,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(n){jo(n)}};function lh(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=Pi(l,c,s);const d=Ei(e,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:d,start:s[l],end:s[c]});continue}const f=js(t,d);for(const u of f){const p=Ei(e,o[u.start],o[u.end],u.loop),g=Hs(r,s,p);for(const m of g)a.push({source:m,target:u,start:{[e]:Yo(d,p,"start",Math.max)},end:{[e]:Yo(d,p,"end",Math.min)}})}}return a}function Ei(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=ft(s),o=ft(o)),{property:n,start:s,end:o}}function ch(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Pi(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 Pi(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Yo(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Uo(n,t){let e=[],i=!1;return X(n)?(i=!0,e=n):e=ch(n,t),e.length?new It({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Xo(n){return n&&n.fill!==!1}function dh(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(!Z(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function hh(n,t,e){const i=gh(n);if($(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Z(s)&&Math.floor(s)===s?fh(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function fh(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function uh(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:$(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function ph(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:$(n)?i=n.value:i=t.getBaseValue(),i}function gh(n){const t=n.options,e=t.fill;let i=N(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function mh(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,a=i.points,r=bh(t,e);r.push(Uo({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let d=c.start;d<=c.end;d++)yh(s,a[d],r)}return new It({points:s,options:{}})}function bh(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 yh(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=_h(o,t,"x");if(!(!l||a&&r)){if(a)i.unshift(l);else if(n.push(l),!r)break}}n.push(...i)}function _h(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 d=o[c],f=a[d.start][e],u=a[d.end][e];if(Ct(s,f,u)){r=s===f,l=s===u;break}}return{first:r,last:l,point:i}}class qo{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:K},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 xh(n){const{chart:t,fill:e,line:i}=n;if(Z(e))return kh(t,e);if(e==="stack")return mh(n);if(e==="shape")return!0;const s=wh(n);return s instanceof qo?s:Uo(s,i)}function kh(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function wh(n){return(n.scale||{}).getPointPositionForValue?Sh(n):vh(n)}function vh(n){const{scale:t={},fill:e}=n,i=uh(e,t);if(Z(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Sh(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,a=ph(e,t,o),r=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new qo({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 Oi(n,t,e){const i=xh(t),{line:s,scale:o,axis:a}=t,r=s.options,l=r.fill,c=r.backgroundColor,{above:d=c,below:f=c}=l||{};i&&s.points.length&&(hn(n,e),Mh(n,{line:s,target:i,above:d,below:f,area:e,scale:o,axis:a}),fn(n))}function Mh(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&&(Ko(n,i,a.top),Go(n,{line:e,target:i,color:s,scale:r,property:l}),n.restore(),n.save(),Ko(n,i,a.bottom)),Go(n,{line:e,target:i,color:o,scale:r,property:l}),n.restore()}function Ko(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,d=s[l],f=s[Pi(l,c,s)];o?(n.moveTo(d.x,d.y),o=!1):(n.lineTo(d.x,e),n.lineTo(d.x,d.y)),a=!!t.pathSegment(n,r,{move:a}),a?n.closePath():n.lineTo(f.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Go(n,t){const{line:e,target:i,property:s,color:o,scale:a}=t,r=lh(e,i,s);for(const{source:l,target:c,start:d,end:f}of r){const{style:{backgroundColor:u=o}={}}=l,p=i!==!0;n.save(),n.fillStyle=u,Ch(n,a,p&&Ei(s,d,f)),n.beginPath();const g=!!e.pathSegment(n,l);let m;if(p){g?n.closePath():Zo(n,i,f,s);const b=!!i.pathSegment(n,c,{move:g,reverse:!0});m=g&&b,m||Zo(n,i,d,s)}n.closePath(),n.fill(m?"evenodd":"nonzero"),n.restore()}}function Ch(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 Zo(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Dh={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 It&&(l={visible:n.isDatasetVisible(a),index:a,fill:hh(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=dh(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&&Oi(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;Xo(o)&&Oi(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Xo(i)||e.drawTime!=="beforeDatasetDraw"||Oi(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Jo=(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)}},Eh=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Qo extends Ot{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Y(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,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=et(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Jo(i,o);let c,d;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,o,r,l)+10):(d=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,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],d=s+r;let f=t;o.textAlign="left",o.textBaseline="middle";let u=-1,p=-d;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)&&(f+=d,c[c.length-(m>0?0:1)]=0,p+=d,u++),l[m]={left:0,top:p,row:u,width:b,height:s},c[c.length-1]+=b+r}),f}_fitCols(t,e,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t;let f=r,u=0,p=0,g=0,m=0;return this.legendItems.forEach((b,y)=>{const{itemWidth:_,itemHeight:k}=Ph(i,e,o,b,s);y>0&&p+k+2*r>d&&(f+=u+r,c.push({width:u,height:p}),g+=u+r,m++,u=p=0),l[y]={left:g,top:p,col:m,width:_,height:k},u=Math.max(u,_),p+=k+r}),f+=u,c.push({width:u,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,a=fe(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=ot(i,this.left+s,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=ot(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=ot(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=ot(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;hn(t,this),this._draw(),fn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=J.color,l=fe(t.rtl,this.left,this.width),c=et(a.font),{padding:d}=a,f=c.size,u=f/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}=Jo(a,f),y=function(C,M,D){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;s.save();const L=N(D.lineWidth,1);if(s.fillStyle=N(D.fillStyle,r),s.lineCap=N(D.lineCap,"butt"),s.lineDashOffset=N(D.lineDashOffset,0),s.lineJoin=N(D.lineJoin,"miter"),s.lineWidth=L,s.strokeStyle=N(D.strokeStyle,r),s.setLineDash(N(D.lineDash,[])),a.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:L},A=l.xPlus(C,g/2),V=M+u;Cs(s,T,A,V,a.pointStyleWidth&&g)}else{const T=M+Math.max((f-m)/2,0),A=l.leftForLtr(C,g),V=Gt(D.borderRadius);s.beginPath(),Object.values(V).some(U=>U!==0)?Oe(s,{x:A,y:T,w:g,h:m,radius:V}):s.rect(A,T,g,m),s.fill(),L!==0&&s.stroke()}s.restore()},_=function(C,M,D){Kt(s,D.text,C,M+b/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},k=this.isHorizontal(),w=this._computeTitleHeight();k?p={x:ot(o,this.left+d,this.right-i[0]),y:this.top+d+w,line:0}:p={x:this.left+d,y:ot(o,this.top+w+d,this.bottom-e[0].height),line:0},$s(this.ctx,t.textDirection);const x=b+d;this.legendItems.forEach((C,M)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const D=s.measureText(C.text).width,L=l.textAlign(C.textAlign||(C.textAlign=a.textAlign)),T=g+u+D;let A=p.x,V=p.y;l.setWidth(this.width),k?M>0&&A+T+d>this.right&&(V=p.y+=x,p.line++,A=p.x=ot(o,this.left+d,this.right-i[p.line])):M>0&&V+x>this.bottom&&(A=p.x=A+e[p.line].width+d,p.line++,V=p.y=ot(o,this.top+w+d,this.bottom-e[p.line].height));const U=l.x(A);if(y(U,V,C),A=Gr(L,A+g+u,k?A+T:this.right,t.rtl),_(l.x(A),V,C),k)p.x+=T+d;else if(typeof C.text!="string"){const B=c.lineHeight;p.y+=ta(C,B)+d}else p.y+=x}),Is(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=et(e.font),s=at(e.padding);if(!e.display)return;const o=fe(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=i.size/2,c=s.top+l;let d,f=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),d=this.top+c,f=ot(t.align,f,this.right-u);else{const g=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);d=c+ot(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const p=ot(r,f,f+u);a.textAlign=o.textAlign(ii(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Kt(a,e.text,p,d,i)}_computeTitleHeight(){const t=this.options.title,e=et(t.font),i=at(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(Ct(t,this.left,this.right)&&Ct(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Ct(t,s.left,s.left+s.width)&&Ct(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Bh(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Eh(s,i);s&&!o&&Y(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&Y(e.onHover,[t,i,this],this)}else i&&Y(e.onClick,[t,i,this],this)}}function Ph(n,t,e,i,s){const o=Oh(i,n,t,e),a=Ah(s,i,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Oh(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 Ah(n,t,e){let i=n;return typeof t.text!="string"&&(i=ta(t,e)),i}function ta(n,t){const e=n.text?n.text.length:0;return t*e}function Bh(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Th={id:"legend",_element:Qo,start(n,t,e){const i=n.legend=new Qo({ctx:n.ctx,options:e,chart:n});rt.configure(n,i,e),rt.addBox(n,i)},stop(n){rt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;rt.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),d=at(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:(d.width+d.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 Ai extends Ot{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=X(i.text)?i.text.length:1;this._padding=at(i.padding);const o=s*et(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,d,f;return this.isHorizontal()?(d=ot(r,i,o),f=e+t,c=o-i):(a.position==="left"?(d=i+t,f=ot(r,s,e),l=q*-.5):(d=o-t,f=ot(r,e,s),l=q*.5),c=s-e),{titleX:d,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=et(e.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);Kt(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:ii(e.align),textBaseline:"middle",translation:[a,r]})}}function Lh(n,t){const e=new Ai({ctx:n.ctx,options:t,chart:n});rt.configure(n,e,t),rt.addBox(n,e),n.titleBlock=e}var Fh={id:"title",_element:Ai,start(n,t,e){Lh(n,e)},stop(n){const t=n.titleBlock;rt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;rt.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 Tn=new WeakMap;var Vh={id:"subtitle",start(n,t,e){const i=new Ai({ctx:n.ctx,options:e,chart:n});rt.configure(n,i,e),rt.addBox(n,i),Tn.set(n,i)},stop(n){rt.removeBox(n,Tn.get(n)),Tn.delete(n)},beforeUpdate(n,t,e){const i=Tn.get(n);rt.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 We={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(),d=ei(t,c);d<s&&(s=d,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function wt(n,t){return t&&(X(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Bt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
28
|
+
`)>-1?n.split(`
|
|
29
|
+
`):n}function Rh(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 ea(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:a,boxHeight:r}=t,l=et(t.bodyFont),c=et(t.titleFont),d=et(t.footerFont),f=o.length,u=s.length,p=i.length,g=at(t.padding);let m=g.height,b=0,y=i.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,f&&(m+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),y){const w=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;m+=p*w+(y-p)*l.lineHeight+(y-1)*t.bodySpacing}u&&(m+=t.footerMarginTop+u*d.lineHeight+(u-1)*t.footerSpacing);let _=0;const k=function(w){b=Math.max(b,e.measureText(w).width+_)};return e.save(),e.font=c.string,H(n.title,k),e.font=l.string,H(n.beforeBody.concat(n.afterBody),k),_=t.displayColors?a+2+t.boxPadding:0,H(i,w=>{H(w.before,k),H(w.lines,k),H(w.after,k)}),_=0,e.font=d.string,H(n.footer,k),e.restore(),b+=g.width,{width:b,height:m}}function Nh(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function $h(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 Ih(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"),$h(c,n,t,e)&&(c="center"),c}function na(n,t,e){const i=e.yAlign||t.yAlign||Nh(n,e);return{xAlign:e.xAlign||t.xAlign||Ih(n,t,e,i),yAlign:i}}function zh(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Wh(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function ia(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=n,{xAlign:r,yAlign:l}=e,c=s+o,{topLeft:d,topRight:f,bottomLeft:u,bottomRight:p}=Gt(a);let g=zh(t,r);const m=Wh(t,l,c);return l==="center"?r==="left"?g+=c:r==="right"&&(g-=c):r==="left"?g-=Math.max(d,u)+s:r==="right"&&(g+=Math.max(f,p)+s),{x:nt(g,0,i.width-t.width),y:nt(m,0,i.height-t.height)}}function Ln(n,t,e){const i=at(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function sa(n){return wt([],Bt(n))}function Hh(n,t,e){return $t(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function oa(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const aa={beforeTitle:Mt,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:Mt,beforeBody:Mt,beforeLabel:Mt,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:Mt,afterBody:Mt,beforeFooter:Mt,footer:Mt,afterFooter:Mt};function lt(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?aa[t].call(e,i):s}class Bi extends Ot{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 qs(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Hh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=lt(i,"beforeTitle",this,t),o=lt(i,"title",this,t),a=lt(i,"afterTitle",this,t);let r=[];return r=wt(r,Bt(s)),r=wt(r,Bt(o)),r=wt(r,Bt(a)),r}getBeforeBody(t,e){return sa(lt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return H(t,o=>{const a={before:[],lines:[],after:[]},r=oa(i,o);wt(a.before,Bt(lt(r,"beforeLabel",this,o))),wt(a.lines,lt(r,"label",this,o)),wt(a.after,Bt(lt(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return sa(lt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=lt(i,"beforeFooter",this,t),o=lt(i,"footer",this,t),a=lt(i,"afterFooter",this,t);let r=[];return r=wt(r,Bt(s)),r=wt(r,Bt(o)),r=wt(r,Bt(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(Rh(this.chart,e[l]));return t.filter&&(r=r.filter((d,f,u)=>t.filter(d,f,u,i))),t.itemSort&&(r=r.sort((d,f)=>t.itemSort(d,f,i))),H(r,d=>{const f=oa(t.callbacks,d);s.push(lt(f,"labelColor",this,d)),o.push(lt(f,"labelPointStyle",this,d)),a.push(lt(f,"labelTextColor",this,d))}),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=We[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=ea(this,i),c=Object.assign({},r,l),d=na(this.chart,i,c),f=ia(i,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:f.x,y:f.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:d,bottomRight:f}=Gt(r),{x:u,y:p}=t,{width:g,height:m}=e;let b,y,_,k,w,x;return o==="center"?(w=p+m/2,s==="left"?(b=u,y=b-a,k=w+a,x=w-a):(b=u+g,y=b+a,k=w-a,x=w+a),_=b):(s==="left"?y=u+Math.max(l,d)+a:s==="right"?y=u+g-Math.max(c,f)-a:y=this.caretX,o==="top"?(k=p,w=k-a,b=y-a,_=y+a):(k=p+m,w=k+a,b=y+a,_=y-a),x=k),{x1:b,x2:y,x3:_,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=fe(i.rtl,this.x,this.width);for(t.x=Ln(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=et(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,d=et(o.bodyFont),f=Ln(this,"left",o),u=s.x(f),p=l<d.lineHeight?(d.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(u,c)+c/2,y=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,li(t,m,b,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,li(t,m,b,y)}else{t.lineWidth=$(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(u,c),b=s.leftForLtr(s.xPlus(u,1),c-2),y=Gt(a.borderRadius);Object.values(y).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Oe(t,{x:m,y:g,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Oe(t,{x:b,y:g+1,w:c-2,h:l-2,radius:y}),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:d}=i,f=et(i.bodyFont);let u=f.lineHeight,p=0;const g=fe(i.rtl,this.x,this.width),m=function(D){e.fillText(D,g.x(t.x+p),t.y+u/2),t.y+=u+o},b=g.textAlign(a);let y,_,k,w,x,C,M;for(e.textAlign=a,e.textBaseline="middle",e.font=f.string,t.x=Ln(this,b,i),e.fillStyle=i.bodyColor,H(this.beforeBody,m),p=r&&b!=="right"?a==="center"?c/2+d:c+2+d:0,w=0,C=s.length;w<C;++w){for(y=s[w],_=this.labelTextColors[w],e.fillStyle=_,H(y.before,m),k=y.lines,r&&k.length&&(this._drawColorBox(e,t,w,g,i),u=Math.max(f.lineHeight,l)),x=0,M=k.length;x<M;++x)m(k[x]),u=f.lineHeight;H(y.after,m)}p=0,u=f.lineHeight,H(this.afterBody,m),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let a,r;if(o){const l=fe(i.rtl,this.x,this.width);for(t.x=Ln(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=et(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:d}=i,{topLeft:f,topRight:u,bottomLeft:p,bottomRight:g}=Gt(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+f,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(r+c-u,l),e.quadraticCurveTo(r+c,l,r+c,l+u),a==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(r+c,l+d-g),e.quadraticCurveTo(r+c,l+d,r+c-g,l+d),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(r+p,l+d),e.quadraticCurveTo(r,l+d,r,l+d-p),a==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(r,l+f),e.quadraticCurveTo(r,l,r+f,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=We[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=ea(this,t),l=Object.assign({},a,this._size),c=na(e,t,l),d=ia(t,l,c,e);(s._to!==d.x||o._to!==d.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,d))}}_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=at(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),$s(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Is(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=!on(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||!on(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=We[o.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}P(Bi,"positioners",We);var jh={id:"tooltip",_element:Bi,positioners:We,afterInit(n,t,e){e&&(n.tooltip=new Bi({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:aa},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"]},Yh=Object.freeze({__proto__:null,Colors:ih,Decimation:rh,Filler:Dh,Legend:Th,SubTitle:Vh,Title:Fh,Tooltip:jh});const Uh=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Xh(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Uh(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const qh=(n,t)=>n===null?null:nt(Math.round(n),0,t);function ra(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Ti extends ne{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:Xh(i,t,N(e,t),this._addedLabels),qh(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 ra.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}}P(Ti,"id","category"),P(Ti,"defaults",{ticks:{callback:ra}});function Kh(n,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:d,maxDigits:f,includeBounds:u}=n,p=o||1,g=d-1,{min:m,max:b}=t,y=!I(a),_=!I(r),k=!I(c),w=(b-m)/(f+1);let x=cs((b-m)/g/p)*p,C,M,D,L;if(x<1e-14&&!y&&!_)return[{value:m},{value:b}];L=Math.ceil(b/x)-Math.floor(m/x),L>g&&(x=cs(L*x/g/p)*p),I(l)||(C=Math.pow(10,l),x=Math.ceil(x*C)/C),s==="ticks"?(M=Math.floor(m/x)*x,D=Math.ceil(b/x)*x):(M=m,D=b),y&&_&&o&&Hr((r-a)/o,x/1e3)?(L=Math.round(Math.min((r-a)/x,d)),x=(r-a)/L,M=a,D=r):k?(M=y?a:M,D=_?r:D,L=c-1,x=(D-M)/L):(L=(D-M)/x,Me(L,Math.round(L),x/1e3)?L=Math.round(L):L=Math.ceil(L));const T=Math.max(hs(x),hs(M));C=Math.pow(10,I(l)?T:l),M=Math.round(M*C)/C,D=Math.round(D*C)/C;let A=0;for(y&&(u&&M!==a?(e.push({value:a}),M<a&&A++,Me(Math.round((M+A*x)*C)/C,a,la(a,w,n))&&A++):M<a&&A++);A<L;++A){const V=Math.round((M+A*x)*C)/C;if(_&&V>r)break;e.push({value:V})}return _&&u&&D!==r?e.length&&Me(e[e.length-1].value,r,la(r,w,n))?e[e.length-1].value=r:e.push({value:r}):(!_||D===r)&&e.push({value:D}),e}function la(n,t,{horizontal:e,minRotation:i}){const s=yt(i),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/o,a)}class Fn extends ne{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return 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=xt(s),c=xt(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=Kh(s,o);return t.bounds==="ticks"&&ds(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 Ee(t,this.chart.options.locale,this.options.ticks.format)}}class Li extends Fn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?t:0,this.max=Z(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=yt(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}}P(Li,"id","linear"),P(Li,"defaults",{ticks:{callback:cn.formatters.numeric}});const He=n=>Math.floor(Nt(n)),ie=(n,t)=>Math.pow(10,He(n)+t);function ca(n){return n/Math.pow(10,He(n))===1}function da(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Gh(n,t){const e=t-n;let i=He(e);for(;da(n,t,i)>10;)i++;for(;da(n,t,i)<10;)i--;return Math.min(i,He(n))}function Zh(n,{min:t,max:e}){t=ht(n.min,t);const i=[],s=He(t);let o=Gh(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,d=Math.floor((t-l)/r/10)*r*10;let f=Math.floor((c-d)/Math.pow(10,o)),u=ht(n.min,Math.round((l+d+f*Math.pow(10,o))*a)/a);for(;u<e;)i.push({value:u,major:ca(u),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,a=o>=0?1:a),u=Math.round((l+d+f*Math.pow(10,o))*a)/a;const p=ht(n.max,u);return i.push({value:p,major:ca(p),significand:f}),i}class Fi extends ne{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Fn.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Z(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?Math.max(0,t):null,this.max=Z(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Z(this._userMin)&&(this.min=t===ie(this.min,0)?ie(this.min,-1):ie(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(ie(i,-1)),a(ie(s,1)))),i<=0&&o(ie(s,-1)),s<=0&&a(ie(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Zh(e,this);return t.bounds==="ticks"&&ds(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":Ee(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Nt(t),this._valueRange=Nt(this.max)-Nt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Nt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(Fi,"id","logarithmic"),P(Fi,"defaults",{ticks:{callback:cn.formatters.logarithmic,major:{enabled:!0}}});function Vi(n){const t=n.ticks;if(t.display&&n.display){const e=at(t.backdropPadding);return N(t.font&&t.font.size,J.font.size)+e.height}return 0}function Jh(n,t,e){return e=X(e)?e:[e],{w:al(n,t.string,e),h:e.length*t.lineHeight}}function ha(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 Qh(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?q/o:0;for(let l=0;l<o;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const d=n.getPointPosition(l,n.drawingArea+s[l],r),f=et(c.font),u=Jh(n.ctx,f,n._pointLabels[l]);i[l]=u;const p=ft(n.getIndexAngle(l)+r),g=Math.round(ti(p)),m=ha(g,d.x,u.w,0,180),b=ha(g,d.y,u.h,90,270);tf(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=sf(n,i,s)}function tf(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 ef(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(ti(ft(l.angle+tt))),d=rf(l.y,r.h,c),f=of(c),u=af(l.x,r.w,f);return{visible:!0,x:l.x,y:d,textAlign:f,left:u,top:d,right:u+r.w,bottom:d+r.h}}function nf(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;return!(Et({x:e,y:i},t)||Et({x:e,y:o},t)||Et({x:s,y:i},t)||Et({x:s,y:o},t))}function sf(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Vi(o)/2,additionalAngle:a?q/s:0};let c;for(let d=0;d<s;d++){l.padding=e[d],l.size=t[d];const f=ef(n,d,l);i.push(f),r==="auto"&&(f.visible=nf(f,c),f.visible&&(c=f))}return i}function of(n){return n===0||n===180?"center":n<180?"left":"right"}function af(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function rf(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function lf(n,t,e){const{left:i,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!I(r)){const l=Gt(t.borderRadius),c=at(t.backdropPadding);n.fillStyle=r;const d=i-c.left,f=s-c.top,u=o-i+c.width,p=a-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),Oe(n,{x:d,y:f,w:u,h:p,radius:l}),n.fill()):n.fillRect(d,f,u,p)}}function cf(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));lf(e,a,o);const r=et(a.font),{x:l,y:c,textAlign:d}=o;Kt(e,n._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:d,textBaseline:"middle"})}}function fa(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,K);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 df(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(),fa(n,e,a,i),o.closePath(),o.stroke(),o.restore())}function hf(n,t,e){return $t(n,{label:e,index:t,type:"pointLabel"})}class je extends Fn{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=at(Vi(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=Z(t)&&!isNaN(t)?t:0,this.max=Z(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Vi(this.options))}generateTickLabels(t){Fn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=Y(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?Qh(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=K/(this._pointLabels.length||1),i=this.options.startAngle||0;return ft(t*e+yt(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 hf(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-tt+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(),fa(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&&cf(this,a),s.display&&this.ticks.forEach((d,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(d.value);const u=this.getContext(f),p=s.setContext(u),g=o.setContext(u);df(this,p,l,a,g)}}),i.display){for(t.save(),r=a-1;r>=0;r--){const d=i.setContext(this.getPointLabelContext(r)),{color:f,lineWidth:u}=d;!u||!f||(t.lineWidth=u,t.strokeStyle=f,t.setLineDash(d.borderDash),t.lineDashOffset=d.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)),d=et(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;const f=at(c.backdropPadding);t.fillRect(-a/2-f.left,-o-d.size/2-f.top,a+f.width,d.size+f.height)}Kt(t,r.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(je,"id","radialLinear"),P(je,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:cn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(je,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(je,"descriptors",{angleLines:{_fallback:"grid"}});const Vn={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}},ct=Object.keys(Vn);function ua(n,t){return n-t}function pa(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)),Z(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(ce(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function ga(n,t,e,i){const s=ct.length;for(let o=ct.indexOf(n);o<s-1;++o){const a=Vn[ct[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=i)return ct[o]}return ct[s-1]}function ff(n,t,e,i,s){for(let o=ct.length-1;o>=ct.indexOf(e);o--){const a=ct[o];if(Vn[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return ct[e?ct.indexOf(e):0]}function uf(n){for(let t=ct.indexOf(n)+1,e=ct.length;t<e;++t)if(Vn[ct[t]].common)return ct[t]}function ma(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=ni(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function pf(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 ba(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:pf(n,i,s,e)}class Ye extends ne{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 wc._date(t.adapters.date);s.init(e),ve(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:pa(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=Z(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=Z(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=Xr(s,o,a);return this._unit=e.unit||(i.autoSkip?ga(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):ff(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:uf(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),ba(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=nt(e,0,a),i=nt(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||ga(o.minUnit,e,i,this._getLabelCapacity(e)),r=N(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=ce(l)||l===!0,d={};let f=e,u,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,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(u=f,p=0;u<i;u=+t.add(u,r,a),p++)ma(d,u,g);return(u===i||s.bounds==="ticks"||p===1)&&ma(d,u,g),Object.keys(d).sort(ua).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 Y(a,[t,e,i],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&r[l],f=c&&r[c],u=i[e],p=c&&f&&u&&u.major;return this._adapter.format(t,s||(p?f:d))}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=yt(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,ba(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(pa(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gs(t.sort(ua))}}P(Ye,"id","time"),P(Ye,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Rn(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}=Dt(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}=Dt(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 Ri extends Ye{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=Rn(e,this.min),this._tableRange=Rn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let a,r,l,c,d;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)d=s[a+1],l=s[a-1],c=s[a],Math.round((d+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(Rn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Rn(this._table,i*this._tableRange+this._minPos,!0)}}P(Ri,"id","timeseries"),P(Ri,"defaults",Ye.defaults);var gf=Object.freeze({__proto__:null,CategoryScale:Ti,LinearScale:Li,LogarithmicScale:Fi,RadialLinearScale:je,TimeScale:Ye,TimeSeriesScale:Ri});const mf=[kc,Zd,Yh,gf];At.register(...mf);const bf={class:"px-24 py-16"},yf={class:"flex flex-col gap-8"},_f={class:"fm-color-typo-primary fm-typo-body-lg-400"},xf={class:"fm-color-typo-secondary fm-typo-body-md-400"},kf={class:"px-6"},wf=h.defineComponent({__name:"FmLine",props:{name:{},paragraph:{},datasets:{},xAxis:{}},setup(n){const t=n,e=h.ref(null);let i=null;h.watch([()=>t.xAxis,()=>t.datasets],()=>{i&&(i.data.datasets=t.datasets,i.data.labels=t.xAxis.categories,i.update())});function s(c,d){const f=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(c);if(f)return`rgba(${parseInt(f[1],16)},${parseInt(f[2],16)},${parseInt(f[3],16)},${d})`;if(c.startsWith("rgb")){const u=c.split(",");if(u.length===3)return[...u.slice(0,2),u[2].replace(")",`,${d})`)].join(",");if(u.length===4)return[...u.slice(0,3),`${d})`].join(",")}return""}function o(c){const d=getComputedStyle(document.documentElement).getPropertyValue(`--${c}`)||c;return d.startsWith("rgb")||d.startsWith("#")?d:null}function a({context:c,color:d}){const{ctx:f,chartArea:u}=c.chart;if(!u)return;const p=f==null?void 0:f.createLinearGradient(0,0,0,u.height);return p.addColorStop(0,s(d,.5)),p.addColorStop(1,s(d,0)),p}const r=h.computed(()=>({labels:t.xAxis.categories,datasets:t.datasets.map(c=>{const d=o(c.color)??"";return{...c,backgroundColor:d?f=>a({context:f,color:d}):"",borderColor:d,borderDash:c.dash?[5,5]:void 0,tension:.1}})}));function l(){e.value&&(i=new At(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 h.onMounted(()=>{l()}),(c,d)=>(h.openBlock(),h.createElementBlock("div",bf,[h.createElementVNode("div",yf,[h.createElementVNode("div",_f,h.toDisplayString(c.name),1),h.createElementVNode("div",xf,h.toDisplayString(c.paragraph),1)]),h.createElementVNode("div",kf,[h.createElementVNode("canvas",{ref_key:"canvas",ref:e},null,512)])]))}});var vf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sf(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ya={exports:{}};(function(n,t){(function(e,i){n.exports=i()})(vf,function(){var e=1e3,i=6e4,s=36e5,o="millisecond",a="second",r="minute",l="hour",c="day",d="week",f="month",u="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=/\[([^\]]+)]|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,_={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(B){var S=["th","st","nd","rd"],v=B%100;return"["+B+(S[(v-20)%10]||S[v]||S[0])+"]"}},k=function(B,S,v){var E=String(B);return!E||E.length>=S?B:""+Array(S+1-E.length).join(v)+B},w={s:k,z:function(B){var S=-B.utcOffset(),v=Math.abs(S),E=Math.floor(v/60),O=v%60;return(S<=0?"+":"-")+k(E,2,"0")+":"+k(O,2,"0")},m:function B(S,v){if(S.date()<v.date())return-B(v,S);var E=12*(v.year()-S.year())+(v.month()-S.month()),O=S.clone().add(E,f),F=v-O<0,R=S.clone().add(E+(F?-1:1),f);return+(-(E+(v-O)/(F?O-R:R-O))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:f,y:p,w:d,d:c,D:g,h:l,m:r,s:a,ms:o,Q:u}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},x="en",C={};C[x]=_;var M="$isDayjsObject",D=function(B){return B instanceof V||!(!B||!B[M])},L=function B(S,v,E){var O;if(!S)return x;if(typeof S=="string"){var F=S.toLowerCase();C[F]&&(O=F),v&&(C[F]=v,O=F);var R=S.split("-");if(!O&&R.length>1)return B(R[0])}else{var W=S.name;C[W]=S,O=W}return!E&&O&&(x=O),O||!E&&x},T=function(B,S){if(D(B))return B.clone();var v=typeof S=="object"?S:{};return v.date=B,v.args=arguments,new V(v)},A=w;A.l=L,A.i=D,A.w=function(B,S){return T(B,{locale:S.$L,utc:S.$u,x:S.$x,$offset:S.$offset})};var V=function(){function B(v){this.$L=L(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[M]=!0}var S=B.prototype;return S.parse=function(v){this.$d=function(E){var O=E.date,F=E.utc;if(O===null)return new Date(NaN);if(A.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var R=O.match(b);if(R){var W=R[2]-1||0,j=(R[7]||"0").substring(0,3);return F?new Date(Date.UTC(R[1],W,R[3]||1,R[4]||0,R[5]||0,R[6]||0,j)):new Date(R[1],W,R[3]||1,R[4]||0,R[5]||0,R[6]||0,j)}}return new Date(O)}(v),this.init()},S.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},S.$utils=function(){return A},S.isValid=function(){return this.$d.toString()!==m},S.isSame=function(v,E){var O=T(v);return this.startOf(E)<=O&&O<=this.endOf(E)},S.isAfter=function(v,E){return T(v)<this.startOf(E)},S.isBefore=function(v,E){return this.endOf(E)<T(v)},S.$g=function(v,E,O){return A.u(v)?this[E]:this.set(O,v)},S.unix=function(){return Math.floor(this.valueOf()/1e3)},S.valueOf=function(){return this.$d.getTime()},S.startOf=function(v,E){var O=this,F=!!A.u(E)||E,R=A.p(v),W=function(ae,dt){var Yt=A.w(O.$u?Date.UTC(O.$y,dt,ae):new Date(O.$y,dt,ae),O);return F?Yt:Yt.endOf(c)},j=function(ae,dt){return A.w(O.toDate()[ae].apply(O.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(dt)),O)},G=this.$W,Q=this.$M,it=this.$D,bt="set"+(this.$u?"UTC":"");switch(R){case p:return F?W(1,0):W(31,11);case f:return F?W(1,Q):W(0,Q+1);case d:var oe=this.$locale().weekStart||0,Je=(G<oe?G+7:G)-oe;return W(F?it-Je:it+(6-Je),Q);case c:case g:return j(bt+"Hours",0);case l:return j(bt+"Minutes",1);case r:return j(bt+"Seconds",2);case a:return j(bt+"Milliseconds",3);default:return this.clone()}},S.endOf=function(v){return this.startOf(v,!1)},S.$set=function(v,E){var O,F=A.p(v),R="set"+(this.$u?"UTC":""),W=(O={},O[c]=R+"Date",O[g]=R+"Date",O[f]=R+"Month",O[p]=R+"FullYear",O[l]=R+"Hours",O[r]=R+"Minutes",O[a]=R+"Seconds",O[o]=R+"Milliseconds",O)[F],j=F===c?this.$D+(E-this.$W):E;if(F===f||F===p){var G=this.clone().set(g,1);G.$d[W](j),G.init(),this.$d=G.set(g,Math.min(this.$D,G.daysInMonth())).$d}else W&&this.$d[W](j);return this.init(),this},S.set=function(v,E){return this.clone().$set(v,E)},S.get=function(v){return this[A.p(v)]()},S.add=function(v,E){var O,F=this;v=Number(v);var R=A.p(E),W=function(Q){var it=T(F);return A.w(it.date(it.date()+Math.round(Q*v)),F)};if(R===f)return this.set(f,this.$M+v);if(R===p)return this.set(p,this.$y+v);if(R===c)return W(1);if(R===d)return W(7);var j=(O={},O[r]=i,O[l]=s,O[a]=e,O)[R]||1,G=this.$d.getTime()+v*j;return A.w(G,this)},S.subtract=function(v,E){return this.add(-1*v,E)},S.format=function(v){var E=this,O=this.$locale();if(!this.isValid())return O.invalidDate||m;var F=v||"YYYY-MM-DDTHH:mm:ssZ",R=A.z(this),W=this.$H,j=this.$m,G=this.$M,Q=O.weekdays,it=O.months,bt=O.meridiem,oe=function(dt,Yt,Qe,Un){return dt&&(dt[Yt]||dt(E,F))||Qe[Yt].slice(0,Un)},Je=function(dt){return A.s(W%12||12,dt,"0")},ae=bt||function(dt,Yt,Qe){var Un=dt<12?"AM":"PM";return Qe?Un.toLowerCase():Un};return F.replace(y,function(dt,Yt){return Yt||function(Qe){switch(Qe){case"YY":return String(E.$y).slice(-2);case"YYYY":return A.s(E.$y,4,"0");case"M":return G+1;case"MM":return A.s(G+1,2,"0");case"MMM":return oe(O.monthsShort,G,it,3);case"MMMM":return oe(it,G);case"D":return E.$D;case"DD":return A.s(E.$D,2,"0");case"d":return String(E.$W);case"dd":return oe(O.weekdaysMin,E.$W,Q,2);case"ddd":return oe(O.weekdaysShort,E.$W,Q,3);case"dddd":return Q[E.$W];case"H":return String(W);case"HH":return A.s(W,2,"0");case"h":return Je(1);case"hh":return Je(2);case"a":return ae(W,j,!0);case"A":return ae(W,j,!1);case"m":return String(j);case"mm":return A.s(j,2,"0");case"s":return String(E.$s);case"ss":return A.s(E.$s,2,"0");case"SSS":return A.s(E.$ms,3,"0");case"Z":return R}return null}(dt)||R.replace(":","")})},S.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},S.diff=function(v,E,O){var F,R=this,W=A.p(E),j=T(v),G=(j.utcOffset()-this.utcOffset())*i,Q=this-j,it=function(){return A.m(R,j)};switch(W){case p:F=it()/12;break;case f:F=it();break;case u:F=it()/3;break;case d:F=(Q-G)/6048e5;break;case c:F=(Q-G)/864e5;break;case l:F=Q/s;break;case r:F=Q/i;break;case a:F=Q/e;break;default:F=Q}return O?F:A.a(F)},S.daysInMonth=function(){return this.endOf(f).$D},S.$locale=function(){return C[this.$L]},S.locale=function(v,E){if(!v)return this.$L;var O=this.clone(),F=L(v,E,!0);return F&&(O.$L=F),O},S.clone=function(){return A.w(this.$d,this)},S.toDate=function(){return new Date(this.valueOf())},S.toJSON=function(){return this.isValid()?this.toISOString():null},S.toISOString=function(){return this.$d.toISOString()},S.toString=function(){return this.$d.toUTCString()},B}(),U=V.prototype;return T.prototype=U,[["$ms",o],["$s",a],["$m",r],["$H",l],["$W",c],["$M",f],["$y",p],["$D",g]].forEach(function(B){U[B[1]]=function(S){return this.$g(S,B[0],B[1])}}),T.extend=function(B,S){return B.$i||(B(S,V,T),B.$i=!0),T},T.locale=L,T.isDayjs=D,T.unix=function(B){return T(1e3*B)},T.en=C[x],T.Ls=C,T.p={},T})})(ya);var Mf=ya.exports;const pe=Sf(Mf),Cf={class:"relative"},Df={class:"w-full"},Ef={class:"flex h-10 justify-between p-2"},Pf={class:"fm-typo-body-lg-400"},Of={class:"flex gap-1 items-center justify-center"},Af={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Bf=["onClick"],Tf=h.defineComponent({__name:"FmDatePicker",props:{label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=h.ref([]),s=h.ref(null),o=h.ref(!1),a=h.ref(pe()),r=h.ref(null),l=h.ref(null),c=m=>{s.value=m,t("update:modelValue",m.format("YYYY-MM-DD")),o.value=!1},d=()=>{i.value=[];const m=pe(a.value).startOf("month"),b=m.endOf("month"),y=m.month();let _=m.startOf("week"),k=[];for(;_.isBefore(b.endOf("week"));)_.day()===0&&k.length>0&&(i.value.push(k),k=[]),k.push({date:_,isCurrentMonth:_.month()===y}),_=_.add(1,"day");k.length>0&&i.value.push(k)},f=()=>{e.disabled||(o.value=!o.value,requestAnimationFrame(()=>{var b;const m=(b=r.value)==null?void 0:b.getBoundingClientRect();l.value.style.top=`${m.height+4}px`,l.value.style.left="0px"}))},u=m=>{const b=m.path||m.composedPath();for(const y of b)if(y==r.value||y==l.value)return;o.value=!1},p=m=>{a.value=m?a.value.add(1,"month"):a.value.subtract(1,"month"),d()},g=h.computed(()=>Array.from(Array(7),(m,b)=>pe().day(b).format("ddd")));return h.onMounted(()=>{window.addEventListener("click",u),d()}),h.onUnmounted(()=>{window.removeEventListener("click",u)}),(m,b)=>{var y;return h.openBlock(),h.createElementBlock("div",Cf,[h.createElementVNode("label",{ref_key:"buttonEl",ref:r,onClick:f},[h.createElementVNode("div",{class:h.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},h.toDisplayString(e.label),3),h.createElementVNode("div",{class:h.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[h.createElementVNode("div",{class:h.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"]])},h.toDisplayString(((y=s.value)==null?void 0:y.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512),h.createElementVNode("div",{ref_key:"dropdownEl",ref:l,class:h.normalizeClass(["absolute bg-fm-color-white fm-calendar gap-6 p-3 rounded-lg shadow-light-neutral-300 w-[360px]",[o.value?"block":"hidden"]])},[h.createElementVNode("div",Df,[h.createElementVNode("div",Ef,[h.createElementVNode("div",Pf,h.toDisplayString(a.value.format("MMMM YYYY")),1),h.createElementVNode("div",Of,[h.createVNode(st,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[0]||(b[0]=()=>p(!1))}),h.createVNode(st,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[1]||(b[1]=()=>p(!0))})])]),h.createElementVNode("div",null,[h.createElementVNode("div",Af,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(g.value,_=>(h.openBlock(),h.createElementBlock("div",{key:_,class:"fm-calendar__cell"},h.toDisplayString(_),1))),128))]),h.createElementVNode("div",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(_,k)=>(h.openBlock(),h.createElementBlock("div",{key:k,class:"fm-calendar__row fm-typo-body-lg-400"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(_,w=>(h.openBlock(),h.createElementBlock("div",{key:w.date.date(),class:"fm-calendar__cell"},[w.isCurrentMonth?(h.openBlock(),h.createElementBlock("button",{key:0,class:h.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":s.value===w.date}]),onClick:()=>c(w.date)},h.toDisplayString(w.date.date()),11,Bf)):h.createCommentVNode("",!0)]))),128))]))),128))])])])],2)])}}}),cg="",Lf=pt(Tf,[["__scopeId","data-v-2698ae54"]]),Ff=n=>(h.pushScopeId("data-v-02a11da6"),n=n(),h.popScopeId(),n),Vf={class:"flex gap-1 items-center relative w-full"},Rf=Ff(()=>h.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)),Nf={class:"w-full"},$f={class:"flex h-10 justify-between p-2"},If={class:"fm-typo-body-lg-400"},zf={class:"flex gap-1 items-center justify-center"},Wf={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Hf=["onClick"],jf=h.defineComponent({__name:"FmDateRangePicker",props:{label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=h.ref([]),s=h.ref({startDate:null,endDate:null}),o=h.ref(!1),a=h.ref(pe()),r=h.ref(null),l=h.ref(null),c=h.ref(null),d=y=>{var _,k;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=y;else if(y.isBefore(s.value.startDate)){const w=s.value.startDate;s.value={startDate:y,endDate:w}}else s.value.endDate=y;t("update:modelValue",{startDate:(_=s.value.startDate)==null?void 0:_.format("YYYY-MM-DD"),endDate:(k=s.value.endDate)==null?void 0:k.format("YYYY-MM-DD")}),s.value.startDate&&s.value.endDate&&(o.value=!1)},f=()=>{i.value=[];const y=pe(a.value).startOf("month"),_=y.endOf("month"),k=y.month();let w=y.startOf("week"),x=[];for(;w.isBefore(_.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)},u=()=>{e.disabled||(o.value=!o.value,requestAnimationFrame(()=>{var _;const y=(_=r.value)==null?void 0:_.getBoundingClientRect();c.value.style.top=`${y.height+4}px`,c.value.style.left="0px"}))},p=y=>{const _=y.path||y.composedPath();for(const k of _)if(k==r.value||k==l.value||k==c.value)return;o.value=!1},g=y=>{a.value=y?a.value.add(1,"month"):a.value.subtract(1,"month"),f()},m=h.computed(()=>Array.from(Array(7),(y,_)=>pe().day(_).format("ddd"))),b=y=>{var _,k,w,x;return{"fm-calendar__cell__button--selected":((_=s.value.startDate)==null?void 0:_.isSame(y))&&!s.value.endDate||((k=s.value.endDate)==null?void 0:k.isSame(y))&&!s.value.startDate,"fm-calendar__cell__button--selected-start":((w=s.value.startDate)==null?void 0:w.isSame(y))&&s.value.endDate,"fm-calendar__cell__button--selected-end":((x=s.value.endDate)==null?void 0:x.isSame(y))&&s.value.startDate,"fm-calendar__cell__button--selected-between":s.value.startDate&&s.value.endDate&&y.isAfter(s.value.startDate)&&y.isBefore(s.value.endDate)}};return h.onMounted(()=>{window.addEventListener("click",p),f()}),h.onUnmounted(()=>{window.removeEventListener("click",p)}),(y,_)=>{var k,w;return h.openBlock(),h.createElementBlock("div",Vf,[h.createElementVNode("label",{ref_key:"startButtonEl",ref:r,class:"w-full",onClick:u},[h.createElementVNode("div",{class:h.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},h.toDisplayString(e.label),3),h.createElementVNode("div",{class:h.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[h.createElementVNode("div",{class:h.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"]])},h.toDisplayString(((k=s.value.startDate)==null?void 0:k.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512),Rf,h.createElementVNode("label",{ref_key:"endButtonEl",ref:l,class:"w-full",onClick:u},[h.createElementVNode("div",{class:h.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},h.toDisplayString(e.label),3),h.createElementVNode("div",{class:h.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[h.createElementVNode("div",{class:h.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"]])},h.toDisplayString(((w=s.value.endDate)==null?void 0:w.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512),h.createElementVNode("div",{ref_key:"dropdownEl",ref:c,class:h.normalizeClass(["absolute bg-fm-color-white fm-calendar gap-6 p-3 rounded-lg shadow-light-300 w-[360px]",[o.value?"block":"hidden"]])},[h.createElementVNode("div",Nf,[h.createElementVNode("div",$f,[h.createElementVNode("div",If,h.toDisplayString(a.value.format("MMMM YYYY")),1),h.createElementVNode("div",zf,[h.createVNode(st,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:_[0]||(_[0]=()=>g(!1))}),h.createVNode(st,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:_[1]||(_[1]=()=>g(!0))})])]),h.createElementVNode("div",null,[h.createElementVNode("div",Wf,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.value,x=>(h.openBlock(),h.createElementBlock("div",{key:x,class:"fm-calendar__cell"},h.toDisplayString(x),1))),128))]),h.createElementVNode("div",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(x,C)=>(h.openBlock(),h.createElementBlock("div",{key:C,class:"fm-calendar__row fm-typo-body-lg-400"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(x,M=>(h.openBlock(),h.createElementBlock("div",{key:M.date.date(),class:"fm-calendar__cell"},[M.isCurrentMonth?(h.openBlock(),h.createElementBlock("button",{key:0,class:h.normalizeClass(["fm-calendar__cell__button",b(M.date)]),onClick:()=>d(M.date)},h.toDisplayString(M.date.date()),11,Hf)):h.createCommentVNode("",!0)]))),128))]))),128))])])])],2)])}}}),dg="",Yf=pt(jf,[["__scopeId","data-v-02a11da6"]]),Uf={class:"fm-checkbox"},Xf={class:"fm-checkbox--wrapper"},qf={class:"fm-checkbox__input--container"},Kf=["checked","disabled","indeterminate"],Gf={key:0,class:"fm-checkbox__label-container"},Zf={class:"fm-typo-body-lg-400"},Jf={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},_a=h.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=h.computed(()=>e.indeterminate?"remove":e.modelValue?"check_small":"");function s(){e.disabled||t("update:modelValue",!e.modelValue)}return(o,a)=>(h.openBlock(),h.createElementBlock("div",Uf,[h.createElementVNode("label",Xf,[h.createElementVNode("div",qf,[h.createElementVNode("input",{class:h.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,Kf),e.indeterminate||e.modelValue?(h.openBlock(),h.createBlock(st,{key:0,class:"fm-checkbox__input--checkmark",name:i.value,size:"md",color:"#FFFFFF"},null,8,["name"])):h.createCommentVNode("",!0)]),e.label?(h.openBlock(),h.createElementBlock("div",Gf,[h.renderSlot(o.$slots,"label"),h.createElementVNode("div",Zf,h.toDisplayString(e.label),1),e.sublabel?(h.openBlock(),h.createElementBlock("div",Jf,h.toDisplayString(e.sublabel),1)):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0)])]))}}),hg="",Qf={class:"fm-radio-btn"},tu={class:"fm-radio-btn__input--container"},eu=["value","disabled","checked"],nu={class:"py-8"},iu={class:"fm-typo-body-lg-400"},su={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},ou=h.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=h.resolveDirective("wave");return h.openBlock(),h.createElementBlock("div",Qf,[h.createElementVNode("label",{class:"cursor-pointer fm-radio-btn--wrapper",onClick:e[0]||(e[0]=s=>t.$emit("update:modelValue",t.value))},[h.withDirectives((h.openBlock(),h.createElementBlock("div",tu,[h.createElementVNode("input",{class:"fm-radio-btn__input--btn",type:"radio",value:t.value,disabled:t.disabled,checked:t.value===t.modelValue},null,8,eu)])),[[i,!t.disabled]]),h.createElementVNode("div",nu,[h.renderSlot(t.$slots,"label",{},void 0,!0),h.createElementVNode("div",iu,h.toDisplayString(t.label),1),t.sublabel?(h.openBlock(),h.createElementBlock("div",su,h.toDisplayString(t.sublabel),1)):h.createCommentVNode("",!0)])])])}}}),fg="",au=pt(ou,[["__scopeId","data-v-f55cf769"]]),ru={class:"relative"},lu=h.defineComponent({__name:"FmDropdown",props:{isOpen:{type:Boolean,default:!1},placement:{default:"bottom-left"},disabled:{type:Boolean,default:!1}},emits:["dropdown-changed"],setup(n,{expose:t,emit:e}){const i=n,s=h.ref(!1),o=h.ref(null),a=h.ref(null);t({show:()=>{s.value||(s.value=!0,e("dropdown-changed",s.value))},hide:()=>{s.value&&(s.value=!1,e("dropdown-changed",s.value))}});const r=()=>{i.disabled||(s.value=!s.value,requestAnimationFrame(()=>{var f,u;const c=(f=a.value)==null?void 0:f.getBoundingClientRect(),d=(u=o.value)==null?void 0:u.getBoundingClientRect();i.placement.includes("bottom")?a.value.style.top=`${d.height+4}px`:i.placement.includes("top")&&(a.value.style.top=`${-c.height-4}px`),i.placement.includes("left")?a.value.style.left="0px":i.placement.includes("center")?a.value.style.left=`${d.width/2-c.width/2}px`:i.placement.includes("right")&&(a.value.style.right="0px")}),e("dropdown-changed",s.value))},l=c=>{if(!s.value)return;const d=c.path||c.composedPath();for(const f of d)if(f==o.value||f==a.value)return;s.value=!1,e("dropdown-changed",s.value)};return h.watch(()=>i.isOpen,c=>s.value=c),h.onMounted(()=>{s.value=i.isOpen,window.addEventListener("click",l)}),h.onUnmounted(()=>{window.removeEventListener("click",l)}),(c,d)=>(h.openBlock(),h.createElementBlock("div",ru,[h.createElementVNode("div",{ref_key:"buttonEl",ref:o,class:"fm-dropdown",onClick:r},[h.renderSlot(c.$slots,"dropdown-button",{},void 0,!0)],512),h.createElementVNode("div",{ref_key:"dropdownEl",ref:a,class:h.normalizeClass({"fm-dropdown__content":!0,"fm-dropdown__content--opened":s.value})},[h.renderSlot(c.$slots,"dropdown-content",{},void 0,!0)],2)]))}}),ug="",xa=pt(lu,[["__scopeId","data-v-7af605e2"]]),pg="",cu={},du={class:"fm-menu"};function hu(n,t){return h.openBlock(),h.createElementBlock("div",du,[h.renderSlot(n.$slots,"default",{},void 0,!0)])}const ka=pt(cu,[["render",hu],["__scopeId","data-v-865b55a8"]]),fu={class:"fm-menu-item--left"},uu={key:0,class:"fm-menu-item--right"},pu=h.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)=>(h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("div",{class:h.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":o.modelValue&&!o.hasCheckbox,"fm-menu-item--disabled":o.disabled}),onClick:i},[h.createElementVNode("div",fu,[!o.hasCheckbox&&o.icon?(h.openBlock(),h.createBlock(st,{key:0,name:o.icon,size:"md",color:o.disabled?"#C7C7CC":o.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","color"])):h.createCommentVNode("",!0),o.hasCheckbox?(h.openBlock(),h.createBlock(_a,{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"])):h.createCommentVNode("",!0),h.createElementVNode("div",null,[h.renderSlot(o.$slots,"label",{},void 0,!0),h.createElementVNode("div",{class:h.normalizeClass(`fm-typo-body-lg-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-primary"}`)},h.toDisplayString(o.label),3),o.sublabel?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(`fm-typo-body-md-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-secondary"}`)},h.toDisplayString(o.sublabel),3)):h.createCommentVNode("",!0)])]),o.expandable?(h.openBlock(),h.createElementBlock("div",uu,[h.createVNode(st,{name:"chevron_right",size:"md",color:o.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):h.createCommentVNode("",!0)],2)]))}}),gg="",wa=pt(pu,[["__scopeId","data-v-2c63be46"]]),gu={class:"fm-select"},mu=h.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=h.ref(!1),s=h.ref([]),o=(r,l)=>{if(e.multiselect){let c=[];r?(c=[...h.toRaw(e.modelValue),l.value],s.value=[...s.value,l]):(c=[...e.modelValue],c=c.filter(d=>JSON.stringify(h.toRaw(d))!==JSON.stringify(l.value)),s.value=s.value.filter(d=>d.label!==l.label)),t("update:modelValue",c)}else i.value=!1,s.value=[l],t("update:modelValue",l.value)},a=h.computed(()=>{const r=s.value.map(l=>l.label).join(", ");return r===""?e.placeholder:r});return(r,l)=>(h.openBlock(),h.createBlock(xa,{disabled:r.disabled,"is-open":i.value,placement:r.placement,onDropdownChanged:l[0]||(l[0]=c=>i.value=c)},{"dropdown-button":h.withCtx(()=>[h.createElementVNode("div",gu,[h.createElementVNode("label",{class:h.normalizeClass({"cursor-not-allowed":r.disabled})},[h.renderSlot(r.$slots,"label",{},void 0,!0),h.createElementVNode("div",{class:h.normalizeClass({"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!r.disabled,"text-fm-color-typo-disabled":r.disabled})},h.toDisplayString(r.label),3),h.createElementVNode("div",{class:h.normalizeClass({"fm-select__container":!0,"fm-select__container--expanded":i.value,"fm-select__container--disabled":r.disabled})},[h.createElementVNode("div",{class:h.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})},h.toDisplayString(a.value),3),h.createVNode(st,{name:i.value?"expand_less":"expand_more",size:"md",color:r.disabled?"#C7C7CC":"black"},null,8,["name","color"])],2)],2)])]),"dropdown-content":h.withCtx(()=>[h.createVNode(ka,{class:"w-[280px]"},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.items,c=>(h.openBlock(),h.createBlock(wa,{key:c.value,"has-checkbox":r.multiselect,label:c.label,value:c.value,"model-value":s.value.map(d=>d.label).includes(c.label),"onUpdate:modelValue":d=>o(d,c)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))]),_:1})]),_:3},8,["disabled","is-open","placement"]))}}),mg="",bu=pt(mu,[["__scopeId","data-v-fbd57494"]]),yu={class:"cursor-pointer fm-switch__container"},_u={key:0},xu={class:"fm-typo-body-lg-400"},ku={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},wu={class:"fm-switch__input--container"},vu=["checked","value","disabled"],Su={key:1},Mu={class:"fm-typo-body-lg-400"},Cu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Du=h.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)=>(h.openBlock(),h.createElementBlock("label",yu,[s.labelPlacement==="left"?(h.openBlock(),h.createElementBlock("div",_u,[h.renderSlot(s.$slots,"label",{},void 0,!0),h.createElementVNode("div",xu,h.toDisplayString(s.label),1),s.sublabel?(h.openBlock(),h.createElementBlock("div",ku,h.toDisplayString(s.sublabel),1)):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0),h.createElementVNode("div",wu,[h.createElementVNode("input",{checked:s.modelValue,class:"fm-switch__input--btn",type:"checkbox",value:s.value,disabled:s.disabled,onClick:i},null,8,vu),h.createElementVNode("div",{class:h.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":s.showIcon})},[s.showIcon?(h.openBlock(),h.createBlock(st,{key:0,name:s.modelValue?"check":"close",size:"sm",color:s.disabled?"#C7C7CC":s.modelValue?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):h.createCommentVNode("",!0)],2)]),s.labelPlacement==="right"?(h.openBlock(),h.createElementBlock("div",Su,[h.createElementVNode("div",Mu,h.toDisplayString(s.label),1),s.sublabel?(h.openBlock(),h.createElementBlock("div",Cu,h.toDisplayString(s.sublabel),1)):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0)]))}}),bg="",Eu=pt(Du,[["__scopeId","data-v-77ad1e00"]]);function Pu(){const n=h.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 Ou={class:"fm-text-field"},Au={class:"fm-text-field--label"},Bu=["value","inputMode","type","placeholder","required","minlength","maxlength","disabled","readOnly"],Tu={class:"fm-text-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},Lu={key:0},Fu={key:1};var va=(n=>(n.required="*",n.optional="(optional)",n))(va||{});const Vu=h.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=h.ref(!1),s=h.ref(!1),o=h.ref([]),{validate:a}=Pu(),r=l=>{let c=a(l.target.value,e.rules);l.target.value||(c=[]),o.value=c,i.value=c.length===0,t("update:modelValue",l.target.value)};return h.watch(()=>e.modelValue,l=>{o.value=a(l,e.rules),i.value=o.value.length===0}),(l,c)=>(h.openBlock(),h.createElementBlock("label",Ou,[h.createElementVNode("div",null,[h.createElementVNode("div",Au,[h.renderSlot(l.$slots,"label"),h.createElementVNode("span",{class:h.normalizeClass({"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!l.disabled,"text-fm-color-typo-disabled":l.disabled})},h.toDisplayString(l.label),3),l.labelMark!=="none"?(h.openBlock(),h.createElementBlock("span",{key:0,class:h.normalizeClass({"fm-color-typo-tertiary fm-typo-body-md-400":l.labelMark==="optional","fm-color-typo-error fm-typo-body-lg-700":l.labelMark==="required"})},h.toDisplayString(va[l.labelMark]),3)):h.createCommentVNode("",!0)])]),h.createElementVNode("div",{class:h.normalizeClass({"fm-text-field__container":!0,"fm-text-field__container--focused":s.value,"fm-text-field__container--invalid":l.inputState==="error"&&!!l.modelValue&&!i.value,"fm-text-field__container--valid":l.inputState==="success"&&!!l.modelValue&&i.value,"fm-text-field__container--warning":l.inputState==="warning","fm-text-field__container--disabled":l.disabled})},[h.renderSlot(l.$slots,"prepend"),l.leadingIcon.name?(h.openBlock(),h.createBlock(st,{key:0,name:l.leadingIcon.name,size:"md",color:l.leadingIcon.color??(l.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):h.createCommentVNode("",!0),h.createElementVNode("input",{class:h.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!l.disabled,"fm-color-typo-disabled":l.disabled}),value:l.modelValue,inputMode:l.inputmode,type:l.inputmode,placeholder:l.placeholder,required:l.required,minlength:l.minLength,maxlength:l.maxLength,disabled:l.disabled,readOnly:l.readonly,onInput:r,onFocus:c[0]||(c[0]=()=>s.value=!0),onBlur:c[1]||(c[1]=()=>s.value=!1)},null,42,Bu),h.renderSlot(l.$slots,"append"),l.trailingIcon.name?(h.openBlock(),h.createBlock(st,{key:1,name:l.trailingIcon.name,size:"md",color:l.trailingIcon.color??(l.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):h.createCommentVNode("",!0)],2),h.createElementVNode("div",Tu,[h.renderSlot(l.$slots,"helper-text"),o.value.length===0?(h.openBlock(),h.createElementBlock("div",Lu,[h.renderSlot(l.$slots,"helper-text"),h.createTextVNode(" "+h.toDisplayString(l.helperText),1)])):(h.openBlock(),h.createElementBlock("div",Fu,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(o.value,d=>(h.openBlock(),h.createElementBlock("div",{key:d,class:"flex gap-4 items-center text-fm-color-typo-error"},[h.createVNode(st,{name:"error",color:"#FF3B30",size:"sm"}),h.createElementVNode("span",null,h.toDisplayString(d),1)]))),128))])),h.createElementVNode("div",{class:h.normalizeClass({"fm-color-typo-disabled":l.disabled})},h.toDisplayString(l.maxLength?`${l.modelValue.length} / ${l.maxLength}`:""),3)])]))}}),yg="",Ru={class:"fm-textarea"},Nu={htmlFor:"{this.name}"},$u={class:"fm-textarea--label"},Iu=["value","placeholder","required","minlength","maxlength","readOnly","disabled"],zu={class:"fm-color-typo-secondary fm-textarea__helper-container fm-typo-body-sm-400"},Wu={class:"fm-textarea__helper__icon"};var Sa=(n=>(n.required="*",n.optional="(optional)",n))(Sa||{}),Ma=(n=>(n.success="check_circle",n.warning="warning",n.error="error",n))(Ma||{}),Ca=(n=>(n.success="#34C759",n.warning="#FF9500",n.error="#FF3B30",n))(Ca||{});const Hu=h.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=h.ref(!1),i=s=>{t("update:modelValue",s.target.value)};return(s,o)=>(h.openBlock(),h.createElementBlock("div",Ru,[h.createElementVNode("label",Nu,[h.createElementVNode("div",$u,[h.renderSlot(s.$slots,"label"),h.createElementVNode("span",{class:h.normalizeClass({"fm-typo-body-lg-400":!0,"fm-color-typo-primary":!s.disabled,"fm-color-typo-disabled":s.disabled})},h.toDisplayString(s.label),3),s.labelMark!=="none"?(h.openBlock(),h.createElementBlock("span",{key:0,class:h.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"})},h.toDisplayString(Sa[s.labelMark]),3)):h.createCommentVNode("",!0)])]),h.createElementVNode("div",{class:h.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})},[h.createElementVNode("textarea",{class:h.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,Iu)],2),h.createElementVNode("div",zu,[h.renderSlot(s.$slots,"helper-text"),h.createElementVNode("div",Wu,[s.inputState!=="default"&&s.modelValue?(h.openBlock(),h.createBlock(st,{key:0,name:Ma[s.inputState],size:"sm",color:Ca[s.inputState]},null,8,["name","color"])):h.createCommentVNode("",!0),h.createElementVNode("span",{class:h.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})},h.toDisplayString(s.helperText),3)]),h.createElementVNode("div",{class:h.normalizeClass({"fm-color-typo-disabled":s.disabled})},h.toDisplayString(s.maxLength?`${s.modelValue.length} / ${s.maxLength}`:""),3)])]))}}),_g="",ju={class:"flex gap-2 items-start justify-end p-0 self-stretch"},Yu={key:0,class:"bg-white flex flex-col gap-5 p-6 w-1/3"},Uu=h.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=h.ref([...t.steps]),i=h.computed(()=>e.value.length),s=h.ref(0),o=h.computed(()=>e.value[s.value]);h.onMounted(()=>{for(let f=0;f<i.value;f++)e.value[f].status=f===0?"active":"default"}),h.watch(s,async(f,u)=>{if(u!=i.value)if(f<i.value)e.value[f].status="active";else{const p=e.value[u].submitForm;p&&e.value.filter(m=>m.status==="error").length===0&&(s.value=0,p())}});const a=h.computed(()=>o.value.validateStep),r=h.computed(()=>{const f=o.value.validateStep;return f?f():!0}),l=f=>{a.value?r.value?(o.value.status="completed",s.value=f):o.value.status="error":c(f)},c=f=>{o.value.status="completed",s.value=f},d=h.computed(()=>{const f=o.value.validateStep;return f?!f():!1});return(f,u)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(`container--${n.orientation}`)},[h.createElementVNode("div",{class:h.normalizeClass(`flex justify-start fm-pi-container--${n.orientation}`)},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.value,(p,g)=>(h.openBlock(),h.createBlock(Da,{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),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(Object.keys(f.$slots),p=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:p},[`step${s.value+1}`===p?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(`flex fm-pi-form--${n.orientation}`)},[h.createElementVNode("div",{class:h.normalizeClass(`bg-white flex flex-col gap-10 p-6 ${f.$slots.card?"w-2/3":"w-full"}`)},[h.createElementVNode("form",{class:"flex flex-col gap-2 p-0 self-stretch",onSubmit:u[1]||(u[1]=h.withModifiers(g=>l(s.value+1),["prevent"]))},[h.renderSlot(f.$slots,p,{class:"gap-0 items-start p-0 self-stretch"}),h.createElementVNode("div",ju,[p!="step1"?(h.openBlock(),h.createBlock(tn,{key:0,type:"button",label:n.previousButtonLabel,variant:"tertiary",onClick:u[0]||(u[0]=h.withModifiers(g=>l(s.value-1),["stop"]))},null,8,["label"])):h.createCommentVNode("",!0),h.createVNode(tn,{variant:"primary",disabled:d.value,label:s.value!=e.value.length-1?n.nextButtonLabel:n.submitButtonLabel,type:"submit"},null,8,["disabled","label"])])],32)],2),f.$slots.card?(h.openBlock(),h.createElementBlock("div",Yu,[h.renderSlot(f.$slots,"card")])):h.createCommentVNode("",!0)],2)):h.createCommentVNode("",!0)],64))),128))],2))}}),xg="",ge=n=>(h.pushScopeId("data-v-a720221d"),n=n(),h.popScopeId(),n),Xu={class:"items-start self-stretch"},qu={class:"flex gap-3 hover:cursor-pointer items-start pl-1 pr-5 py-0 self-stretch"},Ku={key:0,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},Gu=[ge(()=>h.createElementVNode("circle",{cx:"12",cy:"12",r:"11",stroke:"#AEAEB2","stroke-width":"2"},null,-1))],Zu={key:1,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},Ju=[ge(()=>h.createElementVNode("circle",{cx:"12",cy:"12",r:"10",fill:"#FF7823",stroke:"#FF7823","stroke-width":"4"},null,-1))],Qu={key:2,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},tp=[ge(()=>h.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)),ge(()=>h.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))],ep={key:3,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},np=[ge(()=>h.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))],ip={key:4,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},sp=[ge(()=>h.createElementVNode("circle",{cx:"12",cy:"12",r:"11",stroke:"#C7C7CC","stroke-width":"2"},null,-1))],op={class:"flex flex-1 flex-col fm-pi-content-container gap-1 items-start justify-center p-0"},ap=h.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=h.computed(()=>o[e.status]),s=h.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=h.resolveDirective("wave");return h.withDirectives((h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(`flex gap-1 fm-pi-item-container fm-pi-item-container--${n.orientation}`),onClick:l[0]||(l[0]=h.withModifiers(d=>t("validate-step"),["stop"]))},[h.createElementVNode("div",Xu,[h.createElementVNode("div",{class:h.normalizeClass(`self-stretch fm-pi-item-line fm-pi-item-line--${n.orientation} ${s.value} `)},null,2)]),h.createElementVNode("div",qu,[h.createElementVNode("div",null,[n.status==="default"?(h.openBlock(),h.createElementBlock("svg",Ku,Gu)):h.createCommentVNode("",!0),n.status==="active"?(h.openBlock(),h.createElementBlock("svg",Zu,Ju)):h.createCommentVNode("",!0),n.status==="completed"?(h.openBlock(),h.createElementBlock("svg",Qu,tp)):h.createCommentVNode("",!0),n.status==="error"?(h.openBlock(),h.createElementBlock("svg",ep,np)):h.createCommentVNode("",!0),n.status==="disabled"?(h.openBlock(),h.createElementBlock("svg",ip,sp)):h.createCommentVNode("",!0)]),h.createElementVNode("div",op,[h.createElementVNode("span",{class:h.normalizeClass(["fm-typo-body-lg-400",i.value])},h.toDisplayString(n.titleText),3),h.createElementVNode("span",{class:h.normalizeClass(["fm-typo-body-sm-400 overflow-hidden text-ellipsis",n.status!=="disabled"?"text-fm-color-typo-secondary":"text-fm-color-typo-disabled"])},h.toDisplayString(n.supportingText),3)])])],2)),[[c]])}}}),Dg="",Da=pt(ap,[["__scopeId","data-v-a720221d"]]),rp={class:"flex"},lp={key:0,class:"mt-8"},cp=h.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=h.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=h.computed(()=>e.title?{text:e.title,classes:"fm-typo-body-lg-700"}:{text:e.description,classes:""}),o=h.computed(()=>e.bgColor?Xn(e.bgColor)?{style:{backgroundColor:e.bgColor}}:{class:`bg-fm-color-${e.bgColor}`}:{class:`bg-fm-color-${i.value.bgColor}`}),a=h.computed(()=>e.color?Xn(e.color)?{style:{color:e.color}}:{class:`text-fm-color-${e.color}`}:{class:`text-fm-color-${i.value.actionColor}`});return(r,l)=>(h.openBlock(),h.createElementBlock("div",h.mergeProps(o.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[h.createElementVNode("div",rp,[i.value.icon?(h.openBlock(),h.createBlock(st,{key:0,name:i.value.icon.name,color:e.color??i.value.icon.color,class:"mr-12"},null,8,["name","color"])):h.createCommentVNode("",!0),h.createElementVNode("div",{class:h.normalizeClass(`${s.value.classes} grow ellipsis`)},h.toDisplayString(s.value.text),3),e.dismissable?(h.openBlock(),h.createBlock(st,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:l[0]||(l[0]=()=>t("onDismiss"))})):h.createCommentVNode("",!0)]),e.title&&e.description?(h.openBlock(),h.createElementBlock("div",lp,h.toDisplayString(e.description),1)):h.createCommentVNode("",!0),h.renderSlot(r.$slots,"actions",{},()=>[e.action?(h.openBlock(),h.createElementBlock("div",h.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[h.createElementVNode("span",{class:"cursor-pointer",onClick:l[1]||(l[1]=()=>t("onAction"))},h.toDisplayString(e.action),1)],16)):h.createCommentVNode("",!0)],!0)],16))}}),Eg="",dp=pt(cp,[["__scopeId","data-v-b6db34bb"]]),Ue=Math.min,me=Math.max,Nn=Math.round,Wt=n=>({x:n,y:n}),hp={left:"right",right:"left",bottom:"top",top:"bottom"},fp={start:"end",end:"start"};function Ni(n,t,e){return me(n,Ue(t,e))}function Xe(n,t){return typeof n=="function"?n(t):n}function se(n){return n.split("-")[0]}function qe(n){return n.split("-")[1]}function Ea(n){return n==="x"?"y":"x"}function $i(n){return n==="y"?"height":"width"}function $n(n){return["top","bottom"].includes(se(n))?"y":"x"}function Ii(n){return Ea($n(n))}function up(n,t,e){e===void 0&&(e=!1);const i=qe(n),s=Ii(n),o=$i(s);let a=s==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=In(a)),[a,In(a)]}function pp(n){const t=In(n);return[zi(n),t,zi(t)]}function zi(n){return n.replace(/start|end/g,t=>fp[t])}function gp(n,t,e){const i=["left","right"],s=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(n){case"top":case"bottom":return e?t?s:i:t?i:s;case"left":case"right":return t?o:a;default:return[]}}function mp(n,t,e,i){const s=qe(n);let o=gp(se(n),e==="start",i);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(zi)))),o}function In(n){return n.replace(/left|right|bottom|top/g,t=>hp[t])}function bp(n){return{top:0,right:0,bottom:0,left:0,...n}}function Pa(n){return typeof n!="number"?bp(n):{top:n,right:n,bottom:n,left:n}}function zn(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function Oa(n,t,e){let{reference:i,floating:s}=n;const o=$n(t),a=Ii(t),r=$i(a),l=se(t),c=o==="y",d=i.x+i.width/2-s.width/2,f=i.y+i.height/2-s.height/2,u=i[r]/2-s[r]/2;let p;switch(l){case"top":p={x:d,y:i.y-s.height};break;case"bottom":p={x:d,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:f};break;case"left":p={x:i.x-s.width,y:f};break;default:p={x:i.x,y:i.y}}switch(qe(t)){case"start":p[a]-=u*(e&&c?-1:1);break;case"end":p[a]+=u*(e&&c?-1:1);break}return p}const yp=async(n,t,e)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:a}=e,r=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:n,floating:t,strategy:s}),{x:d,y:f}=Oa(c,i,l),u=i,p={},g=0;for(let m=0;m<r.length;m++){const{name:b,fn:y}=r[m],{x:_,y:k,data:w,reset:x}=await y({x:d,y:f,initialPlacement:i,placement:u,strategy:s,middlewareData:p,rects:c,platform:a,elements:{reference:n,floating:t}});if(d=_??d,f=k??f,p={...p,[b]:{...p[b],...w}},x&&g<=50){g++,typeof x=="object"&&(x.placement&&(u=x.placement),x.rects&&(c=x.rects===!0?await a.getElementRects({reference:n,floating:t,strategy:s}):x.rects),{x:d,y:f}=Oa(c,u,l)),m=-1;continue}}return{x:d,y:f,placement:u,strategy:s,middlewareData:p}};async function Aa(n,t){var e;t===void 0&&(t={});const{x:i,y:s,platform:o,rects:a,elements:r,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:u=!1,padding:p=0}=Xe(t,n),g=Pa(p),b=r[u?f==="floating"?"reference":"floating":f],y=zn(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(b)))==null||e?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(r.floating)),boundary:c,rootBoundary:d,strategy:l})),_=f==="floating"?{...a.floating,x:i,y:s}:a.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(r.floating)),w=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},x=zn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:k,strategy:l}):_);return{top:(y.top-x.top+g.top)/w.y,bottom:(x.bottom-y.bottom+g.bottom)/w.y,left:(y.left-x.left+g.left)/w.x,right:(x.right-y.right+g.right)/w.x}}const _p=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:i,placement:s,rects:o,platform:a,elements:r,middlewareData:l}=t,{element:c,padding:d=0}=Xe(n,t)||{};if(c==null)return{};const f=Pa(d),u={x:e,y:i},p=Ii(s),g=$i(p),m=await a.getDimensions(c),b=p==="y",y=b?"top":"left",_=b?"bottom":"right",k=b?"clientHeight":"clientWidth",w=o.reference[g]+o.reference[p]-u[p]-o.floating[g],x=u[p]-o.reference[p],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let M=C?C[k]:0;(!M||!await(a.isElement==null?void 0:a.isElement(C)))&&(M=r.floating[k]||o.floating[g]);const D=w/2-x/2,L=M/2-m[g]/2-1,T=Ue(f[y],L),A=Ue(f[_],L),V=T,U=M-m[g]-A,B=M/2-m[g]/2+D,S=Ni(V,B,U),v=!l.arrow&&qe(s)!=null&&B!=S&&o.reference[g]/2-(B<V?T:A)-m[g]/2<0,E=v?B<V?B-V:B-U:0;return{[p]:u[p]+E,data:{[p]:S,centerOffset:B-S-E,...v&&{alignmentOffset:E}},reset:v}}}),xp=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,i;const{placement:s,middlewareData:o,rects:a,initialPlacement:r,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=Xe(n,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};const y=se(s),_=se(r)===r,k=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=u||(_||!m?[In(r)]:pp(r));!u&&g!=="none"&&w.push(...mp(r,m,g,k));const x=[r,...w],C=await Aa(t,b),M=[];let D=((i=o.flip)==null?void 0:i.overflows)||[];if(d&&M.push(C[y]),f){const V=up(s,a,k);M.push(C[V[0]],C[V[1]])}if(D=[...D,{placement:s,overflows:M}],!M.every(V=>V<=0)){var L,T;const V=(((L=o.flip)==null?void 0:L.index)||0)+1,U=x[V];if(U)return{data:{index:V,overflows:D},reset:{placement:U}};let B=(T=D.filter(S=>S.overflows[0]<=0).sort((S,v)=>S.overflows[1]-v.overflows[1])[0])==null?void 0:T.placement;if(!B)switch(p){case"bestFit":{var A;const S=(A=D.map(v=>[v.placement,v.overflows.filter(E=>E>0).reduce((E,O)=>E+O,0)]).sort((v,E)=>v[1]-E[1])[0])==null?void 0:A[0];S&&(B=S);break}case"initialPlacement":B=r;break}if(s!==B)return{reset:{placement:B}}}return{}}}};async function kp(n,t){const{placement:e,platform:i,elements:s}=n,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),a=se(e),r=qe(e),l=$n(e)==="y",c=["left","top"].includes(a)?-1:1,d=o&&l?-1:1,f=Xe(t,n);let{mainAxis:u,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return r&&typeof g=="number"&&(p=r==="end"?g*-1:g),l?{x:p*d,y:u*c}:{x:u*c,y:p*d}}const wp=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){const{x:e,y:i}=t,s=await kp(t,n);return{x:e+s.x,y:i+s.y,data:s}}}},vp=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:i,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:r={fn:b=>{let{x:y,y:_}=b;return{x:y,y:_}}},...l}=Xe(n,t),c={x:e,y:i},d=await Aa(t,l),f=$n(se(s)),u=Ea(f);let p=c[u],g=c[f];if(o){const b=u==="y"?"top":"left",y=u==="y"?"bottom":"right",_=p+d[b],k=p-d[y];p=Ni(_,p,k)}if(a){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",_=g+d[b],k=g-d[y];g=Ni(_,g,k)}const m=r.fn({...t,[u]:p,[f]:g});return{...m,data:{x:m.x-e,y:m.y-i}}}}};function Ht(n){return Ba(n)?(n.nodeName||"").toLowerCase():"#document"}function ut(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function jt(n){var t;return(t=(Ba(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Ba(n){return n instanceof Node||n instanceof ut(n).Node}function Tt(n){return n instanceof Element||n instanceof ut(n).Element}function vt(n){return n instanceof HTMLElement||n instanceof ut(n).HTMLElement}function Ta(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof ut(n).ShadowRoot}function Ke(n){const{overflow:t,overflowX:e,overflowY:i,display:s}=mt(n);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&!["inline","contents"].includes(s)}function Sp(n){return["table","td","th"].includes(Ht(n))}function Wi(n){const t=Hi(),e=mt(n);return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(e.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(e.contain||"").includes(i))}function Mp(n){let t=be(n);for(;vt(t)&&!Wn(t);){if(Wi(t))return t;t=be(t)}return null}function Hi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Wn(n){return["html","body","#document"].includes(Ht(n))}function mt(n){return ut(n).getComputedStyle(n)}function Hn(n){return Tt(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function be(n){if(Ht(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Ta(n)&&n.host||jt(n);return Ta(t)?t.host:t}function La(n){const t=be(n);return Wn(t)?n.ownerDocument?n.ownerDocument.body:n.body:vt(t)&&Ke(t)?t:La(t)}function ji(n,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);const s=La(n),o=s===((i=n.ownerDocument)==null?void 0:i.body),a=ut(s);return o?t.concat(a,a.visualViewport||[],Ke(s)?s:[],a.frameElement&&e?ji(a.frameElement):[]):t.concat(s,ji(s,[],e))}function Fa(n){const t=mt(n);let e=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=vt(n),o=s?n.offsetWidth:e,a=s?n.offsetHeight:i,r=Nn(e)!==o||Nn(i)!==a;return r&&(e=o,i=a),{width:e,height:i,$:r}}function Va(n){return Tt(n)?n:n.contextElement}function ye(n){const t=Va(n);if(!vt(t))return Wt(1);const e=t.getBoundingClientRect(),{width:i,height:s,$:o}=Fa(t);let a=(o?Nn(e.width):e.width)/i,r=(o?Nn(e.height):e.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!r||!Number.isFinite(r))&&(r=1),{x:a,y:r}}const Cp=Wt(0);function Ra(n){const t=ut(n);return!Hi()||!t.visualViewport?Cp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Dp(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==ut(n)?!1:t}function Ge(n,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);const s=n.getBoundingClientRect(),o=Va(n);let a=Wt(1);t&&(i?Tt(i)&&(a=ye(i)):a=ye(n));const r=Dp(o,e,i)?Ra(o):Wt(0);let l=(s.left+r.x)/a.x,c=(s.top+r.y)/a.y,d=s.width/a.x,f=s.height/a.y;if(o){const u=ut(o),p=i&&Tt(i)?ut(i):i;let g=u.frameElement;for(;g&&i&&p!==u;){const m=ye(g),b=g.getBoundingClientRect(),y=mt(g),_=b.left+(g.clientLeft+parseFloat(y.paddingLeft))*m.x,k=b.top+(g.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,f*=m.y,l+=_,c+=k,g=ut(g).frameElement}}return zn({width:d,height:f,x:l,y:c})}function Ep(n){let{rect:t,offsetParent:e,strategy:i}=n;const s=vt(e),o=jt(e);if(e===o)return t;let a={scrollLeft:0,scrollTop:0},r=Wt(1);const l=Wt(0);if((s||!s&&i!=="fixed")&&((Ht(e)!=="body"||Ke(o))&&(a=Hn(e)),vt(e))){const c=Ge(e);r=ye(e),l.x=c.x+e.clientLeft,l.y=c.y+e.clientTop}return{width:t.width*r.x,height:t.height*r.y,x:t.x*r.x-a.scrollLeft*r.x+l.x,y:t.y*r.y-a.scrollTop*r.y+l.y}}function Pp(n){return Array.from(n.getClientRects())}function Na(n){return Ge(jt(n)).left+Hn(n).scrollLeft}function Op(n){const t=jt(n),e=Hn(n),i=n.ownerDocument.body,s=me(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=me(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-e.scrollLeft+Na(n);const r=-e.scrollTop;return mt(i).direction==="rtl"&&(a+=me(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:a,y:r}}function Ap(n,t){const e=ut(n),i=jt(n),s=e.visualViewport;let o=i.clientWidth,a=i.clientHeight,r=0,l=0;if(s){o=s.width,a=s.height;const c=Hi();(!c||c&&t==="fixed")&&(r=s.offsetLeft,l=s.offsetTop)}return{width:o,height:a,x:r,y:l}}function Bp(n,t){const e=Ge(n,!0,t==="fixed"),i=e.top+n.clientTop,s=e.left+n.clientLeft,o=vt(n)?ye(n):Wt(1),a=n.clientWidth*o.x,r=n.clientHeight*o.y,l=s*o.x,c=i*o.y;return{width:a,height:r,x:l,y:c}}function $a(n,t,e){let i;if(t==="viewport")i=Ap(n,e);else if(t==="document")i=Op(jt(n));else if(Tt(t))i=Bp(t,e);else{const s=Ra(n);i={...t,x:t.x-s.x,y:t.y-s.y}}return zn(i)}function Ia(n,t){const e=be(n);return e===t||!Tt(e)||Wn(e)?!1:mt(e).position==="fixed"||Ia(e,t)}function Tp(n,t){const e=t.get(n);if(e)return e;let i=ji(n,[],!1).filter(r=>Tt(r)&&Ht(r)!=="body"),s=null;const o=mt(n).position==="fixed";let a=o?be(n):n;for(;Tt(a)&&!Wn(a);){const r=mt(a),l=Wi(a);!l&&r.position==="fixed"&&(s=null),(o?!l&&!s:!l&&r.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Ke(a)&&!l&&Ia(n,a))?i=i.filter(d=>d!==a):s=r,a=be(a)}return t.set(n,i),i}function Lp(n){let{element:t,boundary:e,rootBoundary:i,strategy:s}=n;const a=[...e==="clippingAncestors"?Tp(t,this._c):[].concat(e),i],r=a[0],l=a.reduce((c,d)=>{const f=$a(t,d,s);return c.top=me(f.top,c.top),c.right=Ue(f.right,c.right),c.bottom=Ue(f.bottom,c.bottom),c.left=me(f.left,c.left),c},$a(t,r,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Fp(n){return Fa(n)}function Vp(n,t,e){const i=vt(t),s=jt(t),o=e==="fixed",a=Ge(n,!0,o,t);let r={scrollLeft:0,scrollTop:0};const l=Wt(0);if(i||!i&&!o)if((Ht(t)!=="body"||Ke(s))&&(r=Hn(t)),i){const c=Ge(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else s&&(l.x=Na(s));return{x:a.left+r.scrollLeft-l.x,y:a.top+r.scrollTop-l.y,width:a.width,height:a.height}}function za(n,t){return!vt(n)||mt(n).position==="fixed"?null:t?t(n):n.offsetParent}function Wa(n,t){const e=ut(n);if(!vt(n))return e;let i=za(n,t);for(;i&&Sp(i)&&mt(i).position==="static";)i=za(i,t);return i&&(Ht(i)==="html"||Ht(i)==="body"&&mt(i).position==="static"&&!Wi(i))?e:i||Mp(n)||e}const Rp=async function(n){let{reference:t,floating:e,strategy:i}=n;const s=this.getOffsetParent||Wa,o=this.getDimensions;return{reference:Vp(t,await s(e),i),floating:{x:0,y:0,...await o(e)}}};function Np(n){return mt(n).direction==="rtl"}const $p={convertOffsetParentRelativeRectToViewportRelativeRect:Ep,getDocumentElement:jt,getClippingRect:Lp,getOffsetParent:Wa,getElementRects:Rp,getClientRects:Pp,getDimensions:Fp,getScale:ye,isElement:Tt,isRTL:Np},Ip=(n,t,e)=>{const i=new Map,s={platform:$p,...e},o={...s.platform,_c:i};return yp(n,t,{...s,platform:o})};function zp(n){var t;return(t=n==null?void 0:n.$el)!=null?t:n}function Wp(n){return{name:"arrow",options:n,fn(t){const e=zp(h.unref(n.element));return e==null?{}:_p({element:e,padding:n.padding}).fn(t)}}}const Hp={class:"px-2 py-0"},jp={key:0,class:"fm-typo-body-xl-700"},Yp={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},Up=h.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},beak:{default:"top"},hasArrow:{type:Boolean,default:!0},titleText:{default:"Title"},contentText:{},actionButtons:{}},setup(n){const t=n,e=h.ref(null),i=h.ref(null),s=h.ref(null),o=async()=>{var y,_,k,w;const{x:p,y:g,placement:m,middlewareData:b}=await Ip(e.value,i.value,{placement:t.beak,middleware:[wp(10),xp(),vp({padding:5}),t.hasArrow?Wp({element:s.value,padding:10}):null]});if(Object.assign(i.value.style,{left:`${p}px`,top:`${g}px`}),t.hasArrow){const x={top:"bottom",right:"left",bottom:"top",left:"right"}[m.split("-")[0]];Object.assign(s.value.style,{left:((y=b.arrow)==null?void 0:y.x)!=null?`${(_=b.arrow)==null?void 0:_.x}px`:"",top:((k=b.arrow)==null?void 0:k.y)!=null?`${(w=b.arrow)==null?void 0:w.y}px`:"",right:"",bottom:"",background:t.variant==="rich"?"#FFF":"#1C1C1E",[x]:"-4px"})}},a=h.ref(!1),r=h.ref(0),l=h.ref(0),c=h.computed(()=>({...{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)"}}[t.variant],display:a.value?"block":"none"})),d=()=>{clearTimeout(l.value),r.value=window.setTimeout(()=>{a.value=!0},500)},f=()=>{clearTimeout(r.value),l.value=window.setTimeout(()=>a.value=!1,1500)},u=()=>{clearTimeout(l.value),a.value=!0};return h.watchEffect(()=>{a.value?(o(),window.addEventListener("resize",o)):window.removeEventListener("resize",o)}),(p,g)=>(h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("div",{ref_key:"tooltipContainer",ref:e,class:"cursor-pointer flex items-center justify-center relative w-max",onMouseenter:d,onMouseleave:f},[h.renderSlot(p.$slots,"default")],544),h.createElementVNode("div",{ref_key:"tooltip",ref:i,class:"absolute box-border break-words left-0 max-w-xs px-4 py-3 rounded-2xl top-0 w-max whitespace-normal z-50",style:h.normalizeStyle(c.value),onMouseenter:u,onMouseleave:f},[h.createElementVNode("div",null,[h.createElementVNode("div",Hp,[p.variant=="rich"?(h.openBlock(),h.createElementBlock("div",jp,h.toDisplayString(p.titleText),1)):h.createCommentVNode("",!0),h.createElementVNode("div",{class:h.normalizeClass(p.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},h.toDisplayString(p.contentText),3)]),p.variant=="rich"?(h.openBlock(),h.createElementBlock("div",Yp,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(p.actionButtons,(m,b)=>(h.openBlock(),h.createElementBlock("div",{key:b},[h.createVNode(tn,{variant:"tertiary",label:m.label,onClick:m.handler},null,8,["label","onClick"])]))),128))])):h.createCommentVNode("",!0)]),h.createElementVNode("div",{ref_key:"arrowEl",ref:s,class:"-rotate-45 absolute h-3 w-3"},null,512)],36)]))}}),Ha={directive:"wave",color:"currentColor",initialOpacity:.2,finalOpacity:.1,duration:.4,dissolveDuration:.15,easing:"ease-out",cancellationPeriod:75,trigger:"auto",tagName:"div"},Xp=n=>"config"in n&&"globalProperties"in n.config,qp=n=>{let t;return n==="vue2"?t=!1:n==="vue3"?t=!0:t=Xp(n),t?{mounted:"mounted",updated:"updated"}:{mounted:"inserted",updated:"componentUpdated"}},ja=n=>typeof n=="string"&&n!=="auto",Ya=(n,t)=>{n.dataset.vWaveBoundary=ja(t)?t:"true"},Kp=({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},Gp=(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 jn(n,t,e,i){const s=n-e,o=t-i;return Math.sqrt(s*s+o*o)}function Zp(n,t,{width:e,height:i}){const s=jn(n,t,0,0),o=jn(n,t,e,0),a=jn(n,t,0,i),r=jn(n,t,e,i);return Math.max(s,o,a,r)}const Jp=({x:n,y:t},{top:e,left:i})=>({x:n-i,y:t-e}),Yi="vWaveCountInternal";function Qp(n){const t=Ui(n);Ua(n,t+1)}function tg(n){const t=Ui(n);Ua(n,t-1)}function Ua(n,t){n.dataset[Yi]=t.toString()}function Ui(n){var t;return parseInt((t=n.dataset[Yi])!==null&&t!==void 0?t:"0",10)}function eg(n){delete n.dataset[Yi]}const Xi=(n,t,e)=>{const i=t.getBoundingClientRect(),s=window.getComputedStyle(t),{x:o,y:a}=Jp(n,i),r=2.05*Zp(o,a,i),l=Kp(s,e.tagName),c=Gp(o,a,r,e);Qp(t);let d="";s.position==="static"&&(t.style.position&&(d=t.style.position),t.style.position="relative"),l.appendChild(c),t.appendChild(l);let f=!1;const u=b=>{typeof b<"u"&&(document.removeEventListener("pointerup",u),document.removeEventListener("pointercancel",u)),f?p():f=!0},p=()=>{c.style.transition=`opacity ${e.dissolveDuration}s linear`,c.style.opacity="0",setTimeout(()=>{l.remove(),tg(t),Ui(t)===0&&(eg(t),t.style.position=d)},e.dissolveDuration*1e3)};document.addEventListener("pointerup",u),document.addEventListener("pointercancel",u);const g=setTimeout(()=>{document.removeEventListener("pointercancel",m),requestAnimationFrame(()=>{c.style.transform="translate(-50%,-50%) scale(1)",c.style.opacity=`${e.finalOpacity}`,setTimeout(()=>u(),e.duration*1e3)})},e.cancellationPeriod),m=()=>{clearTimeout(g),l.remove(),document.removeEventListener("pointerup",u),document.removeEventListener("pointercancel",u),document.removeEventListener("pointercancel",m)};document.addEventListener("pointercancel",m)},Ze=new WeakMap,Xa=(n={},t="vue3")=>{const e=Object.assign(Object.assign({},Ha),n),i=qp(t),s=r=>{const l=r.currentTarget.dataset.vWaveTrigger;document.querySelectorAll(`[data-v-wave-boundary="${l}"]`).forEach(d=>Xi(r,d,Object.assign(Object.assign({},e),Ze.get(d))))},o={[i.mounted](r,{value:l={}}){var c;Ze.set(r,l),Ya(r,(c=l&&l.trigger)!==null&&c!==void 0?c:e.trigger),r.addEventListener("pointerdown",d=>{if(Ze.get(r)===!1)return;const f=Object.assign(Object.assign({},e),Ze.get(r));if(f.trigger===!1)return Xi(d,r,f);if(ja(f.trigger))return;const u=r.querySelector('[data-v-wave-trigger="true"]');!u&&f.trigger===!0||u&&!d.composedPath().includes(u)||Xi(d,r,f)})},[i.updated](r,{value:l={}}){var c;Ze.set(r,l),Ya(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}},ng={install(n,t={}){if(this.installed)return;this.installed=!0;const e=Object.assign(Object.assign({},Ha),t),{vWave:i,vWaveTrigger:s}=Xa(e,n);n.directive(e.directive,i),n.directive(`${e.directive}-trigger`,s)},installed:!1,createLocalWaveDirective:Xa},ig=n=>{n.use(ng,{})};z.FmBreadcrumb=er,z.FmButton=tn,z.FmCheckbox=_a,z.FmDatePicker=Lf,z.FmDateRangePicker=Yf,z.FmDropdown=xa,z.FmIcon=st,z.FmLineChart=wf,z.FmMenu=ka,z.FmMenuItem=wa,z.FmProgressIndicator=Da,z.FmProgressIndicatorGroup=Uu,z.FmRadio=au,z.FmSelect=bu,z.FmSnackbar=dp,z.FmSwitch=Eu,z.FmTextField=Vu,z.FmTextarea=Hu,z.FmTooltip=Up,z.uiPlugin=ig,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|