@feedmepos/ui-library 0.0.14 → 0.0.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/badge/FmBadge.stories.d.ts +11 -0
- package/dist/components/badge/FmBadge.vue.d.ts +4 -4
- package/dist/components/breadcrumb/FmBreadcrumb.stories.d.ts +6 -0
- package/dist/components/button/FmButton.stories.d.ts +162 -0
- package/dist/components/button-group/FmButtonGroup.stories.d.ts +7 -0
- package/dist/components/card/FmCard.stories.d.ts +6 -0
- package/dist/components/chart/line/FmLine.stories.d.ts +6 -0
- package/dist/components/chip/FmChip.stories.d.ts +7 -0
- package/dist/components/chip/FmChip.vue.d.ts +88 -0
- package/dist/components/chip-group/FmChipGroup.stories.d.ts +6 -0
- package/dist/components/chip-group/FmChipGroup.vue.d.ts +61 -0
- package/dist/components/dialog/FmDialog.stories.d.ts +6 -0
- package/dist/components/drop-field/FmDropField.stories.d.ts +6 -0
- package/dist/components/drop-field/FmDropField.vue.d.ts +0 -1
- package/dist/components/dynamic-dialog/FmDynamicDialog.vue.d.ts +29 -26
- package/dist/components/form/checkbox/FmCheckbox.stories.d.ts +6 -0
- package/dist/components/form/checkbox/FmCheckbox.vue.d.ts +27 -15
- package/dist/components/form/date-picker/FmDatePicker.stories.d.ts +6 -0
- package/dist/components/{date-picker → form/date-picker}/FmDatePicker.vue.d.ts +4 -8
- package/dist/components/form/date-range-picker/FmDateRangePicker.stories.d.ts +6 -0
- package/dist/components/{date-range-picker → form/date-range-picker}/FmDateRangePicker.vue.d.ts +4 -8
- package/dist/components/form/field/FmField.vue.d.ts +42 -20
- package/dist/components/form/form/FmForm.vue.d.ts +1 -0
- package/dist/components/form/form-group/FmFormGroup.vue.d.ts +126 -0
- package/dist/components/form/helper-text/FmHelperText.stories.d.ts +186 -0
- package/dist/components/form/helper-text/FmHelperText.vue.d.ts +54 -0
- package/dist/components/form/label/FmLabel.stories.d.ts +6 -0
- package/dist/components/form/label/FmLabel.vue.d.ts +73 -0
- package/dist/components/form/radio/FmRadio.stories.d.ts +6 -0
- package/dist/components/form/radio/FmRadio.vue.d.ts +5 -5
- package/dist/components/form/radio-group/FmRadioGroup.stories.d.ts +6 -0
- package/dist/components/form/radio-group/FmRadioGroup.vue.d.ts +15 -4
- package/dist/components/form/select/FmSelect.stories.d.ts +6 -0
- package/dist/components/form/select/FmSelect.vue.d.ts +12 -12
- package/dist/components/form/stepper-field/FmStepperField.stories.d.ts +6 -0
- package/dist/components/form/stepper-field/FmStepperField.vue.d.ts +26 -33
- package/dist/components/form/switch/FmSwitch.stories.d.ts +6 -0
- package/dist/components/form/text-field/FmTextField.stories.d.ts +6 -0
- package/dist/components/form/text-field/FmTextField.vue.d.ts +59 -79
- package/dist/components/form/textarea/FmTextarea.stories.d.ts +6 -0
- package/dist/components/form/textarea/FmTextarea.vue.d.ts +37 -22
- package/dist/components/form/time-picker/FmTimePicker.stories.d.ts +6 -0
- package/dist/components/{time-picker → form/time-picker}/FmTimePicker.vue.d.ts +2 -2
- package/dist/components/icon/FmIcon.stories.d.ts +6 -0
- package/dist/components/list/FmList.stories.d.ts +6 -0
- package/dist/components/list/FmList.vue.d.ts +9 -9
- package/dist/components/list/FmListItem.vue.d.ts +5 -5
- package/dist/components/menu/menu-container/FmMenu.stories.d.ts +6 -0
- package/dist/components/menu/menu-item/FmMenuItem.vue.d.ts +1 -0
- package/dist/components/snackbar/FmSnackbar.stories.d.ts +6 -0
- package/dist/components/snackbar/FmSnackbar.vue.d.ts +1 -1
- package/dist/components/spacer/FmSpacer.stories.d.ts +6 -0
- package/dist/components/stepper/FmStepper.stories.d.ts +6 -0
- package/dist/components/tab/FmTab.vue.d.ts +109 -0
- package/dist/components/tabs/FmTabs.stories.d.ts +6 -0
- package/dist/components/tabs/FmTabs.vue.d.ts +91 -0
- package/dist/components/tooltip/FmTooltip.stories.d.ts +7 -0
- package/dist/components/tooltip/FmTooltip.vue.d.ts +17 -10
- package/dist/components.d.ts +3067 -1553
- package/dist/composables/useFormChild.d.ts +12 -4
- package/dist/composables/useProxiedModel.d.ts +14 -0
- package/dist/composables/useValidation.d.ts +1 -2
- package/dist/demo/Badge.vue.d.ts +2 -0
- package/dist/demo/Breadcrumb.vue.d.ts +2 -0
- package/dist/demo/Button.vue.d.ts +2 -0
- package/dist/demo/ButtonGroup.vue.d.ts +2 -0
- package/dist/demo/Card.vue.d.ts +2 -0
- package/dist/demo/Chip.vue.d.ts +2 -0
- package/dist/demo/DatePicker.vue.d.ts +2 -0
- package/dist/demo/DateRangePicker.vue.d.ts +2 -0
- package/dist/demo/DemoSection.vue.d.ts +29 -0
- package/dist/demo/Dialog.vue.d.ts +2 -0
- package/dist/demo/DropField.vue.d.ts +2 -0
- package/dist/demo/Icon.vue.d.ts +2 -0
- package/dist/demo/List.vue.d.ts +2 -0
- package/dist/demo/Menu.vue.d.ts +2 -0
- package/dist/demo/Snackbar.vue.d.ts +2 -0
- package/dist/demo/Stepper.vue.d.ts +2 -0
- package/dist/demo/Tabs.vue.d.ts +2 -0
- package/dist/demo/TimePicker.vue.d.ts +2 -0
- package/dist/demo/Tooltip.vue.d.ts +2 -0
- package/dist/demo/chart/Line.vue.d.ts +2 -0
- package/dist/demo/demo.d.ts +1 -0
- package/dist/demo/form/Checkbox.vue.d.ts +2 -0
- package/dist/demo/form/Field.vue.d.ts +2 -0
- package/dist/demo/form/Form.vue.d.ts +2 -0
- package/dist/demo/form/FormGroup.vue.d.ts +2 -0
- package/dist/demo/form/Radio.vue.d.ts +2 -0
- package/dist/demo/form/Select.vue.d.ts +2 -0
- package/dist/demo/form/Stepper.vue.d.ts +2 -0
- package/dist/demo/form/Switch.vue.d.ts +2 -0
- package/dist/demo/form/TextField.vue.d.ts +2 -0
- package/dist/favicon.ico +0 -0
- package/dist/federation/FmBadge-d37c8e51.css +1 -0
- package/dist/federation/FmButton-e1b8ddc1.css +1 -0
- package/dist/federation/{FmButtonGroup.vue_vue_type_script_setup_true_lang-7823b6ac.js → FmButtonGroup.vue_vue_type_script_setup_true_lang-57bf36e5.js} +1 -1
- package/dist/federation/FmCard-1d456952.css +1 -0
- package/dist/federation/FmCheckbox-2240ce5a.css +1 -0
- package/dist/federation/FmCheckbox.vue_vue_type_style_index_0_lang-820bead5.js +1 -0
- package/dist/federation/FmChip.vue_vue_type_script_setup_true_lang-04e92a4b.js +1 -0
- package/dist/federation/FmChipGroup.vue_vue_type_script_setup_true_lang-69888bbf.js +1 -0
- package/dist/federation/FmDatePicker-4b14e6cc.css +1 -0
- package/dist/federation/{FmDateRangePicker-1535340a.css → FmDateRangePicker-c672a83c.css} +1 -1
- package/dist/federation/FmDialog.vue_vue_type_style_index_0_lang-790dd11b.js +1 -0
- package/dist/federation/{FmDropField-b51924c1.css → FmDropField-7af19c42.css} +1 -1
- package/dist/federation/FmField-c5942ce3.css +1 -0
- package/dist/federation/FmForm.vue_vue_type_script_setup_true_lang-1b9a3581.js +1 -0
- package/dist/federation/FmFormGroup.vue_vue_type_script_setup_true_lang-86375b9f.js +1 -0
- package/dist/federation/FmHelperText.vue_vue_type_script_setup_true_lang-4a276a94.js +1 -0
- package/dist/federation/FmIcon-24e2c414.css +1 -0
- package/dist/federation/FmLabel.vue_vue_type_script_setup_true_lang-67dd13f9.js +1 -0
- package/dist/federation/{FmMenu-1bf41c36.css → FmMenu-e25988db.css} +1 -1
- package/dist/federation/FmMenuItem-dcbc1d3b.css +1 -0
- package/dist/federation/FmRadio-5d786858.css +1 -0
- package/dist/federation/FmRadioGroup.vue_vue_type_script_setup_true_lang-6c9ef988.js +1 -0
- package/dist/federation/{FmSelect-0d4033b1.css → FmSelect-53ed93ae.css} +1 -1
- package/dist/federation/FmStepperField-eaf32390.css +1 -0
- package/dist/federation/FmSwitch-2b54dde6.css +1 -0
- package/dist/federation/FmTab-219d73c7.css +1 -0
- package/dist/federation/FmTabs.vue_vue_type_script_setup_true_lang-381a77c9.js +1 -0
- package/dist/federation/FmTextField-1c52587f.css +1 -0
- package/dist/federation/FmTextField.vue_vue_type_style_index_0_lang-cc0bd137.js +1 -0
- package/dist/federation/FmTextarea-2efb5592.css +1 -0
- package/dist/federation/FmTextarea.vue_vue_type_style_index_0_lang-db014369.js +1 -0
- package/dist/federation/{FmTimeInput-0f7c002b.css → FmTimeInput-86f7cb20.css} +1 -1
- package/dist/federation/{FmTimeInput.vue_vue_type_style_index_0_lang-e49293d8.js → FmTimeInput.vue_vue_type_style_index_0_lang-973551d9.js} +1 -1
- package/dist/federation/FmTimePicker.vue_vue_type_style_index_0_lang-39117a79.js +1 -0
- package/dist/federation/FmTooltip.vue_vue_type_script_setup_true_lang-c77d74ba.js +1 -0
- package/dist/federation/__federation_expose_FmBadge-62e98f72.js +1 -0
- package/dist/federation/__federation_expose_FmButton-1408bfe0.js +8 -0
- package/dist/federation/{__federation_expose_FmButtonGroup-1a266afb.js → __federation_expose_FmButtonGroup-297c233d.js} +1 -1
- package/dist/federation/{__federation_expose_FmCard-b6cd4faf.js → __federation_expose_FmCard-1fd75011.js} +1 -1
- package/dist/federation/{__federation_expose_FmCheckbox-df97214f.js → __federation_expose_FmCheckbox-ad3618ba.js} +1 -1
- package/dist/federation/__federation_expose_FmChip-2d4f8358.js +1 -0
- package/dist/federation/__federation_expose_FmChipGroup-c4aea5c2.js +1 -0
- package/dist/federation/__federation_expose_FmDatePicker-a9955086.js +1 -0
- package/dist/federation/__federation_expose_FmDateRangePicker-6a78c00b.js +1 -0
- package/dist/federation/{__federation_expose_FmDialog-151d364a.js → __federation_expose_FmDialog-f3ed5b3a.js} +1 -1
- package/dist/federation/{__federation_expose_FmDropField-06b0fcef.js → __federation_expose_FmDropField-7c8211ff.js} +1 -1
- package/dist/federation/{__federation_expose_FmDynamicDialog-29099342.js → __federation_expose_FmDynamicDialog-93658b7d.js} +1 -1
- package/dist/federation/__federation_expose_FmField-5a746740.js +1 -0
- package/dist/federation/{__federation_expose_FmForm-81601667.js → __federation_expose_FmForm-76e9d8c1.js} +1 -1
- package/dist/federation/__federation_expose_FmFormGroup-e56ec999.js +1 -0
- package/dist/federation/__federation_expose_FmHelperText-91bbd6a5.js +1 -0
- package/dist/federation/{__federation_expose_FmIcon-ad8868c4.js → __federation_expose_FmIcon-57254641.js} +1 -1
- package/dist/federation/__federation_expose_FmLabel-0533041d.js +1 -0
- package/dist/federation/__federation_expose_FmMenu-db95ebff.js +1 -0
- package/dist/federation/__federation_expose_FmMenuItem-1be56240.js +1 -0
- package/dist/federation/__federation_expose_FmRadio-eed5bd7a.js +1 -0
- package/dist/federation/{__federation_expose_FmRadioGroup-6873b39c.js → __federation_expose_FmRadioGroup-cc0ea357.js} +1 -1
- package/dist/federation/__federation_expose_FmSelect-e09bb8b5.js +1 -0
- package/dist/federation/{__federation_expose_FmSnackbar-f7155df1.js → __federation_expose_FmSnackbar-106183bf.js} +1 -1
- package/dist/federation/{__federation_expose_FmStep-960800c2.js → __federation_expose_FmStep-7bb2f4c3.js} +1 -1
- package/dist/federation/__federation_expose_FmStepperField-d60c0535.js +1 -0
- package/dist/federation/__federation_expose_FmSwitch-3b55edec.js +1 -0
- package/dist/federation/__federation_expose_FmTab-b805dced.js +1 -0
- package/dist/federation/__federation_expose_FmTabs-71976220.js +1 -0
- package/dist/federation/{__federation_expose_FmTextField-faca6dd9.js → __federation_expose_FmTextField-af6b2083.js} +1 -1
- package/dist/federation/{__federation_expose_FmTextarea-b726bf74.js → __federation_expose_FmTextarea-3d2e0272.js} +1 -1
- package/dist/federation/{__federation_expose_FmTimeInput-c18f3848.js → __federation_expose_FmTimeInput-77dad5a1.js} +1 -1
- package/dist/federation/{__federation_expose_FmTimePicker-1f497164.js → __federation_expose_FmTimePicker-c08a483f.js} +1 -1
- package/dist/federation/{__federation_expose_FmTooltip-c3a02043.js → __federation_expose_FmTooltip-a046291f.js} +1 -1
- package/dist/federation/dialog-plugin-bf85a1ee.js +1 -0
- package/dist/federation/feedmepos-ui-components.js +1 -1
- package/dist/federation/index-20b67447.css +1 -0
- package/dist/federation/index-409386ce.js +11 -0
- package/dist/federation/useFormChild-652aaa22.js +1 -0
- package/dist/federation/useProxiedModel-0fd79d93.js +1 -0
- package/dist/feedmepos-ui-library.js +4646 -4076
- package/dist/feedmepos-ui-library.umd.cjs +8 -8
- package/dist/global-components.d.ts +13 -5
- package/dist/logo.svg +15 -0
- package/dist/style.css +1 -1
- package/dist/utils/helpers.d.ts +4 -0
- package/dist/utils/uid.d.ts +1 -0
- package/package.json +21 -6
- package/dist/federation/FmButton-ef253cc5.css +0 -1
- package/dist/federation/FmCard-15286ec1.css +0 -1
- package/dist/federation/FmCheckbox-53f405a9.css +0 -1
- package/dist/federation/FmCheckbox.vue_vue_type_style_index_0_lang-f3571c32.js +0 -1
- package/dist/federation/FmDatePicker-e9390cd2.css +0 -1
- package/dist/federation/FmDialog.vue_vue_type_style_index_0_lang-c521f009.js +0 -1
- package/dist/federation/FmField-f4b1b24a.css +0 -1
- package/dist/federation/FmForm.vue_vue_type_script_setup_true_lang-67f87de0.js +0 -1
- package/dist/federation/FmIcon-2645627d.css +0 -1
- package/dist/federation/FmMenuItem-68412e0d.css +0 -1
- package/dist/federation/FmRadio-e0e6e213.css +0 -1
- package/dist/federation/FmRadioGroup.vue_vue_type_script_setup_true_lang-caf058df.js +0 -1
- package/dist/federation/FmStepperField-6955a063.css +0 -1
- package/dist/federation/FmSwitch-7605f854.css +0 -1
- package/dist/federation/FmTextField-409a3efd.css +0 -1
- package/dist/federation/FmTextField.vue_vue_type_style_index_0_lang-84afccec.js +0 -1
- package/dist/federation/FmTextarea-0e3eab40.css +0 -1
- package/dist/federation/FmTextarea.vue_vue_type_style_index_0_lang-40031212.js +0 -1
- package/dist/federation/FmTimePicker.vue_vue_type_style_index_0_lang-5f8be818.js +0 -1
- package/dist/federation/FmTooltip.vue_vue_type_script_setup_true_lang-7aa0fd70.js +0 -1
- package/dist/federation/__federation_expose_FmButton-ae7b93e6.js +0 -8
- package/dist/federation/__federation_expose_FmDatePicker-2018a6be.js +0 -1
- package/dist/federation/__federation_expose_FmDateRangePicker-1030137f.js +0 -1
- package/dist/federation/__federation_expose_FmField-78a609b3.js +0 -1
- package/dist/federation/__federation_expose_FmMenu-da3eca46.js +0 -1
- package/dist/federation/__federation_expose_FmMenuItem-9518942a.js +0 -1
- package/dist/federation/__federation_expose_FmRadio-eb498ffc.js +0 -1
- package/dist/federation/__federation_expose_FmSelect-1229c16a.js +0 -1
- package/dist/federation/__federation_expose_FmStepperField-67b1f0c6.js +0 -1
- package/dist/federation/__federation_expose_FmSwitch-99acfba1.js +0 -1
- package/dist/federation/dialog-plugin-fb0a4d39.js +0 -1
- package/dist/federation/index-60400755.css +0 -1
- package/dist/federation/index-a8588652.js +0 -11
- package/dist/federation/useValidation-f33a4108.js +0 -1
- /package/dist/components/{time-picker → form/time-picker}/FmTimeInput.vue.d.ts +0 -0
- /package/dist/components/{time-picker → form/time-picker}/TimeInput.vue.d.ts +0 -0
- /package/dist/components/{time-picker → form/time-picker}/timePicker.d.ts +0 -0
- /package/dist/federation/{FmCard.vue_vue_type_style_index_0_lang-7ee6a07f.js → FmCard.vue_vue_type_style_index_0_lang-e5745164.js} +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
fm-btn
|
|
3
|
-
${
|
|
1
|
+
var $g=Object.defineProperty;var Lg=(st,ut,r)=>ut in st?$g(st,ut,{enumerable:!0,configurable:!0,writable:!0,value:r}):st[ut]=r;var V=(st,ut,r)=>(Lg(st,typeof ut!="symbol"?ut+"":ut,r),r);(function(st,ut){typeof exports=="object"&&typeof module<"u"?ut(exports,require("v-wave"),require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","v-wave","vue","vue-router"],ut):(st=typeof globalThis<"u"?globalThis:st||self,ut(st["feedmepos-ui-library"]={},st.VWave,st.Vue,st.VueRouter))})(this,function(st,ut,r,ni){var ts;"use strict";const Rg="",rr={class:"gap-8 inline-flex items-center relative select-none"},lr={key:0,class:"fm-typo-body-sm-400 justify-center"},cr=r.defineComponent({__name:"FmBadge",props:{inline:{type:Boolean,default:!1},value:{default:null},variant:{default:"neutral"}},setup(n){const t=n,e=r.computed(()=>t.value&&t.value>99?"99+":t.value);return(s,i)=>(r.openBlock(),r.createElementBlock("div",rr,[r.renderSlot(s.$slots,"default",{},void 0,!0),r.createElementVNode("div",{class:r.normalizeClass(["fm-badge",`fm-badge--${s.variant}`,{absolute:!s.inline,"top-0 right-0 w-[6px] h-[6px]":t.value===null,"top-[-2px] right-[-4px] w-[16px] h-[16px]":t.value&&t.value<10,"top-[-2px] right-[-12px] px-4 h-[20px] min-w-[24px]":t.value&&t.value>10&&t.value<100,"top-[-2px] right-[-20px] px-4 h-[20px] min-w-[24px]":t.value&&t.value>99}])},[t.value!==null?(r.openBlock(),r.createElementBlock("span",lr,r.toDisplayString(e.value),1)):r.createCommentVNode("",!0)],2)]))}}),zg="",et=(n,t)=>{const e=n.__vccOpts||n;for(const[s,i]of t)e[s]=i;return e},ln=et(cr,[["__scopeId","data-v-02018628"]]),dr={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},hr=["onMouseenter"],fr={key:0},ur=r.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(n){const t=n,e=ni.useRoute(),s=ni.useRouter();r.onMounted(async()=>{await s.isReady();const m=t.items.findIndex(g=>g.route==e.path);m!=-1&&!t.items[m].disabled&&(i.value=m)});const i=r.ref(-1),o=r.ref(-1),a=r.ref(" / "),l=r.ref("... /"),c=r.ref(!1),d=m=>i.value===m?"selected":o.value===m?"hovered":t.items[m].disabled?"disabled":"default",h=m=>{t.items[m].disabled||(i.value=m)},f=m=>m!=t.items.length-1,u=m=>!c.value&&t.items.length>5&&m>=2&&m<t.items.length-2,p=()=>{c.value=!c.value};return(m,g)=>{const b=r.resolveComponent("RouterLink");return r.openBlock(),r.createElementBlock("nav",null,[r.createElementVNode("ul",dr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.items,(y,w)=>(r.openBlock(),r.createElementBlock("li",{key:w,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:_=>o.value=w,onMouseleave:g[0]||(g[0]=_=>o.value=-1)},[u(w)?w===3&&!c.value?(r.openBlock(),r.createElementBlock("a",{key:1,onClick:p},r.toDisplayString(l.value),1)):r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(b,{key:0,class:r.normalizeClass(d(w)),to:y.disabled?"":y.route,onClick:_=>h(w)},{default:r.withCtx(()=>[r.createElementVNode("span",null,r.toDisplayString(y.label),1),f(w)?(r.openBlock(),r.createElementBlock("span",fr,r.toDisplayString(a.value),1)):r.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,hr))),128))])])}}}),Ig="",pr=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,mr=/^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}[)]$/,gr=/^^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*[)]$/,br=/^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*[)]$/,yr=/^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 ns(n){return[pr,mr,gr,br,yr].some(t=>t.test(n))}const _r=r.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=r.computed(()=>{const o=[],a={};return o.push(s()),o.push(i()),ns(t.color)?a.color=t.color:o.push(`text-fm-color-${t.color}`),{class:o.join(" "),style:a}});function s(){return`fm-icon--${t.outline?"outlined":"rounded"}`}function i(){return`fm-icon--${t.size}`}return(o,a)=>(r.openBlock(),r.createElementBlock("span",r.mergeProps(e.value,{class:"fm-icon"}),r.toDisplayString(t.name),17))}}),Wg="",L=et(_r,[["__scopeId","data-v-fd802d37"]]),xr=["disabled","type"],kr={key:1,class:"fm-typo-body-lg-700"},wr=r.defineComponent({__name:"FmButton",props:{variant:{default:"primary"},label:{default:""},icon:{default:""},size:{default:"lg"},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},iconColor:{default:""},type:{default:"button"}},setup(n){const t=n,e=r.ref(!1),s=r.computed(()=>`${i[t.variant]} ${t.disabled?"cursor-not-allowed":"cursor-pointer"}`),i={primary:"bg-fm-color-primary text-fm-color-typo-white rounded-lg",secondary:"bg-transparent rounded-lg",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white rounded-lg",tertiary:"bg-transparent text-fm-color-primary rounded-lg",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white rounded-xxxl"};function o(a){e.value=a}return(a,l)=>{const c=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("button",{ref:"buttonEl",class:r.normalizeClass(`
|
|
2
|
+
fm-btn
|
|
3
|
+
${s.value}
|
|
4
4
|
fm-btn--${a.size}
|
|
5
5
|
${a.label?"":`fm-btn--${a.size}--just-icon`}
|
|
6
6
|
fm-btn--${a.variant}
|
|
7
7
|
${a.disabled?"fm-btn--disabled":""}
|
|
8
|
-
`),disabled:a.disabled,type:a.type,onMousedown:r[0]||(r[0]=()=>o(!0)),onMouseup:r[1]||(r[1]=()=>o(!1)),onMouseleave:r[2]||(r[2]=()=>o(!1))},[a.icon?(l.openBlock(),l.createBlock(R,{key:0,name:a.icon,outline:!e.value,color:a.disabled?"neutral-gray-200":a.iconColor??"",size:"md"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),a.label?(l.openBlock(),l.createElementBlock("span",hr,l.toDisplayString(a.label),1)):l.createCommentVNode("",!0)],42,dr)),[[c,!a.disabled]])}}}),Eg="",bt=it(fr,[["__scopeId","data-v-e62833de"]]),ur={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},pr=["v-wave","disabled","onClick","onMousedown"],mr=l.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c=>{t("update:modelValue",c)},s=l.ref(null),o=c=>{s.value=c},a=c=>c.disabled||e.disabled,r=c=>JSON.stringify(c)===JSON.stringify(e.modelValue);return(c,d)=>(l.openBlock(),l.createElementBlock("div",ur,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.items,(h,f)=>(l.openBlock(),l.createElementBlock("button",{key:f,"v-wave":a(h),class:l.normalizeClass(["border-r flex gap-8 grow hover:bg-fm-color-neutral-gray-200 items-center justify-center last:border-r-0 px-[11px] py-[7px]",{"bg-fm-color-system-warning-100 hover:bg-fm-color-system-warning-100":r(h),"hover:bg-fm-color-neutral-white cursor-not-allowed":a(h)}]),disabled:a(h),onClick:u=>i(h),onMousedown:u=>o(h),onMouseup:d[0]||(d[0]=u=>o(null)),onMouseleave:d[1]||(d[1]=u=>o(null))},[h.icon?(l.openBlock(),l.createBlock(R,{key:0,name:h.icon,size:"md",color:a(h)?"neutral-gray-200":r(h)?"primary":"",outline:JSON.stringify(s.value)!==JSON.stringify(h)&&!r(h)},null,8,["name","color","outline"])):l.createCommentVNode("",!0),h.label?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-lg-700",[a(h)?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},l.toDisplayString(h.label),3)):l.createCommentVNode("",!0)],42,pr))),128))]))}}),gr={class:"grow"},Zi=l.defineComponent({__name:"FmCardTitle",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-title",n.padding])},[l.createElementVNode("div",gr,[l.renderSlot(t.$slots,"default")]),l.renderSlot(t.$slots,"actions")],2))}}),br={class:"fm-typo-title-md-700 grow"},yr=l.defineComponent({__name:"FmCard",props:{title:{type:String,default:void 0},variant:{type:String,default:"elevated"},horizontal:{type:Boolean,default:!1}},setup(n){const t=n,e=l.useSlots();return(i,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex-nowrap fm-card",`${n.variant==="elevated"?"fm-shadow-light-400":"border-1"} ${n.horizontal?"fm-card--horizontal":""}`])},[l.renderSlot(i.$slots,"header",{title:t.title},()=>[n.title||l.unref(e)["header-title"]||l.unref(e)["header-actions"]?(l.openBlock(),l.createBlock(Zi,{key:0},{actions:l.withCtx(()=>[l.renderSlot(i.$slots,"header-actions")]),default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(i.$slots,"header-title",{title:t.title},()=>[l.createElementVNode("div",br,l.toDisplayString(t.title),1)])])]),_:3})):l.createCommentVNode("",!0)]),l.renderSlot(i.$slots,"default"),l.renderSlot(i.$slots,"actions")],2))}}),Vg="",_r=l.defineComponent({__name:"FmCardActions",props:{alignment:{type:String,default:"right"},padding:{type:String,default:"p-16"}},setup(n){const t=n,e=l.computed(()=>{switch(t.alignment){case"left":return"justify-start";case"right":return"justify-end";case"center":return"justify-center";default:return""}});return(i,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-actions",`${e.value} ${n.padding}`])},[l.renderSlot(i.$slots,"default")],2))}}),xr=l.defineComponent({__name:"FmCardSection",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-section",n.padding])},[l.renderSlot(t.$slots,"default")],2))}});/*!
|
|
8
|
+
`),disabled:a.disabled,type:a.type,onMousedown:l[0]||(l[0]=()=>o(!0)),onMouseup:l[1]||(l[1]=()=>o(!1)),onMouseleave:l[2]||(l[2]=()=>o(!1))},[a.icon?(r.openBlock(),r.createBlock(L,{key:0,name:a.icon,outline:!e.value,color:a.disabled?"neutral-gray-200":a.iconColor??"",size:"md"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),a.label?(r.openBlock(),r.createElementBlock("span",kr,r.toDisplayString(a.label),1)):r.createCommentVNode("",!0)],42,xr)),[[c,!a.disabled]])}}}),Yg="",yt=et(wr,[["__scopeId","data-v-d942a068"]]),Cr={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},Mr=["v-wave","disabled","onClick","onMousedown"],Sr=r.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=c=>{t("update:modelValue",c)},i=r.ref(null),o=c=>{i.value=c},a=c=>c.disabled||e.disabled,l=c=>JSON.stringify(c)===JSON.stringify(e.modelValue);return(c,d)=>(r.openBlock(),r.createElementBlock("div",Cr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.items,(h,f)=>(r.openBlock(),r.createElementBlock("button",{key:f,"v-wave":a(h),class:r.normalizeClass(["border-r flex gap-8 grow hover:bg-fm-color-neutral-gray-200 items-center justify-center last:border-r-0 px-[11px] py-[7px]",{"bg-fm-color-system-warning-100 hover:bg-fm-color-system-warning-100":l(h),"hover:bg-fm-color-neutral-white cursor-not-allowed":a(h)}]),disabled:a(h),onClick:u=>s(h),onMousedown:u=>o(h),onMouseup:d[0]||(d[0]=u=>o(null)),onMouseleave:d[1]||(d[1]=u=>o(null))},[h.icon?(r.openBlock(),r.createBlock(L,{key:0,name:h.icon,size:"md",color:a(h)?"neutral-gray-200":l(h)?"primary":"",outline:JSON.stringify(i.value)!==JSON.stringify(h)&&!l(h)},null,8,["name","color","outline"])):r.createCommentVNode("",!0),h.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-lg-700",[a(h)?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},r.toDisplayString(h.label),3)):r.createCommentVNode("",!0)],42,Mr))),128))]))}}),Dr={class:"grow"},si=r.defineComponent({__name:"FmCardTitle",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-title",n.padding])},[r.createElementVNode("div",Dr,[r.renderSlot(t.$slots,"default")]),r.renderSlot(t.$slots,"actions")],2))}}),Br={class:"fm-typo-title-md-700 grow"},vr=r.defineComponent({__name:"FmCard",props:{title:{type:String,default:void 0},variant:{type:String,default:"elevated"},horizontal:{type:Boolean,default:!1}},setup(n){const t=n,e=r.useSlots();return(s,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex-nowrap fm-card",`${n.variant==="elevated"?"fm-shadow-light-400":"border-1"} ${n.horizontal?"fm-card--horizontal":""}`])},[r.renderSlot(s.$slots,"header",{title:t.title},()=>[n.title||r.unref(e)["header-title"]||r.unref(e)["header-actions"]?(r.openBlock(),r.createBlock(si,{key:0},{actions:r.withCtx(()=>[r.renderSlot(s.$slots,"header-actions")]),default:r.withCtx(()=>[r.createElementVNode("div",null,[r.renderSlot(s.$slots,"header-title",{title:t.title},()=>[r.createElementVNode("div",Br,r.toDisplayString(t.title),1)])])]),_:3})):r.createCommentVNode("",!0)]),r.renderSlot(s.$slots,"default"),r.renderSlot(s.$slots,"actions")],2))}}),jg="",Er=r.defineComponent({__name:"FmCardActions",props:{alignment:{type:String,default:"right"},padding:{type:String,default:"p-16"}},setup(n){const t=n,e=r.computed(()=>{switch(t.alignment){case"left":return"justify-start";case"right":return"justify-end";case"center":return"justify-center";default:return""}});return(s,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-actions",`${e.value} ${n.padding}`])},[r.renderSlot(s.$slots,"default")],2))}}),Vr=r.defineComponent({__name:"FmCardSection",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-section",n.padding])},[r.renderSlot(t.$slots,"default")],2))}}),ii=r.defineComponent({__name:"FmChip",props:{label:{default:""},icon:{default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},emits:["chip-closed"],setup(n,{emit:t}){const e=n,s=r.ref(!1),i=r.ref(!1);function o(c){e.selectable&&(i.value=c)}const a=()=>{!e.selectable||e.disabled||(s.value=!s.value)},l=()=>{e.disabled||t("chip-closed")};return r.onMounted(()=>{s.value=e.selected}),r.watch(()=>e.selected,()=>{s.value=e.selected}),(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["inline-flex rounded-md items-center gap-4 justify-center max-w-[200px]",s.value&&!c.disabled?"bg-fm-color-neutral-black":"bg-fm-color-neutral-gray-100",c.compact?"h-[22px] px-8":"h-[30px] px-8 py-4",{"bg-fm-color-neutral-gray-100 cursor-not-allowed":c.disabled,"cursor-pointer":c.selectable&&!c.disabled,"hover:bg-fm-color-opacity-sm":!s.value&&!c.disabled&&c.selectable}]),onClick:a,onMousedown:d[0]||(d[0]=()=>o(!0)),onMouseup:d[1]||(d[1]=()=>o(!1)),onMouseleave:d[2]||(d[2]=()=>o(!1))},[r.renderSlot(c.$slots,"default",{},()=>[c.icon?(r.openBlock(),r.createBlock(L,{key:0,name:c.icon,size:"sm",outline:!i.value&&!s.value,color:c.disabled?"neutral-gray-200":s.value?"neutral-white":"neutral-black"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),c.label?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["fm-typo-body-md-700 select-none text-ellipsis overflow-hidden whitespace-nowrap",c.disabled?"text-fm-color-typo-disabled":s.value?"text-fm-color-typo-white":"text-fm-color-typo-primary"])},r.toDisplayString(c.label),3)):r.createCommentVNode("",!0)]),c.removable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["flex items-center justify-center rounded-xxxl",!s.value&&!c.disabled?"hover:bg-fm-color-opacity-sm":"",{"cursor-not-allowed":c.disabled,"cursor-pointer":c.selectable&&!c.disabled}]),onClick:l},[r.createVNode(L,{name:"close",size:"sm",color:c.disabled?"neutral-gray-200":s.value?"neutral-white":"neutral-black"},null,8,["color"])],2)):r.createCommentVNode("",!0)],34))}}),oi=r.defineComponent({__name:"FmChipGroup",props:{items:{},selectable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},removable:{type:Boolean,default:!1}},emits:["chip-closed"],setup(n,{emit:t}){const e=n,s=r.ref(null),i=r.ref(0),o=r.ref(null),a=r.ref(),l=()=>{var f,u;if(!s.value)return;const d=s.value.getBoundingClientRect();i.value>0&&o.value&&((f=a.value)==null||f.splice(o.value,1)),i.value=0;let h=0;Array.from(s.value.children).forEach((p,m)=>{const g=p.getBoundingClientRect(),b=g.y-d.y;h=Math.max(g.height*2+4,h),b>h&&(i.value+=1,o.value=o.value===null?m:m-i.value)}),i.value>0&&o.value&&((u=a.value)==null||u.splice(o.value,0,{label:`+${i.value}`,removable:!1,selectable:!1,compact:e.compact}))},c=d=>{t("chip-closed",d)};return r.onMounted(()=>{a.value=e.items,l(),new ResizeObserver(()=>{l()}).observe(s.value)}),r.watch(()=>e.items,()=>{a.value=e.items,l()}),(d,h)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"chipsContainer",ref:s,class:r.normalizeClass(["flex flex-wrap gap-4 items-center overflow-y-hidden",d.compact?"max-h-48":"max-h-64"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,(f,u)=>(r.openBlock(),r.createBlock(ii,{key:u,label:f.label,icon:f.icon,selected:f.selected,removable:f.removable!==void 0?f.removable:d.removable,selectable:f.selectable!==void 0?f.selectable:d.selectable,disabled:f.disabled!==void 0?f.disabled:d.disabled,compact:d.compact,onChipClosed:p=>c(u)},null,8,["label","icon","selected","removable","selectable","disabled","compact","onChipClosed"]))),128))],2))}}),Pr={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Or={class:"overflow-y-auto"},Ar={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},Fr=r.defineComponent({__name:"FmDialog",props:{modelValue:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},minWidth:{default:280},closeButton:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=r.ref(null),i=o=>{e.overlay&&s.value&&o.target===s.value&&t("update:modelValue",!1)};return(o,a)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[o.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:s,class:r.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":o.overlay}),onClick:a[1]||(a[1]=l=>i(l))},[r.createElementVNode("div",{class:r.normalizeClass(`fm-dialog min-w-[${o.minWidth}px]`)},[r.createElementVNode("div",Pr,[r.renderSlot(o.$slots,"dialog-header"),o.closeButton?(r.openBlock(),r.createBlock(L,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:a[0]||(a[0]=l=>t("update:modelValue",!1))})):r.createCommentVNode("",!0)]),r.createElementVNode("div",Or,[r.renderSlot(o.$slots,"dialog-content")]),r.createElementVNode("div",Ar,[r.renderSlot(o.$slots,"dialog-footer")])],2)],2)):r.createCommentVNode("",!0)]),_:3})]))}}),Hg="",Nr={class:"fm-drop-field"},Tr=["accept","disabled"],$r=r.defineComponent({__name:"FmDropField",props:{label:{default:""},disabled:{type:Boolean,default:!1},accept:{default:""},maxFileSize:{default:8e6}},emits:["file-upload","file-rejected"],setup(n,{emit:t}){const e=n,s=r.ref(!1),i=r.ref(),o=r.ref(),a=r.ref(),l=k=>{e.disabled||(k.stopPropagation(),k.preventDefault())},c=k=>{e.disabled||(k.stopPropagation(),k.preventDefault(),s.value=!0)},d=k=>{e.disabled||(k.stopPropagation(),k.preventDefault(),s.value=!1)},h=k=>{e.disabled||(k.stopPropagation(),k.preventDefault(),s.value=!1,f(k))},f=k=>{var M;a.value=((M=k.dataTransfer)==null?void 0:M.files)??k.target.files;const x=a.value;if(i.value=p(x[0]),o.value=m(x[0]),i.value&&o.value)t("file-upload",x[0]);else{const C=u();t("file-rejected",[{file:x[0],reason:C}])}},u=()=>{const k=[];return i.value||k.push("invalid-type"),o.value||k.push("invalid-size"),k},p=k=>{if(!e.accept)return!0;const x=e.accept.split(",").map(M=>M.trim());for(const M of x)if(g(M)){if(y(M)===y(k.type))return!0}else if(b(k)===M||k.type===M)return!0;return!1},m=k=>k.size<=e.maxFileSize,g=k=>k.indexOf("*")!==-1,b=k=>"."+k.name.split(".").pop(),y=k=>k.substring(0,k.indexOf("/")),w=r.computed(()=>{if(s.value)return"Drop file to upload";if(i.value){if(!o.value)return`File size exceeds ${e.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),_=r.computed(()=>a.value?!i.value||!o.value:!1);return(k,x)=>(r.openBlock(),r.createElementBlock("label",Nr,[r.renderSlot(k.$slots,"label",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[k.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},r.toDisplayString(k.label),3)],!0),r.createElementVNode("div",{class:r.normalizeClass(["fm-drop-field__container",{"fm-drop-field__container--dragging":s.value,"fm-drop-field__container--invalid":_.value&&!k.disabled,"fm-drop-field__container--disabled":k.disabled}]),onDragenter:l,onDragover:c,onDragleave:d,onDrop:h},[(s.value||_.value)&&!k.disabled?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass({"fm-typo-body-lg-700":!0,"text-fm-color-primary":s.value,"text-fm-color-typo-error":_.value})},r.toDisplayString(w.value),3)):(r.openBlock(),r.createBlock(yt,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:k.disabled},null,8,["disabled"])),r.renderSlot(k.$slots,"accept-text",{},()=>[e.accept?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-md-400",[k.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},r.toDisplayString(`Accepts ${e.accept}`),3)):r.createCommentVNode("",!0)],!0),r.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:k.accept,disabled:k.disabled,onChange:f},null,40,Tr)],34),r.renderSlot(k.$slots,"helper-text",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-sm-400",[k.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},r.toDisplayString(`Max size ${e.maxFileSize*1e-6}mb`),3)],!0)]))}}),Ug="",Lr=et($r,[["__scopeId","data-v-c914dc32"]]),Rr={},zr={class:"flex-grow"};function Ir(n,t){return r.openBlock(),r.createElementBlock("div",zr)}const ai=et(Rr,[["render",Ir]]),ri=Symbol.for("fm:form"),li=Symbol.for("fm:radio-group"),ci=Symbol.for("fm:stepper"),di=Symbol.for("fm:dialog"),Wr={install:n=>{const t={open:e=>{const s={primary:[],secondary:[],tertiary:[]},i={onPrimary:d=>(s.primary.push(d),i),onSecondary:d=>(s.secondary.push(d),i),onTertiary:d=>(s.tertiary.push(d),i)};function o(){a&&r.render(null,a),a=null,c=null}let a=document.createElement("div");document.body.appendChild(a);const l=r.markRaw(hi);let c=r.createVNode(l,{...e,unmount:o,storedFunctions:s});return c.appContext=n._context,r.render(c,a),i}};n.config.globalProperties.$dialog=t,n.provide(di,t)}},Yr={key:0,class:"block relative"},jr={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Hr={class:"fm-typo-title-md-700 text-fm-color-typo-primary"},Ur={key:0,class:"overflow-y-auto"},Xr={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},qr={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},hi=r.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{default:""},primaryActions:{default:null},secondaryActions:{default:null},tertiaryActions:{default:null},overlay:{type:Boolean,default:!0},closeButton:{type:Boolean,default:!0},minWidth:{default:280},dialogComponent:{default:null},contentComponent:{default:null},dialogComponentProps:{default:null},contentComponentProps:{default:null},unmount:{type:Function,default:()=>{}},storedFunctions:{default:null}},emits:["dialog-opened","dialog-closed"],setup(n,{emit:t}){const e=n,s=r.ref(!0),i=r.ref(null),o=()=>{e.overlay&&(e.unmount(),t("dialog-closed"))},a=c=>{i.value&&c.target===i.value&&o()},l=(c,d)=>{e.storedFunctions[d].forEach(h=>h()),c.close&&o()};return r.onMounted(()=>{t("dialog-opened")}),(c,d)=>(r.openBlock(),r.createBlock(r.Transition,null,{default:r.withCtx(()=>[s.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:i,class:r.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":c.overlay}),onClick:a},[c.dialogComponent?(r.openBlock(),r.createElementBlock("div",Yr,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.dialogComponent),r.normalizeProps(r.guardReactiveProps(c.dialogComponentProps)),null,16)),c.closeButton?(r.openBlock(),r.createBlock(L,{key:0,class:"absolute cursor-pointer right-[12px] top-[18px]",name:"close",size:"md",onClick:o})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",{key:1,class:"fm-dialog",style:r.normalizeStyle({"min-width":`${e.minWidth}px`})},[r.createElementVNode("div",jr,[r.createElementVNode("div",Hr,r.toDisplayString(c.title),1),c.closeButton?(r.openBlock(),r.createBlock(L,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:o})):r.createCommentVNode("",!0)]),c.contentComponent?(r.openBlock(),r.createElementBlock("div",Ur,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.contentComponent),r.normalizeProps(r.guardReactiveProps(c.contentComponentProps)),null,16))])):(r.openBlock(),r.createElementBlock("div",Xr,r.toDisplayString(c.message),1)),r.createElementVNode("div",qr,[c.tertiaryActions?(r.openBlock(),r.createBlock(yt,{key:0,class:"sm:w-full xs:w-full",variant:"tertiary",label:c.tertiaryActions.text,size:"md",onClick:d[0]||(d[0]=h=>l(c.tertiaryActions,"tertiary"))},null,8,["label"])):r.createCommentVNode("",!0),r.createVNode(ai,{class:"sm:hidden xs:hidden"}),c.secondaryActions?(r.openBlock(),r.createBlock(yt,{key:1,class:"sm:w-full xs:w-full",variant:"secondary",label:c.secondaryActions.text,size:"md",onClick:d[1]||(d[1]=h=>l(c.secondaryActions,"secondary"))},null,8,["label"])):r.createCommentVNode("",!0),c.primaryActions?(r.openBlock(),r.createBlock(yt,{key:2,class:"sm:w-full xs:w-full",variant:"primary",label:c.primaryActions.text,size:"md",onClick:d[2]||(d[2]=h=>l(c.primaryActions,"primary"))},null,8,["label"])):r.createCommentVNode("",!0)])],4))],2)):r.createCommentVNode("",!0)]),_:1}))}}),Xg="";/*!
|
|
9
9
|
* @kurkle/color v0.3.2
|
|
10
10
|
* https://github.com/kurkle/color#readme
|
|
11
11
|
* (c) 2023 Jukka Kurkela
|
|
12
12
|
* Released under the MIT License
|
|
13
|
-
*/function
|
|
13
|
+
*/function Be(n){return n+.5|0}const Yt=(n,t,e)=>Math.max(Math.min(n,e),t);function ve(n){return Yt(Be(n*2.55),0,255)}function jt(n){return Yt(Be(n*255),0,255)}function Pt(n){return Yt(Be(n/2.55)/100,0,1)}function fi(n){return Yt(Be(n*100),0,100)}const _t={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},ss=[..."0123456789ABCDEF"],Kr=n=>ss[n&15],Gr=n=>ss[(n&240)>>4]+ss[n&15],cn=n=>(n&240)>>4===(n&15),Jr=n=>cn(n.r)&&cn(n.g)&&cn(n.b)&&cn(n.a);function Zr(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&_t[n[1]]*17,g:255&_t[n[2]]*17,b:255&_t[n[3]]*17,a:t===5?_t[n[4]]*17:255}:(t===7||t===9)&&(e={r:_t[n[1]]<<4|_t[n[2]],g:_t[n[3]]<<4|_t[n[4]],b:_t[n[5]]<<4|_t[n[6]],a:t===9?_t[n[7]]<<4|_t[n[8]]:255})),e}const Qr=(n,t)=>n<255?t(n):"";function tl(n){var t=Jr(n)?Kr:Gr;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Qr(n.a,t):void 0}const el=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ui(n,t,e){const s=t*Math.min(e,1-e),i=(o,a=(o+n/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[i(0),i(8),i(4)]}function nl(n,t,e){const s=(i,o=(i+n/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function sl(n,t,e){const s=ui(n,1,.5);let i;for(t+e>1&&(i=1/(t+e),t*=i,e*=i),i=0;i<3;i++)s[i]*=1-t-e,s[i]+=t;return s}function il(n,t,e,s,i){return n===i?(t-e)/s+(t<e?6:0):t===i?(e-n)/s+2:(n-t)/s+4}function is(n){const e=n.r/255,s=n.g/255,i=n.b/255,o=Math.max(e,s,i),a=Math.min(e,s,i),l=(o+a)/2;let c,d,h;return o!==a&&(h=o-a,d=l>.5?h/(2-o-a):h/(o+a),c=il(e,s,i,h,o),c=c*60+.5),[c|0,d||0,l]}function os(n,t,e,s){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,s)).map(jt)}function as(n,t,e){return os(ui,n,t,e)}function ol(n,t,e){return os(sl,n,t,e)}function al(n,t,e){return os(nl,n,t,e)}function pi(n){return(n%360+360)%360}function rl(n){const t=el.exec(n);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?ve(+t[5]):jt(+t[5]));const i=pi(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=ol(i,o,a):t[1]==="hsv"?s=al(i,o,a):s=as(i,o,a),{r:s[0],g:s[1],b:s[2],a:e}}function ll(n,t){var e=is(n);e[0]=pi(e[0]+t),e=as(e),n.r=e[0],n.g=e[1],n.b=e[2]}function cl(n){if(!n)return;const t=is(n),e=t[0],s=fi(t[1]),i=fi(t[2]);return n.a<255?`hsla(${e}, ${s}%, ${i}%, ${Pt(n.a)})`:`hsl(${e}, ${s}%, ${i}%)`}const mi={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},gi={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function dl(){const n={},t=Object.keys(gi),e=Object.keys(mi);let s,i,o,a,l;for(s=0;s<t.length;s++){for(a=l=t[s],i=0;i<e.length;i++)o=e[i],l=l.replace(o,mi[o]);o=parseInt(gi[a],16),n[l]=[o>>16&255,o>>8&255,o&255]}return n}let dn;function hl(n){dn||(dn=dl(),dn.transparent=[0,0,0,0]);const t=dn[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const fl=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ul(n){const t=fl.exec(n);let e=255,s,i,o;if(t){if(t[7]!==s){const a=+t[7];e=t[8]?ve(a):Yt(a*255,0,255)}return s=+t[1],i=+t[3],o=+t[5],s=255&(t[2]?ve(s):Yt(s,0,255)),i=255&(t[4]?ve(i):Yt(i,0,255)),o=255&(t[6]?ve(o):Yt(o,0,255)),{r:s,g:i,b:o,a:e}}}function pl(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Pt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const rs=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ye=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function ml(n,t,e){const s=ye(Pt(n.r)),i=ye(Pt(n.g)),o=ye(Pt(n.b));return{r:jt(rs(s+e*(ye(Pt(t.r))-s))),g:jt(rs(i+e*(ye(Pt(t.g))-i))),b:jt(rs(o+e*(ye(Pt(t.b))-o))),a:n.a+e*(t.a-n.a)}}function hn(n,t,e){if(n){let s=is(n);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=as(s),n.r=s[0],n.g=s[1],n.b=s[2]}}function bi(n,t){return n&&Object.assign(t||{},n)}function yi(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=jt(n[3]))):(t=bi(n,{r:0,g:0,b:0,a:1}),t.a=jt(t.a)),t}function gl(n){return n.charAt(0)==="r"?ul(n):rl(n)}class Ee{constructor(t){if(t instanceof Ee)return t;const e=typeof t;let s;e==="object"?s=yi(t):e==="string"&&(s=Zr(t)||hl(t)||gl(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=bi(this._rgb);return t&&(t.a=Pt(t.a)),t}set rgb(t){this._rgb=yi(t)}rgbString(){return this._valid?pl(this._rgb):void 0}hexString(){return this._valid?tl(this._rgb):void 0}hslString(){return this._valid?cl(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,i=t.rgb;let o;const a=e===o?.5:e,l=2*a-1,c=s.a-i.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;o=1-d,s.r=255&d*s.r+o*i.r+.5,s.g=255&d*s.g+o*i.g+.5,s.b=255&d*s.b+o*i.b+.5,s.a=a*s.a+(1-a)*i.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=ml(this._rgb,t._rgb,e)),this}clone(){return new Ee(this.rgb)}alpha(t){return this._rgb.a=jt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Be(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 hn(this._rgb,2,t),this}darken(t){return hn(this._rgb,2,-t),this}saturate(t){return hn(this._rgb,1,t),this}desaturate(t){return hn(this._rgb,1,-t),this}rotate(t){return ll(this._rgb,t),this}}/*!
|
|
14
14
|
* Chart.js v4.4.0
|
|
15
15
|
* https://www.chartjs.org
|
|
16
16
|
* (c) 2023 Chart.js Contributors
|
|
17
17
|
* Released under the MIT License
|
|
18
|
-
*/function Bt(){}const Yr=(()=>{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 z(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function J(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function pt(n,t){return J(n)?n:t}function $(n,t){return typeof n>"u"?t:n}const Hr=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,as=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function j(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Y(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(z(n))for(a=Object.keys(n),o=a.length,s=0;s<o;s++)t.call(e,n[a[s]],a[s])}function dn(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 hn(n){if(X(n))return n.map(hn);if(z(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=hn(n[e[s]]);return t}return n}function rs(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function jr(n,t,e,i){if(!rs(n))return;const s=t[n],o=e[n];z(s)&&z(o)?Ve(s,o,i):t[n]=hn(o)}function Ve(n,t,e){const i=X(t)?t:[t],s=i.length;if(!z(n))return n;e=e||{};const o=e.merger||jr;let a;for(let r=0;r<s;++r){if(a=i[r],!z(a))continue;const c=Object.keys(a);for(let d=0,h=c.length;d<h;++d)o(c[d],n,a,e)}return n}function Be(n,t){return Ve(n,t,{merger:Ur})}function Ur(n,t,e){if(!rs(n))return;const i=t[n],s=e[n];z(i)&&z(s)?Be(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=hn(s))}const ls={"":n=>n,x:n=>n.x,y:n=>n.y};function Xr(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 qr(n){const t=Xr(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Wt(n,t){return(ls[t]||(ls[t]=qr(t)))(n)}function si(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ve=n=>typeof n<"u",Yt=n=>typeof n=="function",cs=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Kr(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const q=Math.PI,K=2*q,Gr=K+q,fn=Number.POSITIVE_INFINITY,Jr=q/180,tt=q/2,Qt=q/4,ds=q*2/3,Ht=Math.log10,Mt=Math.sign;function Pe(n,t,e){return Math.abs(n-t)<e}function hs(n){const t=Math.round(n);n=Pe(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Ht(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Zr(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 be(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Qr(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function fs(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 kt(n){return n*(q/180)}function oi(n){return n*(180/q)}function us(n){if(!J(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function ps(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 ai(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function tl(n,t){return(n-t+Gr)%K-q}function mt(n){return(n%K+K)%K}function Oe(n,t,e,i){const s=mt(n),o=mt(t),a=mt(e),r=mt(o-s),c=mt(a-s),d=mt(s-o),h=mt(s-a);return s===o||s===a||i&&o===a||r>c&&d<h}function st(n,t,e){return Math.max(t,Math.min(e,n))}function el(n){return st(n,-32768,32767)}function vt(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function ri(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 Pt=(n,t,e,i)=>ri(n,e,i?s=>{const o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),nl=(n,t,e)=>ri(n,e,i=>n[i][t]>=e);function il(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 ms=["push","pop","shift","splice","unshift"];function sl(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ms.forEach(e=>{const i="_onData"+si(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 gs(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)&&(ms.forEach(o=>{delete n[o]}),delete n._chartjs)}function bs(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const ys=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function _s(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,ys.call(window,()=>{i=!1,n.apply(t,e)}))}}function ol(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const li=n=>n==="start"?"left":n==="end"?"right":"center",at=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,al=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function xs(n,t,e){const i=t.length;let s=0,o=i;if(n._sorted){const{iScale:a,_parsed:r}=n,c=a.axis,{min:d,max:h,minDefined:f,maxDefined:u}=a.getUserBounds();f&&(s=st(Math.min(Pt(r,c,d).lo,e?i:Pt(t,c,a.getPixelForValue(d)).lo),0,i-1)),u?o=st(Math.max(Pt(r,a.axis,h,!0).hi+1,e?0:Pt(t,c,a.getPixelForValue(h),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function ks(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 un=n=>n===0||n===1,ws=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*K/e)),Cs=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*K/e)+1,Ae={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=>un(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=>un(n)?n:ws(n,.075,.3),easeOutElastic:n=>un(n)?n:Cs(n,.075,.3),easeInOutElastic(n){return un(n)?n:n<.5?.5*ws(n*2,.1125,.45):.5+.5*Cs(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-Ae.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?Ae.easeInBounce(n*2)*.5:Ae.easeOutBounce(n*2-1)*.5+.5};function ci(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ms(n){return ci(n)?n:new Ee(n)}function di(n){return ci(n)?n:new Ee(n).saturate(.5).darken(.1).hexString()}const rl=["x","y","borderWidth","radius","tension"],ll=["color","borderColor","backgroundColor"];function cl(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:ll},numbers:{type:"number",properties:rl}}),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 dl(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ss=new Map;function hl(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Ss.get(e);return i||(i=new Intl.NumberFormat(n,t),Ss.set(e,i)),i}function Fe(n,t,e){return hl(t,e).format(n)}const Ds={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 d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),o=fl(n,e)}const a=Ht(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(c,this.options.ticks.format),Fe(n,i,c)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Ht(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Ds.numeric.call(this,n,t,e):""}};function fl(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 pn={formatters:Ds};function ul(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:pn.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 te=Object.create(null),hi=Object.create(null);function Te(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 fi(n,t,e){return typeof t=="string"?Ve(Te(n,t),e):Ve(Te(n,""),t)}class pl{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)=>di(s.backgroundColor),this.hoverBorderColor=(i,s)=>di(s.borderColor),this.hoverColor=(i,s)=>di(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 fi(this,t,e)}get(t){return Te(this,t)}describe(t,e){return fi(hi,t,e)}override(t,e){return fi(te,t,e)}route(t,e,i,s){const o=Te(this,t),a=Te(this,i),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const c=this[r],d=a[s];return z(c)?Object.assign({},d,c):$(c,d)},set(c){this[r]=c}}})}apply(t){t.forEach(e=>e(this))}}var Z=new pl({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[cl,dl,ul]);function ml(n){return!n||I(n.size)||I(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function mn(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 gl(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 c,d,h,f,u;for(c=0;c<r;c++)if(f=e[c],f!=null&&!X(f))a=mn(n,s,o,a,f);else if(X(f))for(d=0,h=f.length;d<h;d++)u=f[d],u!=null&&!X(u)&&(a=mn(n,s,o,a,u));n.restore();const p=o.length/2;if(p>e.length){for(c=0;c<p;c++)delete s[o[c]];o.splice(0,p)}return a}function ee(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 Es(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function ui(n,t,e,i){Vs(n,t,e,i,null)}function Vs(n,t,e,i,s){let o,a,r,c,d,h,f,u;const p=t.pointStyle,m=t.rotation,g=t.radius;let b=(m||0)*Jr;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(g)||g<=0)){switch(n.beginPath(),p){default:s?n.ellipse(e,i,s/2,g,0,0,K):n.arc(e,i,g,0,K),n.closePath();break;case"triangle":h=s?s/2:g,n.moveTo(e+Math.sin(b)*h,i-Math.cos(b)*g),b+=ds,n.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*g),b+=ds,n.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*g),n.closePath();break;case"rectRounded":d=g*.516,c=g-d,a=Math.cos(b+Qt)*c,f=Math.cos(b+Qt)*(s?s/2-d:c),r=Math.sin(b+Qt)*c,u=Math.sin(b+Qt)*(s?s/2-d:c),n.arc(e-f,i-r,d,b-q,b-tt),n.arc(e+u,i-a,d,b-tt,b),n.arc(e+f,i+r,d,b,b+tt),n.arc(e-u,i+a,d,b+tt,b+q),n.closePath();break;case"rect":if(!m){c=Math.SQRT1_2*g,h=s?s/2:c,n.rect(e-h,i-c,2*h,2*c);break}b+=Qt;case"rectRot":f=Math.cos(b)*(s?s/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),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+=Qt;case"cross":f=Math.cos(b)*(s?s/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),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:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),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+=Qt,f=Math.cos(b)*(s?s/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),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)*g,r=Math.sin(b)*g,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:g),i+Math.sin(b)*g);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ot(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 gn(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function bn(n){n.restore()}function bl(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 yl(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 _l(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 xl(n,t,e,i,s){if(s.strikethrough||s.underline){const o=n.measureText(i),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,c=e-o.actualBoundingBoxAscent,d=e+o.actualBoundingBoxDescent,h=s.strikethrough?(c+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,h),n.lineTo(r,h),n.stroke()}}function kl(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ne(n,t,e,i,s,o={}){const a=X(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let c,d;for(n.save(),n.font=s.string,_l(n,o),c=0;c<a.length;++c)d=a[c],o.backdrop&&kl(n,o.backdrop),r&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),I(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(d,e,i,o.maxWidth)),n.fillText(d,e,i,o.maxWidth),xl(n,e,i,d,o),i+=Number(s.lineHeight);n.restore()}function Ne(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 wl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Cl=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ml(n,t){const e=(""+n).match(wl);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 Sl=n=>+n||0;function pi(n,t){const e={},i=z(t),s=i?Object.keys(t):t,o=z(n)?i?a=>$(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=Sl(o(a));return e}function Bs(n){return pi(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ie(n){return pi(n,["topLeft","topRight","bottomLeft","bottomRight"])}function rt(n){const t=Bs(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function et(n,t){n=n||{},t=t||Z.font;let e=$(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=$(n.style,t.style);i&&!(""+i).match(Cl)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:$(n.family,t.family),lineHeight:Ml($(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:$(n.weight,t.weight),string:""};return s.string=ml(s),s}function Le(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 Dl(n,t,e){const{min:i,max:s}=n,o=as(t,(s-i)/2),a=(r,c)=>e&&r===0?0:r+c;return{min:a(i,-Math.abs(o)),max:a(s,o)}}function jt(n,t){return Object.assign(Object.create(n),t)}function mi(n,t=[""],e,i,s=()=>n[0]){const o=e||n;typeof i>"u"&&(i=Fs("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:r=>mi([r,...n],t,o,i)};return new Proxy(a,{deleteProperty(r,c){return delete r[c],delete r._keys,delete n[0][c],!0},get(r,c){return Ps(r,c,()=>Fl(c,t,n,r))},getOwnPropertyDescriptor(r,c){return Reflect.getOwnPropertyDescriptor(r._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,c){return Ts(r).includes(c)},ownKeys(r){return Ts(r)},set(r,c,d){const h=r._storage||(r._storage=s());return r[c]=h[c]=d,delete r._keys,!0}})}function ye(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:vs(n,i),setContext:o=>ye(n,o,e,i),override:o=>ye(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,()=>Vl(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 vs(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:Yt(e)?e:()=>e,isIndexable:Yt(i)?i:()=>i}}const El=(n,t)=>n?n+si(t):t,gi=(n,t)=>z(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 Vl(n,t,e){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;let r=i[t];return Yt(r)&&a.isScriptable(t)&&(r=Bl(t,r,n,e)),X(r)&&r.length&&(r=vl(t,r,n,a.isIndexable)),gi(t,r)&&(r=ye(r,s,o&&o[t],a)),r}function Bl(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 c=t(o,a||i);return r.delete(n),gi(n,c)&&(c=bi(s._scopes,s,n,c)),c}function vl(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(z(t[0])){const c=t,d=s._scopes.filter(h=>h!==c);t=[];for(const h of c){const f=bi(d,s,n,h);t.push(ye(f,o,a&&a[n],r))}}return t}function Os(n,t,e){return Yt(n)?n(t,e):n}const Pl=(n,t)=>n===!0?t:typeof n=="string"?Wt(t,n):void 0;function Ol(n,t,e,i,s){for(const o of t){const a=Pl(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 bi(n,t,e,i){const s=t._rootScopes,o=Os(t._fallback,e,i),a=[...n,...s],r=new Set;r.add(i);let c=As(r,a,e,o||e,i);return c===null||typeof o<"u"&&o!==e&&(c=As(r,a,o,c,i),c===null)?!1:mi(Array.from(r),[""],s,o,()=>Al(t,e,i))}function As(n,t,e,i,s){for(;e;)e=Ol(n,t,e,i,s);return e}function Al(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return X(s)&&z(e)?e:s||{}}function Fl(n,t,e,i){let s;for(const o of t)if(s=Fs(El(o,n),e),typeof s<"u")return gi(n,s)?bi(e,i,n,s):s}function Fs(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=Tl(n._scopes)),t}function Tl(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 Ns(n,t,e,i){const{iScale:s}=n,{key:o="r"}=this._parsing,a=new Array(i);let r,c,d,h;for(r=0,c=i;r<c;++r)d=r+e,h=t[d],a[r]={r:s.parse(Wt(h,o),d)};return a}const Nl=Number.EPSILON||1e-14,_e=(n,t)=>t<n.length&&!n[t].skip&&n[t],Ls=n=>n==="x"?"y":"x";function Ll(n,t,e,i){const s=n.skip?t:n,o=t,a=e.skip?t:e,r=ai(o,s),c=ai(a,o);let d=r/(r+c),h=c/(r+c);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const f=i*d,u=i*h;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 $l(n,t,e){const i=n.length;let s,o,a,r,c,d=_e(n,0);for(let h=0;h<i-1;++h)if(c=d,d=_e(n,h+1),!(!c||!d)){if(Pe(t[h],0,Nl)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[h]=s*a*t[h],e[h+1]=o*a*t[h])}}function Rl(n,t,e="x"){const i=Ls(e),s=n.length;let o,a,r,c=_e(n,0);for(let d=0;d<s;++d){if(a=r,r=c,c=_e(n,d+1),!r)continue;const h=r[e],f=r[i];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${i}`]=f-o*t[d]),c&&(o=(c[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${i}`]=f+o*t[d])}}function zl(n,t="x"){const e=Ls(t),i=n.length,s=Array(i).fill(0),o=Array(i);let a,r,c,d=_e(n,0);for(a=0;a<i;++a)if(r=c,c=d,d=_e(n,a+1),!!c){if(d){const h=d[t]-c[t];s[a]=h!==0?(d[e]-c[e])/h:0}o[a]=r?d?Mt(s[a-1])!==Mt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}$l(n,s,o),Rl(n,o,t)}function yn(n,t,e){return Math.max(Math.min(n,e),t)}function Il(n,t){let e,i,s,o,a,r=Ot(n[0],t);for(e=0,i=n.length;e<i;++e)a=o,o=r,r=e<i-1&&Ot(n[e+1],t),o&&(s=n[e],a&&(s.cp1x=yn(s.cp1x,t.left,t.right),s.cp1y=yn(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=yn(s.cp2x,t.left,t.right),s.cp2y=yn(s.cp2y,t.top,t.bottom)))}function Wl(n,t,e,i,s){let o,a,r,c;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")zl(n,s);else{let d=i?n[n.length-1]:n[0];for(o=0,a=n.length;o<a;++o)r=n[o],c=Ll(d,r,n[Math.min(o+1,a-(i?0:1))%a],t.tension),r.cp1x=c.previous.x,r.cp1y=c.previous.y,r.cp2x=c.next.x,r.cp2y=c.next.y,d=r}t.capBezierPoints&&Il(n,e)}function $s(){return typeof window<"u"&&typeof document<"u"}function yi(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function _n(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 xn=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Yl(n,t){return xn(n).getPropertyValue(t)}const Hl=["top","right","bottom","left"];function se(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Hl[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const jl=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Ul(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i;let a=!1,r,c;if(jl(s,o,n.target))r=s,c=o;else{const d=t.getBoundingClientRect();r=i.clientX-d.left,c=i.clientY-d.top,a=!0}return{x:r,y:c,box:a}}function oe(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=xn(e),o=s.boxSizing==="border-box",a=se(s,"padding"),r=se(s,"border","width"),{x:c,y:d,box:h}=Ul(n,e),f=a.left+(h&&r.left),u=a.top+(h&&r.top);let{width:p,height:m}=t;return o&&(p-=a.width+r.width,m-=a.height+r.height),{x:Math.round((c-f)/p*e.width/i),y:Math.round((d-u)/m*e.height/i)}}function Xl(n,t,e){let i,s;if(t===void 0||e===void 0){const o=yi(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{const a=o.getBoundingClientRect(),r=xn(o),c=se(r,"border","width"),d=se(r,"padding");t=a.width-d.width-c.width,e=a.height-d.height-c.height,i=_n(r.maxWidth,o,"clientWidth"),s=_n(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||fn,maxHeight:s||fn}}const kn=n=>Math.round(n*10)/10;function ql(n,t,e,i){const s=xn(n),o=se(s,"margin"),a=_n(s.maxWidth,n,"clientWidth")||fn,r=_n(s.maxHeight,n,"clientHeight")||fn,c=Xl(n,t,e);let{width:d,height:h}=c;if(s.boxSizing==="content-box"){const u=se(s,"border","width"),p=se(s,"padding");d-=p.width+u.width,h-=p.height+u.height}return d=Math.max(0,d-o.width),h=Math.max(0,i?d/i:h-o.height),d=kn(Math.min(d,a,c.maxWidth)),h=kn(Math.min(h,r,c.maxHeight)),d&&!h&&(h=kn(d/2)),(t!==void 0||e!==void 0)&&i&&c.height&&h>c.height&&(h=c.height,d=kn(Math.floor(h*i))),{width:d,height:h}}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 Kl=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 zs(n,t){const e=Yl(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function ae(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Gl(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 Jl(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},a=ae(n,s,e),r=ae(s,o,e),c=ae(o,t,e),d=ae(a,r,e),h=ae(r,c,e);return ae(d,h,e)}const Zl=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}}},Ql=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function xe(n,t,e){return n?Zl(t,e):Ql()}function Is(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 Ws(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Ys(n){return n==="angle"?{between:Oe,compare:tl,normalize:mt}:{between:vt,compare:(t,e)=>t-e,normalize:t=>t}}function Hs({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 tc(n,t,e){const{property:i,start:s,end:o}=e,{between:a,normalize:r}=Ys(i),c=t.length;let{start:d,end:h,loop:f}=n,u,p;if(f){for(d+=c,h+=c,u=0,p=c;u<p&&a(r(t[d%c][i]),s,o);++u)d--,h--;d%=c,h%=c}return h<d&&(h+=c),{start:d,end:h,loop:f,style:n.style}}function js(n,t,e){if(!e)return[n];const{property:i,start:s,end:o}=e,a=t.length,{compare:r,between:c,normalize:d}=Ys(i),{start:h,end:f,loop:u,style:p}=tc(n,t,e),m=[];let g=!1,b=null,_,x,M;const C=()=>c(s,M,_)&&r(s,M)!==0,y=()=>r(o,_)===0||c(o,M,_),w=()=>g||C(),k=()=>!g||y();for(let S=h,V=h;S<=f;++S)x=t[S%a],!x.skip&&(_=d(x[i]),_!==M&&(g=c(_,s,o),b===null&&w()&&(b=r(_,s)===0?S:V),b!==null&&k()&&(m.push(Hs({start:b,end:S,loop:u,count:a,style:p})),b=null),V=S,M=_));return b!==null&&m.push(Hs({start:b,end:f,loop:u,count:a,style:p})),m}function Us(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const o=js(i[s],n.points,t);o.length&&e.push(...o)}return e}function ec(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 nc(n,t,e,i){const s=n.length,o=[];let a=t,r=n[t],c;for(c=t+1;c<=e;++c){const d=n[c%s];d.skip||d.stop?r.skip||(i=!1,o.push({start:t%s,end:(c-1)%s,loop:i}),t=a=d.stop?c:null):(a=c,r.skip&&(t=c)),r=d}return a!==null&&o.push({start:t%s,end:a%s,loop:i}),o}function ic(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const o=!!n._loop,{start:a,end:r}=ec(e,s,o,i);if(i===!0)return Xs(n,[{start:a,end:r,loop:o}],e,t);const c=r<a?r+s:r,d=!!n._fullLoop&&a===0&&r===s-1;return Xs(n,nc(e,a,c,d),e,t)}function Xs(n,t,e,i){return!i||!i.setContext||!e?t:sc(n,t,e,i)}function sc(n,t,e,i){const s=n._chart.getContext(),o=qs(n.options),{_datasetIndex:a,options:{spanGaps:r}}=n,c=e.length,d=[];let h=o,f=t[0].start,u=f;function p(m,g,b,_){const x=r?-1:1;if(m!==g){for(m+=c;e[m%c].skip;)m-=x;for(;e[g%c].skip;)g+=x;m%c!==g%c&&(d.push({start:m%c,end:g%c,loop:b,style:_}),h=_,f=g%c)}}for(const m of t){f=r?f:m.start;let g=e[f%c],b;for(u=f+1;u<=m.end;u++){const _=e[u%c];b=qs(i.setContext(jt(s,{type:"segment",p0:g,p1:_,p0DataIndex:(u-1)%c,p1DataIndex:u%c,datasetIndex:a}))),oc(b,h)&&p(f,u-1,m.loop,h),g=_,h=b}f<u-1&&p(f,u-1,m.loop,h)}return d}function qs(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function oc(n,t){if(!t)return!1;const e=[],i=function(s,o){return ci(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
|
|
18
|
+
*/function Ot(){}const bl=(()=>{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 z(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function J(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function pt(n,t){return J(n)?n:t}function R(n,t){return typeof n>"u"?t:n}const yl=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,_i=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function H(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Y(n,t,e,s){let i,o,a;if(X(n))if(o=n.length,s)for(i=o-1;i>=0;i--)t.call(e,n[i],i);else for(i=0;i<o;i++)t.call(e,n[i],i);else if(z(n))for(a=Object.keys(n),o=a.length,i=0;i<o;i++)t.call(e,n[a[i]],a[i])}function fn(n,t){let e,s,i,o;if(!n||!t||n.length!==t.length)return!1;for(e=0,s=n.length;e<s;++e)if(i=n[e],o=t[e],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function un(n){if(X(n))return n.map(un);if(z(n)){const t=Object.create(null),e=Object.keys(n),s=e.length;let i=0;for(;i<s;++i)t[e[i]]=un(n[e[i]]);return t}return n}function xi(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function _l(n,t,e,s){if(!xi(n))return;const i=t[n],o=e[n];z(i)&&z(o)?Ve(i,o,s):t[n]=un(o)}function Ve(n,t,e){const s=X(t)?t:[t],i=s.length;if(!z(n))return n;e=e||{};const o=e.merger||_l;let a;for(let l=0;l<i;++l){if(a=s[l],!z(a))continue;const c=Object.keys(a);for(let d=0,h=c.length;d<h;++d)o(c[d],n,a,e)}return n}function Pe(n,t){return Ve(n,t,{merger:xl})}function xl(n,t,e){if(!xi(n))return;const s=t[n],i=e[n];z(s)&&z(i)?Pe(s,i):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=un(i))}const ki={"":n=>n,x:n=>n.x,y:n=>n.y};function kl(n){const t=n.split("."),e=[];let s="";for(const i of t)s+=i,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function wl(n){const t=kl(n);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Ht(n,t){return(ki[t]||(ki[t]=wl(t)))(n)}function ls(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Oe=n=>typeof n<"u",Ut=n=>typeof n=="function",wi=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Cl(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const q=Math.PI,K=2*q,Ml=K+q,pn=Number.POSITIVE_INFINITY,Sl=q/180,tt=q/2,ee=q/4,Ci=q*2/3,Xt=Math.log10,St=Math.sign;function Ae(n,t,e){return Math.abs(n-t)<e}function Mi(n){const t=Math.round(n);n=Ae(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Xt(n))),s=n/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Dl(n){const t=[],e=Math.sqrt(n);let s;for(s=1;s<e;s++)n%s===0&&(t.push(s),t.push(n/s));return e===(e|0)&&t.push(e),t.sort((i,o)=>i-o).pop(),t}function _e(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Bl(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Si(n,t,e){let s,i,o;for(s=0,i=n.length;s<i;s++)o=n[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Ct(n){return n*(q/180)}function cs(n){return n*(180/q)}function Di(n){if(!J(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Bi(n,t){const e=t.x-n.x,s=t.y-n.y,i=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*q&&(o+=K),{angle:o,distance:i}}function ds(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function vl(n,t){return(n-t+Ml)%K-q}function mt(n){return(n%K+K)%K}function Fe(n,t,e,s){const i=mt(n),o=mt(t),a=mt(e),l=mt(o-i),c=mt(a-i),d=mt(i-o),h=mt(i-a);return i===o||i===a||s&&o===a||l>c&&d<h}function it(n,t,e){return Math.max(t,Math.min(e,n))}function El(n){return it(n,-32768,32767)}function At(n,t,e,s=1e-6){return n>=Math.min(t,e)-s&&n<=Math.max(t,e)+s}function hs(n,t,e){e=e||(a=>n[a]<t);let s=n.length-1,i=0,o;for(;s-i>1;)o=i+s>>1,e(o)?i=o:s=o;return{lo:i,hi:s}}const Ft=(n,t,e,s)=>hs(n,e,s?i=>{const o=n[i][t];return o<e||o===e&&n[i+1][t]===e}:i=>n[i][t]<e),Vl=(n,t,e)=>hs(n,e,s=>n[s][t]>=e);function Pl(n,t,e){let s=0,i=n.length;for(;s<i&&n[s]<t;)s++;for(;i>s&&n[i-1]>e;)i--;return s>0||i<n.length?n.slice(s,i):n}const vi=["push","pop","shift","splice","unshift"];function Ol(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),vi.forEach(e=>{const s="_onData"+ls(e),i=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...o){const a=i.apply(this,o);return n._chartjs.listeners.forEach(l=>{typeof l[s]=="function"&&l[s](...o)}),a}})})}function Ei(n,t){const e=n._chartjs;if(!e)return;const s=e.listeners,i=s.indexOf(t);i!==-1&&s.splice(i,1),!(s.length>0)&&(vi.forEach(o=>{delete n[o]}),delete n._chartjs)}function Vi(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Pi=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Oi(n,t){let e=[],s=!1;return function(...i){e=i,s||(s=!0,Pi.call(window,()=>{s=!1,n.apply(t,e)}))}}function Al(n,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(n,t,s)):n.apply(this,s),t}}const fs=n=>n==="start"?"left":n==="end"?"right":"center",at=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Fl=(n,t,e,s)=>n===(s?"left":"right")?e:n==="center"?(t+e)/2:t;function Ai(n,t,e){const s=t.length;let i=0,o=s;if(n._sorted){const{iScale:a,_parsed:l}=n,c=a.axis,{min:d,max:h,minDefined:f,maxDefined:u}=a.getUserBounds();f&&(i=it(Math.min(Ft(l,c,d).lo,e?s:Ft(t,c,a.getPixelForValue(d)).lo),0,s-1)),u?o=it(Math.max(Ft(l,a.axis,h,!0).hi+1,e?0:Ft(t,c,a.getPixelForValue(h),!0).hi+1),i,s)-i:o=s-i}return{start:i,count:o}}function Fi(n){const{xScale:t,yScale:e,_scaleRanges:s}=n,i={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return n._scaleRanges=i,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,i),o}const mn=n=>n===0||n===1,Ni=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*K/e)),Ti=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*K/e)+1,Ne={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=>mn(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=>mn(n)?n:Ni(n,.075,.3),easeOutElastic:n=>mn(n)?n:Ti(n,.075,.3),easeInOutElastic(n){return mn(n)?n:n<.5?.5*Ni(n*2,.1125,.45):.5+.5*Ti(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-Ne.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?Ne.easeInBounce(n*2)*.5:Ne.easeOutBounce(n*2-1)*.5+.5};function us(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function $i(n){return us(n)?n:new Ee(n)}function ps(n){return us(n)?n:new Ee(n).saturate(.5).darken(.1).hexString()}const Nl=["x","y","borderWidth","radius","tension"],Tl=["color","borderColor","backgroundColor"];function $l(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:Tl},numbers:{type:"number",properties:Nl}}),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 Ll(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Li=new Map;function Rl(n,t){t=t||{};const e=n+JSON.stringify(t);let s=Li.get(e);return s||(s=new Intl.NumberFormat(n,t),Li.set(e,s)),s}function Te(n,t,e){return Rl(t,e).format(n)}const Ri={values(n){return X(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const s=this.chart.options.locale;let i,o=n;if(e.length>1){const d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(i="scientific"),o=zl(n,e)}const a=Xt(Math.abs(o)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:i,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Te(n,s,c)},logarithmic(n,t,e){if(n===0)return"0";const s=e[t].significand||n/Math.pow(10,Math.floor(Xt(n)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?Ri.numeric.call(this,n,t,e):""}};function zl(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 gn={formatters:Ri};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:gn.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 ne=Object.create(null),ms=Object.create(null);function $e(n,t){if(!t)return n;const e=t.split(".");for(let s=0,i=e.length;s<i;++s){const o=e[s];n=n[o]||(n[o]=Object.create(null))}return n}function gs(n,t,e){return typeof t=="string"?Ve($e(n,t),e):Ve($e(n,""),t)}class Wl{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,i)=>ps(i.backgroundColor),this.hoverBorderColor=(s,i)=>ps(i.borderColor),this.hoverColor=(s,i)=>ps(i.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 gs(this,t,e)}get(t){return $e(this,t)}describe(t,e){return gs(ms,t,e)}override(t,e){return gs(ne,t,e)}route(t,e,s,i){const o=$e(this,t),a=$e(this,s),l="_"+e;Object.defineProperties(o,{[l]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const c=this[l],d=a[i];return z(c)?Object.assign({},d,c):R(c,d)},set(c){this[l]=c}}})}apply(t){t.forEach(e=>e(this))}}var Z=new Wl({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[$l,Ll,Il]);function Yl(n){return!n||I(n.size)||I(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function bn(n,t,e,s,i){let o=t[i];return o||(o=t[i]=n.measureText(i).width,e.push(i)),o>s&&(s=o),s}function jl(n,t,e,s){s=s||{};let i=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(i=s.data={},o=s.garbageCollect=[],s.font=t),n.save(),n.font=t;let a=0;const l=e.length;let c,d,h,f,u;for(c=0;c<l;c++)if(f=e[c],f!=null&&!X(f))a=bn(n,i,o,a,f);else if(X(f))for(d=0,h=f.length;d<h;d++)u=f[d],u!=null&&!X(u)&&(a=bn(n,i,o,a,u));n.restore();const p=o.length/2;if(p>e.length){for(c=0;c<p;c++)delete i[o[c]];o.splice(0,p)}return a}function se(n,t,e){const s=n.currentDevicePixelRatio,i=e!==0?Math.max(e/2,.5):0;return Math.round((t-i)*s)/s+i}function zi(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function bs(n,t,e,s){Ii(n,t,e,s,null)}function Ii(n,t,e,s,i){let o,a,l,c,d,h,f,u;const p=t.pointStyle,m=t.rotation,g=t.radius;let b=(m||0)*Sl;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(e,s),n.rotate(b),n.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),p){default:i?n.ellipse(e,s,i/2,g,0,0,K):n.arc(e,s,g,0,K),n.closePath();break;case"triangle":h=i?i/2:g,n.moveTo(e+Math.sin(b)*h,s-Math.cos(b)*g),b+=Ci,n.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*g),b+=Ci,n.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*g),n.closePath();break;case"rectRounded":d=g*.516,c=g-d,a=Math.cos(b+ee)*c,f=Math.cos(b+ee)*(i?i/2-d:c),l=Math.sin(b+ee)*c,u=Math.sin(b+ee)*(i?i/2-d:c),n.arc(e-f,s-l,d,b-q,b-tt),n.arc(e+u,s-a,d,b-tt,b),n.arc(e+f,s+l,d,b,b+tt),n.arc(e-u,s+a,d,b+tt,b+q),n.closePath();break;case"rect":if(!m){c=Math.SQRT1_2*g,h=i?i/2:c,n.rect(e-h,s-c,2*h,2*c);break}b+=ee;case"rectRot":f=Math.cos(b)*(i?i/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(i?i/2:g),n.moveTo(e-f,s-l),n.lineTo(e+u,s-a),n.lineTo(e+f,s+l),n.lineTo(e-u,s+a),n.closePath();break;case"crossRot":b+=ee;case"cross":f=Math.cos(b)*(i?i/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(i?i/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a);break;case"star":f=Math.cos(b)*(i?i/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(i?i/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a),b+=ee,f=Math.cos(b)*(i?i/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(i?i/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a);break;case"line":a=i?i/2:Math.cos(b)*g,l=Math.sin(b)*g,n.moveTo(e-a,s-l),n.lineTo(e+a,s+l);break;case"dash":n.moveTo(e,s),n.lineTo(e+Math.cos(b)*(i?i/2:g),s+Math.sin(b)*g);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Nt(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 yn(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function _n(n){n.restore()}function Hl(n,t,e,s,i){if(!t)return n.lineTo(e.x,e.y);if(i==="middle"){const o=(t.x+e.x)/2;n.lineTo(o,t.y),n.lineTo(o,e.y)}else i==="after"!=!!s?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function Ul(n,t,e,s){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function Xl(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 ql(n,t,e,s,i){if(i.strikethrough||i.underline){const o=n.measureText(s),a=t-o.actualBoundingBoxLeft,l=t+o.actualBoundingBoxRight,c=e-o.actualBoundingBoxAscent,d=e+o.actualBoundingBoxDescent,h=i.strikethrough?(c+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=i.decorationWidth||2,n.moveTo(a,h),n.lineTo(l,h),n.stroke()}}function Kl(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ie(n,t,e,s,i,o={}){const a=X(t)?t:[t],l=o.strokeWidth>0&&o.strokeColor!=="";let c,d;for(n.save(),n.font=i.string,Xl(n,o),c=0;c<a.length;++c)d=a[c],o.backdrop&&Kl(n,o.backdrop),l&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),I(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(d,e,s,o.maxWidth)),n.fillText(d,e,s,o.maxWidth),ql(n,e,s,d,o),s+=Number(i.lineHeight);n.restore()}function Le(n,t){const{x:e,y:s,w:i,h:o,radius:a}=t;n.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*q,q,!0),n.lineTo(e,s+o-a.bottomLeft),n.arc(e+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,q,tt,!0),n.lineTo(e+i-a.bottomRight,s+o),n.arc(e+i-a.bottomRight,s+o-a.bottomRight,a.bottomRight,tt,0,!0),n.lineTo(e+i,s+a.topRight),n.arc(e+i-a.topRight,s+a.topRight,a.topRight,0,-tt,!0),n.lineTo(e+a.topLeft,s)}const Gl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Jl=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Zl(n,t){const e=(""+n).match(Gl);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 Ql=n=>+n||0;function ys(n,t){const e={},s=z(t),i=s?Object.keys(t):t,o=z(n)?s?a=>R(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of i)e[a]=Ql(o(a));return e}function Wi(n){return ys(n,{top:"y",right:"x",bottom:"y",left:"x"})}function oe(n){return ys(n,["topLeft","topRight","bottomLeft","bottomRight"])}function rt(n){const t=Wi(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function nt(n,t){n=n||{},t=t||Z.font;let e=R(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=R(n.style,t.style);s&&!(""+s).match(Jl)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const i={family:R(n.family,t.family),lineHeight:Zl(R(n.lineHeight,t.lineHeight),e),size:e,style:s,weight:R(n.weight,t.weight),string:""};return i.string=Yl(i),i}function Re(n,t,e,s){let i=!0,o,a,l;for(o=0,a=n.length;o<a;++o)if(l=n[o],l!==void 0&&(t!==void 0&&typeof l=="function"&&(l=l(t),i=!1),e!==void 0&&X(l)&&(l=l[e%l.length],i=!1),l!==void 0))return s&&!i&&(s.cacheable=!1),l}function tc(n,t,e){const{min:s,max:i}=n,o=_i(t,(i-s)/2),a=(l,c)=>e&&l===0?0:l+c;return{min:a(s,-Math.abs(o)),max:a(i,o)}}function qt(n,t){return Object.assign(Object.create(n),t)}function _s(n,t=[""],e,s,i=()=>n[0]){const o=e||n;typeof s>"u"&&(s=Xi("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:s,_getTarget:i,override:l=>_s([l,...n],t,o,s)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete n[0][c],!0},get(l,c){return ji(l,c,()=>lc(c,t,n,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,c){return qi(l).includes(c)},ownKeys(l){return qi(l)},set(l,c,d){const h=l._storage||(l._storage=i());return l[c]=h[c]=d,delete l._keys,!0}})}function xe(n,t,e,s){const i={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Yi(n,s),setContext:o=>xe(n,o,e,s),override:o=>xe(n.override(o),t,e,s)};return new Proxy(i,{deleteProperty(o,a){return delete o[a],delete n[a],!0},get(o,a,l){return ji(o,a,()=>nc(o,a,l))},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,l){return n[a]=l,delete o[a],!0}})}function Yi(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:i=t.allKeys}=n;return{allKeys:i,scriptable:e,indexable:s,isScriptable:Ut(e)?e:()=>e,isIndexable:Ut(s)?s:()=>s}}const ec=(n,t)=>n?n+ls(t):t,xs=(n,t)=>z(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ji(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const s=e();return n[t]=s,s}function nc(n,t,e){const{_proxy:s,_context:i,_subProxy:o,_descriptors:a}=n;let l=s[t];return Ut(l)&&a.isScriptable(t)&&(l=sc(t,l,n,e)),X(l)&&l.length&&(l=ic(t,l,n,a.isIndexable)),xs(t,l)&&(l=xe(l,i,o&&o[t],a)),l}function sc(n,t,e,s){const{_proxy:i,_context:o,_subProxy:a,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let c=t(o,a||s);return l.delete(n),xs(n,c)&&(c=ks(i._scopes,i,n,c)),c}function ic(n,t,e,s){const{_proxy:i,_context:o,_subProxy:a,_descriptors:l}=e;if(typeof o.index<"u"&&s(n))return t[o.index%t.length];if(z(t[0])){const c=t,d=i._scopes.filter(h=>h!==c);t=[];for(const h of c){const f=ks(d,i,n,h);t.push(xe(f,o,a&&a[n],l))}}return t}function Hi(n,t,e){return Ut(n)?n(t,e):n}const oc=(n,t)=>n===!0?t:typeof n=="string"?Ht(t,n):void 0;function ac(n,t,e,s,i){for(const o of t){const a=oc(e,o);if(a){n.add(a);const l=Hi(a._fallback,e,i);if(typeof l<"u"&&l!==e&&l!==s)return l}else if(a===!1&&typeof s<"u"&&e!==s)return null}return!1}function ks(n,t,e,s){const i=t._rootScopes,o=Hi(t._fallback,e,s),a=[...n,...i],l=new Set;l.add(s);let c=Ui(l,a,e,o||e,s);return c===null||typeof o<"u"&&o!==e&&(c=Ui(l,a,o,c,s),c===null)?!1:_s(Array.from(l),[""],i,o,()=>rc(t,e,s))}function Ui(n,t,e,s,i){for(;e;)e=ac(n,t,e,s,i);return e}function rc(n,t,e){const s=n._getTarget();t in s||(s[t]={});const i=s[t];return X(i)&&z(e)?e:i||{}}function lc(n,t,e,s){let i;for(const o of t)if(i=Xi(ec(o,n),e),typeof i<"u")return xs(n,i)?ks(e,s,n,i):i}function Xi(n,t){for(const e of t){if(!e)continue;const s=e[n];if(typeof s<"u")return s}}function qi(n){let t=n._keys;return t||(t=n._keys=cc(n._scopes)),t}function cc(n){const t=new Set;for(const e of n)for(const s of Object.keys(e).filter(i=>!i.startsWith("_")))t.add(s);return Array.from(t)}function Ki(n,t,e,s){const{iScale:i}=n,{key:o="r"}=this._parsing,a=new Array(s);let l,c,d,h;for(l=0,c=s;l<c;++l)d=l+e,h=t[d],a[l]={r:i.parse(Ht(h,o),d)};return a}const dc=Number.EPSILON||1e-14,ke=(n,t)=>t<n.length&&!n[t].skip&&n[t],Gi=n=>n==="x"?"y":"x";function hc(n,t,e,s){const i=n.skip?t:n,o=t,a=e.skip?t:e,l=ds(o,i),c=ds(a,o);let d=l/(l+c),h=c/(l+c);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const f=s*d,u=s*h;return{previous:{x:o.x-f*(a.x-i.x),y:o.y-f*(a.y-i.y)},next:{x:o.x+u*(a.x-i.x),y:o.y+u*(a.y-i.y)}}}function fc(n,t,e){const s=n.length;let i,o,a,l,c,d=ke(n,0);for(let h=0;h<s-1;++h)if(c=d,d=ke(n,h+1),!(!c||!d)){if(Ae(t[h],0,dc)){e[h]=e[h+1]=0;continue}i=e[h]/t[h],o=e[h+1]/t[h],l=Math.pow(i,2)+Math.pow(o,2),!(l<=9)&&(a=3/Math.sqrt(l),e[h]=i*a*t[h],e[h+1]=o*a*t[h])}}function uc(n,t,e="x"){const s=Gi(e),i=n.length;let o,a,l,c=ke(n,0);for(let d=0;d<i;++d){if(a=l,l=c,c=ke(n,d+1),!l)continue;const h=l[e],f=l[s];a&&(o=(h-a[e])/3,l[`cp1${e}`]=h-o,l[`cp1${s}`]=f-o*t[d]),c&&(o=(c[e]-h)/3,l[`cp2${e}`]=h+o,l[`cp2${s}`]=f+o*t[d])}}function pc(n,t="x"){const e=Gi(t),s=n.length,i=Array(s).fill(0),o=Array(s);let a,l,c,d=ke(n,0);for(a=0;a<s;++a)if(l=c,c=d,d=ke(n,a+1),!!c){if(d){const h=d[t]-c[t];i[a]=h!==0?(d[e]-c[e])/h:0}o[a]=l?d?St(i[a-1])!==St(i[a])?0:(i[a-1]+i[a])/2:i[a-1]:i[a]}fc(n,i,o),uc(n,o,t)}function xn(n,t,e){return Math.max(Math.min(n,e),t)}function mc(n,t){let e,s,i,o,a,l=Nt(n[0],t);for(e=0,s=n.length;e<s;++e)a=o,o=l,l=e<s-1&&Nt(n[e+1],t),o&&(i=n[e],a&&(i.cp1x=xn(i.cp1x,t.left,t.right),i.cp1y=xn(i.cp1y,t.top,t.bottom)),l&&(i.cp2x=xn(i.cp2x,t.left,t.right),i.cp2y=xn(i.cp2y,t.top,t.bottom)))}function gc(n,t,e,s,i){let o,a,l,c;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")pc(n,i);else{let d=s?n[n.length-1]:n[0];for(o=0,a=n.length;o<a;++o)l=n[o],c=hc(d,l,n[Math.min(o+1,a-(s?0:1))%a],t.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}t.capBezierPoints&&mc(n,e)}function Ji(){return typeof window<"u"&&typeof document<"u"}function ws(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function kn(n,t,e){let s;return typeof n=="string"?(s=parseInt(n,10),n.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=n,s}const wn=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function bc(n,t){return wn(n).getPropertyValue(t)}const yc=["top","right","bottom","left"];function ae(n,t,e){const s={};e=e?"-"+e:"";for(let i=0;i<4;i++){const o=yc[i];s[o]=parseFloat(n[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const _c=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function xc(n,t){const e=n.touches,s=e&&e.length?e[0]:n,{offsetX:i,offsetY:o}=s;let a=!1,l,c;if(_c(i,o,n.target))l=i,c=o;else{const d=t.getBoundingClientRect();l=s.clientX-d.left,c=s.clientY-d.top,a=!0}return{x:l,y:c,box:a}}function re(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:s}=t,i=wn(e),o=i.boxSizing==="border-box",a=ae(i,"padding"),l=ae(i,"border","width"),{x:c,y:d,box:h}=xc(n,e),f=a.left+(h&&l.left),u=a.top+(h&&l.top);let{width:p,height:m}=t;return o&&(p-=a.width+l.width,m-=a.height+l.height),{x:Math.round((c-f)/p*e.width/s),y:Math.round((d-u)/m*e.height/s)}}function kc(n,t,e){let s,i;if(t===void 0||e===void 0){const o=ws(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{const a=o.getBoundingClientRect(),l=wn(o),c=ae(l,"border","width"),d=ae(l,"padding");t=a.width-d.width-c.width,e=a.height-d.height-c.height,s=kn(l.maxWidth,o,"clientWidth"),i=kn(l.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||pn,maxHeight:i||pn}}const Cn=n=>Math.round(n*10)/10;function wc(n,t,e,s){const i=wn(n),o=ae(i,"margin"),a=kn(i.maxWidth,n,"clientWidth")||pn,l=kn(i.maxHeight,n,"clientHeight")||pn,c=kc(n,t,e);let{width:d,height:h}=c;if(i.boxSizing==="content-box"){const u=ae(i,"border","width"),p=ae(i,"padding");d-=p.width+u.width,h-=p.height+u.height}return d=Math.max(0,d-o.width),h=Math.max(0,s?d/s:h-o.height),d=Cn(Math.min(d,a,c.maxWidth)),h=Cn(Math.min(h,l,c.maxHeight)),d&&!h&&(h=Cn(d/2)),(t!==void 0||e!==void 0)&&s&&c.height&&h>c.height&&(h=c.height,d=Cn(Math.floor(h*s))),{width:d,height:h}}function Zi(n,t,e){const s=t||1,i=Math.floor(n.height*s),o=Math.floor(n.width*s);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!==s||a.height!==i||a.width!==o?(n.currentDevicePixelRatio=s,a.height=i,a.width=o,n.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Cc=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 Qi(n,t){const e=bc(n,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function le(n,t,e,s){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Mc(n,t,e,s){return{x:n.x+e*(t.x-n.x),y:s==="middle"?e<.5?n.y:t.y:s==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Sc(n,t,e,s){const i={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},a=le(n,i,e),l=le(i,o,e),c=le(o,t,e),d=le(a,l,e),h=le(l,c,e);return le(d,h,e)}const Dc=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,s){return e-s},leftForLtr(e,s){return e-s}}},Bc=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function we(n,t,e){return n?Dc(t,e):Bc()}function to(n,t){let e,s;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=s)}function eo(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function no(n){return n==="angle"?{between:Fe,compare:vl,normalize:mt}:{between:At,compare:(t,e)=>t-e,normalize:t=>t}}function so({start:n,end:t,count:e,loop:s,style:i}){return{start:n%e,end:t%e,loop:s&&(t-n+1)%e===0,style:i}}function vc(n,t,e){const{property:s,start:i,end:o}=e,{between:a,normalize:l}=no(s),c=t.length;let{start:d,end:h,loop:f}=n,u,p;if(f){for(d+=c,h+=c,u=0,p=c;u<p&&a(l(t[d%c][s]),i,o);++u)d--,h--;d%=c,h%=c}return h<d&&(h+=c),{start:d,end:h,loop:f,style:n.style}}function io(n,t,e){if(!e)return[n];const{property:s,start:i,end:o}=e,a=t.length,{compare:l,between:c,normalize:d}=no(s),{start:h,end:f,loop:u,style:p}=vc(n,t,e),m=[];let g=!1,b=null,y,w,_;const k=()=>c(i,_,y)&&l(i,_)!==0,x=()=>l(o,y)===0||c(o,_,y),M=()=>g||k(),C=()=>!g||x();for(let S=h,v=h;S<=f;++S)w=t[S%a],!w.skip&&(y=d(w[s]),y!==_&&(g=c(y,i,o),b===null&&M()&&(b=l(y,i)===0?S:v),b!==null&&C()&&(m.push(so({start:b,end:S,loop:u,count:a,style:p})),b=null),v=S,_=y));return b!==null&&m.push(so({start:b,end:f,loop:u,count:a,style:p})),m}function oo(n,t){const e=[],s=n.segments;for(let i=0;i<s.length;i++){const o=io(s[i],n.points,t);o.length&&e.push(...o)}return e}function Ec(n,t,e,s){let i=0,o=t-1;if(e&&!s)for(;i<t&&!n[i].skip;)i++;for(;i<t&&n[i].skip;)i++;for(i%=t,e&&(o+=i);o>i&&n[o%t].skip;)o--;return o%=t,{start:i,end:o}}function Vc(n,t,e,s){const i=n.length,o=[];let a=t,l=n[t],c;for(c=t+1;c<=e;++c){const d=n[c%i];d.skip||d.stop?l.skip||(s=!1,o.push({start:t%i,end:(c-1)%i,loop:s}),t=a=d.stop?c:null):(a=c,l.skip&&(t=c)),l=d}return a!==null&&o.push({start:t%i,end:a%i,loop:s}),o}function Pc(n,t){const e=n.points,s=n.options.spanGaps,i=e.length;if(!i)return[];const o=!!n._loop,{start:a,end:l}=Ec(e,i,o,s);if(s===!0)return ao(n,[{start:a,end:l,loop:o}],e,t);const c=l<a?l+i:l,d=!!n._fullLoop&&a===0&&l===i-1;return ao(n,Vc(e,a,c,d),e,t)}function ao(n,t,e,s){return!s||!s.setContext||!e?t:Oc(n,t,e,s)}function Oc(n,t,e,s){const i=n._chart.getContext(),o=ro(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,c=e.length,d=[];let h=o,f=t[0].start,u=f;function p(m,g,b,y){const w=l?-1:1;if(m!==g){for(m+=c;e[m%c].skip;)m-=w;for(;e[g%c].skip;)g+=w;m%c!==g%c&&(d.push({start:m%c,end:g%c,loop:b,style:y}),h=y,f=g%c)}}for(const m of t){f=l?f:m.start;let g=e[f%c],b;for(u=f+1;u<=m.end;u++){const y=e[u%c];b=ro(s.setContext(qt(i,{type:"segment",p0:g,p1:y,p0DataIndex:(u-1)%c,p1DataIndex:u%c,datasetIndex:a}))),Ac(b,h)&&p(f,u-1,m.loop,h),g=y,h=b}f<u-1&&p(f,u-1,m.loop,h)}return d}function ro(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Ac(n,t){if(!t)return!1;const e=[],s=function(i,o){return us(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,s)!==JSON.stringify(t,s)}/*!
|
|
19
19
|
* Chart.js v4.4.0
|
|
20
20
|
* https://www.chartjs.org
|
|
21
21
|
* (c) 2023 Chart.js Contributors
|
|
22
22
|
* Released under the MIT License
|
|
23
|
-
*/class ac{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=ys.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,c;for(;a>=0;--a)c=o[a],c._active?(c._total>i.duration&&(i.duration=c._total),c.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 At=new ac;const Ks="transparent",rc={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Ms(n||Ks),s=i.valid&&Ms(t||Ks);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class lc{constructor(t,e,i,s){const o=e[i];s=Le([t.to,s,o,t.from]);const a=Le([t.from,o,s]);this._active=!0,this._fn=t.fn||rc[t.type||typeof a],this._easing=Ae[t.easing]||Ae.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=Le([t.to,e,s,t.from]),this._from=Le([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 c;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}c=e/i%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,r,c)}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 Gs{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!z(t))return;const e=Object.keys(Z.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!z(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=dc(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&cc(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 c;for(c=a.length-1;c>=0;--c){const d=a[c];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[d];let f=o[d];const u=i.get(d);if(f)if(u&&f.active()){f.update(u,h,r);continue}else f.cancel();if(!u||!u.duration){t[d]=h;continue}o[d]=f=new lc(u,t,d,h),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 At.add(this._chart,i),!0}}function cc(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 dc(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 Js(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 hc(n,t,e){if(e===!1)return!1;const i=Js(n,e),s=Js(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function fc(n){let t,e,i,s;return z(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 Zs(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 Qs(n,t,e,i={}){const s=n.keys,o=i.mode==="single";let a,r,c,d;if(t!==null){for(a=0,r=s.length;a<r;++a){if(c=+s[a],c===e){if(i.all)continue;break}d=n.values[c],J(d)&&(o||t===0||Mt(t)===Mt(d))&&(t+=d)}return t}}function uc(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 to(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function pc(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function mc(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 gc(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function eo(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 no(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=i,c=o.axis,d=a.axis,h=pc(o,a,i),f=t.length;let u;for(let p=0;p<f;++p){const m=t[p],{[c]:g,[d]:b}=m,_=m._stacks||(m._stacks={});u=_[d]=gc(s,h,g),u[r]=b,u._top=eo(u,a,!0,i.type),u._bottom=eo(u,a,!1,i.type);const x=u._visualValues||(u._visualValues={});x[r]=b}}function _i(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function bc(n,t){return jt(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function yc(n,t,e){return jt(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function $e(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 xi=n=>n==="reset"||n==="none",io=(n,t)=>t?n:Object.assign({},n),_c=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Zs(e,!0),values:null};class wt{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=to(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&&$e(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(f,u,p,m)=>f==="x"?u:f==="r"?m:p,o=e.xAxisID=$(i.xAxisID,_i(t,"x")),a=e.yAxisID=$(i.yAxisID,_i(t,"y")),r=e.rAxisID=$(i.rAxisID,_i(t,"r")),c=e.indexAxis,d=e.iAxisID=s(c,o,a,r),h=e.vAxisID=s(c,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(d),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&gs(this._data,this),t._stacked&&$e(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(z(e))this._data=uc(e);else if(i!==e){if(i){gs(i,this);const s=this._cachedMeta;$e(s),s._parsed=[]}e&&Object.isExtensible(e)&&sl(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=to(e.vScale,e),e.stack!==i.stack&&(s=!0,$e(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&no(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 c=t===0&&e===s.length?!0:i._sorted,d=t>0&&i._parsed[t-1],h,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):z(s[t])?u=this.parseObjectData(i,s,t,e):u=this.parsePrimitiveData(i,s,t,e);const p=()=>f[r]===null||d&&f[r]<d[r];for(h=0;h<e;++h)i._parsed[h+t]=f=u[h],c&&(p()&&(c=!1),d=f);i._sorted=c}a&&no(this,u)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:a}=t,r=o.axis,c=a.axis,d=o.getLabels(),h=o===a,f=new Array(s);let u,p,m;for(u=0,p=s;u<p;++u)m=u+i,f[u]={[r]:h||o.parse(d[m],m),[c]:a.parse(e[m],m)};return f}parseArrayData(t,e,i,s){const{xScale:o,yScale:a}=t,r=new Array(s);let c,d,h,f;for(c=0,d=s;c<d;++c)h=c+i,f=e[h],r[c]={x:o.parse(f[0],h),y:a.parse(f[1],h)};return r}parseObjectData(t,e,i,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:c="y"}=this._parsing,d=new Array(s);let h,f,u,p;for(h=0,f=s;h<f;++h)u=h+i,p=e[u],d[h]={x:o.parse(Wt(p,r),u),y:a.parse(Wt(p,c),u)};return d}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:Zs(s,!0),values:e._stacks[t.axis]._visualValues};return Qs(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=Qs(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),c=_c(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:f}=mc(r);let u,p;function m(){p=s[u];const g=p[r.axis];return!J(p[t.axis])||h>g||f<g}for(u=0;u<a&&!(!m()&&(this.updateRangeFromParsed(d,t,p,c),o));++u);if(o){for(u=a-1;u>=0;--u)if(!m()){this.updateRangeFromParsed(d,t,p,c);break}}return d}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],J(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=fc($(this.options.clip,hc(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,c=this._drawCount||s.length-r,d=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,o,r,c),h=r;h<r+c;++h){const f=s[h];f.hidden||(f.active&&d?a.push(f):f.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=yc(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=bc(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],c=this.enableOptionSharing&&ve(i);if(r)return io(r,c);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),f=s?[`${t}Hover`,"hover",t,""]:[t,""],u=d.getOptionScopes(this.getDataset(),h),p=Object.keys(Z.elements[t]),m=()=>this.getContext(i,s,e),g=d.resolveNamedOptions(u,p,m,f);return g.$shared&&(g.$shared=c,o[a]=Object.freeze(io(g,c))),g}_resolveAnimations(t,e,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let c;if(s.options.animation!==!1){const h=this.chart.config,f=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),f);c=h.createResolver(u,this.getContext(t,i,e))}const d=new Gs(s,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||xi(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){xi(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!xi(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,c,d]of this._syncList)this[r](c,d);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 c=d=>{for(d.length+=e,r=d.length-1;r>=a;r--)d[r]=d[r-e]};for(c(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&c(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&&$e(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])}}v(wt,"defaults",{}),v(wt,"datasetElementType",null),v(wt,"dataElementType",null);function xc(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=bs(i.sort((s,o)=>s-o))}return n._cache.$bar}function kc(n){const t=n.iScale,e=xc(t,n.type);let i=t._length,s,o,a,r;const c=()=>{a===32767||a===-32768||(ve(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]),c();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),c();return i}function wc(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 Cc(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 c=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const d=o-(o-Math.min(a,r))/2*c;return{chunk:Math.abs(r-a)/2*c/i,ratio:e.barPercentage,start:d}}function Mc(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 c=a,d=r;Math.abs(a)>Math.abs(r)&&(c=r,d=a),t[e.axis]=d,t._custom={barStart:c,barEnd:d,start:s,end:o,min:a,max:r}}function so(n,t,e,i){return X(n)?Mc(n,t,e,i):t[e.axis]=e.parse(n,i),t}function oo(n,t,e,i){const s=n.iScale,o=n.vScale,a=s.getLabels(),r=s===o,c=[];let d,h,f,u;for(d=e,h=e+i;d<h;++d)u=t[d],f={},f[s.axis]=r||s.parse(a[d],d),c.push(so(u,f,o,d));return c}function ki(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Sc(n,t,e){return n!==0?Mt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Dc(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 Ec(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:c,top:d,bottom:h}=Dc(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=d:(e._bottom||0)===i?s=h:(o[ao(h,a,r,c)]=!0,s=d)),o[ao(s,a,r,c)]=!0,n.borderSkipped=o}function ao(n,t,e,i){return i?(n=Vc(n,t,e),n=ro(n,e,t)):n=ro(n,t,e),n}function Vc(n,t,e){return n===t?e:n===e?t:n}function ro(n,t,e){return n==="start"?t:n==="end"?e:n}function Bc(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class wn extends wt{parsePrimitiveData(t,e,i,s){return oo(t,e,i,s)}parseArrayData(t,e,i,s){return oo(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:c="y"}=this._parsing,d=o.axis==="x"?r:c,h=a.axis==="x"?r:c,f=[];let u,p,m,g;for(u=i,p=i+s;u<p;++u)g=e[u],m={},m[o.axis]=o.parse(Wt(g,d),u),f.push(so(Wt(g,h),m,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=ki(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,c=r.getBasePixel(),d=r.isHorizontal(),h=this._getRuler(),{sharedOptions:f,includeOptions:u}=this._getSharedOptions(e,s);for(let p=e;p<e+i;p++){const m=this.getParsed(p),g=o||I(m[r.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,h),_=(m._stacks||{})[r.axis],x={horizontal:d,base:g.base,enableBorderRadius:!_||ki(m._custom)||a===_._top||a===_._bottom,x:d?g.head:b.center,y:d?b.center:g.head,height:d?b.size:Math.abs(g.size),width:d?Math.abs(g.size):b.size};u&&(x.options=f||this.resolveDataElementOptions(p,t[p].active?"active":s));const M=x.options||t[p].options;Ec(x,M,_,a),Bc(x,M,h.ratio),this.updateElement(t[p],p,x,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),o=i.options.stacked,a=[],r=c=>{const d=c.controller.getParsed(e),h=d&&d[c.vScale.axis];if(I(h)||isNaN(h))return!0};for(const c of s)if(!(e!==void 0&&r(c))&&((o===!1||a.indexOf(c.stack)===-1||o===void 0&&c.stack===void 0)&&a.push(c.stack),c.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||kc(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,c=this.getParsed(t),d=c._custom,h=ki(d);let f=c[e.axis],u=0,p=i?this.applyStack(e,c,i):f,m,g;p!==f&&(u=p-f,p=f),h&&(f=d.barStart,p=d.barEnd-d.barStart,f!==0&&Mt(f)!==Mt(d.barEnd)&&(u=0),u+=f);const b=!I(o)&&!h?o:u;let _=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(u+p):m=_,g=m-_,Math.abs(g)<a){g=Sc(g,e,r)*a,f===r&&(_-=g/2);const x=e.getPixelForDecimal(0),M=e.getPixelForDecimal(1),C=Math.min(x,M),y=Math.max(x,M);_=Math.max(Math.min(_,y),C),m=_+g,i&&!h&&(c._stacks[e.axis]._visualValues[s]=e.getValueForPixel(m)-e.getValueForPixel(_))}if(_===e.getPixelForValue(r)){const x=Mt(g)*e.getLineWidthForValue(r)/2;_+=x,g-=x}return{size:g,base:_,head:m,center:m+g/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,a=$(s.maxBarThickness,1/0);let r,c;if(e.grouped){const d=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?Cc(t,e,s,d):wc(t,e,s,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=h.start+h.chunk*f+h.chunk/2,c=Math.min(a,h.chunk*h.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),c=Math.min(a,e.min*e.ratio);return{base:r-c/2,head:r+c/2,center:r,size:c}}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)}}v(wn,"id","bar"),v(wn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),v(wn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Cn extends wt{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=$(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=$(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),c=o.getLabelForValue(a.y),d=a._custom;return{label:i[t]||"",value:"("+r+", "+c+(d?", "+d:"")+")"}}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:c,includeOptions:d}=this._getSharedOptions(e,s),h=a.axis,f=r.axis;for(let u=e;u<e+i;u++){const p=t[u],m=!o&&this.getParsed(u),g={},b=g[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(m[h]),_=g[f]=o?r.getBasePixel():r.getPixelForValue(m[f]);g.skip=isNaN(b)||isNaN(_),d&&(g.options=c||this.resolveDataElementOptions(u,p.active?"active":s),o&&(g.options.radius=0)),this.updateElement(p,u,g,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+=$(i&&i._custom,o),s}}v(Cn,"id","bubble"),v(Cn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),v(Cn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function vc(n,t,e){let i=1,s=1,o=0,a=0;if(t<K){const r=n,c=r+t,d=Math.cos(r),h=Math.sin(r),f=Math.cos(c),u=Math.sin(c),p=(M,C,y)=>Oe(M,r,c,!0)?1:Math.max(C,C*e,y,y*e),m=(M,C,y)=>Oe(M,r,c,!0)?-1:Math.min(C,C*e,y,y*e),g=p(0,d,f),b=p(tt,h,u),_=m(q,d,f),x=m(q+tt,h,u);i=(g-_)/2,s=(b-x)/2,o=-(g+_)/2,a=-(b+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class re extends wt{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=c=>+i[c];if(z(i[t])){const{key:c="value"}=this._parsing;o=d=>+Wt(i[d],c)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return kt(this.options.rotation-90)}_getCircumference(){return kt(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),c=Math.min(Hr(this.options.cutout,r),1),d=this._getRingWeight(this.index),{circumference:h,rotation:f}=this._getRotationExtents(),{ratioX:u,ratioY:p,offsetX:m,offsetY:g}=vc(f,h,c),b=(i.width-a)/u,_=(i.height-a)/p,x=Math.max(Math.min(b,_)/2,0),M=as(this.options.radius,x),C=Math.max(M*c,0),y=(M-C)/this._getVisibleDatasetWeightTotal();this.offsetX=m*M,this.offsetY=g*M,s.total=this.calculateTotal(),this.outerRadius=M-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*d,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,d=a.options.animation,h=(r.left+r.right)/2,f=(r.top+r.bottom)/2,u=o&&d.animateScale,p=u?0:this.innerRadius,m=u?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(e,s);let _=this._getRotation(),x;for(x=0;x<e;++x)_+=this._circumference(x,o);for(x=e;x<e+i;++x){const M=this._circumference(x,o),C=t[x],y={x:h+this.offsetX,y:f+this.offsetY,startAngle:_,endAngle:_+M,circumference:M,outerRadius:m,innerRadius:p};b&&(y.options=g||this.resolveDataElementOptions(x,C.active?"active":s)),_+=M,this.updateElement(C,x,y,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=Fe(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,c;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)c=r.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(e=Math.max(e,c.borderWidth||0,c.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($(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}v(re,"id","doughnut"),v(re,"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"}),v(re,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),v(re,"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 c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class Mn extends wt{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:c}=xs(e,s,a);this._drawStart=r,this._drawCount=c,ks(e)&&(r=0,c=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},t),this.updateElements(s,r,c,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s),u=a.axis,p=r.axis,{spanGaps:m,segment:g}=this.options,b=be(m)?m:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none",x=e+i,M=t.length;let C=e>0&&this.getParsed(e-1);for(let y=0;y<M;++y){const w=t[y],k=_?w:{};if(y<e||y>=x){k.skip=!0;continue}const S=this.getParsed(y),V=I(S[p]),P=k[u]=a.getPixelForValue(S[u],y),A=k[p]=o||V?r.getBasePixel():r.getPixelForValue(c?this.applyStack(r,S,c):S[p],y);k.skip=isNaN(P)||isNaN(A)||V,k.stop=y>0&&Math.abs(S[u]-C[u])>b,g&&(k.parsed=S,k.raw=d.data[y]),f&&(k.options=h||this.resolveDataElementOptions(y,w.active?"active":s)),_||this.updateElement(w,y,k,s),C=S}}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()}}v(Mn,"id","line"),v(Mn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),v(Mn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Re extends wt{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=Fe(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return Ns.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,c=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,f=d.yCenter,u=d.getIndexAngle(0)-.5*q;let p=u,m;const g=360/this.countVisibleElements();for(m=0;m<e;++m)p+=this._computeAngle(m,s,g);for(m=e;m<e+i;m++){const b=t[m];let _=p,x=p+this._computeAngle(m,s,g),M=a.getDataVisibility(m)?d.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=x,o&&(c.animateScale&&(M=0),c.animateRotate&&(_=x=u));const C={x:h,y:f,innerRadius:0,outerRadius:M,startAngle:_,endAngle:x,options:this.resolveDataElementOptions(m,b.active?"active":s)};this.updateElement(b,m,C,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)?kt(this.resolveDataElementOptions(t,e).angle||i):0}}v(Re,"id","polarArea"),v(Re,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),v(Re,"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 c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.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 wi extends re{}v(wi,"id","pie"),v(wi,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Sn extends wt{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 Ns.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 c=t[r],d=this.resolveDataElementOptions(r,c.active?"active":s),h=o.getPointPositionForValue(r,this.getParsed(r).r),f=a?o.xCenter:h.x,u=a?o.yCenter:h.y,p={x:f,y:u,angle:h.angle,skip:isNaN(f)||isNaN(u),options:d};this.updateElement(c,r,p,s)}}}v(Sn,"id","radar"),v(Sn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),v(Sn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Dn extends wt{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),c=o.getLabelForValue(a.y);return{label:i[t]||"",value:"("+r+", "+c+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=xs(e,i,s);if(this._drawStart=o,this._drawCount=a,ks(e)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:c}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!c._decimated,r.points=i;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:d},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:c,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),f=this.getSharedOptions(h),u=this.includeOptions(s,f),p=a.axis,m=r.axis,{spanGaps:g,segment:b}=this.options,_=be(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let M=e>0&&this.getParsed(e-1);for(let C=e;C<e+i;++C){const y=t[C],w=this.getParsed(C),k=x?y:{},S=I(w[m]),V=k[p]=a.getPixelForValue(w[p],C),P=k[m]=o||S?r.getBasePixel():r.getPixelForValue(c?this.applyStack(r,w,c):w[m],C);k.skip=isNaN(V)||isNaN(P)||S,k.stop=C>0&&Math.abs(w[p]-M[p])>_,b&&(k.parsed=w,k.raw=d.data[C]),u&&(k.options=f||this.resolveDataElementOptions(C,y.active?"active":s)),x||this.updateElement(y,C,k,s),M=w}this.updateSharedOptions(f,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let c=e.length-1;c>=0;--c)r=Math.max(r,e[c].size(this.resolveDataElementOptions(c))/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}}v(Dn,"id","scatter"),v(Dn,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),v(Dn,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Pc=Object.freeze({__proto__:null,BarController:wn,BubbleController:Cn,DoughnutController:re,LineController:Mn,PieController:wi,PolarAreaController:Re,RadarController:Sn,ScatterController:Dn});function le(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ci{constructor(t){v(this,"options");this.options=t||{}}static override(t){Object.assign(Ci.prototype,t)}init(){}formats(){return le()}parse(){return le()}format(){return le()}add(){return le()}diff(){return le()}startOf(){return le()}endOf(){return le()}}var Oc={_date:Ci};function Ac(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 c=r._reversePixels?nl:Pt;if(i){if(s._sharedOptions){const d=o[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){const f=c(o,t,e-h),u=c(o,t,e+h);return{lo:f.lo,hi:u.hi}}}}else return c(o,t,e)}return{lo:0,hi:o.length-1}}function ze(n,t,e,i,s){const o=n.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,c=o.length;r<c;++r){const{index:d,data:h}=o[r],{lo:f,hi:u}=Ac(o[r],t,a,s);for(let p=f;p<=u;++p){const m=h[p];m.skip||i(m,d,p)}}}function Fc(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 Mi(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||ze(n,e,t,function(r,c,d){!s&&!Ot(r,n.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:c,index:d})},!0),o}function Tc(n,t,e,i){let s=[];function o(a,r,c){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:f}=ps(a,{x:t.x,y:t.y});Oe(f,d,h)&&s.push({element:a,datasetIndex:r,index:c})}return ze(n,e,t,o),s}function Nc(n,t,e,i,s,o){let a=[];const r=Fc(e);let c=Number.POSITIVE_INFINITY;function d(h,f,u){const p=h.inRange(t.x,t.y,s);if(i&&!p)return;const m=h.getCenterPoint(s);if(!(!!o||n.isPointInArea(m))&&!p)return;const b=r(t,m);b<c?(a=[{element:h,datasetIndex:f,index:u}],c=b):b===c&&a.push({element:h,datasetIndex:f,index:u})}return ze(n,e,t,d),a}function Si(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?Tc(n,t,e,s):Nc(n,t,e,i,s,o)}function lo(n,t,e,i,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return ze(n,e,t,(c,d,h)=>{c[a](t[e],s)&&(o.push({element:c,datasetIndex:d,index:h}),r=r||c.inRange(t.x,t.y,s))}),i&&!r?[]:o}var Lc={evaluateInteractionItems:ze,modes:{index(n,t,e,i){const s=oe(t,n),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?Mi(n,s,o,i,a):Si(n,s,o,!1,i,a),c=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=r[0].index,f=d.data[h];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:h})}),c):[]},dataset(n,t,e,i){const s=oe(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?Mi(n,s,o,i,a):Si(n,s,o,!1,i,a);if(r.length>0){const c=r[0].datasetIndex,d=n.getDatasetMeta(c).data;r=[];for(let h=0;h<d.length;++h)r.push({element:d[h],datasetIndex:c,index:h})}return r},point(n,t,e,i){const s=oe(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Mi(n,s,o,i,a)},nearest(n,t,e,i){const s=oe(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Si(n,s,o,e.intersect,i,a)},x(n,t,e,i){const s=oe(t,n);return lo(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=oe(t,n);return lo(n,s,"y",e.intersect,i)}}};const co=["left","top","right","bottom"];function Ie(n,t){return n.filter(e=>e.pos===t)}function ho(n,t){return n.filter(e=>co.indexOf(e.pos)===-1&&e.box.axis===t)}function We(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 $c(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 Rc(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!co.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 zc(n,t){const e=Rc(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=n.length;o<a;++o){r=n[o];const{fullSize:c}=r.box,d=e[r.stack],h=d&&r.stackWeight/d.weight;r.horizontal?(r.width=h?h*i:c&&t.availableWidth,r.height=s):(r.width=i,r.height=h?h*s:c&&t.availableHeight)}return e}function Ic(n){const t=$c(n),e=We(t.filter(d=>d.box.fullSize),!0),i=We(Ie(t,"left"),!0),s=We(Ie(t,"right")),o=We(Ie(t,"top"),!0),a=We(Ie(t,"bottom")),r=ho(t,"x"),c=ho(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(c).concat(a).concat(r),chartArea:Ie(t,"chartArea"),vertical:i.concat(s).concat(c),horizontal:o.concat(a).concat(r)}}function fo(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function uo(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 Wc(n,t,e,i){const{pos:s,box:o}=e,a=n.maxPadding;if(!z(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&&uo(a,o.getPadding());const r=Math.max(0,t.outerWidth-fo(a,n,"left","right")),c=Math.max(0,t.outerHeight-fo(a,n,"top","bottom")),d=r!==n.w,h=c!==n.h;return n.w=r,n.h=c,e.horizontal?{same:d,other:h}:{same:h,other:d}}function Yc(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 Hc(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 Ye(n,t,e,i){const s=[];let o,a,r,c,d,h;for(o=0,a=n.length,d=0;o<a;++o){r=n[o],c=r.box,c.update(r.width||t.w,r.height||t.h,Hc(r.horizontal,t));const{same:f,other:u}=Wc(t,e,r,i);d|=f&&s.length,h=h||u,c.fullSize||s.push(r)}return d&&Ye(s,t,e,i)||h}function En(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 po(n,t,e,i){const s=e.padding;let{x:o,y:a}=t;for(const r of n){const c=r.box,d=i[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/d.weight||1;if(r.horizontal){const f=t.w*h,u=d.size||c.height;ve(d.start)&&(a=d.start),c.fullSize?En(c,s.left,a,e.outerWidth-s.right-s.left,u):En(c,t.left+d.placed,a,f,u),d.start=a,d.placed+=f,a=c.bottom}else{const f=t.h*h,u=d.size||c.width;ve(d.start)&&(o=d.start),c.fullSize?En(c,o,s.top,u,e.outerHeight-s.bottom-s.top):En(c,o,t.top+d.placed,u,f),d.start=o,d.placed+=f,o=c.right}}t.x=o,t.y=a}var lt={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=rt(n.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=Ic(n.boxes),c=r.vertical,d=r.horizontal;Y(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=c.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},s);uo(u,rt(i));const p=Object.assign({maxPadding:u,w:o,h:a,x:s.left,y:s.top},s),m=zc(c.concat(d),f);Ye(r.fullSize,p,f,m),Ye(c,p,f,m),Ye(d,p,f,m)&&Ye(c,p,f,m),Yc(p),po(r.leftAndTop,p,f,m),p.x+=p.w,p.y+=p.h,po(r.rightAndBottom,p,f,m),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Y(r.chartArea,g=>{const b=g.box;Object.assign(b,n.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class mo{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 jc extends mo{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Vn="$chartjs",Uc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},go=n=>n===null||n==="";function Xc(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",go(s)){const o=zs(n,"width");o!==void 0&&(n.width=o)}if(go(i))if(n.style.height==="")n.height=n.width/(t||2);else{const o=zs(n,"height");o!==void 0&&(n.height=o)}return n}const bo=Kl?{passive:!0}:!1;function qc(n,t,e){n.addEventListener(t,e,bo)}function Kc(n,t,e){n.canvas.removeEventListener(t,e,bo)}function Gc(n,t){const e=Uc[n.type]||n.type,{x:i,y:s}=oe(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Bn(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Jc(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Bn(r.addedNodes,i),a=a&&!Bn(r.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Zc(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Bn(r.removedNodes,i),a=a&&!Bn(r.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const He=new Map;let yo=0;function _o(){const n=window.devicePixelRatio;n!==yo&&(yo=n,He.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Qc(n,t){He.size||window.addEventListener("resize",_o),He.set(n,t)}function td(n){He.delete(n),He.size||window.removeEventListener("resize",_o)}function ed(n,t,e){const i=n.canvas,s=i&&yi(i);if(!s)return;const o=_s((r,c)=>{const d=s.clientWidth;e(r,c),d<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const c=r[0],d=c.contentRect.width,h=c.contentRect.height;d===0&&h===0||o(d,h)});return a.observe(s),Qc(n,o),a}function Di(n,t,e){e&&e.disconnect(),t==="resize"&&td(n)}function nd(n,t,e){const i=n.canvas,s=_s(o=>{n.ctx!==null&&e(Gc(o,n))},n);return qc(i,t,s),s}class id extends mo{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Xc(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:Jc,detach:Zc,resize:ed}[e]||nd;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Di,detach:Di,resize:Di}[e]||Kc)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return ql(t,e,i,s)}isAttached(t){const e=yi(t);return!!(e&&e.isConnected)}}function sd(n){return!$s()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?jc:id}let Ft=(Gn=class{constructor(){v(this,"x");v(this,"y");v(this,"active",!1);v(this,"options");v(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return be(this.x)&&be(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}},v(Gn,"defaults",{}),v(Gn,"defaultRoutes"),Gn);function od(n,t){const e=n.options.ticks,i=ad(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?ld(t):[],a=o.length,r=o[0],c=o[a-1],d=[];if(a>s)return cd(t,d,o,a/s),d;const h=rd(o,t,s);if(a>0){let f,u;const p=a>1?Math.round((c-r)/(a-1)):null;for(vn(t,d,h,I(p)?0:r-p,r),f=0,u=a-1;f<u;f++)vn(t,d,h,o[f],o[f+1]);return vn(t,d,h,c,I(p)?t.length:c+p),d}return vn(t,d,h),d}function ad(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 rd(n,t,e){const i=dd(n),s=t.length/e;if(!i)return Math.max(s,1);const o=Zr(i);for(let a=0,r=o.length-1;a<r;a++){const c=o[a];if(c>s)return c}return Math.max(s,1)}function ld(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function cd(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 vn(n,t,e,i,s){const o=$(i,0),a=Math.min($(s,n.length),n.length);let r=0,c,d,h;for(e=Math.ceil(e),s&&(c=s-i,e=c/Math.floor(c/e)),h=o;h<0;)r++,h=Math.round(o+r*e);for(d=Math.max(o,0);d<a;d++)d===h&&(t.push(n[d]),r++,h=Math.round(o+r*e))}function dd(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 hd=n=>n==="left"?"right":n==="right"?"left":n,xo=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,ko=(n,t)=>Math.min(t||n,n);function wo(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 fd(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,a=n._endPixel,r=1e-6;let c=n.getPixelForTick(s),d;if(!(e&&(i===1?d=Math.max(c-o,a-c):t===0?d=(n.getPixelForTick(1)-c)/2:d=(c-n.getPixelForTick(s-1))/2,c+=s<t?d:-d,c<o-r||c>a+r)))return c}function ud(n,t){Y(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 je(n){return n.drawTicks?n.tickLength:0}function Co(n,t){if(!n.display)return 0;const e=et(n.font,t),i=rt(n.padding);return(X(n.text)?n.text.length:1)*e.lineHeight+i.height}function pd(n,t){return jt(n,{scale:t,type:"scale"})}function md(n,t,e){return jt(n,{tick:e,index:t,type:"tick"})}function gd(n,t,e){let i=li(n);return(e&&t!=="right"||!e&&t==="right")&&(i=hd(i)),i}function bd(n,t,e,i){const{top:s,left:o,bottom:a,right:r,chart:c}=n,{chartArea:d,scales:h}=c;let f=0,u,p,m;const g=a-s,b=r-o;if(n.isHorizontal()){if(p=at(i,o,r),z(e)){const _=Object.keys(e)[0],x=e[_];m=h[_].getPixelForValue(x)+g-t}else e==="center"?m=(d.bottom+d.top)/2+g-t:m=xo(n,e,t);u=r-o}else{if(z(e)){const _=Object.keys(e)[0],x=e[_];p=h[_].getPixelForValue(x)-b+t}else e==="center"?p=(d.left+d.right)/2-b+t:p=xo(n,e,t);m=at(i,a,s),f=e==="left"?-tt:tt}return{titleX:p,titleY:m,maxWidth:u,rotation:f}}class ce extends Ft{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=pt(t,Number.POSITIVE_INFINITY),e=pt(e,Number.NEGATIVE_INFINITY),i=pt(i,Number.POSITIVE_INFINITY),s=pt(s,Number.NEGATIVE_INFINITY),{min:pt(t,i),max:pt(e,s),minDefined:J(t),maxDefined:J(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 c=0,d=r.length;c<d;++c)a=r[c].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:pt(e,pt(i,e)),max:pt(i,pt(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(){j(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=Dl(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=r<this.ticks.length;this._convertTicksToLabels(c?wo(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=od(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&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(){j(this.options.afterUpdate,[this])}beforeSetDimensions(){j(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(){j(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),j(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){j(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=j(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){j(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){j(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=ko(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,c,d;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),f=h.widest.width,u=h.highest.height,p=st(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)),c=this.maxHeight-je(t.grid)-e.padding-Co(t.title,this.chart.options.font),d=Math.sqrt(f*f+u*u),a=oi(Math.min(Math.asin(st((h.highest.height+6)/r,-1,1)),Math.asin(st(c/d,-1,1))-Math.asin(st(u/d,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){j(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){j(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 c=Co(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=je(o)+c):(t.height=this.maxHeight,t.width=je(o)+c),i.display&&this.ticks.length){const{first:d,last:h,widest:f,highest:u}=this._getLabelSizes(),p=i.padding*2,m=kt(this.labelRotation),g=Math.cos(m),b=Math.sin(m);if(r){const _=i.mirror?0:b*f.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+_+p)}else{const _=i.mirror?0:g*f.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+_+p)}this._calculatePadding(d,h,b,g)}}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,c=this.labelRotation!==0,d=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,p=0;c?d?(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-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((p-f+a)*this.width/(this.width-f),0)}else{let h=e.height/2,f=t.height/2;o==="start"?(h=0,f=t.height):o==="end"&&(h=e.height,f=0),this.paddingTop=h+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(){j(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=wo(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=[],c=Math.floor(e/ko(e,i));let d=0,h=0,f,u,p,m,g,b,_,x,M,C,y;for(f=0;f<e;f+=c){if(m=t[f].label,g=this._resolveTickFontOptions(f),s.font=b=g.string,_=o[b]=o[b]||{data:{},gc:[]},x=g.lineHeight,M=C=0,!I(m)&&!X(m))M=mn(s,_.data,_.gc,M,m),C=x;else if(X(m))for(u=0,p=m.length;u<p;++u)y=m[u],!I(y)&&!X(y)&&(M=mn(s,_.data,_.gc,M,y),C+=x);a.push(M),r.push(C),d=Math.max(M,d),h=Math.max(C,h)}ud(o,e);const w=a.indexOf(d),k=r.indexOf(h),S=V=>({width:a[V]||0,height:r[V]||0});return{first:S(0),last:S(e-1),widest:S(w),highest:S(k),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 el(this._alignToPixels?ee(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=md(this.getContext(),t,i))}return this.$context||(this.$context=pd(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=kt(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,c=o?o.highest.height+a:0;return this.isHorizontal()?c*i>r*s?r/i:c/s:c*s<r*i?c/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,c=o.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),u=je(o),p=[],m=r.setContext(this.getContext()),g=m.display?m.width:0,b=g/2,_=function(D){return ee(i,D,g)};let x,M,C,y,w,k,S,V,P,A,N,U;if(a==="top")x=_(this.bottom),k=this.bottom-u,V=x-b,A=_(t.top)+b,U=t.bottom;else if(a==="bottom")x=_(this.top),A=t.top,U=_(t.bottom)-b,k=x+b,V=this.top+u;else if(a==="left")x=_(this.right),w=this.right-u,S=x-b,P=_(t.left)+b,N=t.right;else if(a==="right")x=_(this.left),P=t.left,N=_(t.right)-b,w=x+b,S=this.left+u;else if(e==="x"){if(a==="center")x=_((t.top+t.bottom)/2+.5);else if(z(a)){const D=Object.keys(a)[0],B=a[D];x=_(this.chart.scales[D].getPixelForValue(B))}A=t.top,U=t.bottom,k=x+b,V=k+u}else if(e==="y"){if(a==="center")x=_((t.left+t.right)/2);else if(z(a)){const D=Object.keys(a)[0],B=a[D];x=_(this.chart.scales[D].getPixelForValue(B))}w=x-b,S=w-u,P=t.left,N=t.right}const F=$(s.ticks.maxTicksLimit,f),E=Math.max(1,Math.ceil(f/F));for(M=0;M<f;M+=E){const D=this.getContext(M),B=o.setContext(D),O=r.setContext(D),T=B.lineWidth,L=B.color,W=O.dash||[],H=O.dashOffset,G=B.tickWidth,Q=B.tickColor,ot=B.tickBorderDash||[],xt=B.tickBorderDashOffset;C=fd(this,M,c),C!==void 0&&(y=ee(i,C,T),d?w=S=P=N=y:k=V=A=U=y,p.push({tx1:w,ty1:k,tx2:S,ty2:V,x1:P,y1:A,x2:N,y2:U,width:T,color:L,borderDash:W,borderDashOffset:H,tickWidth:G,tickColor:Q,tickBorderDash:ot,tickBorderDashOffset:xt}))}return this._ticksLength=f,this._borderValue=x,p}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:c,crossAlign:d,padding:h,mirror:f}=o,u=je(i.grid),p=u+h,m=f?-h:p,g=-kt(this.labelRotation),b=[];let _,x,M,C,y,w,k,S,V,P,A,N,U="middle";if(s==="top")w=this.bottom-m,k=this._getXAxisLabelAlignment();else if(s==="bottom")w=this.top+m,k=this._getXAxisLabelAlignment();else if(s==="left"){const E=this._getYAxisLabelAlignment(u);k=E.textAlign,y=E.x}else if(s==="right"){const E=this._getYAxisLabelAlignment(u);k=E.textAlign,y=E.x}else if(e==="x"){if(s==="center")w=(t.top+t.bottom)/2+p;else if(z(s)){const E=Object.keys(s)[0],D=s[E];w=this.chart.scales[E].getPixelForValue(D)+p}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")y=(t.left+t.right)/2-p;else if(z(s)){const E=Object.keys(s)[0],D=s[E];y=this.chart.scales[E].getPixelForValue(D)}k=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(c==="start"?U="top":c==="end"&&(U="bottom"));const F=this._getLabelSizes();for(_=0,x=r.length;_<x;++_){M=r[_],C=M.label;const E=o.setContext(this.getContext(_));S=this.getPixelForTick(_)+o.labelOffset,V=this._resolveTickFontOptions(_),P=V.lineHeight,A=X(C)?C.length:1;const D=A/2,B=E.color,O=E.textStrokeColor,T=E.textStrokeWidth;let L=k;a?(y=S,k==="inner"&&(_===x-1?L=this.options.reverse?"left":"right":_===0?L=this.options.reverse?"right":"left":L="center"),s==="top"?d==="near"||g!==0?N=-A*P+P/2:d==="center"?N=-F.highest.height/2-D*P+P:N=-F.highest.height+P/2:d==="near"||g!==0?N=P/2:d==="center"?N=F.highest.height/2-D*P:N=F.highest.height-A*P,f&&(N*=-1),g!==0&&!E.showLabelBackdrop&&(y+=P/2*Math.sin(g))):(w=S,N=(1-A)*P/2);let W;if(E.showLabelBackdrop){const H=rt(E.backdropPadding),G=F.heights[_],Q=F.widths[_];let ot=N-H.top,xt=0-H.left;switch(U){case"middle":ot-=G/2;break;case"bottom":ot-=G;break}switch(k){case"center":xt-=Q/2;break;case"right":xt-=Q;break}W={left:xt,top:ot,width:Q+H.width,height:G+H.height,color:E.backdropColor}}b.push({label:C,font:V,textOffset:N,options:{rotation:g,color:B,strokeColor:O,strokeWidth:T,textAlign:L,textBaseline:U,translation:[y,w],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-kt(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,c=a.widest.width;let d,h;return e==="left"?s?(h=this.right+o,i==="near"?d="left":i==="center"?(d="center",h+=c/2):(d="right",h+=c)):(h=this.right-r,i==="near"?d="right":i==="center"?(d="center",h-=c/2):(d="left",h=this.left)):e==="right"?s?(h=this.left+o,i==="near"?d="right":i==="center"?(d="center",h-=c/2):(d="left",h-=c)):(h=this.left+r,i==="near"?d="left":i==="center"?(d="center",h+=c/2):(d="right",h=this.right)):d="right",{textAlign:d,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(c,d,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(e.display)for(o=0,a=s.length;o<a;++o){const c=s[o];e.drawOnChartArea&&r({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),e.drawTicks&&r({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.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,c=this._borderValue;let d,h,f,u;this.isHorizontal()?(d=ee(t,this.left,a)-a/2,h=ee(t,this.right,r)+r/2,f=u=c):(f=ee(t,this.top,a)-a/2,u=ee(t,this.bottom,r)+r/2,d=h=c),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(d,f),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&gn(i,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,c=a.font,d=a.label,h=a.textOffset;ne(i,d,0,h,c,r)}s&&bn(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=et(i.font),a=rt(i.padding),r=i.align;let c=o.lineHeight/2;e==="bottom"||e==="center"||z(e)?(c+=a.bottom,X(i.text)&&(c+=o.lineHeight*(i.text.length-1))):c+=a.top;const{titleX:d,titleY:h,maxWidth:f,rotation:u}=bd(this,c,e,r);ne(t,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:u,textAlign:gd(r,e,s),textBaseline:"middle",translation:[d,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=$(t.grid&&t.grid.z,-1),s=$(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ce.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 Pn{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;xd(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,yd(t,a,i),this.override&&Z.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 Z[s]&&(delete Z[s][i],this.override&&delete te[i])}}function yd(n,t,e){const i=Ve(Object.create(null),[e?Z.get(e):{},Z.get(t),n.defaults]);Z.set(t,i),n.defaultRoutes&&_d(t,n.defaultRoutes),n.descriptors&&Z.describe(t,n.descriptors)}function _d(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(),c=a.join(".");Z.route(o,s,c,r)})}function xd(n){return"id"in n&&"defaults"in n}class kd{constructor(){this.controllers=new Pn(wt,"datasets",!0),this.elements=new Pn(Ft,"elements"),this.plugins=new Pn(Object,"plugins"),this.scales=new Pn(ce,"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):Y(s,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,i){const s=si(t);j(i["before"+s],[],i),e[t](i),j(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 St=new kd;class wd{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],c=[e,s,o.options];if(j(r,c,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=$(i.options&&i.options.plugins,{}),o=Cd(i);return s===!1&&!e?[]:Sd(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(r=>!a.some(c=>r.plugin.id===c.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Cd(n){const t={},e=[],i=Object.keys(St.plugins.items);for(let o=0;o<i.length;o++)e.push(St.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 Md(n,t){return!t&&n===!1?null:n===!0?{}:n}function Sd(n,{plugins:t,localIds:e},i,s){const o=[],a=n.getContext();for(const r of t){const c=r.id,d=Md(i[c],s);d!==null&&o.push({plugin:r,options:Dd(n.config,{plugin:r,local:e[c]},d,a)})}return o}function Dd(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 Ei(n,t){const e=Z.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Ed(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Vd(n,t){return n===t?"_index_":"_value_"}function Mo(n){if(n==="x"||n==="y"||n==="r")return n}function Bd(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Vi(n,...t){if(Mo(n))return n;for(const e of t){const i=e.axis||Bd(e.position)||n.length>1&&Mo(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function So(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function vd(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 So(n,"x",e[0])||So(n,"y",e[0])}return{}}function Pd(n,t){const e=te[n.type]||{scales:{}},i=t.scales||{},s=Ei(n.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const r=i[a];if(!z(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 c=Vi(a,r,vd(a,n),Z.scales[r.type]),d=Vd(c,s),h=e.scales||{};o[a]=Be(Object.create(null),[{axis:c},r,h[c],h[d]])}),n.data.datasets.forEach(a=>{const r=a.type||n.type,c=a.indexAxis||Ei(r,t),h=(te[r]||{}).scales||{};Object.keys(h).forEach(f=>{const u=Ed(f,c),p=a[u+"AxisID"]||u;o[p]=o[p]||Object.create(null),Be(o[p],[{axis:u},i[p],h[f]])})}),Object.keys(o).forEach(a=>{const r=o[a];Be(r,[Z.scales[r.type],Z.scale])}),o}function Do(n){const t=n.options||(n.options={});t.plugins=$(t.plugins,{}),t.scales=Pd(n,t)}function Eo(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Od(n){return n=n||{},n.data=Eo(n.data),Do(n),n}const Vo=new Map,Bo=new Set;function On(n,t){let e=Vo.get(n);return e||(e=t(),Vo.set(n,e),Bo.add(e)),e}const Ue=(n,t,e)=>{const i=Wt(t,e);i!==void 0&&n.add(i)};class Ad{constructor(t){this._config=Od(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Eo(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Do(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return On(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return On(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return On(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return On(`${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 c=new Set;e.forEach(h=>{t&&(c.add(t),h.forEach(f=>Ue(c,t,f))),h.forEach(f=>Ue(c,s,f)),h.forEach(f=>Ue(c,te[o]||{},f)),h.forEach(f=>Ue(c,Z,f)),h.forEach(f=>Ue(c,hi,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Bo.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,te[e]||{},Z.datasets[e]||{},{type:e},Z,hi]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=vo(this._resolverCache,t,s);let c=a;if(Td(a,e)){o.$shared=!1,i=Yt(i)?i():i;const d=this.createResolver(t,i,r);c=ye(a,i,d)}for(const d of e)o[d]=c[d];return o}createResolver(t,e,i=[""],s){const{resolver:o}=vo(this._resolverCache,t,i);return z(e)?ye(o,e,void 0,s):o}}function vo(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:mi(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,o)),o}const Fd=n=>z(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||Yt(n[e]),!1);function Td(n,t){const{isScriptable:e,isIndexable:i}=vs(n);for(const s of t){const o=e(s),a=i(s),r=(a||o)&&n[s];if(o&&(Yt(r)||Fd(r))||a&&X(r))return!0}return!1}var Nd="4.4.0";const Ld=["top","bottom","left","right","chartArea"];function Po(n,t){return n==="top"||n==="bottom"||Ld.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"),j(e&&e.onComplete,[n],t)}function $d(n){const t=n.chart,e=t.options.animation;j(e&&e.onProgress,[n],t)}function Fo(n){return $s()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const An={},To=n=>{const t=Fo(n);return Object.values(An).filter(e=>e.canvas===t).pop()};function Rd(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 zd(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Fn(n,t,e){return n.options.clip?n[e]:t[e]}function Id(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Fn(e,t,"left"),right:Fn(e,t,"right"),top:Fn(i,t,"top"),bottom:Fn(i,t,"bottom")}:t}class Tt{static register(...t){St.add(...t),No()}static unregister(...t){St.remove(...t),No()}constructor(t,e){const i=this.config=new Ad(e),s=Fo(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||sd(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,a.aspectRatio),c=r&&r.canvas,d=c&&c.height,h=c&&c.width;if(this.id=Yr(),this.ctx=r,this.canvas=c,this.width=h,this.height=d,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 wd,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ol(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],An[this.id]=this,!r||!c){console.error("Failed to create chart: can't acquire context from the given item");return}At.listen(this,"complete",Ao),At.listen(this,"progress",$d),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 St}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Rs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Es(this.canvas,this.ctx),this}stop(){return At.stop(this),this}resize(t,e){At.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(),c=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}),j(i.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Y(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],c=Vi(a,r),d=c==="r",h=c==="x";return{options:r,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),Y(o,a=>{const r=a.options,c=r.id,d=Vi(c,r),h=$(r.type,a.dtype);(r.position===void 0||Po(r.position,d)!==Po(a.dposition))&&(r.position=a.dposition),s[c]=!0;let f=null;if(c in i&&i[c].type===h)f=i[c];else{const u=St.getScale(h);f=new u({id:c,type:h,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(r,t)}),Y(s,(a,r)=>{a||delete i[r]}),Y(i,a=>{lt.configure(this,a,a.options),lt.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||Ei(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 c=St.getController(r),{datasetElementType:d,dataElementType:h}=Z.datasets[r];Object.assign(c,{dataElementType:St.getElement(h),datasetElementType:d&&St.getElement(d)}),a.controller=new c(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Y(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 d=0,h=this.data.datasets.length;d<h;d++){const{controller:f}=this.getDatasetMeta(d),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||Y(o,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Oo("z","_idx"));const{_active:r,_lastEvent:c}=this;c?this._eventHandler(c,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){Y(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!cs(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;Rd(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(!cs(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;lt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Y(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,Yt(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&&(At.has(this)?this.attached&&!At.running(this)&&At.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=Id(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&gn(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&&bn(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Ot(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=Lc.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=jt(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);ve(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(),At.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(),Es(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete An[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)};Y(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(c,d)=>{e.addEventListener(this,c,d),t[c]=d},s=(c,d)=>{t[c]&&(e.removeEventListener(this,c,d),delete t[c])},o=(c,d)=>{this.canvas&&this.resize(c,d)};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(){Y(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Y(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,c;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,c=t.length;r<c;++r){a=t[r];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[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}});!dn(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=(c,d)=>c.filter(h=>!d.some(f=>h.datasetIndex===f.datasetIndex&&h.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),c=Kr(t),d=zd(t,this._lastEvent,i,c);i&&(this._lastEvent=null,j(o.onHover,[t,r,this],this),c&&j(o.onClick,[t,r,this],this));const h=!dn(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=d,h}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}v(Tt,"defaults",Z),v(Tt,"instances",An),v(Tt,"overrides",te),v(Tt,"registry",St),v(Tt,"version",Nd),v(Tt,"getChart",To);function No(){return Y(Tt.instances,n=>n._plugins.invalidate())}function Wd(n,t,e){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:c}=t;let d=s/r;n.beginPath(),n.arc(o,a,r,i-d,e+d),c>s?(d=s/c,n.arc(o,a,c,e+d,i-d,!0)):n.arc(o,a,s,e+tt,i-tt),n.closePath(),n.clip()}function Yd(n){return pi(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Hd(n,t,e,i){const s=Yd(n.options.borderRadius),o=(e-t)/2,a=Math.min(o,i*t/2),r=c=>{const d=(e-Math.min(o,c))*i/2;return st(c,0,Math.min(o,d))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:st(s.innerStart,0,a),innerEnd:st(s.innerEnd,0,a)}}function ke(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Tn(n,t,e,i,s,o){const{x:a,y:r,startAngle:c,pixelMargin:d,innerRadius:h}=t,f=Math.max(t.outerRadius+i+e-d,0),u=h>0?h+i+e+d:0;let p=0;const m=s-c;if(i){const E=h>0?h-i:0,D=f>0?f-i:0,B=(E+D)/2,O=B!==0?m*B/(B+i):m;p=(m-O)/2}const g=Math.max(.001,m*f-e/q)/f,b=(m-g)/2,_=c+b+p,x=s-b-p,{outerStart:M,outerEnd:C,innerStart:y,innerEnd:w}=Hd(t,u,f,x-_),k=f-M,S=f-C,V=_+M/k,P=x-C/S,A=u+y,N=u+w,U=_+y/A,F=x-w/N;if(n.beginPath(),o){const E=(V+P)/2;if(n.arc(a,r,f,V,E),n.arc(a,r,f,E,P),C>0){const T=ke(S,P,a,r);n.arc(T.x,T.y,C,P,x+tt)}const D=ke(N,x,a,r);if(n.lineTo(D.x,D.y),w>0){const T=ke(N,F,a,r);n.arc(T.x,T.y,w,x+tt,F+Math.PI)}const B=(x-w/u+(_+y/u))/2;if(n.arc(a,r,u,x-w/u,B,!0),n.arc(a,r,u,B,_+y/u,!0),y>0){const T=ke(A,U,a,r);n.arc(T.x,T.y,y,U+Math.PI,_-tt)}const O=ke(k,_,a,r);if(n.lineTo(O.x,O.y),M>0){const T=ke(k,V,a,r);n.arc(T.x,T.y,M,_-tt,V)}}else{n.moveTo(a,r);const E=Math.cos(V)*f+a,D=Math.sin(V)*f+r;n.lineTo(E,D);const B=Math.cos(P)*f+a,O=Math.sin(P)*f+r;n.lineTo(B,O)}n.closePath()}function jd(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let c=t.endAngle;if(o){Tn(n,t,e,i,c,s);for(let d=0;d<o;++d)n.fill();isNaN(r)||(c=a+(r%K||K))}return Tn(n,t,e,i,c,s),n.fill(),c}function Ud(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r,options:c}=t,{borderWidth:d,borderJoinStyle:h,borderDash:f,borderDashOffset:u}=c,p=c.borderAlign==="inner";if(!d)return;n.setLineDash(f||[]),n.lineDashOffset=u,p?(n.lineWidth=d*2,n.lineJoin=h||"round"):(n.lineWidth=d,n.lineJoin=h||"bevel");let m=t.endAngle;if(o){Tn(n,t,e,i,m,s);for(let g=0;g<o;++g)n.stroke();isNaN(r)||(m=a+(r%K||K))}p&&Wd(n,t,m),o||(Tn(n,t,e,i,m,s),n.stroke())}class Xe extends Ft{constructor(e){super();v(this,"circumference");v(this,"endAngle");v(this,"fullCircles");v(this,"innerRadius");v(this,"outerRadius");v(this,"pixelMargin");v(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}=ps(o,{x:e,y:i}),{startAngle:c,endAngle:d,innerRadius:h,outerRadius:f,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),p=(this.options.spacing+this.options.borderWidth)/2,g=$(u,d-c)>=K||Oe(a,c,d),b=vt(r,h+p,f+p);return g&&b}getCenterPoint(e){const{x:i,y:s,startAngle:o,endAngle:a,innerRadius:r,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:d,spacing:h}=this.options,f=(o+a)/2,u=(r+c+h+d)/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 c=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(c)*o,Math.sin(c)*o);const d=1-Math.sin(Math.min(q,s||0)),h=o*d;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,jd(e,this,h,a,r),Ud(e,this,h,a,r),e.restore()}}v(Xe,"id","arc"),v(Xe,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),v(Xe,"defaultRoutes",{backgroundColor:"backgroundColor"}),v(Xe,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Lo(n,t,e=t){n.lineCap=$(e.borderCapStyle,t.borderCapStyle),n.setLineDash($(e.borderDash,t.borderDash)),n.lineDashOffset=$(e.borderDashOffset,t.borderDashOffset),n.lineJoin=$(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=$(e.borderWidth,t.borderWidth),n.strokeStyle=$(e.borderColor,t.borderColor)}function Xd(n,t,e){n.lineTo(e.x,e.y)}function qd(n){return n.stepped?bl:n.tension||n.cubicInterpolationMode==="monotone"?yl:Xd}function $o(n,t,e={}){const i=n.length,{start:s=0,end:o=i-1}=e,{start:a,end:r}=t,c=Math.max(s,a),d=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:i,start:c,loop:t.loop,ilen:d<c&&!h?i+d-c:d-c}}function Kd(n,t,e,i){const{points:s,options:o}=t,{count:a,start:r,loop:c,ilen:d}=$o(s,e,i),h=qd(o);let{move:f=!0,reverse:u}=i||{},p,m,g;for(p=0;p<=d;++p)m=s[(r+(u?d-p:p))%a],!m.skip&&(f?(n.moveTo(m.x,m.y),f=!1):h(n,g,m,u,o.stepped),g=m);return c&&(m=s[(r+(u?d:0))%a],h(n,g,m,u,o.stepped)),!!c}function Gd(n,t,e,i){const s=t.points,{count:o,start:a,ilen:r}=$o(s,e,i),{move:c=!0,reverse:d}=i||{};let h=0,f=0,u,p,m,g,b,_;const x=C=>(a+(d?r-C:C))%o,M=()=>{g!==b&&(n.lineTo(h,b),n.lineTo(h,g),n.lineTo(h,_))};for(c&&(p=s[x(0)],n.moveTo(p.x,p.y)),u=0;u<=r;++u){if(p=s[x(u)],p.skip)continue;const C=p.x,y=p.y,w=C|0;w===m?(y<g?g=y:y>b&&(b=y),h=(f*h+C)/++f):(M(),n.lineTo(C,y),m=w,f=0,g=b=y),_=y}M()}function Bi(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Gd:Kd}function Jd(n){return n.stepped?Gl:n.tension||n.cubicInterpolationMode==="monotone"?Jl:ae}function Zd(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Lo(n,t.options),n.stroke(s)}function Qd(n,t,e,i){const{segments:s,options:o}=t,a=Bi(t);for(const r of s)Lo(n,o,r.style),n.beginPath(),a(n,t,r,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const th=typeof Path2D=="function";function eh(n,t,e,i){th&&!t.options.segment?Zd(n,t,e,i):Qd(n,t,e,i)}class Ut extends Ft{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;Wl(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=ic(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=Us(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],c=Jd(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:f,end:u}=a[d],p=o[f],m=o[u];if(p===m){r.push(p);continue}const g=Math.abs((s-p[e])/(m[e]-p[e])),b=c(p,m,g,i.stepped);b[e]=t[e],r.push(b)}return r.length===1?r[0]:r}pathSegment(t,e,i){return Bi(this)(t,this,e,i)}path(t,e,i){const s=this.segments,o=Bi(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(),eh(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}v(Ut,"id","line"),v(Ut,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),v(Ut,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),v(Ut,"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 Nn extends Ft{constructor(e){super();v(this,"parsed");v(this,"skip");v(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||!Ot(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,ui(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}v(Nn,"id","point"),v(Nn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),v(Nn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function zo(n,t){const{x:e,y:i,base:s,width:o,height:a}=n.getProps(["x","y","base","width","height"],t);let r,c,d,h,f;return n.horizontal?(f=a/2,r=Math.min(e,s),c=Math.max(e,s),d=i-f,h=i+f):(f=o/2,r=e-f,c=e+f,d=Math.min(i,s),h=Math.max(i,s)),{left:r,top:d,right:c,bottom:h}}function Xt(n,t,e,i){return n?0:st(t,e,i)}function nh(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,o=Bs(i);return{t:Xt(s.top,o.top,0,e),r:Xt(s.right,o.right,0,t),b:Xt(s.bottom,o.bottom,0,e),l:Xt(s.left,o.left,0,t)}}function ih(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=ie(s),a=Math.min(t,e),r=n.borderSkipped,c=i||z(s);return{topLeft:Xt(!c||r.top||r.left,o.topLeft,0,a),topRight:Xt(!c||r.top||r.right,o.topRight,0,a),bottomLeft:Xt(!c||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Xt(!c||r.bottom||r.right,o.bottomRight,0,a)}}function sh(n){const t=zo(n),e=t.right-t.left,i=t.bottom-t.top,s=nh(n,e/2,i/2),o=ih(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 vi(n,t,e,i){const s=t===null,o=e===null,r=n&&!(s&&o)&&zo(n,i);return r&&(s||vt(t,r.left,r.right))&&(o||vt(e,r.top,r.bottom))}function oh(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function ah(n,t){n.rect(t.x,t.y,t.w,t.h)}function Pi(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 Ln extends Ft{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}=sh(this),r=oh(a.radius)?Ne:ah;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,Pi(a,e,o)),t.clip(),r(t,Pi(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,Pi(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return vi(this,t,e,i)}inXRange(t,e){return vi(this,t,null,e)}inYRange(t,e){return vi(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}}v(Ln,"id","bar"),v(Ln,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),v(Ln,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var rh=Object.freeze({__proto__:null,ArcElement:Xe,BarElement:Ln,LineElement:Ut,PointElement:Nn});const Oi=["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)"],Io=Oi.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Wo(n){return Oi[n%Oi.length]}function Yo(n){return Io[n%Io.length]}function lh(n,t){return n.borderColor=Wo(t),n.backgroundColor=Yo(t),++t}function ch(n,t){return n.backgroundColor=n.data.map(()=>Wo(t++)),t}function dh(n,t){return n.backgroundColor=n.data.map(()=>Yo(t++)),t}function hh(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof re?t=ch(e,t):s instanceof Re?t=dh(e,t):s&&(t=lh(e,t))}}function Ho(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function fh(n){return n&&(n.borderColor||n.backgroundColor)}var uh={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&&(Ho(i)||fh(s)||o&&Ho(o)))return;const a=hh(n);i.forEach(a)}};function ph(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 c=0;const d=t+e-1;let h=t,f,u,p,m,g;for(a[c++]=n[h],f=0;f<o-2;f++){let b=0,_=0,x;const M=Math.floor((f+1)*r)+1+t,C=Math.min(Math.floor((f+2)*r)+1,e)+t,y=C-M;for(x=M;x<C;x++)b+=n[x].x,_+=n[x].y;b/=y,_/=y;const w=Math.floor(f*r)+1+t,k=Math.min(Math.floor((f+1)*r)+1,e)+t,{x:S,y:V}=n[h];for(p=m=-1,x=w;x<k;x++)m=.5*Math.abs((S-b)*(n[x].y-V)-(S-n[x].x)*(_-V)),m>p&&(p=m,u=n[x],g=x);a[c++]=u,h=g}return a[c++]=n[d],a}function mh(n,t,e,i){let s=0,o=0,a,r,c,d,h,f,u,p,m,g;const b=[],_=t+e-1,x=n[t].x,C=n[_].x-x;for(a=t;a<t+e;++a){r=n[a],c=(r.x-x)/C*i,d=r.y;const y=c|0;if(y===h)d<m?(m=d,f=a):d>g&&(g=d,u=a),s=(o*s+r.x)/++o;else{const w=a-1;if(!I(f)&&!I(u)){const k=Math.min(f,u),S=Math.max(f,u);k!==p&&k!==w&&b.push({...n[k],x:s}),S!==p&&S!==w&&b.push({...n[S],x:s})}a>0&&w!==p&&b.push(n[w]),b.push(r),h=y,o=0,m=g=d,f=u=p=a}}return b}function jo(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 Uo(n){n.data.datasets.forEach(t=>{jo(t)})}function gh(n,t){const e=t.length;let i=0,s;const{iScale:o}=n,{min:a,max:r,minDefined:c,maxDefined:d}=o.getUserBounds();return c&&(i=st(Pt(t,o.axis,a).lo,0,e-1)),d?s=st(Pt(t,o.axis,r).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var bh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Uo(n);return}const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,c=n.getDatasetMeta(o),d=a||s.data;if(Le([r,n.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const h=n.scales[c.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:f,count:u}=gh(c,d);const p=e.threshold||4*i;if(u<=p){jo(s);return}I(a)&&(s._data=d,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=ph(d,f,u,i,e);break;case"min-max":m=mh(d,f,u,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=m})},destroy(n){Uo(n)}};function yh(n,t,e){const i=n.segments,s=n.points,o=t.points,a=[];for(const r of i){let{start:c,end:d}=r;d=Fi(c,d,s);const h=Ai(e,s[c],s[d],r.loop);if(!t.segments){a.push({source:r,target:h,start:s[c],end:s[d]});continue}const f=Us(t,h);for(const u of f){const p=Ai(e,o[u.start],o[u.end],u.loop),m=js(r,s,p);for(const g of m)a.push({source:g,target:u,start:{[e]:Xo(h,p,"start",Math.max)},end:{[e]:Xo(h,p,"end",Math.min)}})}}return a}function Ai(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=mt(s),o=mt(o)),{property:n,start:s,end:o}}function _h(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Fi(a,r,s);const c=s[a],d=s[r];i!==null?(o.push({x:c.x,y:i}),o.push({x:d.x,y:i})):e!==null&&(o.push({x:e,y:c.y}),o.push({x:e,y:d.y}))}),o}function Fi(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Xo(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function qo(n,t){let e=[],i=!1;return X(n)?(i=!0,e=n):e=_h(n,t),e.length?new Ut({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ko(n){return n&&n.fill!==!1}function xh(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(!J(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function kh(n,t,e){const i=Sh(n);if(z(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return J(s)&&Math.floor(s)===s?wh(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function wh(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Ch(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:z(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Mh(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:z(n)?i=n.value:i=t.getBaseValue(),i}function Sh(n){const t=n.options,e=t.fill;let i=$(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Dh(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,a=i.points,r=Eh(t,e);r.push(qo({x:null,y:t.bottom},i));for(let c=0;c<o.length;c++){const d=o[c];for(let h=d.start;h<=d.end;h++)Vh(s,a[h],r)}return new Ut({points:s,options:{}})}function Eh(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 Vh(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:c}=Bh(o,t,"x");if(!(!c||a&&r)){if(a)i.unshift(c);else if(n.push(c),!r)break}}n.push(...i)}function Bh(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,c=!1;for(let d=0;d<o.length;d++){const h=o[d],f=a[h.start][e],u=a[h.end][e];if(vt(s,f,u)){r=s===f,c=s===u;break}}return{first:r,last:c,point:i}}class Go{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 vh(n){const{chart:t,fill:e,line:i}=n;if(J(e))return Ph(t,e);if(e==="stack")return Dh(n);if(e==="shape")return!0;const s=Oh(n);return s instanceof Go?s:qo(s,i)}function Ph(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Oh(n){return(n.scale||{}).getPointPositionForValue?Fh(n):Ah(n)}function Ah(n){const{scale:t={},fill:e}=n,i=Ch(e,t);if(J(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Fh(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,a=Mh(e,t,o),r=[];if(i.grid.circular){const c=t.getPointPositionForValue(0,o);return new Go({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(a)})}for(let c=0;c<s;++c)r.push(t.getPointPositionForValue(c,a));return r}function Ti(n,t,e){const i=vh(t),{line:s,scale:o,axis:a}=t,r=s.options,c=r.fill,d=r.backgroundColor,{above:h=d,below:f=d}=c||{};i&&s.points.length&&(gn(n,e),Th(n,{line:s,target:i,above:h,below:f,area:e,scale:o,axis:a}),bn(n))}function Th(n,t){const{line:e,target:i,above:s,below:o,area:a,scale:r}=t,c=e._loop?"angle":t.axis;n.save(),c==="x"&&o!==s&&(Jo(n,i,a.top),Zo(n,{line:e,target:i,color:s,scale:r,property:c}),n.restore(),n.save(),Jo(n,i,a.bottom)),Zo(n,{line:e,target:i,color:o,scale:r,property:c}),n.restore()}function Jo(n,t,e){const{segments:i,points:s}=t;let o=!0,a=!1;n.beginPath();for(const r of i){const{start:c,end:d}=r,h=s[c],f=s[Fi(c,d,s)];o?(n.moveTo(h.x,h.y),o=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,r,{move:a}),a?n.closePath():n.lineTo(f.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Zo(n,t){const{line:e,target:i,property:s,color:o,scale:a}=t,r=yh(e,i,s);for(const{source:c,target:d,start:h,end:f}of r){const{style:{backgroundColor:u=o}={}}=c,p=i!==!0;n.save(),n.fillStyle=u,Nh(n,a,p&&Ai(s,h,f)),n.beginPath();const m=!!e.pathSegment(n,c);let g;if(p){m?n.closePath():Qo(n,i,f,s);const b=!!i.pathSegment(n,d,{move:m,reverse:!0});g=m&&b,g||Qo(n,i,h,s)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function Nh(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 Qo(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Lh={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let o,a,r,c;for(a=0;a<i;++a)o=n.getDatasetMeta(a),r=o.dataset,c=null,r&&r.options&&r instanceof Ut&&(c={visible:n.isDatasetVisible(a),index:a,fill:kh(r,a,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=c,s.push(c);for(a=0;a<i;++a)c=s[a],!(!c||c.fill===!1)&&(c.fill=xh(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&&Ti(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;Ko(o)&&Ti(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Ko(i)||e.drawTime!=="beforeDatasetDraw"||Ti(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ta=(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)}},$h=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class ea extends Ft{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=j(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:c}=ta(i,o);let d,h;e.font=s.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,o,r,c)+10):(h=this.maxHeight,d=this._fitCols(a,s,r,c)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],h=s+r;let f=t;o.textAlign="left",o.textBaseline="middle";let u=-1,p=-h;return this.legendItems.forEach((m,g)=>{const b=i+e/2+o.measureText(m.text).width;(g===0||d[d.length-1]+b+2*r>a)&&(f+=h,d[d.length-(g>0?0:1)]=0,p+=h,u++),c[g]={left:0,top:p,row:u,width:b,height:s},d[d.length-1]+=b+r}),f}_fitCols(t,e,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let f=r,u=0,p=0,m=0,g=0;return this.legendItems.forEach((b,_)=>{const{itemWidth:x,itemHeight:M}=Rh(i,e,o,b,s);_>0&&p+M+2*r>h&&(f+=u+r,d.push({width:u,height:p}),m+=u+r,g++,u=p=0),c[_]={left:m,top:p,col:g,width:x,height:M},u=Math.max(u,x),p+=M+r}),f+=u,d.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=xe(o,this.left,this.width);if(this.isHorizontal()){let r=0,c=at(i,this.left+s,this.right-this.lineWidths[r]);for(const d of e)r!==d.row&&(r=d.row,c=at(i,this.left+s,this.right-this.lineWidths[r])),d.top+=this.top+t+s,d.left=a.leftForLtr(a.x(c),d.width),c+=d.width+s}else{let r=0,c=at(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const d of e)d.col!==r&&(r=d.col,c=at(i,this.top+t+s,this.bottom-this.columnSizes[r].height)),d.top=c,d.left+=this.left+s,d.left=a.leftForLtr(a.x(d.left),d.width),c+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;gn(t,this),this._draw(),bn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=Z.color,c=xe(t.rtl,this.left,this.width),d=et(a.font),{padding:h}=a,f=d.size,u=f/2;let p;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:m,boxHeight:g,itemHeight:b}=ta(a,f),_=function(w,k,S){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;s.save();const V=$(S.lineWidth,1);if(s.fillStyle=$(S.fillStyle,r),s.lineCap=$(S.lineCap,"butt"),s.lineDashOffset=$(S.lineDashOffset,0),s.lineJoin=$(S.lineJoin,"miter"),s.lineWidth=V,s.strokeStyle=$(S.strokeStyle,r),s.setLineDash($(S.lineDash,[])),a.usePointStyle){const P={radius:g*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:V},A=c.xPlus(w,m/2),N=k+u;Vs(s,P,A,N,a.pointStyleWidth&&m)}else{const P=k+Math.max((f-g)/2,0),A=c.leftForLtr(w,m),N=ie(S.borderRadius);s.beginPath(),Object.values(N).some(U=>U!==0)?Ne(s,{x:A,y:P,w:m,h:g,radius:N}):s.rect(A,P,m,g),s.fill(),V!==0&&s.stroke()}s.restore()},x=function(w,k,S){ne(s,S.text,w,k+b/2,d,{strikethrough:S.hidden,textAlign:c.textAlign(S.textAlign)})},M=this.isHorizontal(),C=this._computeTitleHeight();M?p={x:at(o,this.left+h,this.right-i[0]),y:this.top+h+C,line:0}:p={x:this.left+h,y:at(o,this.top+C+h,this.bottom-e[0].height),line:0},Is(this.ctx,t.textDirection);const y=b+h;this.legendItems.forEach((w,k)=>{s.strokeStyle=w.fontColor,s.fillStyle=w.fontColor;const S=s.measureText(w.text).width,V=c.textAlign(w.textAlign||(w.textAlign=a.textAlign)),P=m+u+S;let A=p.x,N=p.y;c.setWidth(this.width),M?k>0&&A+P+h>this.right&&(N=p.y+=y,p.line++,A=p.x=at(o,this.left+h,this.right-i[p.line])):k>0&&N+y>this.bottom&&(A=p.x=A+e[p.line].width+h,p.line++,N=p.y=at(o,this.top+C+h,this.bottom-e[p.line].height));const U=c.x(A);if(_(U,N,w),A=al(V,A+m+u,M?A+P:this.right,t.rtl),x(c.x(A),N,w),M)p.x+=P+h;else if(typeof w.text!="string"){const F=d.lineHeight;p.y+=na(w,F)+h}else p.y+=y}),Ws(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=et(e.font),s=rt(e.padding);if(!e.display)return;const o=xe(t.rtl,this.left,this.width),a=this.ctx,r=e.position,c=i.size/2,d=s.top+c;let h,f=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+d,f=at(t.align,f,this.right-u);else{const m=this.columnSizes.reduce((g,b)=>Math.max(g,b.height),0);h=d+at(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=at(r,f,f+u);a.textAlign=o.textAlign(li(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,ne(a,e.text,p,h,i)}_computeTitleHeight(){const t=this.options.title,e=et(t.font),i=rt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(vt(t,this.left,this.right)&&vt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],vt(t,s.left,s.left+s.width)&&vt(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Wh(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=$h(s,i);s&&!o&&j(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&j(e.onHover,[t,i,this],this)}else i&&j(e.onClick,[t,i,this],this)}}function Rh(n,t,e,i,s){const o=zh(i,n,t,e),a=Ih(s,i,t.lineHeight);return{itemWidth:o,itemHeight:a}}function zh(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 Ih(n,t,e){let i=n;return typeof t.text!="string"&&(i=na(t,e)),i}function na(n,t){const e=n.text?n.text.length:0;return t*e}function Wh(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Yh={id:"legend",_element:ea,start(n,t,e){const i=n.legend=new ea({ctx:n.ctx,options:e,chart:n});lt.configure(n,i,e),lt.addBox(n,i)},stop(n){lt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;lt.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(c=>{const d=c.controller.getStyle(e?0:void 0),h=rt(d.borderWidth);return{text:t[c.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:s||d.textAlign,borderRadius:a&&(r||d.borderRadius),datasetIndex:c.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 Ni extends Ft{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=rt(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 c=0,d,h,f;return this.isHorizontal()?(h=at(r,i,o),f=e+t,d=o-i):(a.position==="left"?(h=i+t,f=at(r,s,e),c=q*-.5):(h=o-t,f=at(r,e,s),c=q*.5),d=s-e),{titleX:h,titleY:f,maxWidth:d,rotation:c}}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:c,rotation:d}=this._drawArgs(o);ne(t,e.text,0,0,i,{color:e.color,maxWidth:c,rotation:d,textAlign:li(e.align),textBaseline:"middle",translation:[a,r]})}}function Hh(n,t){const e=new Ni({ctx:n.ctx,options:t,chart:n});lt.configure(n,e,t),lt.addBox(n,e),n.titleBlock=e}var jh={id:"title",_element:Ni,start(n,t,e){Hh(n,e)},stop(n){const t=n.titleBlock;lt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;lt.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 $n=new WeakMap;var Uh={id:"subtitle",start(n,t,e){const i=new Ni({ctx:n.ctx,options:e,chart:n});lt.configure(n,i,e),lt.addBox(n,i),$n.set(n,i)},stop(n){lt.removeBox(n,$n.get(n)),$n.delete(n)},beforeUpdate(n,t,e){const i=$n.get(n);lt.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 qe={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 c=n[o].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),h=ai(t,d);h<s&&(s=h,r=c)}}if(r){const c=r.tooltipPosition();e=c.x,i=c.y}return{x:e,y:i}}};function Dt(n,t){return t&&(X(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Nt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
23
|
+
*/class Fc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,i){const o=e.listeners[i],a=e.duration;o.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Pi.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,i)=>{if(!s.running||!s.items.length)return;const o=s.items;let a=o.length-1,l=!1,c;for(;a>=0;--a)c=o[a],c._active?(c._total>s.duration&&(s.duration=c._total),c.tick(t),l=!0):(o[a]=o[o.length-1],o.pop());l&&(i.draw(),this._notify(i,s,t,"progress")),o.length||(s.running=!1,this._notify(i,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,i)=>Math.max(s,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let i=s.length-1;for(;i>=0;--i)s[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Tt=new Fc;const lo="transparent",Nc={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const s=$i(n||lo),i=s.valid&&$i(t||lo);return i&&i.valid?i.mix(s,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Tc{constructor(t,e,s,i){const o=e[s];i=Re([t.to,i,o,t.from]);const a=Re([t.from,o,i]);this._active=!0,this._fn=t.fn||Nc[t.type||typeof a],this._easing=Ne[t.easing]||Ne.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const i=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Re([t.to,e,i,t.from]),this._from=Re([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,i=this._prop,o=this._from,a=this._loop,l=this._to;let c;if(this._active=o!==l&&(a||e<s),!this._active){this._target[i]=l,this._notify(!0);return}if(e<0){this._target[i]=o;return}c=e/s%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[i]=this._fn(o,l,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let i=0;i<s.length;i++)s[i][e]()}}class co{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!z(t))return;const e=Object.keys(Z.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!z(o))return;const a={};for(const l of e)a[l]=o[l];(X(o.properties)&&o.properties||[i]).forEach(l=>{(l===i||!s.has(l))&&s.set(l,a)})})}_animateOptions(t,e){const s=e.options,i=Lc(t,s);if(!i)return[];const o=this._createAnimations(i,s);return s.$shared&&$c(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,i=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),l=Date.now();let c;for(c=a.length-1;c>=0;--c){const d=a[c];if(d.charAt(0)==="$")continue;if(d==="options"){i.push(...this._animateOptions(t,e));continue}const h=e[d];let f=o[d];const u=s.get(d);if(f)if(u&&f.active()){f.update(u,h,l);continue}else f.cancel();if(!u||!u.duration){t[d]=h;continue}o[d]=f=new Tc(u,t,d,h),i.push(f)}return i}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Tt.add(this._chart,s),!0}}function $c(n,t){const e=[],s=Object.keys(t);for(let i=0;i<s.length;i++){const o=n[s[i]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Lc(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 ho(n,t){const e=n&&n.options||{},s=e.reverse,i=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:i,end:s?i:o}}function Rc(n,t,e){if(e===!1)return!1;const s=ho(n,e),i=ho(t,e);return{top:i.end,right:s.end,bottom:i.start,left:s.start}}function zc(n){let t,e,s,i;return z(n)?(t=n.top,e=n.right,s=n.bottom,i=n.left):t=e=s=i=n,{top:t,right:e,bottom:s,left:i,disabled:n===!1}}function fo(n,t){const e=[],s=n._getSortedDatasetMetas(t);let i,o;for(i=0,o=s.length;i<o;++i)e.push(s[i].index);return e}function uo(n,t,e,s={}){const i=n.keys,o=s.mode==="single";let a,l,c,d;if(t!==null){for(a=0,l=i.length;a<l;++a){if(c=+i[a],c===e){if(s.all)continue;break}d=n.values[c],J(d)&&(o||t===0||St(t)===St(d))&&(t+=d)}return t}}function Ic(n){const t=Object.keys(n),e=new Array(t.length);let s,i,o;for(s=0,i=t.length;s<i;++s)o=t[s],e[s]={x:o,y:n[o]};return e}function po(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Wc(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Yc(n){const{min:t,max:e,minDefined:s,maxDefined:i}=n.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:i?e:Number.POSITIVE_INFINITY}}function jc(n,t,e){const s=n[t]||(n[t]={});return s[e]||(s[e]={})}function mo(n,t,e,s){for(const i of t.getMatchingVisibleMetas(s).reverse()){const o=n[i.index];if(e&&o>0||!e&&o<0)return i.index}return null}function go(n,t){const{chart:e,_cachedMeta:s}=n,i=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:l}=s,c=o.axis,d=a.axis,h=Wc(o,a,s),f=t.length;let u;for(let p=0;p<f;++p){const m=t[p],{[c]:g,[d]:b}=m,y=m._stacks||(m._stacks={});u=y[d]=jc(i,h,g),u[l]=b,u._top=mo(u,a,!0,s.type),u._bottom=mo(u,a,!1,s.type);const w=u._visualValues||(u._visualValues={});w[l]=b}}function Cs(n,t){const e=n.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Hc(n,t){return qt(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Uc(n,t,e){return qt(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ze(n,t){const e=n.controller.index,s=n.vScale&&n.vScale.axis;if(s){t=t||n._parsed;for(const i of t){const o=i._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const Ms=n=>n==="reset"||n==="none",bo=(n,t)=>t?n:Object.assign({},n),Xc=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:fo(e,!0),values:null};class Mt{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=po(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&&ze(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),i=(f,u,p,m)=>f==="x"?u:f==="r"?m:p,o=e.xAxisID=R(s.xAxisID,Cs(t,"x")),a=e.yAxisID=R(s.yAxisID,Cs(t,"y")),l=e.rAxisID=R(s.rAxisID,Cs(t,"r")),c=e.indexAxis,d=e.iAxisID=i(c,o,a,l),h=e.vAxisID=i(c,a,o,l);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(d),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ei(this._data,this),t._stacked&&ze(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(z(e))this._data=Ic(e);else if(s!==e){if(s){Ei(s,this);const i=this._cachedMeta;ze(i),i._parsed=[]}e&&Object.isExtensible(e)&&Ol(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let i=!1;this._dataCheck();const o=e._stacked;e._stacked=po(e.vScale,e),e.stack!==s.stack&&(i=!0,ze(e),e.stack=s.stack),this._resyncElements(t),(i||o!==e._stacked)&&go(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:i}=this,{iScale:o,_stacked:a}=s,l=o.axis;let c=t===0&&e===i.length?!0:s._sorted,d=t>0&&s._parsed[t-1],h,f,u;if(this._parsing===!1)s._parsed=i,s._sorted=!0,u=i;else{X(i[t])?u=this.parseArrayData(s,i,t,e):z(i[t])?u=this.parseObjectData(s,i,t,e):u=this.parsePrimitiveData(s,i,t,e);const p=()=>f[l]===null||d&&f[l]<d[l];for(h=0;h<e;++h)s._parsed[h+t]=f=u[h],c&&(p()&&(c=!1),d=f);s._sorted=c}a&&go(this,u)}parsePrimitiveData(t,e,s,i){const{iScale:o,vScale:a}=t,l=o.axis,c=a.axis,d=o.getLabels(),h=o===a,f=new Array(i);let u,p,m;for(u=0,p=i;u<p;++u)m=u+s,f[u]={[l]:h||o.parse(d[m],m),[c]:a.parse(e[m],m)};return f}parseArrayData(t,e,s,i){const{xScale:o,yScale:a}=t,l=new Array(i);let c,d,h,f;for(c=0,d=i;c<d;++c)h=c+s,f=e[h],l[c]={x:o.parse(f[0],h),y:a.parse(f[1],h)};return l}parseObjectData(t,e,s,i){const{xScale:o,yScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(i);let h,f,u,p;for(h=0,f=i;h<f;++h)u=h+s,p=e[u],d[h]={x:o.parse(Ht(p,l),u),y:a.parse(Ht(p,c),u)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const i=this.chart,o=this._cachedMeta,a=e[t.axis],l={keys:fo(i,!0),values:e._stacks[t.axis]._visualValues};return uo(l,a,o.index,{mode:s})}updateRangeFromParsed(t,e,s,i){const o=s[e.axis];let a=o===null?NaN:o;const l=i&&s._stacks[e.axis];i&&l&&(i.values=l,a=uo(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const s=this._cachedMeta,i=s._parsed,o=s._sorted&&t===s.iScale,a=i.length,l=this._getOtherScale(t),c=Xc(e,s,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:f}=Yc(l);let u,p;function m(){p=i[u];const g=p[l.axis];return!J(p[t.axis])||h>g||f<g}for(u=0;u<a&&!(!m()&&(this.updateRangeFromParsed(d,t,p,c),o));++u);if(o){for(u=a-1;u>=0;--u)if(!m()){this.updateRangeFromParsed(d,t,p,c);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let i,o,a;for(i=0,o=e.length;i<o;++i)a=e[i][t.axis],J(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,i=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=zc(R(this.options.clip,Rc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,i=s.data||[],o=e.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||i.length-l,d=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,l,c),h=l;h<l+c;++h){const f=i[h];f.hidden||(f.active&&d?a.push(f):f.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=Uc(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Hc(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const i=e==="active",o=this._cachedDataOpts,a=t+"-"+e,l=o[a],c=this.enableOptionSharing&&Oe(s);if(l)return bo(l,c);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],u=d.getOptionScopes(this.getDataset(),h),p=Object.keys(Z.elements[t]),m=()=>this.getContext(s,i,e),g=d.resolveNamedOptions(u,p,m,f);return g.$shared&&(g.$shared=c,o[a]=Object.freeze(bo(g,c))),g}_resolveAnimations(t,e,s){const i=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,l=o[a];if(l)return l;let c;if(i.options.animation!==!1){const h=this.chart.config,f=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),f);c=h.createResolver(u,this.getContext(t,s,e))}const d=new co(i,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ms(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),i=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(e,o)||o!==i;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:a}}updateElement(t,e,s,i){Ms(i)?Object.assign(t,s):this._resolveAnimations(e,i).update(t,s)}updateSharedOptions(t,e,s){t&&!Ms(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,i){t.active=i;const o=this.getStyle(e,i);this._resolveAnimations(e,s,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const i=s.length,o=e.length,a=Math.min(o,i);a&&this.parse(0,a),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,e,s=!0){const i=this._cachedMeta,o=i.data,a=t+e;let l;const c=d=>{for(d.length+=e,l=d.length-1;l>=a;l--)d[l]=d[l-e]};for(c(o),l=t;l<a;++l)o[l]=new this.dataElementType;this._parsing&&c(i._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,i){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const i=s._parsed.splice(t,e);s._stacked&&ze(s,i)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,i]=t;this[e](s,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}V(Mt,"defaults",{}),V(Mt,"datasetElementType",null),V(Mt,"dataElementType",null);function qc(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let s=[];for(let i=0,o=e.length;i<o;i++)s=s.concat(e[i].controller.getAllParsedValues(n));n._cache.$bar=Vi(s.sort((i,o)=>i-o))}return n._cache.$bar}function Kc(n){const t=n.iScale,e=qc(t,n.type);let s=t._length,i,o,a,l;const c=()=>{a===32767||a===-32768||(Oe(l)&&(s=Math.min(s,Math.abs(a-l)||s)),l=a)};for(i=0,o=e.length;i<o;++i)a=t.getPixelForValue(e[i]),c();for(l=void 0,i=0,o=t.ticks.length;i<o;++i)a=t.getPixelForTick(i),c();return s}function Gc(n,t,e,s){const i=e.barThickness;let o,a;return I(i)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=i*s,a=1),{chunk:o/s,ratio:a,start:t.pixels[n]-o/2}}function Jc(n,t,e,s){const i=t.pixels,o=i[n];let a=n>0?i[n-1]:null,l=n<i.length-1?i[n+1]:null;const c=e.categoryPercentage;a===null&&(a=o-(l===null?t.end-t.start:l-o)),l===null&&(l=o+o-a);const d=o-(o-Math.min(a,l))/2*c;return{chunk:Math.abs(l-a)/2*c/s,ratio:e.barPercentage,start:d}}function Zc(n,t,e,s){const i=e.parse(n[0],s),o=e.parse(n[1],s),a=Math.min(i,o),l=Math.max(i,o);let c=a,d=l;Math.abs(a)>Math.abs(l)&&(c=l,d=a),t[e.axis]=d,t._custom={barStart:c,barEnd:d,start:i,end:o,min:a,max:l}}function yo(n,t,e,s){return X(n)?Zc(n,t,e,s):t[e.axis]=e.parse(n,s),t}function _o(n,t,e,s){const i=n.iScale,o=n.vScale,a=i.getLabels(),l=i===o,c=[];let d,h,f,u;for(d=e,h=e+s;d<h;++d)u=t[d],f={},f[i.axis]=l||i.parse(a[d],d),c.push(yo(u,f,o,d));return c}function Ss(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Qc(n,t,e){return n!==0?St(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function td(n){let t,e,s,i,o;return n.horizontal?(t=n.base>n.x,e="left",s="right"):(t=n.base<n.y,e="bottom",s="top"),t?(i="end",o="start"):(i="start",o="end"),{start:e,end:s,reverse:t,top:i,bottom:o}}function ed(n,t,e,s){let i=t.borderSkipped;const o={};if(!i){n.borderSkipped=o;return}if(i===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:c,top:d,bottom:h}=td(n);i==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===s?i=d:(e._bottom||0)===s?i=h:(o[xo(h,a,l,c)]=!0,i=d)),o[xo(i,a,l,c)]=!0,n.borderSkipped=o}function xo(n,t,e,s){return s?(n=nd(n,t,e),n=ko(n,e,t)):n=ko(n,t,e),n}function nd(n,t,e){return n===t?e:n===e?t:n}function ko(n,t,e){return n==="start"?t:n==="end"?e:n}function sd(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Mn extends Mt{parsePrimitiveData(t,e,s,i){return _o(t,e,s,i)}parseArrayData(t,e,s,i){return _o(t,e,s,i)}parseObjectData(t,e,s,i){const{iScale:o,vScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=o.axis==="x"?l:c,h=a.axis==="x"?l:c,f=[];let u,p,m,g;for(u=s,p=s+i;u<p;++u)g=e[u],m={},m[o.axis]=o.parse(Ht(g,d),u),f.push(yo(Ht(g,h),m,a,u));return f}updateRangeFromParsed(t,e,s,i){super.updateRangeFromParsed(t,e,s,i);const o=s._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:s,vScale:i}=e,o=this.getParsed(t),a=o._custom,l=Ss(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:l}}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,s,i){const o=i==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),h=this._getRuler(),{sharedOptions:f,includeOptions:u}=this._getSharedOptions(e,i);for(let p=e;p<e+s;p++){const m=this.getParsed(p),g=o||I(m[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,h),y=(m._stacks||{})[l.axis],w={horizontal:d,base:g.base,enableBorderRadius:!y||Ss(m._custom)||a===y._top||a===y._bottom,x:d?g.head:b.center,y:d?b.center:g.head,height:d?b.size:Math.abs(g.size),width:d?Math.abs(g.size):b.size};u&&(w.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const _=w.options||t[p].options;ed(w,_,y,a),sd(w,_,h.ratio),this.updateElement(t[p],p,w,i)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,i=s.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),o=s.options.stacked,a=[],l=c=>{const d=c.controller.getParsed(e),h=d&&d[c.vScale.axis];if(I(h)||isNaN(h))return!0};for(const c of i)if(!(e!==void 0&&l(c))&&((o===!1||a.indexOf(c.stack)===-1||o===void 0&&c.stack===void 0)&&a.push(c.stack),c.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const i=this._getStacks(t,s),o=e!==void 0?i.indexOf(e):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,i=[];let o,a;for(o=0,a=e.data.length;o<a;++o)i.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const l=t.barThickness;return{min:l||Kc(e),pixels:i,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:i},options:{base:o,minBarLength:a}}=this,l=o||0,c=this.getParsed(t),d=c._custom,h=Ss(d);let f=c[e.axis],u=0,p=s?this.applyStack(e,c,s):f,m,g;p!==f&&(u=p-f,p=f),h&&(f=d.barStart,p=d.barEnd-d.barStart,f!==0&&St(f)!==St(d.barEnd)&&(u=0),u+=f);const b=!I(o)&&!h?o:u;let y=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(u+p):m=y,g=m-y,Math.abs(g)<a){g=Qc(g,e,l)*a,f===l&&(y-=g/2);const w=e.getPixelForDecimal(0),_=e.getPixelForDecimal(1),k=Math.min(w,_),x=Math.max(w,_);y=Math.max(Math.min(y,x),k),m=y+g,s&&!h&&(c._stacks[e.axis]._visualValues[i]=e.getValueForPixel(m)-e.getValueForPixel(y))}if(y===e.getPixelForValue(l)){const w=St(g)*e.getLineWidthForValue(l)/2;y+=w,g-=w}return{size:g,base:y,head:m,center:m+g/2}}_calculateBarIndexPixels(t,e){const s=e.scale,i=this.options,o=i.skipNull,a=R(i.maxBarThickness,1/0);let l,c;if(e.grouped){const d=o?this._getStackCount(t):e.stackCount,h=i.barThickness==="flex"?Jc(t,e,i,d):Gc(t,e,i,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);l=h.start+h.chunk*f+h.chunk/2,c=Math.min(a,h.chunk*h.ratio)}else l=s.getPixelForValue(this.getParsed(t)[s.axis],t),c=Math.min(a,e.min*e.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const t=this._cachedMeta,e=t.vScale,s=t.data,i=s.length;let o=0;for(;o<i;++o)this.getParsed(o)[e.axis]!==null&&s[o].draw(this._ctx)}}V(Mn,"id","bar"),V(Mn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),V(Mn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Sn extends Mt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,s,i){const o=super.parsePrimitiveData(t,e,s,i);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+s).radius;return o}parseArrayData(t,e,s,i){const o=super.parseArrayData(t,e,s,i);for(let a=0;a<o.length;a++){const l=e[s+a];o[a]._custom=R(l[2],this.resolveDataElementOptions(a+s).radius)}return o}parseObjectData(t,e,s,i){const o=super.parseObjectData(t,e,s,i);for(let a=0;a<o.length;a++){const l=e[s+a];o[a]._custom=R(l&&l.r&&+l.r,this.resolveDataElementOptions(a+s).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let s=t.length-1;s>=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:i,yScale:o}=e,a=this.getParsed(t),l=i.getLabelForValue(a.x),c=o.getLabelForValue(a.y),d=a._custom;return{label:s[t]||"",value:"("+l+", "+c+(d?", "+d:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,i){const o=i==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,i),h=a.axis,f=l.axis;for(let u=e;u<e+s;u++){const p=t[u],m=!o&&this.getParsed(u),g={},b=g[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(m[h]),y=g[f]=o?l.getBasePixel():l.getPixelForValue(m[f]);g.skip=isNaN(b)||isNaN(y),d&&(g.options=c||this.resolveDataElementOptions(u,p.active?"active":i),o&&(g.options.radius=0)),this.updateElement(p,u,g,i)}}resolveDataElementOptions(t,e){const s=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return e!=="active"&&(i.radius=0),i.radius+=R(s&&s._custom,o),i}}V(Sn,"id","bubble"),V(Sn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),V(Sn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function id(n,t,e){let s=1,i=1,o=0,a=0;if(t<K){const l=n,c=l+t,d=Math.cos(l),h=Math.sin(l),f=Math.cos(c),u=Math.sin(c),p=(_,k,x)=>Fe(_,l,c,!0)?1:Math.max(k,k*e,x,x*e),m=(_,k,x)=>Fe(_,l,c,!0)?-1:Math.min(k,k*e,x,x*e),g=p(0,d,f),b=p(tt,h,u),y=m(q,d,f),w=m(q+tt,h,u);s=(g-y)/2,i=(b-w)/2,o=-(g+y)/2,a=-(b+w)/2}return{ratioX:s,ratioY:i,offsetX:o,offsetY:a}}class ce extends Mt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=s;else{let o=c=>+s[c];if(z(s[t])){const{key:c="value"}=this._parsing;o=d=>+Ht(s[d],c)}let a,l;for(a=t,l=t+e;a<l;++a)i._parsed[a]=o(a)}}_getRotation(){return Ct(this.options.rotation-90)}_getCircumference(){return Ct(this.options.circumference)}_getRotationExtents(){let t=K,e=-K;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const i=this.chart.getDatasetMeta(s).controller,o=i._getRotation(),a=i._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:s}=e,i=this._cachedMeta,o=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(s.width,s.height)-a)/2,0),c=Math.min(yl(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:f}=this._getRotationExtents(),{ratioX:u,ratioY:p,offsetX:m,offsetY:g}=id(f,h,c),b=(s.width-a)/u,y=(s.height-a)/p,w=Math.max(Math.min(b,y)/2,0),_=_i(this.options.radius,w),k=Math.max(_*c,0),x=(_-k)/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=g*_,i.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*d,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const s=this.options,i=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/K)}updateElements(t,e,s,i){const o=i==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,h=(l.left+l.right)/2,f=(l.top+l.bottom)/2,u=o&&d.animateScale,p=u?0:this.innerRadius,m=u?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(e,i);let y=this._getRotation(),w;for(w=0;w<e;++w)y+=this._circumference(w,o);for(w=e;w<e+s;++w){const _=this._circumference(w,o),k=t[w],x={x:h+this.offsetX,y:f+this.offsetY,startAngle:y,endAngle:y+_,circumference:_,outerRadius:m,innerRadius:p};b&&(x.options=g||this.resolveDataElementOptions(w,k.active?"active":i)),y+=_,this.updateElement(k,w,x,i)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,i;for(i=0;i<e.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!e[i].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?K*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,i=s.data.labels||[],o=Te(e._parsed[t],s.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let i,o,a,l,c;if(!t){for(i=0,o=s.data.datasets.length;i<o;++i)if(s.isDatasetVisible(i)){a=s.getDatasetMeta(i),t=a.data,l=a.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)c=l.resolveDataElementOptions(i),c.borderAlign!=="inner"&&(e=Math.max(e,c.borderWidth||0,c.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,i=t.length;s<i;++s){const o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(R(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}V(ce,"id","doughnut"),V(ce,"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"}),V(ce,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),V(ce,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:i}}=t.legend.options;return e.labels.map((o,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:i,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}});class Dn extends Mt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:i=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:l,count:c}=Ai(e,i,a);this._drawStart=l,this._drawCount=c,Fi(e)&&(l=0,c=i.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=i;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:d},t),this.updateElements(i,l,c,t)}updateElements(t,e,s,i){const o=i==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,i),u=a.axis,p=l.axis,{spanGaps:m,segment:g}=this.options,b=_e(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||i==="none",w=e+s,_=t.length;let k=e>0&&this.getParsed(e-1);for(let x=0;x<_;++x){const M=t[x],C=y?M:{};if(x<e||x>=w){C.skip=!0;continue}const S=this.getParsed(x),v=I(S[p]),P=C[u]=a.getPixelForValue(S[u],x),A=C[p]=o||v?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,S,c):S[p],x);C.skip=isNaN(P)||isNaN(A)||v,C.stop=x>0&&Math.abs(S[u]-k[u])>b,g&&(C.parsed=S,C.raw=d.data[x]),f&&(C.options=h||this.resolveDataElementOptions(x,M.active?"active":i)),y||this.updateElement(M,x,C,i),k=S}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return s;const o=i[0].size(this.resolveDataElementOptions(0)),a=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(s,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}V(Dn,"id","line"),V(Dn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),V(Dn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ie extends Mt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,i=s.data.labels||[],o=Te(e._parsed[t].r,s.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,e,s,i){return Ki.bind(this)(t,e,s,i)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(i/2,0),a=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),l=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,s,i){const o=i==="reset",a=this.chart,c=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,f=d.yCenter,u=d.getIndexAngle(0)-.5*q;let p=u,m;const g=360/this.countVisibleElements();for(m=0;m<e;++m)p+=this._computeAngle(m,i,g);for(m=e;m<e+s;m++){const b=t[m];let y=p,w=p+this._computeAngle(m,i,g),_=a.getDataVisibility(m)?d.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=w,o&&(c.animateScale&&(_=0),c.animateRotate&&(y=w=u));const k={x:h,y:f,innerRadius:0,outerRadius:_,startAngle:y,endAngle:w,options:this.resolveDataElementOptions(m,b.active?"active":i)};this.updateElement(b,m,k,i)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((s,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?Ct(this.resolveDataElementOptions(t,e).angle||s):0}}V(Ie,"id","polarArea"),V(Ie,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),V(Ie,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:i}}=t.legend.options;return e.labels.map((o,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:i,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Ds extends ce{}V(Ds,"id","pie"),V(Ds,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Bn extends Mt{getLabelAndValue(t){const e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,i){return Ki.bind(this)(t,e,s,i)}update(t){const e=this._cachedMeta,s=e.dataset,i=e.data||[],o=e.iScale.getLabels();if(s.points=i,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:o.length===i.length,options:a};this.updateElement(s,void 0,l,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,s,i){const o=this._cachedMeta.rScale,a=i==="reset";for(let l=e;l<e+s;l++){const c=t[l],d=this.resolveDataElementOptions(l,c.active?"active":i),h=o.getPointPositionForValue(l,this.getParsed(l).r),f=a?o.xCenter:h.x,u=a?o.yCenter:h.y,p={x:f,y:u,angle:h.angle,skip:isNaN(f)||isNaN(u),options:d};this.updateElement(c,l,p,i)}}}V(Bn,"id","radar"),V(Bn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),V(Bn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class vn extends Mt{getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:i,yScale:o}=e,a=this.getParsed(t),l=i.getLabelForValue(a.x),c=o.getLabelForValue(a.y);return{label:s[t]||"",value:"("+l+", "+c+")"}}update(t){const e=this._cachedMeta,{data:s=[]}=e,i=this.chart._animationsDisabled;let{start:o,count:a}=Ai(e,s,i);if(this._drawStart=o,this._drawCount=a,Fi(e)&&(o=0,a=s.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:c}=e;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=s;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!i,options:d},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(s,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,s,i){const o=i==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,i),f=this.getSharedOptions(h),u=this.includeOptions(i,f),p=a.axis,m=l.axis,{spanGaps:g,segment:b}=this.options,y=_e(g)?g:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||i==="none";let _=e>0&&this.getParsed(e-1);for(let k=e;k<e+s;++k){const x=t[k],M=this.getParsed(k),C=w?x:{},S=I(M[m]),v=C[p]=a.getPixelForValue(M[p],k),P=C[m]=o||S?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,M,c):M[m],k);C.skip=isNaN(v)||isNaN(P)||S,C.stop=k>0&&Math.abs(M[p]-_[p])>y,b&&(C.parsed=M,C.raw=d.data[k]),u&&(C.options=f||this.resolveDataElementOptions(k,x.active?"active":i)),w||this.updateElement(x,k,C,i),_=M}this.updateSharedOptions(f,i,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let c=e.length-1;c>=0;--c)l=Math.max(l,e[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const s=t.dataset,i=s.options&&s.options.borderWidth||0;if(!e.length)return i;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(i,o,a)/2}}V(vn,"id","scatter"),V(vn,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),V(vn,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var od=Object.freeze({__proto__:null,BarController:Mn,BubbleController:Sn,DoughnutController:ce,LineController:Dn,PieController:Ds,PolarAreaController:Ie,RadarController:Bn,ScatterController:vn});function de(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Bs{constructor(t){V(this,"options");this.options=t||{}}static override(t){Object.assign(Bs.prototype,t)}init(){}formats(){return de()}parse(){return de()}format(){return de()}add(){return de()}diff(){return de()}startOf(){return de()}endOf(){return de()}}var ad={_date:Bs};function rd(n,t,e,s){const{controller:i,data:o,_sorted:a}=n,l=i._cachedMeta.iScale;if(l&&t===l.axis&&t!=="r"&&a&&o.length){const c=l._reversePixels?Vl:Ft;if(s){if(i._sharedOptions){const d=o[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){const f=c(o,t,e-h),u=c(o,t,e+h);return{lo:f.lo,hi:u.hi}}}}else return c(o,t,e)}return{lo:0,hi:o.length-1}}function We(n,t,e,s,i){const o=n.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,c=o.length;l<c;++l){const{index:d,data:h}=o[l],{lo:f,hi:u}=rd(o[l],t,a,i);for(let p=f;p<=u;++p){const m=h[p];m.skip||s(m,d,p)}}}function ld(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(s,i){const o=t?Math.abs(s.x-i.x):0,a=e?Math.abs(s.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function vs(n,t,e,s,i){const o=[];return!i&&!n.isPointInArea(t)||We(n,e,t,function(l,c,d){!i&&!Nt(l,n.chartArea,0)||l.inRange(t.x,t.y,s)&&o.push({element:l,datasetIndex:c,index:d})},!0),o}function cd(n,t,e,s){let i=[];function o(a,l,c){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],s),{angle:f}=Bi(a,{x:t.x,y:t.y});Fe(f,d,h)&&i.push({element:a,datasetIndex:l,index:c})}return We(n,e,t,o),i}function dd(n,t,e,s,i,o){let a=[];const l=ld(e);let c=Number.POSITIVE_INFINITY;function d(h,f,u){const p=h.inRange(t.x,t.y,i);if(s&&!p)return;const m=h.getCenterPoint(i);if(!(!!o||n.isPointInArea(m))&&!p)return;const b=l(t,m);b<c?(a=[{element:h,datasetIndex:f,index:u}],c=b):b===c&&a.push({element:h,datasetIndex:f,index:u})}return We(n,e,t,d),a}function Es(n,t,e,s,i,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!s?cd(n,t,e,i):dd(n,t,e,s,i,o)}function wo(n,t,e,s,i){const o=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return We(n,e,t,(c,d,h)=>{c[a](t[e],i)&&(o.push({element:c,datasetIndex:d,index:h}),l=l||c.inRange(t.x,t.y,i))}),s&&!l?[]:o}var hd={evaluateInteractionItems:We,modes:{index(n,t,e,s){const i=re(t,n),o=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?vs(n,i,o,s,a):Es(n,i,o,!1,s,a),c=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=l[0].index,f=d.data[h];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:h})}),c):[]},dataset(n,t,e,s){const i=re(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?vs(n,i,o,s,a):Es(n,i,o,!1,s,a);if(l.length>0){const c=l[0].datasetIndex,d=n.getDatasetMeta(c).data;l=[];for(let h=0;h<d.length;++h)l.push({element:d[h],datasetIndex:c,index:h})}return l},point(n,t,e,s){const i=re(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return vs(n,i,o,s,a)},nearest(n,t,e,s){const i=re(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Es(n,i,o,e.intersect,s,a)},x(n,t,e,s){const i=re(t,n);return wo(n,i,"x",e.intersect,s)},y(n,t,e,s){const i=re(t,n);return wo(n,i,"y",e.intersect,s)}}};const Co=["left","top","right","bottom"];function Ye(n,t){return n.filter(e=>e.pos===t)}function Mo(n,t){return n.filter(e=>Co.indexOf(e.pos)===-1&&e.box.axis===t)}function je(n,t){return n.sort((e,s)=>{const i=t?s:e,o=t?e:s;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function fd(n){const t=[];let e,s,i,o,a,l;for(e=0,s=(n||[]).length;e<s;++e)i=n[e],{position:o,options:{stack:a,stackWeight:l=1}}=i,t.push({index:e,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&o+a,stackWeight:l});return t}function ud(n){const t={};for(const e of n){const{stack:s,pos:i,stackWeight:o}=e;if(!s||!Co.includes(i))continue;const a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function pd(n,t){const e=ud(n),{vBoxMaxWidth:s,hBoxMaxHeight:i}=t;let o,a,l;for(o=0,a=n.length;o<a;++o){l=n[o];const{fullSize:c}=l.box,d=e[l.stack],h=d&&l.stackWeight/d.weight;l.horizontal?(l.width=h?h*s:c&&t.availableWidth,l.height=i):(l.width=s,l.height=h?h*i:c&&t.availableHeight)}return e}function md(n){const t=fd(n),e=je(t.filter(d=>d.box.fullSize),!0),s=je(Ye(t,"left"),!0),i=je(Ye(t,"right")),o=je(Ye(t,"top"),!0),a=je(Ye(t,"bottom")),l=Mo(t,"x"),c=Mo(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:i.concat(c).concat(a).concat(l),chartArea:Ye(t,"chartArea"),vertical:s.concat(i).concat(c),horizontal:o.concat(a).concat(l)}}function So(n,t,e,s){return Math.max(n[e],t[e])+Math.max(n[s],t[s])}function Do(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 gd(n,t,e,s){const{pos:i,box:o}=e,a=n.maxPadding;if(!z(i)){e.size&&(n[i]-=e.size);const f=s[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[i]+=e.size}o.getPadding&&Do(a,o.getPadding());const l=Math.max(0,t.outerWidth-So(a,n,"left","right")),c=Math.max(0,t.outerHeight-So(a,n,"top","bottom")),d=l!==n.w,h=c!==n.h;return n.w=l,n.h=c,e.horizontal?{same:d,other:h}:{same:h,other:d}}function bd(n){const t=n.maxPadding;function e(s){const i=Math.max(t[s]-n[s],0);return n[s]+=i,i}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function yd(n,t){const e=t.maxPadding;function s(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return s(n?["left","right"]:["top","bottom"])}function He(n,t,e,s){const i=[];let o,a,l,c,d,h;for(o=0,a=n.length,d=0;o<a;++o){l=n[o],c=l.box,c.update(l.width||t.w,l.height||t.h,yd(l.horizontal,t));const{same:f,other:u}=gd(t,e,l,s);d|=f&&i.length,h=h||u,c.fullSize||i.push(l)}return d&&He(i,t,e,s)||h}function En(n,t,e,s,i){n.top=e,n.left=t,n.right=t+s,n.bottom=e+i,n.width=s,n.height=i}function Bo(n,t,e,s){const i=e.padding;let{x:o,y:a}=t;for(const l of n){const c=l.box,d=s[l.stack]||{count:1,placed:0,weight:1},h=l.stackWeight/d.weight||1;if(l.horizontal){const f=t.w*h,u=d.size||c.height;Oe(d.start)&&(a=d.start),c.fullSize?En(c,i.left,a,e.outerWidth-i.right-i.left,u):En(c,t.left+d.placed,a,f,u),d.start=a,d.placed+=f,a=c.bottom}else{const f=t.h*h,u=d.size||c.width;Oe(d.start)&&(o=d.start),c.fullSize?En(c,o,i.top,u,e.outerHeight-i.bottom-i.top):En(c,o,t.top+d.placed,u,f),d.start=o,d.placed+=f,o=c.right}}t.x=o,t.y=a}var lt={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,s){if(!n)return;const i=rt(n.options.layout.padding),o=Math.max(t-i.width,0),a=Math.max(e-i.height,0),l=md(n.boxes),c=l.vertical,d=l.horizontal;Y(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=c.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},i);Do(u,rt(s));const p=Object.assign({maxPadding:u,w:o,h:a,x:i.left,y:i.top},i),m=pd(c.concat(d),f);He(l.fullSize,p,f,m),He(c,p,f,m),He(d,p,f,m)&&He(c,p,f,m),bd(p),Bo(l.leftAndTop,p,f,m),p.x+=p.w,p.y+=p.h,Bo(l.rightAndBottom,p,f,m),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Y(l.chartArea,g=>{const b=g.box;Object.assign(b,n.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class vo{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,i){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):s)}}isAttached(t){return!0}updateConfig(t){}}class _d extends vo{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Vn="$chartjs",xd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Eo=n=>n===null||n==="";function kd(n,t){const e=n.style,s=n.getAttribute("height"),i=n.getAttribute("width");if(n[Vn]={initial:{height:s,width:i,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Eo(i)){const o=Qi(n,"width");o!==void 0&&(n.width=o)}if(Eo(s))if(n.style.height==="")n.height=n.width/(t||2);else{const o=Qi(n,"height");o!==void 0&&(n.height=o)}return n}const Vo=Cc?{passive:!0}:!1;function wd(n,t,e){n.addEventListener(t,e,Vo)}function Cd(n,t,e){n.canvas.removeEventListener(t,e,Vo)}function Md(n,t){const e=xd[n.type]||n.type,{x:s,y:i}=re(n,t);return{type:e,chart:t,native:n,x:s!==void 0?s:null,y:i!==void 0?i:null}}function Pn(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Sd(n,t,e){const s=n.canvas,i=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||Pn(l.addedNodes,s),a=a&&!Pn(l.removedNodes,s);a&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}function Dd(n,t,e){const s=n.canvas,i=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||Pn(l.removedNodes,s),a=a&&!Pn(l.addedNodes,s);a&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}const Ue=new Map;let Po=0;function Oo(){const n=window.devicePixelRatio;n!==Po&&(Po=n,Ue.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Bd(n,t){Ue.size||window.addEventListener("resize",Oo),Ue.set(n,t)}function vd(n){Ue.delete(n),Ue.size||window.removeEventListener("resize",Oo)}function Ed(n,t,e){const s=n.canvas,i=s&&ws(s);if(!i)return;const o=Oi((l,c)=>{const d=i.clientWidth;e(l,c),d<i.clientWidth&&e()},window),a=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,h=c.contentRect.height;d===0&&h===0||o(d,h)});return a.observe(i),Bd(n,o),a}function Vs(n,t,e){e&&e.disconnect(),t==="resize"&&vd(n)}function Vd(n,t,e){const s=n.canvas,i=Oi(o=>{n.ctx!==null&&e(Md(o,n))},n);return wd(s,t,i),i}class Pd extends vo{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(kd(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[Vn])return!1;const s=e[Vn].initial;["height","width"].forEach(o=>{const a=s[o];I(a)?e.removeAttribute(o):e.setAttribute(o,a)});const i=s.style||{};return Object.keys(i).forEach(o=>{e.style[o]=i[o]}),e.width=e.width,delete e[Vn],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),a={attach:Sd,detach:Dd,resize:Ed}[e]||Vd;i[e]=a(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),i=s[e];if(!i)return;({attach:Vs,detach:Vs,resize:Vs}[e]||Cd)(t,e,i),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,i){return wc(t,e,s,i)}isAttached(t){const e=ws(t);return!!(e&&e.isConnected)}}function Od(n){return!Ji()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?_d:Pd}let $t=(ts=class{constructor(){V(this,"x");V(this,"y");V(this,"active",!1);V(this,"options");V(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return _e(this.x)&&_e(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const i={};return t.forEach(o=>{i[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),i}},V(ts,"defaults",{}),V(ts,"defaultRoutes"),ts);function Ad(n,t){const e=n.options.ticks,s=Fd(n),i=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Td(t):[],a=o.length,l=o[0],c=o[a-1],d=[];if(a>i)return $d(t,d,o,a/i),d;const h=Nd(o,t,i);if(a>0){let f,u;const p=a>1?Math.round((c-l)/(a-1)):null;for(On(t,d,h,I(p)?0:l-p,l),f=0,u=a-1;f<u;f++)On(t,d,h,o[f],o[f+1]);return On(t,d,h,c,I(p)?t.length:c+p),d}return On(t,d,h),d}function Fd(n){const t=n.options.offset,e=n._tickSize(),s=n._length/e+(t?0:1),i=n._maxLength/e;return Math.floor(Math.min(s,i))}function Nd(n,t,e){const s=Ld(n),i=t.length/e;if(!s)return Math.max(i,1);const o=Dl(s);for(let a=0,l=o.length-1;a<l;a++){const c=o[a];if(c>i)return c}return Math.max(i,1)}function Td(n){const t=[];let e,s;for(e=0,s=n.length;e<s;e++)n[e].major&&t.push(e);return t}function $d(n,t,e,s){let i=0,o=e[0],a;for(s=Math.ceil(s),a=0;a<n.length;a++)a===o&&(t.push(n[a]),i++,o=e[i*s])}function On(n,t,e,s,i){const o=R(s,0),a=Math.min(R(i,n.length),n.length);let l=0,c,d,h;for(e=Math.ceil(e),i&&(c=i-s,e=c/Math.floor(c/e)),h=o;h<0;)l++,h=Math.round(o+l*e);for(d=Math.max(o,0);d<a;d++)d===h&&(t.push(n[d]),l++,h=Math.round(o+l*e))}function Ld(n){const t=n.length;let e,s;if(t<2)return!1;for(s=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==s)return!1;return s}const Rd=n=>n==="left"?"right":n==="right"?"left":n,Ao=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Fo=(n,t)=>Math.min(t||n,n);function No(n,t){const e=[],s=n.length/t,i=n.length;let o=0;for(;o<i;o+=s)e.push(n[Math.floor(o)]);return e}function zd(n,t,e){const s=n.ticks.length,i=Math.min(t,s-1),o=n._startPixel,a=n._endPixel,l=1e-6;let c=n.getPixelForTick(i),d;if(!(e&&(s===1?d=Math.max(c-o,a-c):t===0?d=(n.getPixelForTick(1)-c)/2:d=(c-n.getPixelForTick(i-1))/2,c+=i<t?d:-d,c<o-l||c>a+l)))return c}function Id(n,t){Y(n,e=>{const s=e.gc,i=s.length/2;let o;if(i>t){for(o=0;o<i;++o)delete e.data[s[o]];s.splice(0,i)}})}function Xe(n){return n.drawTicks?n.tickLength:0}function To(n,t){if(!n.display)return 0;const e=nt(n.font,t),s=rt(n.padding);return(X(n.text)?n.text.length:1)*e.lineHeight+s.height}function Wd(n,t){return qt(n,{scale:t,type:"scale"})}function Yd(n,t,e){return qt(n,{tick:e,index:t,type:"tick"})}function jd(n,t,e){let s=fs(n);return(e&&t!=="right"||!e&&t==="right")&&(s=Rd(s)),s}function Hd(n,t,e,s){const{top:i,left:o,bottom:a,right:l,chart:c}=n,{chartArea:d,scales:h}=c;let f=0,u,p,m;const g=a-i,b=l-o;if(n.isHorizontal()){if(p=at(s,o,l),z(e)){const y=Object.keys(e)[0],w=e[y];m=h[y].getPixelForValue(w)+g-t}else e==="center"?m=(d.bottom+d.top)/2+g-t:m=Ao(n,e,t);u=l-o}else{if(z(e)){const y=Object.keys(e)[0],w=e[y];p=h[y].getPixelForValue(w)-b+t}else e==="center"?p=(d.left+d.right)/2-b+t:p=Ao(n,e,t);m=at(s,a,i),f=e==="left"?-tt:tt}return{titleX:p,titleY:m,maxWidth:u,rotation:f}}class he extends $t{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:i}=this;return t=pt(t,Number.POSITIVE_INFINITY),e=pt(e,Number.NEGATIVE_INFINITY),s=pt(s,Number.POSITIVE_INFINITY),i=pt(i,Number.NEGATIVE_INFINITY),{min:pt(t,s),max:pt(e,i),minDefined:J(t),maxDefined:J(e)}}getMinMax(t){let{min:e,max:s,minDefined:i,maxDefined:o}=this.getUserBounds(),a;if(i&&o)return{min:e,max:s};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)a=l[c].controller.getMinMax(this,t),i||(e=Math.min(e,a.min)),o||(s=Math.max(s,a.max));return e=o&&e>s?s:e,s=i&&e>s?e:s,{min:pt(e,pt(s,e)),max:pt(s,pt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){H(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:i,grace:o,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=tc(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?No(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Ad(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){H(this.options.afterUpdate,[this])}beforeSetDimensions(){H(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){H(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),H(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){H(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,i,o;for(s=0,i=t.length;s<i;s++)o=t[s],o.label=H(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){H(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){H(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Fo(this.ticks.length,t.ticks.maxTicksLimit),i=e.minRotation||0,o=e.maxRotation;let a=i,l,c,d;if(!this._isVisible()||!e.display||i>=o||s<=1||!this.isHorizontal()){this.labelRotation=i;return}const h=this._getLabelSizes(),f=h.widest.width,u=h.highest.height,p=it(this.chart.width-f,0,this.maxWidth);l=t.offset?this.maxWidth/s:p/(s-1),f+6>l&&(l=p/(s-(t.offset?.5:1)),c=this.maxHeight-Xe(t.grid)-e.padding-To(t.title,this.chart.options.font),d=Math.sqrt(f*f+u*u),a=cs(Math.min(Math.asin(it((h.highest.height+6)/l,-1,1)),Math.asin(it(c/d,-1,1))-Math.asin(it(u/d,-1,1)))),a=Math.max(i,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){H(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){H(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:i,grid:o}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const c=To(i,e.options.font);if(l?(t.width=this.maxWidth,t.height=Xe(o)+c):(t.height=this.maxHeight,t.width=Xe(o)+c),s.display&&this.ticks.length){const{first:d,last:h,widest:f,highest:u}=this._getLabelSizes(),p=s.padding*2,m=Ct(this.labelRotation),g=Math.cos(m),b=Math.sin(m);if(l){const y=s.mirror?0:b*f.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+y+p)}else{const y=s.mirror?0:g*f.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+y+p)}this._calculatePadding(d,h,b,g)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,i){const{ticks:{align:o,padding:a},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,p=0;c?d?(u=i*t.width,p=s*e.height):(u=s*t.height,p=i*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-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((p-f+a)*this.width/(this.width-f),0)}else{let h=e.height/2,f=t.height/2;o==="start"?(h=0,f=t.height):o==="end"&&(h=e.height,f=0),this.paddingTop=h+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(){H(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)I(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=No(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:i,_longestTextCache:o}=this,a=[],l=[],c=Math.floor(e/Fo(e,s));let d=0,h=0,f,u,p,m,g,b,y,w,_,k,x;for(f=0;f<e;f+=c){if(m=t[f].label,g=this._resolveTickFontOptions(f),i.font=b=g.string,y=o[b]=o[b]||{data:{},gc:[]},w=g.lineHeight,_=k=0,!I(m)&&!X(m))_=bn(i,y.data,y.gc,_,m),k=w;else if(X(m))for(u=0,p=m.length;u<p;++u)x=m[u],!I(x)&&!X(x)&&(_=bn(i,y.data,y.gc,_,x),k+=w);a.push(_),l.push(k),d=Math.max(_,d),h=Math.max(k,h)}Id(o,e);const M=a.indexOf(d),C=l.indexOf(h),S=v=>({width:a[v]||0,height:l[v]||0});return{first:S(0),last:S(e-1),widest:S(M),highest:S(C),widths:a,heights:l}}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 El(this._alignToPixels?se(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=Yd(this.getContext(),t,s))}return this.$context||(this.$context=Wd(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ct(this.labelRotation),s=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,l=o?o.widest.width+a:0,c=o?o.highest.height+a:0;return this.isHorizontal()?c*s>l*i?l/s:c/i:c*i<l*s?c/s:l/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,i=this.options,{grid:o,position:a,border:l}=i,c=o.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),u=Xe(o),p=[],m=l.setContext(this.getContext()),g=m.display?m.width:0,b=g/2,y=function(D){return se(s,D,g)};let w,_,k,x,M,C,S,v,P,A,T,U;if(a==="top")w=y(this.bottom),C=this.bottom-u,v=w-b,A=y(t.top)+b,U=t.bottom;else if(a==="bottom")w=y(this.top),A=t.top,U=y(t.bottom)-b,C=w+b,v=this.top+u;else if(a==="left")w=y(this.right),M=this.right-u,S=w-b,P=y(t.left)+b,T=t.right;else if(a==="right")w=y(this.left),P=t.left,T=y(t.right)-b,M=w+b,S=this.left+u;else if(e==="x"){if(a==="center")w=y((t.top+t.bottom)/2+.5);else if(z(a)){const D=Object.keys(a)[0],E=a[D];w=y(this.chart.scales[D].getPixelForValue(E))}A=t.top,U=t.bottom,C=w+b,v=C+u}else if(e==="y"){if(a==="center")w=y((t.left+t.right)/2);else if(z(a)){const D=Object.keys(a)[0],E=a[D];w=y(this.chart.scales[D].getPixelForValue(E))}M=w-b,S=M-u,P=t.left,T=t.right}const F=R(i.ticks.maxTicksLimit,f),B=Math.max(1,Math.ceil(f/F));for(_=0;_<f;_+=B){const D=this.getContext(_),E=o.setContext(D),O=l.setContext(D),N=E.lineWidth,$=E.color,W=O.dash||[],j=O.dashOffset,G=E.tickWidth,Q=E.tickColor,ot=E.tickBorderDash||[],wt=E.tickBorderDashOffset;k=zd(this,_,c),k!==void 0&&(x=se(s,k,N),d?M=S=P=T=x:C=v=A=U=x,p.push({tx1:M,ty1:C,tx2:S,ty2:v,x1:P,y1:A,x2:T,y2:U,width:N,color:$,borderDash:W,borderDashOffset:j,tickWidth:G,tickColor:Q,tickBorderDash:ot,tickBorderDashOffset:wt}))}return this._ticksLength=f,this._borderValue=w,p}_computeLabelItems(t){const e=this.axis,s=this.options,{position:i,ticks:o}=s,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:h,mirror:f}=o,u=Xe(s.grid),p=u+h,m=f?-h:p,g=-Ct(this.labelRotation),b=[];let y,w,_,k,x,M,C,S,v,P,A,T,U="middle";if(i==="top")M=this.bottom-m,C=this._getXAxisLabelAlignment();else if(i==="bottom")M=this.top+m,C=this._getXAxisLabelAlignment();else if(i==="left"){const B=this._getYAxisLabelAlignment(u);C=B.textAlign,x=B.x}else if(i==="right"){const B=this._getYAxisLabelAlignment(u);C=B.textAlign,x=B.x}else if(e==="x"){if(i==="center")M=(t.top+t.bottom)/2+p;else if(z(i)){const B=Object.keys(i)[0],D=i[B];M=this.chart.scales[B].getPixelForValue(D)+p}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(i==="center")x=(t.left+t.right)/2-p;else if(z(i)){const B=Object.keys(i)[0],D=i[B];x=this.chart.scales[B].getPixelForValue(D)}C=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(c==="start"?U="top":c==="end"&&(U="bottom"));const F=this._getLabelSizes();for(y=0,w=l.length;y<w;++y){_=l[y],k=_.label;const B=o.setContext(this.getContext(y));S=this.getPixelForTick(y)+o.labelOffset,v=this._resolveTickFontOptions(y),P=v.lineHeight,A=X(k)?k.length:1;const D=A/2,E=B.color,O=B.textStrokeColor,N=B.textStrokeWidth;let $=C;a?(x=S,C==="inner"&&(y===w-1?$=this.options.reverse?"left":"right":y===0?$=this.options.reverse?"right":"left":$="center"),i==="top"?d==="near"||g!==0?T=-A*P+P/2:d==="center"?T=-F.highest.height/2-D*P+P:T=-F.highest.height+P/2:d==="near"||g!==0?T=P/2:d==="center"?T=F.highest.height/2-D*P:T=F.highest.height-A*P,f&&(T*=-1),g!==0&&!B.showLabelBackdrop&&(x+=P/2*Math.sin(g))):(M=S,T=(1-A)*P/2);let W;if(B.showLabelBackdrop){const j=rt(B.backdropPadding),G=F.heights[y],Q=F.widths[y];let ot=T-j.top,wt=0-j.left;switch(U){case"middle":ot-=G/2;break;case"bottom":ot-=G;break}switch(C){case"center":wt-=Q/2;break;case"right":wt-=Q;break}W={left:wt,top:ot,width:Q+j.width,height:G+j.height,color:B.backdropColor}}b.push({label:k,font:v,textOffset:T,options:{rotation:g,color:E,strokeColor:O,strokeWidth:N,textAlign:$,textBaseline:U,translation:[x,M],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ct(this.labelRotation))return t==="top"?"left":"right";let i="center";return e.align==="start"?i="left":e.align==="end"?i="right":e.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:i,padding:o}}=this.options,a=this._getLabelSizes(),l=t+o,c=a.widest.width;let d,h;return e==="left"?i?(h=this.right+o,s==="near"?d="left":s==="center"?(d="center",h+=c/2):(d="right",h+=c)):(h=this.right-l,s==="near"?d="right":s==="center"?(d="center",h-=c/2):(d="left",h=this.left)):e==="right"?i?(h=this.left+o,s==="near"?d="right":s==="center"?(d="center",h-=c/2):(d="left",h-=c)):(h=this.left+l,s==="near"?d="left":s==="center"?(d="center",h+=c/2):(d="right",h=this.right)):d="right",{textAlign:d,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:i,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,i,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const l=(c,d,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(c.x,c.y),s.lineTo(d.x,d.y),s.stroke(),s.restore())};if(e.display)for(o=0,a=i.length;o<a;++o){const c=i[o];e.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),e.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:i}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;const l=i.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,h,f,u;this.isHorizontal()?(d=se(t,this.left,a)-a/2,h=se(t,this.right,l)+l/2,f=u=c):(f=se(t,this.top,a)-a/2,u=se(t,this.bottom,l)+l/2,d=h=c),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(d,f),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,i=this._computeLabelArea();i&&yn(s,i);const o=this.getLabelItems(t);for(const a of o){const l=a.options,c=a.font,d=a.label,h=a.textOffset;ie(s,d,0,h,c,l)}i&&_n(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:i}}=this;if(!s.display)return;const o=nt(s.font),a=rt(s.padding),l=s.align;let c=o.lineHeight/2;e==="bottom"||e==="center"||z(e)?(c+=a.bottom,X(s.text)&&(c+=o.lineHeight*(s.text.length-1))):c+=a.top;const{titleX:d,titleY:h,maxWidth:f,rotation:u}=Hd(this,c,e,l);ie(t,s.text,0,0,o,{color:s.color,maxWidth:f,rotation:u,textAlign:jd(l,e,i),textBaseline:"middle",translation:[d,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=R(t.grid&&t.grid.z,-1),i=R(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==he.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",i=[];let o,a;for(o=0,a=e.length;o<a;++o){const l=e[o];l[s]===this.id&&(!t||l.type===t)&&i.push(l)}return i}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return nt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class An{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;qd(e)&&(s=this.register(e));const i=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,Ud(t,a,s),this.override&&Z.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,i=this.scope;s in e&&delete e[s],i&&s in Z[i]&&(delete Z[i][s],this.override&&delete ne[s])}}function Ud(n,t,e){const s=Ve(Object.create(null),[e?Z.get(e):{},Z.get(t),n.defaults]);Z.set(t,s),n.defaultRoutes&&Xd(t,n.defaultRoutes),n.descriptors&&Z.describe(t,n.descriptors)}function Xd(n,t){Object.keys(t).forEach(e=>{const s=e.split("."),i=s.pop(),o=[n].concat(s).join("."),a=t[e].split("."),l=a.pop(),c=a.join(".");Z.route(o,i,c,l)})}function qd(n){return"id"in n&&"defaults"in n}class Kd{constructor(){this.controllers=new An(Mt,"datasets",!0),this.elements=new An($t,"elements"),this.plugins=new An(Object,"plugins"),this.scales=new An(he,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(i=>{const o=s||this._getRegistryForType(i);s||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Y(i,a=>{const l=s||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,s){const i=ls(t);H(s["before"+i],[],s),e[t](s),H(s["after"+i],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const i=e.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return i}}var Dt=new Kd;class Gd{constructor(){this._init=[]}notify(t,e,s,i){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),a=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,s,i){i=i||{};for(const o of t){const a=o.plugin,l=a[s],c=[e,i,o.options];if(H(l,c,a)===!1&&i.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 s=t&&t.config,i=R(s.options&&s.options.plugins,{}),o=Jd(s);return i===!1&&!e?[]:Qd(t,o,i,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,i=(o,a)=>o.filter(l=>!a.some(c=>l.plugin.id===c.plugin.id));this._notify(i(e,s),t,"stop"),this._notify(i(s,e),t,"start")}}function Jd(n){const t={},e=[],s=Object.keys(Dt.plugins.items);for(let o=0;o<s.length;o++)e.push(Dt.getPlugin(s[o]));const i=n.plugins||[];for(let o=0;o<i.length;o++){const a=i[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Zd(n,t){return!t&&n===!1?null:n===!0?{}:n}function Qd(n,{plugins:t,localIds:e},s,i){const o=[],a=n.getContext();for(const l of t){const c=l.id,d=Zd(s[c],i);d!==null&&o.push({plugin:l,options:th(n.config,{plugin:l,local:e[c]},d,a)})}return o}function th(n,{plugin:t,local:e},s,i){const o=n.pluginScopeKeys(t),a=n.getOptionScopes(s,o);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ps(n,t){const e=Z.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function eh(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function nh(n,t){return n===t?"_index_":"_value_"}function $o(n){if(n==="x"||n==="y"||n==="r")return n}function sh(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Os(n,...t){if($o(n))return n;for(const e of t){const s=e.axis||sh(e.position)||n.length>1&&$o(n[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Lo(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function ih(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===n||s.yAxisID===n);if(e.length)return Lo(n,"x",e[0])||Lo(n,"y",e[0])}return{}}function oh(n,t){const e=ne[n.type]||{scales:{}},s=t.scales||{},i=Ps(n.type,t),o=Object.create(null);return Object.keys(s).forEach(a=>{const l=s[a];if(!z(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Os(a,l,ih(a,n),Z.scales[l.type]),d=nh(c,i),h=e.scales||{};o[a]=Pe(Object.create(null),[{axis:c},l,h[c],h[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,c=a.indexAxis||Ps(l,t),h=(ne[l]||{}).scales||{};Object.keys(h).forEach(f=>{const u=eh(f,c),p=a[u+"AxisID"]||u;o[p]=o[p]||Object.create(null),Pe(o[p],[{axis:u},s[p],h[f]])})}),Object.keys(o).forEach(a=>{const l=o[a];Pe(l,[Z.scales[l.type],Z.scale])}),o}function Ro(n){const t=n.options||(n.options={});t.plugins=R(t.plugins,{}),t.scales=oh(n,t)}function zo(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function ah(n){return n=n||{},n.data=zo(n.data),Ro(n),n}const Io=new Map,Wo=new Set;function Fn(n,t){let e=Io.get(n);return e||(e=t(),Io.set(n,e),Wo.add(e)),e}const qe=(n,t,e)=>{const s=Ht(t,e);s!==void 0&&n.add(s)};class rh{constructor(t){this._config=ah(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=zo(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(),Ro(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Fn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Fn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Fn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return Fn(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let i=s.get(t);return(!i||e)&&(i=new Map,s.set(t,i)),i}getOptionScopes(t,e,s){const{options:i,type:o}=this,a=this._cachedScopes(t,s),l=a.get(e);if(l)return l;const c=new Set;e.forEach(h=>{t&&(c.add(t),h.forEach(f=>qe(c,t,f))),h.forEach(f=>qe(c,i,f)),h.forEach(f=>qe(c,ne[o]||{},f)),h.forEach(f=>qe(c,Z,f)),h.forEach(f=>qe(c,ms,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Wo.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,ne[e]||{},Z.datasets[e]||{},{type:e},Z,ms]}resolveNamedOptions(t,e,s,i=[""]){const o={$shared:!0},{resolver:a,subPrefixes:l}=Yo(this._resolverCache,t,i);let c=a;if(ch(a,e)){o.$shared=!1,s=Ut(s)?s():s;const d=this.createResolver(t,s,l);c=xe(a,s,d)}for(const d of e)o[d]=c[d];return o}createResolver(t,e,s=[""],i){const{resolver:o}=Yo(this._resolverCache,t,s);return z(e)?xe(o,e,void 0,i):o}}function Yo(n,t,e){let s=n.get(t);s||(s=new Map,n.set(t,s));const i=e.join();let o=s.get(i);return o||(o={resolver:_s(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},s.set(i,o)),o}const lh=n=>z(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||Ut(n[e]),!1);function ch(n,t){const{isScriptable:e,isIndexable:s}=Yi(n);for(const i of t){const o=e(i),a=s(i),l=(a||o)&&n[i];if(o&&(Ut(l)||lh(l))||a&&X(l))return!0}return!1}var dh="4.4.0";const hh=["top","bottom","left","right","chartArea"];function jo(n,t){return n==="top"||n==="bottom"||hh.indexOf(n)===-1&&t==="x"}function Ho(n,t){return function(e,s){return e[n]===s[n]?e[t]-s[t]:e[n]-s[n]}}function Uo(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),H(e&&e.onComplete,[n],t)}function fh(n){const t=n.chart,e=t.options.animation;H(e&&e.onProgress,[n],t)}function Xo(n){return Ji()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Nn={},qo=n=>{const t=Xo(n);return Object.values(Nn).filter(e=>e.canvas===t).pop()};function uh(n,t,e){const s=Object.keys(n);for(const i of s){const o=+i;if(o>=t){const a=n[i];delete n[i],(e>0||o>t)&&(n[o+e]=a)}}}function ph(n,t,e,s){return!e||n.type==="mouseout"?null:s?t:n}function Tn(n,t,e){return n.options.clip?n[e]:t[e]}function mh(n,t){const{xScale:e,yScale:s}=n;return e&&s?{left:Tn(e,t,"left"),right:Tn(e,t,"right"),top:Tn(s,t,"top"),bottom:Tn(s,t,"bottom")}:t}class Lt{static register(...t){Dt.add(...t),Ko()}static unregister(...t){Dt.remove(...t),Ko()}constructor(t,e){const s=this.config=new rh(e),i=Xo(t),o=qo(i);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=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Od(i)),this.platform.updateConfig(s);const l=this.platform.acquireContext(i,a.aspectRatio),c=l&&l.canvas,d=c&&c.height,h=c&&c.width;if(this.id=bl(),this.ctx=l,this.canvas=c,this.width=h,this.height=d,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 Gd,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Al(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],Nn[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Tt.listen(this,"complete",Uo),Tt.listen(this,"progress",fh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:i,_aspectRatio:o}=this;return I(t)?e&&o?o:i?s/i: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 Dt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Zi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return zi(this.canvas,this.ctx),this}stop(){return Tt.stop(this),this}resize(t,e){Tt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,i=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(i,t,e,o),l=s.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Zi(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),H(s.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Y(e,(s,i)=>{s.id=i})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,i=Object.keys(s).reduce((a,l)=>(a[l]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const l=e[a],c=Os(a,l),d=c==="r",h=c==="x";return{options:l,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),Y(o,a=>{const l=a.options,c=l.id,d=Os(c,l),h=R(l.type,a.dtype);(l.position===void 0||jo(l.position,d)!==jo(a.dposition))&&(l.position=a.dposition),i[c]=!0;let f=null;if(c in s&&s[c].type===h)f=s[c];else{const u=Dt.getScale(h);f=new u({id:c,type:h,ctx:this.ctx,chart:this}),s[f.id]=f}f.init(l,t)}),Y(i,(a,l)=>{a||delete s[l]}),Y(s,a=>{lt.configure(this,a,a.options),lt.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((i,o)=>i.index-o.index),s>e){for(let i=e;i<s;++i)this._destroyDatasetMeta(i);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Ho("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,i)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,i;for(this._removeUnreferencedMetasets(),s=0,i=e.length;s<i;s++){const o=e[s];let a=this.getDatasetMeta(s);const l=o.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=l,a.indexAxis=o.indexAxis||Ps(l,this.options),a.order=o.order||0,a.index=s,a.label=""+o.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{const c=Dt.getController(l),{datasetElementType:d,dataElementType:h}=Z.datasets[l];Object.assign(c,{dataElementType:Dt.getElement(h),datasetElementType:d&&Dt.getElement(d)}),a.controller=new c(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Y(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,h=this.data.datasets.length;d<h;d++){const{controller:f}=this.getDatasetMeta(d),u=!i&&o.indexOf(f)===-1;f.buildOrUpdateElements(u),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),i||Y(o,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ho("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Y(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!wi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:i,count:o}of e){const a=s==="_removeElements"?-o:o;uh(t,i,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),i=s(0);for(let o=1;o<e;o++)if(!wi(i,s(o)))return;return Array.from(i).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;lt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],Y(this.boxes,i=>{s&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,Ut(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),i={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(s.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Tt.has(this)?this.attached&&!Tt.running(this)&&Tt.start(this):(this.draw(),Uo({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:i}=this._resizeBeforeDraw;this._resize(s,i),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,s=[];let i,o;for(i=0,o=e.length;i<o;++i){const a=e[i];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,i=!s.disabled,o=mh(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(i&&yn(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),i&&_n(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Nt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,i){const o=hd.modes[e];return typeof o=="function"?o(this,t,s,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let i=s.filter(o=>o&&o._dataset===e).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(i)),i}getContext(){return this.$context||(this.$context=qt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const i=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,i);Oe(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(l=>l.datasetIndex===t?i: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(),Tt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),zi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Nn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},i=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};Y(this.options.events,o=>s(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(c,d)=>{e.addEventListener(this,c,d),t[c]=d},i=(c,d)=>{t[c]&&(e.removeEventListener(this,c,d),delete t[c])},o=(c,d)=>{this.canvas&&this.resize(c,d)};let a;const l=()=>{i("attach",l),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),s("attach",l)},e.isAttached(this.canvas)?l():a()}unbindEvents(){Y(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Y(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const i=s?"set":"remove";let o,a,l,c;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){a=t[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[i+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:a})=>{const l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!fn(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const i=this.options.hover,o=(c,d)=>c.filter(h=>!d.some(f=>h.datasetIndex===f.datasetIndex&&h.index===f.index)),a=o(e,t),l=s?t:o(t,e);a.length&&this.updateHoverStyle(a,i.mode,!1),l.length&&i.mode&&this.updateHoverStyle(l,i.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},i=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,i)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,i),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:i=[],options:o}=this,a=e,l=this._getActiveElements(t,i,s,a),c=Cl(t),d=ph(t,this._lastEvent,s,c);s&&(this._lastEvent=null,H(o.onHover,[t,l,this],this),c&&H(o.onClick,[t,l,this],this));const h=!fn(l,i);return(h||e)&&(this._active=l,this._updateHoverStyles(l,i,e)),this._lastEvent=d,h}_getActiveElements(t,e,s,i){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}V(Lt,"defaults",Z),V(Lt,"instances",Nn),V(Lt,"overrides",ne),V(Lt,"registry",Dt),V(Lt,"version",dh),V(Lt,"getChart",qo);function Ko(){return Y(Lt.instances,n=>n._plugins.invalidate())}function gh(n,t,e){const{startAngle:s,pixelMargin:i,x:o,y:a,outerRadius:l,innerRadius:c}=t;let d=i/l;n.beginPath(),n.arc(o,a,l,s-d,e+d),c>i?(d=i/c,n.arc(o,a,c,e+d,s-d,!0)):n.arc(o,a,i,e+tt,s-tt),n.closePath(),n.clip()}function bh(n){return ys(n,["outerStart","outerEnd","innerStart","innerEnd"])}function yh(n,t,e,s){const i=bh(n.options.borderRadius),o=(e-t)/2,a=Math.min(o,s*t/2),l=c=>{const d=(e-Math.min(o,c))*s/2;return it(c,0,Math.min(o,d))};return{outerStart:l(i.outerStart),outerEnd:l(i.outerEnd),innerStart:it(i.innerStart,0,a),innerEnd:it(i.innerEnd,0,a)}}function Ce(n,t,e,s){return{x:e+n*Math.cos(t),y:s+n*Math.sin(t)}}function $n(n,t,e,s,i,o){const{x:a,y:l,startAngle:c,pixelMargin:d,innerRadius:h}=t,f=Math.max(t.outerRadius+s+e-d,0),u=h>0?h+s+e+d:0;let p=0;const m=i-c;if(s){const B=h>0?h-s:0,D=f>0?f-s:0,E=(B+D)/2,O=E!==0?m*E/(E+s):m;p=(m-O)/2}const g=Math.max(.001,m*f-e/q)/f,b=(m-g)/2,y=c+b+p,w=i-b-p,{outerStart:_,outerEnd:k,innerStart:x,innerEnd:M}=yh(t,u,f,w-y),C=f-_,S=f-k,v=y+_/C,P=w-k/S,A=u+x,T=u+M,U=y+x/A,F=w-M/T;if(n.beginPath(),o){const B=(v+P)/2;if(n.arc(a,l,f,v,B),n.arc(a,l,f,B,P),k>0){const N=Ce(S,P,a,l);n.arc(N.x,N.y,k,P,w+tt)}const D=Ce(T,w,a,l);if(n.lineTo(D.x,D.y),M>0){const N=Ce(T,F,a,l);n.arc(N.x,N.y,M,w+tt,F+Math.PI)}const E=(w-M/u+(y+x/u))/2;if(n.arc(a,l,u,w-M/u,E,!0),n.arc(a,l,u,E,y+x/u,!0),x>0){const N=Ce(A,U,a,l);n.arc(N.x,N.y,x,U+Math.PI,y-tt)}const O=Ce(C,y,a,l);if(n.lineTo(O.x,O.y),_>0){const N=Ce(C,v,a,l);n.arc(N.x,N.y,_,y-tt,v)}}else{n.moveTo(a,l);const B=Math.cos(v)*f+a,D=Math.sin(v)*f+l;n.lineTo(B,D);const E=Math.cos(P)*f+a,O=Math.sin(P)*f+l;n.lineTo(E,O)}n.closePath()}function _h(n,t,e,s,i){const{fullCircles:o,startAngle:a,circumference:l}=t;let c=t.endAngle;if(o){$n(n,t,e,s,c,i);for(let d=0;d<o;++d)n.fill();isNaN(l)||(c=a+(l%K||K))}return $n(n,t,e,s,c,i),n.fill(),c}function xh(n,t,e,s,i){const{fullCircles:o,startAngle:a,circumference:l,options:c}=t,{borderWidth:d,borderJoinStyle:h,borderDash:f,borderDashOffset:u}=c,p=c.borderAlign==="inner";if(!d)return;n.setLineDash(f||[]),n.lineDashOffset=u,p?(n.lineWidth=d*2,n.lineJoin=h||"round"):(n.lineWidth=d,n.lineJoin=h||"bevel");let m=t.endAngle;if(o){$n(n,t,e,s,m,i);for(let g=0;g<o;++g)n.stroke();isNaN(l)||(m=a+(l%K||K))}p&&gh(n,t,m),o||($n(n,t,e,s,m,i),n.stroke())}class Ke extends $t{constructor(e){super();V(this,"circumference");V(this,"endAngle");V(this,"fullCircles");V(this,"innerRadius");V(this,"outerRadius");V(this,"pixelMargin");V(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,s,i){const o=this.getProps(["x","y"],i),{angle:a,distance:l}=Bi(o,{x:e,y:s}),{startAngle:c,endAngle:d,innerRadius:h,outerRadius:f,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,g=R(u,d-c)>=K||Fe(a,c,d),b=At(l,h+p,f+p);return g&&b}getCenterPoint(e){const{x:s,y:i,startAngle:o,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:d,spacing:h}=this.options,f=(o+a)/2,u=(l+c+h+d)/2;return{x:s+Math.cos(f)*u,y:i+Math.sin(f)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:s,circumference:i}=this,o=(s.offset||0)/4,a=(s.spacing||0)/2,l=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=i>K?Math.floor(i/K):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const c=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(c)*o,Math.sin(c)*o);const d=1-Math.sin(Math.min(q,i||0)),h=o*d;e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,_h(e,this,h,a,l),xh(e,this,h,a,l),e.restore()}}V(Ke,"id","arc"),V(Ke,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),V(Ke,"defaultRoutes",{backgroundColor:"backgroundColor"}),V(Ke,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Go(n,t,e=t){n.lineCap=R(e.borderCapStyle,t.borderCapStyle),n.setLineDash(R(e.borderDash,t.borderDash)),n.lineDashOffset=R(e.borderDashOffset,t.borderDashOffset),n.lineJoin=R(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=R(e.borderWidth,t.borderWidth),n.strokeStyle=R(e.borderColor,t.borderColor)}function kh(n,t,e){n.lineTo(e.x,e.y)}function wh(n){return n.stepped?Hl:n.tension||n.cubicInterpolationMode==="monotone"?Ul:kh}function Jo(n,t,e={}){const s=n.length,{start:i=0,end:o=s-1}=e,{start:a,end:l}=t,c=Math.max(i,a),d=Math.min(o,l),h=i<a&&o<a||i>l&&o>l;return{count:s,start:c,loop:t.loop,ilen:d<c&&!h?s+d-c:d-c}}function Ch(n,t,e,s){const{points:i,options:o}=t,{count:a,start:l,loop:c,ilen:d}=Jo(i,e,s),h=wh(o);let{move:f=!0,reverse:u}=s||{},p,m,g;for(p=0;p<=d;++p)m=i[(l+(u?d-p:p))%a],!m.skip&&(f?(n.moveTo(m.x,m.y),f=!1):h(n,g,m,u,o.stepped),g=m);return c&&(m=i[(l+(u?d:0))%a],h(n,g,m,u,o.stepped)),!!c}function Mh(n,t,e,s){const i=t.points,{count:o,start:a,ilen:l}=Jo(i,e,s),{move:c=!0,reverse:d}=s||{};let h=0,f=0,u,p,m,g,b,y;const w=k=>(a+(d?l-k:k))%o,_=()=>{g!==b&&(n.lineTo(h,b),n.lineTo(h,g),n.lineTo(h,y))};for(c&&(p=i[w(0)],n.moveTo(p.x,p.y)),u=0;u<=l;++u){if(p=i[w(u)],p.skip)continue;const k=p.x,x=p.y,M=k|0;M===m?(x<g?g=x:x>b&&(b=x),h=(f*h+k)/++f):(_(),n.lineTo(k,x),m=M,f=0,g=b=x),y=x}_()}function As(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Mh:Ch}function Sh(n){return n.stepped?Mc:n.tension||n.cubicInterpolationMode==="monotone"?Sc:le}function Dh(n,t,e,s){let i=t._path;i||(i=t._path=new Path2D,t.path(i,e,s)&&i.closePath()),Go(n,t.options),n.stroke(i)}function Bh(n,t,e,s){const{segments:i,options:o}=t,a=As(t);for(const l of i)Go(n,o,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+s-1})&&n.closePath(),n.stroke()}const vh=typeof Path2D=="function";function Eh(n,t,e,s){vh&&!t.options.segment?Dh(n,t,e,s):Bh(n,t,e,s)}class Kt extends $t{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 s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const i=s.spanGaps?this._loop:this._fullLoop;gc(this._points,s,t,i,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=Pc(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,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,i=t[e],o=this.points,a=oo(this,{property:e,start:i,end:i});if(!a.length)return;const l=[],c=Sh(s);let d,h;for(d=0,h=a.length;d<h;++d){const{start:f,end:u}=a[d],p=o[f],m=o[u];if(p===m){l.push(p);continue}const g=Math.abs((i-p[e])/(m[e]-p[e])),b=c(p,m,g,s.stepped);b[e]=t[e],l.push(b)}return l.length===1?l[0]:l}pathSegment(t,e,s){return As(this)(t,this,e,s)}path(t,e,s){const i=this.segments,o=As(this);let a=this._loop;e=e||0,s=s||this.points.length-e;for(const l of i)a&=o(t,this,l,{start:e,end:e+s-1});return!!a}draw(t,e,s,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Eh(t,this,s,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}V(Kt,"id","line"),V(Kt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),V(Kt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),V(Kt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Zo(n,t,e,s){const i=n.options,{[e]:o}=n.getProps([e],s);return Math.abs(t-o)<i.radius+i.hitRadius}class Ln extends $t{constructor(e){super();V(this,"parsed");V(this,"skip");V(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,s,i){const o=this.options,{x:a,y:l}=this.getProps(["x","y"],i);return Math.pow(e-a,2)+Math.pow(s-l,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,s){return Zo(this,e,"x",s)}inYRange(e,s){return Zo(this,e,"y",s)}getCenterPoint(e){const{x:s,y:i}=this.getProps(["x","y"],e);return{x:s,y:i}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);const i=s&&e.borderWidth||0;return(s+i)*2}draw(e,s){const i=this.options;this.skip||i.radius<.1||!Nt(this,s,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,bs(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}V(Ln,"id","point"),V(Ln,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),V(Ln,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Qo(n,t){const{x:e,y:s,base:i,width:o,height:a}=n.getProps(["x","y","base","width","height"],t);let l,c,d,h,f;return n.horizontal?(f=a/2,l=Math.min(e,i),c=Math.max(e,i),d=s-f,h=s+f):(f=o/2,l=e-f,c=e+f,d=Math.min(s,i),h=Math.max(s,i)),{left:l,top:d,right:c,bottom:h}}function Gt(n,t,e,s){return n?0:it(t,e,s)}function Vh(n,t,e){const s=n.options.borderWidth,i=n.borderSkipped,o=Wi(s);return{t:Gt(i.top,o.top,0,e),r:Gt(i.right,o.right,0,t),b:Gt(i.bottom,o.bottom,0,e),l:Gt(i.left,o.left,0,t)}}function Ph(n,t,e){const{enableBorderRadius:s}=n.getProps(["enableBorderRadius"]),i=n.options.borderRadius,o=oe(i),a=Math.min(t,e),l=n.borderSkipped,c=s||z(i);return{topLeft:Gt(!c||l.top||l.left,o.topLeft,0,a),topRight:Gt(!c||l.top||l.right,o.topRight,0,a),bottomLeft:Gt(!c||l.bottom||l.left,o.bottomLeft,0,a),bottomRight:Gt(!c||l.bottom||l.right,o.bottomRight,0,a)}}function Oh(n){const t=Qo(n),e=t.right-t.left,s=t.bottom-t.top,i=Vh(n,e/2,s/2),o=Ph(n,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:e-i.l-i.r,h:s-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function Fs(n,t,e,s){const i=t===null,o=e===null,l=n&&!(i&&o)&&Qo(n,s);return l&&(i||At(t,l.left,l.right))&&(o||At(e,l.top,l.bottom))}function Ah(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Fh(n,t){n.rect(t.x,t.y,t.w,t.h)}function Ns(n,t,e={}){const s=n.x!==e.x?-t:0,i=n.y!==e.y?-t:0,o=(n.x+n.w!==e.x+e.w?t:0)-s,a=(n.y+n.h!==e.y+e.h?t:0)-i;return{x:n.x+s,y:n.y+i,w:n.w+o,h:n.h+a,radius:n.radius}}class Rn extends $t{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:s,backgroundColor:i}}=this,{inner:o,outer:a}=Oh(this),l=Ah(a.radius)?Le:Fh;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),l(t,Ns(a,e,o)),t.clip(),l(t,Ns(o,-e,a)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),l(t,Ns(o,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,s){return Fs(this,t,e,s)}inXRange(t,e){return Fs(this,t,null,e)}inYRange(t,e){return Fs(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+i)/2:e,y:o?s:(s+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}V(Rn,"id","bar"),V(Rn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),V(Rn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Nh=Object.freeze({__proto__:null,ArcElement:Ke,BarElement:Rn,LineElement:Kt,PointElement:Ln});const Ts=["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)"],ta=Ts.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ea(n){return Ts[n%Ts.length]}function na(n){return ta[n%ta.length]}function Th(n,t){return n.borderColor=ea(t),n.backgroundColor=na(t),++t}function $h(n,t){return n.backgroundColor=n.data.map(()=>ea(t++)),t}function Lh(n,t){return n.backgroundColor=n.data.map(()=>na(t++)),t}function Rh(n){let t=0;return(e,s)=>{const i=n.getDatasetMeta(s).controller;i instanceof ce?t=$h(e,t):i instanceof Ie?t=Lh(e,t):i&&(t=Th(e,t))}}function sa(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function zh(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:s},options:i}=n.config,{elements:o}=i;if(!e.forceOverride&&(sa(s)||zh(i)||o&&sa(o)))return;const a=Rh(n);s.forEach(a)}};function Wh(n,t,e,s,i){const o=i.samples||s;if(o>=e)return n.slice(t,t+e);const a=[],l=(e-2)/(o-2);let c=0;const d=t+e-1;let h=t,f,u,p,m,g;for(a[c++]=n[h],f=0;f<o-2;f++){let b=0,y=0,w;const _=Math.floor((f+1)*l)+1+t,k=Math.min(Math.floor((f+2)*l)+1,e)+t,x=k-_;for(w=_;w<k;w++)b+=n[w].x,y+=n[w].y;b/=x,y/=x;const M=Math.floor(f*l)+1+t,C=Math.min(Math.floor((f+1)*l)+1,e)+t,{x:S,y:v}=n[h];for(p=m=-1,w=M;w<C;w++)m=.5*Math.abs((S-b)*(n[w].y-v)-(S-n[w].x)*(y-v)),m>p&&(p=m,u=n[w],g=w);a[c++]=u,h=g}return a[c++]=n[d],a}function Yh(n,t,e,s){let i=0,o=0,a,l,c,d,h,f,u,p,m,g;const b=[],y=t+e-1,w=n[t].x,k=n[y].x-w;for(a=t;a<t+e;++a){l=n[a],c=(l.x-w)/k*s,d=l.y;const x=c|0;if(x===h)d<m?(m=d,f=a):d>g&&(g=d,u=a),i=(o*i+l.x)/++o;else{const M=a-1;if(!I(f)&&!I(u)){const C=Math.min(f,u),S=Math.max(f,u);C!==p&&C!==M&&b.push({...n[C],x:i}),S!==p&&S!==M&&b.push({...n[S],x:i})}a>0&&M!==p&&b.push(n[M]),b.push(l),h=x,o=0,m=g=d,f=u=p=a}}return b}function ia(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 oa(n){n.data.datasets.forEach(t=>{ia(t)})}function jh(n,t){const e=t.length;let s=0,i;const{iScale:o}=n,{min:a,max:l,minDefined:c,maxDefined:d}=o.getUserBounds();return c&&(s=it(Ft(t,o.axis,a).lo,0,e-1)),d?i=it(Ft(t,o.axis,l).hi+1,s,e)-s:i=e-s,{start:s,count:i}}var Hh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){oa(n);return}const s=n.width;n.data.datasets.forEach((i,o)=>{const{_data:a,indexAxis:l}=i,c=n.getDatasetMeta(o),d=a||i.data;if(Re([l,n.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const h=n.scales[c.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:f,count:u}=jh(c,d);const p=e.threshold||4*s;if(u<=p){ia(i);return}I(a)&&(i._data=d,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=Wh(d,f,u,s,e);break;case"min-max":m=Yh(d,f,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}i._decimated=m})},destroy(n){oa(n)}};function Uh(n,t,e){const s=n.segments,i=n.points,o=t.points,a=[];for(const l of s){let{start:c,end:d}=l;d=Ls(c,d,i);const h=$s(e,i[c],i[d],l.loop);if(!t.segments){a.push({source:l,target:h,start:i[c],end:i[d]});continue}const f=oo(t,h);for(const u of f){const p=$s(e,o[u.start],o[u.end],u.loop),m=io(l,i,p);for(const g of m)a.push({source:g,target:u,start:{[e]:aa(h,p,"start",Math.max)},end:{[e]:aa(h,p,"end",Math.min)}})}}return a}function $s(n,t,e,s){if(s)return;let i=t[n],o=e[n];return n==="angle"&&(i=mt(i),o=mt(o)),{property:n,start:i,end:o}}function Xh(n,t){const{x:e=null,y:s=null}=n||{},i=t.points,o=[];return t.segments.forEach(({start:a,end:l})=>{l=Ls(a,l,i);const c=i[a],d=i[l];s!==null?(o.push({x:c.x,y:s}),o.push({x:d.x,y:s})):e!==null&&(o.push({x:e,y:c.y}),o.push({x:e,y:d.y}))}),o}function Ls(n,t,e){for(;t>n;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function aa(n,t,e,s){return n&&t?s(n[e],t[e]):n?n[e]:t?t[e]:0}function ra(n,t){let e=[],s=!1;return X(n)?(s=!0,e=n):e=Xh(n,t),e.length?new Kt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function la(n){return n&&n.fill!==!1}function qh(n,t,e){let i=n[t].fill;const o=[t];let a;if(!e)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!J(i))return i;if(a=n[i],!a)return!1;if(a.visible)return i;o.push(i),i=a.fill}return!1}function Kh(n,t,e){const s=Qh(n);if(z(s))return isNaN(s.value)?!1:s;let i=parseFloat(s);return J(i)&&Math.floor(i)===i?Gh(s[0],t,i,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Gh(n,t,e,s){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Jh(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:z(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Zh(n,t,e){let s;return n==="start"?s=e:n==="end"?s=t.options.reverse?t.min:t.max:z(n)?s=n.value:s=t.getBaseValue(),s}function Qh(n){const t=n.options,e=t.fill;let s=R(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function tf(n){const{scale:t,index:e,line:s}=n,i=[],o=s.segments,a=s.points,l=ef(t,e);l.push(ra({x:null,y:t.bottom},s));for(let c=0;c<o.length;c++){const d=o[c];for(let h=d.start;h<=d.end;h++)nf(i,a[h],l)}return new Kt({points:i,options:{}})}function ef(n,t){const e=[],s=n.getMatchingVisibleMetas("line");for(let i=0;i<s.length;i++){const o=s[i];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function nf(n,t,e){const s=[];for(let i=0;i<e.length;i++){const o=e[i],{first:a,last:l,point:c}=sf(o,t,"x");if(!(!c||a&&l)){if(a)s.unshift(c);else if(n.push(c),!l)break}}n.push(...s)}function sf(n,t,e){const s=n.interpolate(t,e);if(!s)return{};const i=s[e],o=n.segments,a=n.points;let l=!1,c=!1;for(let d=0;d<o.length;d++){const h=o[d],f=a[h.start][e],u=a[h.end][e];if(At(i,f,u)){l=i===f,c=i===u;break}}return{first:l,last:c,point:s}}class ca{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:i,y:o,radius:a}=this;return e=e||{start:0,end:K},t.arc(i,o,a,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:i}=this,o=t.angle;return{x:e+Math.cos(o)*i,y:s+Math.sin(o)*i,angle:o}}}function of(n){const{chart:t,fill:e,line:s}=n;if(J(e))return af(t,e);if(e==="stack")return tf(n);if(e==="shape")return!0;const i=rf(n);return i instanceof ca?i:ra(i,s)}function af(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function rf(n){return(n.scale||{}).getPointPositionForValue?cf(n):lf(n)}function lf(n){const{scale:t={},fill:e}=n,s=Jh(e,t);if(J(s)){const i=t.isHorizontal();return{x:i?s:null,y:i?null:s}}return null}function cf(n){const{scale:t,fill:e}=n,s=t.options,i=t.getLabels().length,o=s.reverse?t.max:t.min,a=Zh(e,t,o),l=[];if(s.grid.circular){const c=t.getPointPositionForValue(0,o);return new ca({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(a)})}for(let c=0;c<i;++c)l.push(t.getPointPositionForValue(c,a));return l}function Rs(n,t,e){const s=of(t),{line:i,scale:o,axis:a}=t,l=i.options,c=l.fill,d=l.backgroundColor,{above:h=d,below:f=d}=c||{};s&&i.points.length&&(yn(n,e),df(n,{line:i,target:s,above:h,below:f,area:e,scale:o,axis:a}),_n(n))}function df(n,t){const{line:e,target:s,above:i,below:o,area:a,scale:l}=t,c=e._loop?"angle":t.axis;n.save(),c==="x"&&o!==i&&(da(n,s,a.top),ha(n,{line:e,target:s,color:i,scale:l,property:c}),n.restore(),n.save(),da(n,s,a.bottom)),ha(n,{line:e,target:s,color:o,scale:l,property:c}),n.restore()}function da(n,t,e){const{segments:s,points:i}=t;let o=!0,a=!1;n.beginPath();for(const l of s){const{start:c,end:d}=l,h=i[c],f=i[Ls(c,d,i)];o?(n.moveTo(h.x,h.y),o=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(f.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function ha(n,t){const{line:e,target:s,property:i,color:o,scale:a}=t,l=Uh(e,s,i);for(const{source:c,target:d,start:h,end:f}of l){const{style:{backgroundColor:u=o}={}}=c,p=s!==!0;n.save(),n.fillStyle=u,hf(n,a,p&&$s(i,h,f)),n.beginPath();const m=!!e.pathSegment(n,c);let g;if(p){m?n.closePath():fa(n,s,f,i);const b=!!s.pathSegment(n,d,{move:m,reverse:!0});g=m&&b,g||fa(n,s,h,i)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function hf(n,t,e){const{top:s,bottom:i}=t.chart.chartArea,{property:o,start:a,end:l}=e||{};o==="x"&&(n.beginPath(),n.rect(a,s,l-a,i-s),n.clip())}function fa(n,t,e,s){const i=t.interpolate(e,s);i&&n.lineTo(i.x,i.y)}var ff={id:"filler",afterDatasetsUpdate(n,t,e){const s=(n.data.datasets||[]).length,i=[];let o,a,l,c;for(a=0;a<s;++a)o=n.getDatasetMeta(a),l=o.dataset,c=null,l&&l.options&&l instanceof Kt&&(c={visible:n.isDatasetVisible(a),index:a,fill:Kh(l,a,s),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:l}),o.$filler=c,i.push(c);for(a=0;a<s;++a)c=i[a],!(!c||c.fill===!1)&&(c.fill=qh(i,a,e.propagate))},beforeDraw(n,t,e){const s=e.drawTime==="beforeDraw",i=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let a=i.length-1;a>=0;--a){const l=i[a].$filler;l&&(l.line.updateControlPoints(o,l.axis),s&&l.fill&&Rs(n.ctx,l,o))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=n.getSortedVisibleDatasetMetas();for(let i=s.length-1;i>=0;--i){const o=s[i].$filler;la(o)&&Rs(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const s=t.meta.$filler;!la(s)||e.drawTime!=="beforeDatasetDraw"||Rs(n.ctx,s,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ua=(n,t)=>{let{boxHeight:e=t,boxWidth:s=t}=n;return n.usePointStyle&&(e=Math.min(e,t),s=n.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},uf=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class pa extends $t{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=H(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,i)=>t.sort(s,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,i=nt(s.font),o=i.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=ua(s,o);let d,h;e.font=i.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,o,l,c)+10):(h=this.maxHeight,d=this._fitCols(a,i,l,c)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,i){const{ctx:o,maxWidth:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],h=i+l;let f=t;o.textAlign="left",o.textBaseline="middle";let u=-1,p=-h;return this.legendItems.forEach((m,g)=>{const b=s+e/2+o.measureText(m.text).width;(g===0||d[d.length-1]+b+2*l>a)&&(f+=h,d[d.length-(g>0?0:1)]=0,p+=h,u++),c[g]={left:0,top:p,row:u,width:b,height:i},d[d.length-1]+=b+l}),f}_fitCols(t,e,s,i){const{ctx:o,maxHeight:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let f=l,u=0,p=0,m=0,g=0;return this.legendItems.forEach((b,y)=>{const{itemWidth:w,itemHeight:_}=pf(s,e,o,b,i);y>0&&p+_+2*l>h&&(f+=u+l,d.push({width:u,height:p}),m+=u+l,g++,u=p=0),c[y]={left:m,top:p,col:g,width:w,height:_},u=Math.max(u,w),p+=_+l}),f+=u,d.push({width:u,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:i},rtl:o}}=this,a=we(o,this.left,this.width);if(this.isHorizontal()){let l=0,c=at(s,this.left+i,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,c=at(s,this.left+i,this.right-this.lineWidths[l])),d.top+=this.top+t+i,d.left=a.leftForLtr(a.x(c),d.width),c+=d.width+i}else{let l=0,c=at(s,this.top+t+i,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,c=at(s,this.top+t+i,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+i,d.left=a.leftForLtr(a.x(d.left),d.width),c+=d.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;yn(t,this),this._draw(),_n(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:i}=this,{align:o,labels:a}=t,l=Z.color,c=we(t.rtl,this.left,this.width),d=nt(a.font),{padding:h}=a,f=d.size,u=f/2;let p;this.drawTitle(),i.textAlign=c.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=d.string;const{boxWidth:m,boxHeight:g,itemHeight:b}=ua(a,f),y=function(M,C,S){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;i.save();const v=R(S.lineWidth,1);if(i.fillStyle=R(S.fillStyle,l),i.lineCap=R(S.lineCap,"butt"),i.lineDashOffset=R(S.lineDashOffset,0),i.lineJoin=R(S.lineJoin,"miter"),i.lineWidth=v,i.strokeStyle=R(S.strokeStyle,l),i.setLineDash(R(S.lineDash,[])),a.usePointStyle){const P={radius:g*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:v},A=c.xPlus(M,m/2),T=C+u;Ii(i,P,A,T,a.pointStyleWidth&&m)}else{const P=C+Math.max((f-g)/2,0),A=c.leftForLtr(M,m),T=oe(S.borderRadius);i.beginPath(),Object.values(T).some(U=>U!==0)?Le(i,{x:A,y:P,w:m,h:g,radius:T}):i.rect(A,P,m,g),i.fill(),v!==0&&i.stroke()}i.restore()},w=function(M,C,S){ie(i,S.text,M,C+b/2,d,{strikethrough:S.hidden,textAlign:c.textAlign(S.textAlign)})},_=this.isHorizontal(),k=this._computeTitleHeight();_?p={x:at(o,this.left+h,this.right-s[0]),y:this.top+h+k,line:0}:p={x:this.left+h,y:at(o,this.top+k+h,this.bottom-e[0].height),line:0},to(this.ctx,t.textDirection);const x=b+h;this.legendItems.forEach((M,C)=>{i.strokeStyle=M.fontColor,i.fillStyle=M.fontColor;const S=i.measureText(M.text).width,v=c.textAlign(M.textAlign||(M.textAlign=a.textAlign)),P=m+u+S;let A=p.x,T=p.y;c.setWidth(this.width),_?C>0&&A+P+h>this.right&&(T=p.y+=x,p.line++,A=p.x=at(o,this.left+h,this.right-s[p.line])):C>0&&T+x>this.bottom&&(A=p.x=A+e[p.line].width+h,p.line++,T=p.y=at(o,this.top+k+h,this.bottom-e[p.line].height));const U=c.x(A);if(y(U,T,M),A=Fl(v,A+m+u,_?A+P:this.right,t.rtl),w(c.x(A),T,M),_)p.x+=P+h;else if(typeof M.text!="string"){const F=d.lineHeight;p.y+=ma(M,F)+h}else p.y+=x}),eo(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=nt(e.font),i=rt(e.padding);if(!e.display)return;const o=we(t.rtl,this.left,this.width),a=this.ctx,l=e.position,c=s.size/2,d=i.top+c;let h,f=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+d,f=at(t.align,f,this.right-u);else{const m=this.columnSizes.reduce((g,b)=>Math.max(g,b.height),0);h=d+at(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=at(l,f,f+u);a.textAlign=o.textAlign(fs(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,ie(a,e.text,p,h,s)}_computeTitleHeight(){const t=this.options.title,e=nt(t.font),s=rt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,i,o;if(At(t,this.left,this.right)&&At(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(i=o[s],At(t,i.left,i.left+i.width)&&At(e,i.top,i.top+i.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!bf(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=uf(i,s);i&&!o&&H(e.onLeave,[t,i,this],this),this._hoveredItem=s,s&&!o&&H(e.onHover,[t,s,this],this)}else s&&H(e.onClick,[t,s,this],this)}}function pf(n,t,e,s,i){const o=mf(s,n,t,e),a=gf(i,s,t.lineHeight);return{itemWidth:o,itemHeight:a}}function mf(n,t,e,s){let i=n.text;return i&&typeof i!="string"&&(i=i.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+s.measureText(i).width}function gf(n,t,e){let s=n;return typeof t.text!="string"&&(s=ma(t,e)),s}function ma(n,t){const e=n.text?n.text.length:0;return t*e}function bf(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var yf={id:"legend",_element:pa,start(n,t,e){const s=n.legend=new pa({ctx:n.ctx,options:e,chart:n});lt.configure(n,s,e),lt.addBox(n,s)},stop(n){lt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const s=n.legend;lt.configure(n,s,e),s.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 s=t.datasetIndex,i=e.chart;i.isDatasetVisible(s)?(i.hide(s),t.hidden=!0):(i.show(s),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:s,textAlign:i,color:o,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(e?0:void 0),h=rt(d.borderWidth);return{text:t[c.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:s||d.pointStyle,rotation:d.rotation,textAlign:i||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:c.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 zs extends $t{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 s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const i=X(s.text)?s.text.length:1;this._padding=rt(s.padding);const o=i*nt(s.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:s,bottom:i,right:o,options:a}=this,l=a.align;let c=0,d,h,f;return this.isHorizontal()?(h=at(l,s,o),f=e+t,d=o-s):(a.position==="left"?(h=s+t,f=at(l,i,e),c=q*-.5):(h=o-t,f=at(l,e,i),c=q*.5),d=i-e),{titleX:h,titleY:f,maxWidth:d,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=nt(e.font),o=s.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(o);ie(t,e.text,0,0,s,{color:e.color,maxWidth:c,rotation:d,textAlign:fs(e.align),textBaseline:"middle",translation:[a,l]})}}function _f(n,t){const e=new zs({ctx:n.ctx,options:t,chart:n});lt.configure(n,e,t),lt.addBox(n,e),n.titleBlock=e}var xf={id:"title",_element:zs,start(n,t,e){_f(n,e)},stop(n){const t=n.titleBlock;lt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const s=n.titleBlock;lt.configure(n,s,e),s.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 zn=new WeakMap;var kf={id:"subtitle",start(n,t,e){const s=new zs({ctx:n.ctx,options:e,chart:n});lt.configure(n,s,e),lt.addBox(n,s),zn.set(n,s)},stop(n){lt.removeBox(n,zn.get(n)),zn.delete(n)},beforeUpdate(n,t,e){const s=zn.get(n);lt.configure(n,s,e),s.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 Ge={average(n){if(!n.length)return!1;let t,e,s=0,i=0,o=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s+=l.x,i+=l.y,++o}}return{x:s/o,y:i/o}},nearest(n,t){if(!n.length)return!1;let e=t.x,s=t.y,i=Number.POSITIVE_INFINITY,o,a,l;for(o=0,a=n.length;o<a;++o){const c=n[o].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),h=ds(t,d);h<i&&(i=h,l=c)}}if(l){const c=l.tooltipPosition();e=c.x,s=c.y}return{x:e,y:s}}};function Bt(n,t){return t&&(X(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Rt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
24
24
|
`)>-1?n.split(`
|
|
25
|
-
`):n}function Xh(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 ia(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:a,boxHeight:r}=t,c=et(t.bodyFont),d=et(t.titleFont),h=et(t.footerFont),f=o.length,u=s.length,p=i.length,m=rt(t.padding);let g=m.height,b=0,_=i.reduce((C,y)=>C+y.before.length+y.lines.length+y.after.length,0);if(_+=n.beforeBody.length+n.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),_){const C=t.displayColors?Math.max(r,c.lineHeight):c.lineHeight;g+=p*C+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let x=0;const M=function(C){b=Math.max(b,e.measureText(C).width+x)};return e.save(),e.font=d.string,Y(n.title,M),e.font=c.string,Y(n.beforeBody.concat(n.afterBody),M),x=t.displayColors?a+2+t.boxPadding:0,Y(i,C=>{Y(C.before,M),Y(C.lines,M),Y(C.after,M)}),x=0,e.font=h.string,Y(n.footer,M),e.restore(),b+=m.width,{width:b,height:g}}function qh(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Kh(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 Gh(n,t,e,i){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:c}}=n;let d="center";return i==="center"?d=s<=(r+c)/2?"left":"right":s<=o/2?d="left":s>=a-o/2&&(d="right"),Kh(d,n,t,e)&&(d="center"),d}function sa(n,t,e){const i=e.yAlign||t.yAlign||qh(n,e);return{xAlign:e.xAlign||t.xAlign||Gh(n,t,e,i),yAlign:i}}function Jh(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Zh(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function oa(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=n,{xAlign:r,yAlign:c}=e,d=s+o,{topLeft:h,topRight:f,bottomLeft:u,bottomRight:p}=ie(a);let m=Jh(t,r);const g=Zh(t,c,d);return c==="center"?r==="left"?m+=d:r==="right"&&(m-=d):r==="left"?m-=Math.max(h,u)+s:r==="right"&&(m+=Math.max(f,p)+s),{x:st(m,0,i.width-t.width),y:st(g,0,i.height-t.height)}}function Rn(n,t,e){const i=rt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function aa(n){return Dt([],Nt(n))}function Qh(n,t,e){return jt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ra(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const la={beforeTitle:Bt,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:Bt,beforeBody:Bt,beforeLabel:Bt,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:Bt,afterBody:Bt,beforeFooter:Bt,footer:Bt,afterFooter:Bt};function dt(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?la[t].call(e,i):s}class Li extends Ft{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 Gs(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Qh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=dt(i,"beforeTitle",this,t),o=dt(i,"title",this,t),a=dt(i,"afterTitle",this,t);let r=[];return r=Dt(r,Nt(s)),r=Dt(r,Nt(o)),r=Dt(r,Nt(a)),r}getBeforeBody(t,e){return aa(dt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return Y(t,o=>{const a={before:[],lines:[],after:[]},r=ra(i,o);Dt(a.before,Nt(dt(r,"beforeLabel",this,o))),Dt(a.lines,dt(r,"label",this,o)),Dt(a.after,Nt(dt(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return aa(dt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=dt(i,"beforeFooter",this,t),o=dt(i,"footer",this,t),a=dt(i,"afterFooter",this,t);let r=[];return r=Dt(r,Nt(s)),r=Dt(r,Nt(o)),r=Dt(r,Nt(a)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],a=[];let r=[],c,d;for(c=0,d=e.length;c<d;++c)r.push(Xh(this.chart,e[c]));return t.filter&&(r=r.filter((h,f,u)=>t.filter(h,f,u,i))),t.itemSort&&(r=r.sort((h,f)=>t.itemSort(h,f,i))),Y(r,h=>{const f=ra(t.callbacks,h);s.push(dt(f,"labelColor",this,h)),o.push(dt(f,"labelPointStyle",this,h)),a.push(dt(f,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=qe[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 c=this._size=ia(this,i),d=Object.assign({},r,c),h=sa(this.chart,i,d),f=oa(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:f.x,y:f.y,width:c.width,height:c.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:c,topRight:d,bottomLeft:h,bottomRight:f}=ie(r),{x:u,y:p}=t,{width:m,height:g}=e;let b,_,x,M,C,y;return o==="center"?(C=p+g/2,s==="left"?(b=u,_=b-a,M=C+a,y=C-a):(b=u+m,_=b+a,M=C-a,y=C+a),x=b):(s==="left"?_=u+Math.max(c,h)+a:s==="right"?_=u+m-Math.max(d,f)-a:_=this.caretX,o==="top"?(M=p,C=M-a,b=_-a,x=_+a):(M=p+g,C=M+a,b=_+a,x=_-a),y=M),{x1:b,x2:_,x3:x,y1:M,y2:C,y3:y}}drawTitle(t,e,i){const s=this.title,o=s.length;let a,r,c;if(o){const d=xe(i.rtl,this.x,this.width);for(t.x=Rn(this,i.titleAlign,i),e.textAlign=d.textAlign(i.titleAlign),e.textBaseline="middle",a=et(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,c=0;c<o;++c)e.fillText(s[c],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,c+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,s,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:c,boxWidth:d}=o,h=et(o.bodyFont),f=Rn(this,"left",o),u=s.x(f),p=c<h.lineHeight?(h.lineHeight-c)/2:0,m=e.y+p;if(o.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},b=s.leftForLtr(u,d)+d/2,_=m+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ui(t,g,b,_),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ui(t,g,b,_)}else{t.lineWidth=z(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 g=s.leftForLtr(u,d),b=s.leftForLtr(s.xPlus(u,1),d-2),_=ie(a.borderRadius);Object.values(_).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Ne(t,{x:g,y:m,w:d,h:c,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Ne(t,{x:b,y:m+1,w:d-2,h:c-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,m,d,c),t.strokeRect(g,m,d,c),t.fillStyle=a.backgroundColor,t.fillRect(b,m+1,d-2,c-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:c,boxWidth:d,boxPadding:h}=i,f=et(i.bodyFont);let u=f.lineHeight,p=0;const m=xe(i.rtl,this.x,this.width),g=function(S){e.fillText(S,m.x(t.x+p),t.y+u/2),t.y+=u+o},b=m.textAlign(a);let _,x,M,C,y,w,k;for(e.textAlign=a,e.textBaseline="middle",e.font=f.string,t.x=Rn(this,b,i),e.fillStyle=i.bodyColor,Y(this.beforeBody,g),p=r&&b!=="right"?a==="center"?d/2+h:d+2+h:0,C=0,w=s.length;C<w;++C){for(_=s[C],x=this.labelTextColors[C],e.fillStyle=x,Y(_.before,g),M=_.lines,r&&M.length&&(this._drawColorBox(e,t,C,m,i),u=Math.max(f.lineHeight,c)),y=0,k=M.length;y<k;++y)g(M[y]),u=f.lineHeight;Y(_.after,g)}p=0,u=f.lineHeight,Y(this.afterBody,g),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let a,r;if(o){const c=xe(i.rtl,this.x,this.width);for(t.x=Rn(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=c.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],c.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:c}=t,{width:d,height:h}=i,{topLeft:f,topRight:u,bottomLeft:p,bottomRight:m}=ie(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+f,c),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(r+d-u,c),e.quadraticCurveTo(r+d,c,r+d,c+u),a==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(r+d,c+h-m),e.quadraticCurveTo(r+d,c+h,r+d-m,c+h),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(r+p,c+h),e.quadraticCurveTo(r,c+h,r,c+h-p),a==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(r,c+f),e.quadraticCurveTo(r,c,r+f,c),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=qe[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=ia(this,t),c=Object.assign({},a,this._size),d=sa(e,t,c),h=oa(t,c,d,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=rt(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),Is(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Ws(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:r,index:c})=>{const d=this.chart.getDatasetMeta(r);if(!d)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:d.data[c],index:c}}),o=!dn(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),c=e||!dn(a,o)||r;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),c}_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=qe[o.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}v(Li,"positioners",qe);var tf={id:"tooltip",_element:Li,positioners:qe,afterInit(n,t,e){e&&(n.tooltip=new Li({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:la},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"]},ef=Object.freeze({__proto__:null,Colors:uh,Decimation:bh,Filler:Lh,Legend:Yh,SubTitle:Uh,Title:jh,Tooltip:tf});const nf=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function sf(n,t,e,i){const s=n.indexOf(t);if(s===-1)return nf(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const of=(n,t)=>n===null?null:st(Math.round(n),0,t);function ca(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class $i extends ce{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:sf(i,t,$(e,t),this._addedLabels),of(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 ca.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}}v($i,"id","category"),v($i,"defaults",{ticks:{callback:ca}});function af(n,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:c,count:d,maxTicks:h,maxDigits:f,includeBounds:u}=n,p=o||1,m=h-1,{min:g,max:b}=t,_=!I(a),x=!I(r),M=!I(d),C=(b-g)/(f+1);let y=hs((b-g)/m/p)*p,w,k,S,V;if(y<1e-14&&!_&&!x)return[{value:g},{value:b}];V=Math.ceil(b/y)-Math.floor(g/y),V>m&&(y=hs(V*y/m/p)*p),I(c)||(w=Math.pow(10,c),y=Math.ceil(y*w)/w),s==="ticks"?(k=Math.floor(g/y)*y,S=Math.ceil(b/y)*y):(k=g,S=b),_&&x&&o&&Qr((r-a)/o,y/1e3)?(V=Math.round(Math.min((r-a)/y,h)),y=(r-a)/V,k=a,S=r):M?(k=_?a:k,S=x?r:S,V=d-1,y=(S-k)/V):(V=(S-k)/y,Pe(V,Math.round(V),y/1e3)?V=Math.round(V):V=Math.ceil(V));const P=Math.max(us(y),us(k));w=Math.pow(10,I(c)?P:c),k=Math.round(k*w)/w,S=Math.round(S*w)/w;let A=0;for(_&&(u&&k!==a?(e.push({value:a}),k<a&&A++,Pe(Math.round((k+A*y)*w)/w,a,da(a,C,n))&&A++):k<a&&A++);A<V;++A){const N=Math.round((k+A*y)*w)/w;if(x&&N>r)break;e.push({value:N})}return x&&u&&S!==r?e.length&&Pe(e[e.length-1].value,r,da(r,C,n))?e[e.length-1].value=r:e.push({value:r}):(!x||S===r)&&e.push({value:S}),e}function da(n,t,{horizontal:e,minRotation:i}){const s=kt(i),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/o,a)}class zn extends ce{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=c=>s=e?s:c,r=c=>o=i?o:c;if(t){const c=Mt(s),d=Mt(o);c<0&&d<0?r(0):c>0&&d>0&&a(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);r(o+c),t||a(s-c)}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=af(s,o);return t.bounds==="ticks"&&fs(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 Fe(t,this.chart.options.locale,this.options.ticks.format)}}class Ri extends zn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?t:0,this.max=J(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=kt(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}}v(Ri,"id","linear"),v(Ri,"defaults",{ticks:{callback:pn.formatters.numeric}});const Ke=n=>Math.floor(Ht(n)),de=(n,t)=>Math.pow(10,Ke(n)+t);function ha(n){return n/Math.pow(10,Ke(n))===1}function fa(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function rf(n,t){const e=t-n;let i=Ke(e);for(;fa(n,t,i)>10;)i++;for(;fa(n,t,i)<10;)i--;return Math.min(i,Ke(n))}function lf(n,{min:t,max:e}){t=pt(n.min,t);const i=[],s=Ke(t);let o=rf(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),c=s>o?Math.pow(10,s):0,d=Math.round((t-c)*a)/a,h=Math.floor((t-c)/r/10)*r*10;let f=Math.floor((d-h)/Math.pow(10,o)),u=pt(n.min,Math.round((c+h+f*Math.pow(10,o))*a)/a);for(;u<e;)i.push({value:u,major:ha(u),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,a=o>=0?1:a),u=Math.round((c+h+f*Math.pow(10,o))*a)/a;const p=pt(n.max,u);return i.push({value:p,major:ha(p),significand:f}),i}class zi extends ce{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=zn.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return J(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?Math.max(0,t):null,this.max=J(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!J(this._userMin)&&(this.min=t===de(this.min,0)?de(this.min,-1):de(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(de(i,-1)),a(de(s,1)))),i<=0&&o(de(s,-1)),s<=0&&a(de(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=lf(e,this);return t.bounds==="ticks"&&fs(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":Fe(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ht(t),this._valueRange=Ht(this.max)-Ht(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ht(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}v(zi,"id","logarithmic"),v(zi,"defaults",{ticks:{callback:pn.formatters.logarithmic,major:{enabled:!0}}});function Ii(n){const t=n.ticks;if(t.display&&n.display){const e=rt(t.backdropPadding);return $(t.font&&t.font.size,Z.font.size)+e.height}return 0}function cf(n,t,e){return e=X(e)?e:[e],{w:gl(n,t.string,e),h:e.length*t.lineHeight}}function ua(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 df(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 c=0;c<o;c++){const d=a.setContext(n.getPointLabelContext(c));s[c]=d.padding;const h=n.getPointPosition(c,n.drawingArea+s[c],r),f=et(d.font),u=cf(n.ctx,f,n._pointLabels[c]);i[c]=u;const p=mt(n.getIndexAngle(c)+r),m=Math.round(oi(p)),g=ua(m,h.x,u.w,0,180),b=ua(m,h.y,u.h,90,270);hf(e,t,p,g,b)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=pf(n,i,s)}function hf(n,t,e,i,s){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,c=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?(c=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-c)):s.end>t.b&&(c=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+c))}function ff(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=e,c=n.getPointPosition(t,i+s+a,o),d=Math.round(oi(mt(c.angle+tt))),h=bf(c.y,r.h,d),f=mf(d),u=gf(c.x,r.w,f);return{visible:!0,x:c.x,y:h,textAlign:f,left:u,top:h,right:u+r.w,bottom:h+r.h}}function uf(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;return!(Ot({x:e,y:i},t)||Ot({x:e,y:o},t)||Ot({x:s,y:i},t)||Ot({x:s,y:o},t))}function pf(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:a,display:r}=o.pointLabels,c={extra:Ii(o)/2,additionalAngle:a?q/s:0};let d;for(let h=0;h<s;h++){c.padding=e[h],c.size=t[h];const f=ff(n,h,c);i.push(f),r==="auto"&&(f.visible=uf(f,d),f.visible&&(d=f))}return i}function mf(n){return n===0||n===180?"center":n<180?"left":"right"}function gf(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function bf(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function yf(n,t,e){const{left:i,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!I(r)){const c=ie(t.borderRadius),d=rt(t.backdropPadding);n.fillStyle=r;const h=i-d.left,f=s-d.top,u=o-i+d.width,p=a-s+d.height;Object.values(c).some(m=>m!==0)?(n.beginPath(),Ne(n,{x:h,y:f,w:u,h:p,radius:c}),n.fill()):n.fillRect(h,f,u,p)}}function _f(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));yf(e,a,o);const r=et(a.font),{x:c,y:d,textAlign:h}=o;ne(e,n._pointLabels[s],c,d+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function pa(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 xf(n,t,e,i,s){const o=n.ctx,a=t.circular,{color:r,lineWidth:c}=t;!a&&!i||!r||!c||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=c,o.setLineDash(s.dash),o.lineDashOffset=s.dashOffset,o.beginPath(),pa(n,e,a,i),o.closePath(),o.stroke(),o.restore())}function kf(n,t,e){return jt(n,{label:e,index:t,type:"pointLabel"})}class Ge extends zn{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=rt(Ii(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=J(t)&&!isNaN(t)?t:0,this.max=J(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ii(this.options))}generateTickLabels(t){zn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=j(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?df(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 mt(t*e+kt(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 kf(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(),pa(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,c,d;if(e.pointLabels.display&&_f(this,a),s.display&&this.ticks.forEach((h,f)=>{if(f!==0){c=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(f),p=s.setContext(u),m=o.setContext(u);xf(this,p,c,a,m)}}),i.display){for(t.save(),r=a-1;r>=0;r--){const h=i.setContext(this.getPointLabelContext(r)),{color:f,lineWidth:u}=h;!u||!f||(t.lineWidth=u,t.strokeStyle=f,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,c=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),d=this.getPointPosition(r,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.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,c)=>{if(c===0&&!e.reverse)return;const d=i.setContext(this.getContext(c)),h=et(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(r.label).width,t.fillStyle=d.backdropColor;const f=rt(d.backdropPadding);t.fillRect(-a/2-f.left,-o-h.size/2-f.top,a+f.width,h.size+f.height)}ne(t,r.label,0,-o,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}v(Ge,"id","radialLinear"),v(Ge,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:pn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),v(Ge,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),v(Ge,"descriptors",{angleLines:{_fallback:"grid"}});const In={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ht=Object.keys(In);function ma(n,t){return n-t}function ga(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)),J(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(be(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function ba(n,t,e,i){const s=ht.length;for(let o=ht.indexOf(n);o<s-1;++o){const a=In[ht[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=i)return ht[o]}return ht[s-1]}function wf(n,t,e,i,s){for(let o=ht.length-1;o>=ht.indexOf(e);o--){const a=ht[o];if(In[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return ht[e?ht.indexOf(e):0]}function Cf(n){for(let t=ht.indexOf(n)+1,e=ht.length;t<e;++t)if(In[ht[t]].common)return ht[t]}function ya(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=ri(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function Mf(n,t,e,i){const s=n._adapter,o=+s.startOf(t[0].value,i),a=t[t.length-1].value;let r,c;for(r=o;r<=a;r=+s.add(r,1,i))c=e[r],c>=0&&(t[c].major=!0);return t}function _a(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:Mf(n,i,s,e)}class Je extends ce{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 Oc._date(t.adapters.date);s.init(e),Be(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:ga(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 c(d){!a&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!r&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!a||!r)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=J(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=J(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=il(s,o,a);return this._unit=e.unit||(i.autoSkip?ba(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):wf(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Cf(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),_a(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=st(e,0,a),i=st(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||ba(o.minUnit,e,i,this._getLabelCapacity(e)),r=$(s.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,d=be(c)||c===!0,h={};let f=e,u,p;if(d&&(f=+t.startOf(f,"isoWeek",c)),f=+t.startOf(f,d?"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 m=s.ticks.source==="data"&&this.getDataTimestamps();for(u=f,p=0;u<i;u=+t.add(u,r,a),p++)ya(h,u,m);return(u===i||s.bounds==="ticks"||p===1)&&ya(h,u,m),Object.keys(h).sort(ma).map(g=>+g)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const 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 j(a,[t,e,i],this);const r=o.time.displayFormats,c=this._unit,d=this._majorUnit,h=c&&r[c],f=d&&r[d],u=i[e],p=d&&f&&u&&u.major;return this._adapter.format(t,s||(p?f:h))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=kt(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,_a(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(ga(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return bs(t.sort(ma))}}v(Je,"id","time"),v(Je,"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 Wn(n,t,e){let i=0,s=n.length-1,o,a,r,c;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Pt(n,"pos",t)),{pos:o,time:r}=n[i],{pos:a,time:c}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Pt(n,"time",t)),{time:o,pos:r}=n[i],{time:a,pos:c}=n[s]);const d=a-o;return d?r+(c-r)*(t-o)/d:r}class Wi extends Je{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=Wn(e,this.min),this._tableRange=Wn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let a,r,c,d,h;for(a=0,r=t.length;a<r;++a)d=t[a],d>=e&&d<=i&&s.push(d);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,r=s.length;a<r;++a)h=s[a+1],c=s[a-1],d=s[a],Math.round((h+c)/2)!==d&&o.push({time:d,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(Wn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Wn(this._table,i*this._tableRange+this._minPos,!0)}}v(Wi,"id","timeseries"),v(Wi,"defaults",Je.defaults);var Sf=Object.freeze({__proto__:null,CategoryScale:$i,LinearScale:Ri,LogarithmicScale:zi,RadialLinearScale:Ge,TimeScale:Je,TimeSeriesScale:Wi});const Df=[Pc,rh,ef,Sf];Tt.register(...Df);const Ef={class:"px-24 py-16"},Vf={class:"flex flex-col gap-8"},Bf={class:"fm-color-typo-primary fm-typo-body-lg-400"},vf={class:"fm-color-typo-secondary fm-typo-body-md-400"},Pf=l.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{}},setup(n){const t=n,e=l.ref(null);let i=null;l.watch([()=>t.xAxis,()=>t.datasets],()=>{i&&(i.data.datasets=t.datasets,i.data.labels=t.xAxis.categories,i.update())});function s(d,h){const f=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(d);if(f)return`rgba(${parseInt(f[1],16)},${parseInt(f[2],16)},${parseInt(f[3],16)},${h})`;if(d.startsWith("rgb")){const u=d.split(",");if(u.length===3)return[...u.slice(0,2),u[2].replace(")",`,${h})`)].join(",");if(u.length===4)return[...u.slice(0,3),`${h})`].join(",")}return""}function o(d){const h=getComputedStyle(document.documentElement).getPropertyValue(`--${d}`)||d;return h.startsWith("rgb")||h.startsWith("#")?h:null}function a({context:d,color:h}){const{ctx:f,chartArea:u}=d.chart;if(!u)return;const p=f==null?void 0:f.createLinearGradient(0,0,0,u.height);return p.addColorStop(0,s(h,.5)),p.addColorStop(1,s(h,0)),p}const r=l.computed(()=>({labels:t.xAxis.categories,datasets:t.datasets.map(d=>{const h=o(d.color)??"";return{...d,backgroundColor:h?f=>a({context:f,color:h}):"",borderColor:h,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));function c(){e.value&&(i=new Tt(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 l.onMounted(()=>{c()}),(d,h)=>(l.openBlock(),l.createElementBlock("div",Ef,[l.createElementVNode("div",Vf,[l.createElementVNode("div",Bf,l.toDisplayString(d.name),1),l.createElementVNode("div",vf,l.toDisplayString(d.paragraph),1)]),l.createElementVNode("canvas",{ref_key:"canvas",ref:e},null,512)]))}});var Of=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Af(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var xa={exports:{}};(function(n,t){(function(e,i){n.exports=i()})(Of,function(){var e=1e3,i=6e4,s=36e5,o="millisecond",a="second",r="minute",c="hour",d="day",h="week",f="month",u="quarter",p="year",m="date",g="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={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(F){var E=["th","st","nd","rd"],D=F%100;return"["+F+(E[(D-20)%10]||E[D]||E[0])+"]"}},M=function(F,E,D){var B=String(F);return!B||B.length>=E?F:""+Array(E+1-B.length).join(D)+F},C={s:M,z:function(F){var E=-F.utcOffset(),D=Math.abs(E),B=Math.floor(D/60),O=D%60;return(E<=0?"+":"-")+M(B,2,"0")+":"+M(O,2,"0")},m:function F(E,D){if(E.date()<D.date())return-F(D,E);var B=12*(D.year()-E.year())+(D.month()-E.month()),O=E.clone().add(B,f),T=D-O<0,L=E.clone().add(B+(T?-1:1),f);return+(-(B+(D-O)/(T?O-L:L-O))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:f,y:p,w:h,d,D:m,h:c,m:r,s:a,ms:o,Q:u}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},y="en",w={};w[y]=x;var k="$isDayjsObject",S=function(F){return F instanceof N||!(!F||!F[k])},V=function F(E,D,B){var O;if(!E)return y;if(typeof E=="string"){var T=E.toLowerCase();w[T]&&(O=T),D&&(w[T]=D,O=T);var L=E.split("-");if(!O&&L.length>1)return F(L[0])}else{var W=E.name;w[W]=E,O=W}return!B&&O&&(y=O),O||!B&&y},P=function(F,E){if(S(F))return F.clone();var D=typeof E=="object"?E:{};return D.date=F,D.args=arguments,new N(D)},A=C;A.l=V,A.i=S,A.w=function(F,E){return P(F,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var N=function(){function F(D){this.$L=V(D.locale,null,!0),this.parse(D),this.$x=this.$x||D.x||{},this[k]=!0}var E=F.prototype;return E.parse=function(D){this.$d=function(B){var O=B.date,T=B.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 L=O.match(b);if(L){var W=L[2]-1||0,H=(L[7]||"0").substring(0,3);return T?new Date(Date.UTC(L[1],W,L[3]||1,L[4]||0,L[5]||0,L[6]||0,H)):new Date(L[1],W,L[3]||1,L[4]||0,L[5]||0,L[6]||0,H)}}return new Date(O)}(D),this.init()},E.init=function(){var D=this.$d;this.$y=D.getFullYear(),this.$M=D.getMonth(),this.$D=D.getDate(),this.$W=D.getDay(),this.$H=D.getHours(),this.$m=D.getMinutes(),this.$s=D.getSeconds(),this.$ms=D.getMilliseconds()},E.$utils=function(){return A},E.isValid=function(){return this.$d.toString()!==g},E.isSame=function(D,B){var O=P(D);return this.startOf(B)<=O&&O<=this.endOf(B)},E.isAfter=function(D,B){return P(D)<this.startOf(B)},E.isBefore=function(D,B){return this.endOf(B)<P(D)},E.$g=function(D,B,O){return A.u(D)?this[B]:this.set(O,D)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(D,B){var O=this,T=!!A.u(B)||B,L=A.p(D),W=function(me,ft){var Zt=A.w(O.$u?Date.UTC(O.$y,ft,me):new Date(O.$y,ft,me),O);return T?Zt:Zt.endOf(d)},H=function(me,ft){return A.w(O.toDate()[me].apply(O.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(ft)),O)},G=this.$W,Q=this.$M,ot=this.$D,xt="set"+(this.$u?"UTC":"");switch(L){case p:return T?W(1,0):W(31,11);case f:return T?W(1,Q):W(0,Q+1);case h:var pe=this.$locale().weekStart||0,on=(G<pe?G+7:G)-pe;return W(T?ot-on:ot+(6-on),Q);case d:case m:return H(xt+"Hours",0);case c:return H(xt+"Minutes",1);case r:return H(xt+"Seconds",2);case a:return H(xt+"Milliseconds",3);default:return this.clone()}},E.endOf=function(D){return this.startOf(D,!1)},E.$set=function(D,B){var O,T=A.p(D),L="set"+(this.$u?"UTC":""),W=(O={},O[d]=L+"Date",O[m]=L+"Date",O[f]=L+"Month",O[p]=L+"FullYear",O[c]=L+"Hours",O[r]=L+"Minutes",O[a]=L+"Seconds",O[o]=L+"Milliseconds",O)[T],H=T===d?this.$D+(B-this.$W):B;if(T===f||T===p){var G=this.clone().set(m,1);G.$d[W](H),G.init(),this.$d=G.set(m,Math.min(this.$D,G.daysInMonth())).$d}else W&&this.$d[W](H);return this.init(),this},E.set=function(D,B){return this.clone().$set(D,B)},E.get=function(D){return this[A.p(D)]()},E.add=function(D,B){var O,T=this;D=Number(D);var L=A.p(B),W=function(Q){var ot=P(T);return A.w(ot.date(ot.date()+Math.round(Q*D)),T)};if(L===f)return this.set(f,this.$M+D);if(L===p)return this.set(p,this.$y+D);if(L===d)return W(1);if(L===h)return W(7);var H=(O={},O[r]=i,O[c]=s,O[a]=e,O)[L]||1,G=this.$d.getTime()+D*H;return A.w(G,this)},E.subtract=function(D,B){return this.add(-1*D,B)},E.format=function(D){var B=this,O=this.$locale();if(!this.isValid())return O.invalidDate||g;var T=D||"YYYY-MM-DDTHH:mm:ssZ",L=A.z(this),W=this.$H,H=this.$m,G=this.$M,Q=O.weekdays,ot=O.months,xt=O.meridiem,pe=function(ft,Zt,an,Jn){return ft&&(ft[Zt]||ft(B,T))||an[Zt].slice(0,Jn)},on=function(ft){return A.s(W%12||12,ft,"0")},me=xt||function(ft,Zt,an){var Jn=ft<12?"AM":"PM";return an?Jn.toLowerCase():Jn};return T.replace(_,function(ft,Zt){return Zt||function(an){switch(an){case"YY":return String(B.$y).slice(-2);case"YYYY":return A.s(B.$y,4,"0");case"M":return G+1;case"MM":return A.s(G+1,2,"0");case"MMM":return pe(O.monthsShort,G,ot,3);case"MMMM":return pe(ot,G);case"D":return B.$D;case"DD":return A.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return pe(O.weekdaysMin,B.$W,Q,2);case"ddd":return pe(O.weekdaysShort,B.$W,Q,3);case"dddd":return Q[B.$W];case"H":return String(W);case"HH":return A.s(W,2,"0");case"h":return on(1);case"hh":return on(2);case"a":return me(W,H,!0);case"A":return me(W,H,!1);case"m":return String(H);case"mm":return A.s(H,2,"0");case"s":return String(B.$s);case"ss":return A.s(B.$s,2,"0");case"SSS":return A.s(B.$ms,3,"0");case"Z":return L}return null}(ft)||L.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(D,B,O){var T,L=this,W=A.p(B),H=P(D),G=(H.utcOffset()-this.utcOffset())*i,Q=this-H,ot=function(){return A.m(L,H)};switch(W){case p:T=ot()/12;break;case f:T=ot();break;case u:T=ot()/3;break;case h:T=(Q-G)/6048e5;break;case d:T=(Q-G)/864e5;break;case c:T=Q/s;break;case r:T=Q/i;break;case a:T=Q/e;break;default:T=Q}return O?T:A.a(T)},E.daysInMonth=function(){return this.endOf(f).$D},E.$locale=function(){return w[this.$L]},E.locale=function(D,B){if(!D)return this.$L;var O=this.clone(),T=V(D,B,!0);return T&&(O.$L=T),O},E.clone=function(){return A.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},F}(),U=N.prototype;return P.prototype=U,[["$ms",o],["$s",a],["$m",r],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(F){U[F[1]]=function(E){return this.$g(E,F[0],F[1])}}),P.extend=function(F,E){return F.$i||(F(E,N,P),F.$i=!0),P},P.locale=V,P.isDayjs=S,P.unix=function(F){return P(1e3*F)},P.en=w[y],P.Ls=w,P.p={},P})})(xa);var Ff=xa.exports;const ct=Af(Ff),we=Math.min,he=Math.max,Yn=Math.round,Hn=Math.floor,qt=n=>({x:n,y:n}),Tf={left:"right",right:"left",bottom:"top",top:"bottom"},Nf={start:"end",end:"start"};function Yi(n,t,e){return he(n,we(t,e))}function Ze(n,t){return typeof n=="function"?n(t):n}function fe(n){return n.split("-")[0]}function Qe(n){return n.split("-")[1]}function ka(n){return n==="x"?"y":"x"}function Hi(n){return n==="y"?"height":"width"}function jn(n){return["top","bottom"].includes(fe(n))?"y":"x"}function ji(n){return ka(jn(n))}function Lf(n,t,e){e===void 0&&(e=!1);const i=Qe(n),s=ji(n),o=Hi(s);let a=s==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Un(a)),[a,Un(a)]}function $f(n){const t=Un(n);return[Ui(n),t,Ui(t)]}function Ui(n){return n.replace(/start|end/g,t=>Nf[t])}function Rf(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 zf(n,t,e,i){const s=Qe(n);let o=Rf(fe(n),e==="start",i);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Ui)))),o}function Un(n){return n.replace(/left|right|bottom|top/g,t=>Tf[t])}function If(n){return{top:0,right:0,bottom:0,left:0,...n}}function wa(n){return typeof n!="number"?If(n):{top:n,right:n,bottom:n,left:n}}function Xn(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function Ca(n,t,e){let{reference:i,floating:s}=n;const o=jn(t),a=ji(t),r=Hi(a),c=fe(t),d=o==="y",h=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(c){case"top":p={x:h,y:i.y-s.height};break;case"bottom":p={x:h,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&&d?-1:1);break;case"end":p[a]+=u*(e&&d?-1:1);break}return p}const Wf=async(n,t,e)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:a}=e,r=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:n,floating:t,strategy:s}),{x:h,y:f}=Ca(d,i,c),u=i,p={},m=0;for(let g=0;g<r.length;g++){const{name:b,fn:_}=r[g],{x,y:M,data:C,reset:y}=await _({x:h,y:f,initialPlacement:i,placement:u,strategy:s,middlewareData:p,rects:d,platform:a,elements:{reference:n,floating:t}});if(h=x??h,f=M??f,p={...p,[b]:{...p[b],...C}},y&&m<=50){m++,typeof y=="object"&&(y.placement&&(u=y.placement),y.rects&&(d=y.rects===!0?await a.getElementRects({reference:n,floating:t,strategy:s}):y.rects),{x:h,y:f}=Ca(d,u,c)),g=-1;continue}}return{x:h,y:f,placement:u,strategy:s,middlewareData:p}};async function Ma(n,t){var e;t===void 0&&(t={});const{x:i,y:s,platform:o,rects:a,elements:r,strategy:c}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:p=0}=Ze(t,n),m=wa(p),b=r[u?f==="floating"?"reference":"floating":f],_=Xn(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:d,rootBoundary:h,strategy:c})),x=f==="floating"?{...a.floating,x:i,y:s}:a.reference,M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(r.floating)),C=await(o.isElement==null?void 0:o.isElement(M))?await(o.getScale==null?void 0:o.getScale(M))||{x:1,y:1}:{x:1,y:1},y=Xn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:M,strategy:c}):x);return{top:(_.top-y.top+m.top)/C.y,bottom:(y.bottom-_.bottom+m.bottom)/C.y,left:(_.left-y.left+m.left)/C.x,right:(y.right-_.right+m.right)/C.x}}const Yf=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:i,placement:s,rects:o,platform:a,elements:r,middlewareData:c}=t,{element:d,padding:h=0}=Ze(n,t)||{};if(d==null)return{};const f=wa(h),u={x:e,y:i},p=ji(s),m=Hi(p),g=await a.getDimensions(d),b=p==="y",_=b?"top":"left",x=b?"bottom":"right",M=b?"clientHeight":"clientWidth",C=o.reference[m]+o.reference[p]-u[p]-o.floating[m],y=u[p]-o.reference[p],w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let k=w?w[M]:0;(!k||!await(a.isElement==null?void 0:a.isElement(w)))&&(k=r.floating[M]||o.floating[m]);const S=C/2-y/2,V=k/2-g[m]/2-1,P=we(f[_],V),A=we(f[x],V),N=P,U=k-g[m]-A,F=k/2-g[m]/2+S,E=Yi(N,F,U),D=!c.arrow&&Qe(s)!=null&&F!=E&&o.reference[m]/2-(F<N?P:A)-g[m]/2<0,B=D?F<N?F-N:F-U:0;return{[p]:u[p]+B,data:{[p]:E,centerOffset:F-E-B,...D&&{alignmentOffset:B}},reset:D}}}),Sa=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:c,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=Ze(n,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};const _=fe(s),x=fe(r)===r,M=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=u||(x||!g?[Un(r)]:$f(r));!u&&m!=="none"&&C.push(...zf(r,g,m,M));const y=[r,...C],w=await Ma(t,b),k=[];let S=((i=o.flip)==null?void 0:i.overflows)||[];if(h&&k.push(w[_]),f){const N=Lf(s,a,M);k.push(w[N[0]],w[N[1]])}if(S=[...S,{placement:s,overflows:k}],!k.every(N=>N<=0)){var V,P;const N=(((V=o.flip)==null?void 0:V.index)||0)+1,U=y[N];if(U)return{data:{index:N,overflows:S},reset:{placement:U}};let F=(P=S.filter(E=>E.overflows[0]<=0).sort((E,D)=>E.overflows[1]-D.overflows[1])[0])==null?void 0:P.placement;if(!F)switch(p){case"bestFit":{var A;const E=(A=S.map(D=>[D.placement,D.overflows.filter(B=>B>0).reduce((B,O)=>B+O,0)]).sort((D,B)=>D[1]-B[1])[0])==null?void 0:A[0];E&&(F=E);break}case"initialPlacement":F=r;break}if(s!==F)return{reset:{placement:F}}}return{}}}};async function Hf(n,t){const{placement:e,platform:i,elements:s}=n,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),a=fe(e),r=Qe(e),c=jn(e)==="y",d=["left","top"].includes(a)?-1:1,h=o&&c?-1:1,f=Ze(t,n);let{mainAxis:u,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return r&&typeof m=="number"&&(p=r==="end"?m*-1:m),c?{x:p*h,y:u*d}:{x:u*d,y:p*h}}const Da=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){const{x:e,y:i}=t,s=await Hf(t,n);return{x:e+s.x,y:i+s.y,data:s}}}},jf=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:x}=b;return{x:_,y:x}}},...c}=Ze(n,t),d={x:e,y:i},h=await Ma(t,c),f=jn(fe(s)),u=ka(f);let p=d[u],m=d[f];if(o){const b=u==="y"?"top":"left",_=u==="y"?"bottom":"right",x=p+h[b],M=p-h[_];p=Yi(x,p,M)}if(a){const b=f==="y"?"top":"left",_=f==="y"?"bottom":"right",x=m+h[b],M=m-h[_];m=Yi(x,m,M)}const g=r.fn({...t,[u]:p,[f]:m});return{...g,data:{x:g.x-e,y:g.y-i}}}}};function Kt(n){return Ea(n)?(n.nodeName||"").toLowerCase():"#document"}function gt(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function Lt(n){var t;return(t=(Ea(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Ea(n){return n instanceof Node||n instanceof gt(n).Node}function $t(n){return n instanceof Element||n instanceof gt(n).Element}function Et(n){return n instanceof HTMLElement||n instanceof gt(n).HTMLElement}function Va(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof gt(n).ShadowRoot}function tn(n){const{overflow:t,overflowX:e,overflowY:i,display:s}=_t(n);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&!["inline","contents"].includes(s)}function Uf(n){return["table","td","th"].includes(Kt(n))}function Xi(n){const t=qi(),e=_t(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 Xf(n){let t=Ce(n);for(;Et(t)&&!qn(t);){if(Xi(t))return t;t=Ce(t)}return null}function qi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function qn(n){return["html","body","#document"].includes(Kt(n))}function _t(n){return gt(n).getComputedStyle(n)}function Kn(n){return $t(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function Ce(n){if(Kt(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Va(n)&&n.host||Lt(n);return Va(t)?t.host:t}function Ba(n){const t=Ce(n);return qn(t)?n.ownerDocument?n.ownerDocument.body:n.body:Et(t)&&tn(t)?t:Ba(t)}function en(n,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);const s=Ba(n),o=s===((i=n.ownerDocument)==null?void 0:i.body),a=gt(s);return o?t.concat(a,a.visualViewport||[],tn(s)?s:[],a.frameElement&&e?en(a.frameElement):[]):t.concat(s,en(s,[],e))}function va(n){const t=_t(n);let e=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=Et(n),o=s?n.offsetWidth:e,a=s?n.offsetHeight:i,r=Yn(e)!==o||Yn(i)!==a;return r&&(e=o,i=a),{width:e,height:i,$:r}}function Ki(n){return $t(n)?n:n.contextElement}function Me(n){const t=Ki(n);if(!Et(t))return qt(1);const e=t.getBoundingClientRect(),{width:i,height:s,$:o}=va(t);let a=(o?Yn(e.width):e.width)/i,r=(o?Yn(e.height):e.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!r||!Number.isFinite(r))&&(r=1),{x:a,y:r}}const qf=qt(0);function Pa(n){const t=gt(n);return!qi()||!t.visualViewport?qf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kf(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==gt(n)?!1:t}function ue(n,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);const s=n.getBoundingClientRect(),o=Ki(n);let a=qt(1);t&&(i?$t(i)&&(a=Me(i)):a=Me(n));const r=Kf(o,e,i)?Pa(o):qt(0);let c=(s.left+r.x)/a.x,d=(s.top+r.y)/a.y,h=s.width/a.x,f=s.height/a.y;if(o){const u=gt(o),p=i&&$t(i)?gt(i):i;let m=u.frameElement;for(;m&&i&&p!==u;){const g=Me(m),b=m.getBoundingClientRect(),_=_t(m),x=b.left+(m.clientLeft+parseFloat(_.paddingLeft))*g.x,M=b.top+(m.clientTop+parseFloat(_.paddingTop))*g.y;c*=g.x,d*=g.y,h*=g.x,f*=g.y,c+=x,d+=M,m=gt(m).frameElement}}return Xn({width:h,height:f,x:c,y:d})}function Gf(n){let{rect:t,offsetParent:e,strategy:i}=n;const s=Et(e),o=Lt(e);if(e===o)return t;let a={scrollLeft:0,scrollTop:0},r=qt(1);const c=qt(0);if((s||!s&&i!=="fixed")&&((Kt(e)!=="body"||tn(o))&&(a=Kn(e)),Et(e))){const d=ue(e);r=Me(e),c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}return{width:t.width*r.x,height:t.height*r.y,x:t.x*r.x-a.scrollLeft*r.x+c.x,y:t.y*r.y-a.scrollTop*r.y+c.y}}function Jf(n){return Array.from(n.getClientRects())}function Oa(n){return ue(Lt(n)).left+Kn(n).scrollLeft}function Zf(n){const t=Lt(n),e=Kn(n),i=n.ownerDocument.body,s=he(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=he(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-e.scrollLeft+Oa(n);const r=-e.scrollTop;return _t(i).direction==="rtl"&&(a+=he(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:a,y:r}}function Qf(n,t){const e=gt(n),i=Lt(n),s=e.visualViewport;let o=i.clientWidth,a=i.clientHeight,r=0,c=0;if(s){o=s.width,a=s.height;const d=qi();(!d||d&&t==="fixed")&&(r=s.offsetLeft,c=s.offsetTop)}return{width:o,height:a,x:r,y:c}}function tu(n,t){const e=ue(n,!0,t==="fixed"),i=e.top+n.clientTop,s=e.left+n.clientLeft,o=Et(n)?Me(n):qt(1),a=n.clientWidth*o.x,r=n.clientHeight*o.y,c=s*o.x,d=i*o.y;return{width:a,height:r,x:c,y:d}}function Aa(n,t,e){let i;if(t==="viewport")i=Qf(n,e);else if(t==="document")i=Zf(Lt(n));else if($t(t))i=tu(t,e);else{const s=Pa(n);i={...t,x:t.x-s.x,y:t.y-s.y}}return Xn(i)}function Fa(n,t){const e=Ce(n);return e===t||!$t(e)||qn(e)?!1:_t(e).position==="fixed"||Fa(e,t)}function eu(n,t){const e=t.get(n);if(e)return e;let i=en(n,[],!1).filter(r=>$t(r)&&Kt(r)!=="body"),s=null;const o=_t(n).position==="fixed";let a=o?Ce(n):n;for(;$t(a)&&!qn(a);){const r=_t(a),c=Xi(a);!c&&r.position==="fixed"&&(s=null),(o?!c&&!s:!c&&r.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||tn(a)&&!c&&Fa(n,a))?i=i.filter(h=>h!==a):s=r,a=Ce(a)}return t.set(n,i),i}function nu(n){let{element:t,boundary:e,rootBoundary:i,strategy:s}=n;const a=[...e==="clippingAncestors"?eu(t,this._c):[].concat(e),i],r=a[0],c=a.reduce((d,h)=>{const f=Aa(t,h,s);return d.top=he(f.top,d.top),d.right=we(f.right,d.right),d.bottom=we(f.bottom,d.bottom),d.left=he(f.left,d.left),d},Aa(t,r,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function iu(n){return va(n)}function su(n,t,e){const i=Et(t),s=Lt(t),o=e==="fixed",a=ue(n,!0,o,t);let r={scrollLeft:0,scrollTop:0};const c=qt(0);if(i||!i&&!o)if((Kt(t)!=="body"||tn(s))&&(r=Kn(t)),i){const d=ue(t,!0,o,t);c.x=d.x+t.clientLeft,c.y=d.y+t.clientTop}else s&&(c.x=Oa(s));return{x:a.left+r.scrollLeft-c.x,y:a.top+r.scrollTop-c.y,width:a.width,height:a.height}}function Ta(n,t){return!Et(n)||_t(n).position==="fixed"?null:t?t(n):n.offsetParent}function Na(n,t){const e=gt(n);if(!Et(n))return e;let i=Ta(n,t);for(;i&&Uf(i)&&_t(i).position==="static";)i=Ta(i,t);return i&&(Kt(i)==="html"||Kt(i)==="body"&&_t(i).position==="static"&&!Xi(i))?e:i||Xf(n)||e}const ou=async function(n){let{reference:t,floating:e,strategy:i}=n;const s=this.getOffsetParent||Na,o=this.getDimensions;return{reference:su(t,await s(e),i),floating:{x:0,y:0,...await o(e)}}};function au(n){return _t(n).direction==="rtl"}const ru={convertOffsetParentRelativeRectToViewportRelativeRect:Gf,getDocumentElement:Lt,getClippingRect:nu,getOffsetParent:Na,getElementRects:ou,getClientRects:Jf,getDimensions:iu,getScale:Me,isElement:$t,isRTL:au};function lu(n,t){let e=null,i;const s=Lt(n);function o(){clearTimeout(i),e&&e.disconnect(),e=null}function a(r,c){r===void 0&&(r=!1),c===void 0&&(c=1),o();const{left:d,top:h,width:f,height:u}=n.getBoundingClientRect();if(r||t(),!f||!u)return;const p=Hn(h),m=Hn(s.clientWidth-(d+f)),g=Hn(s.clientHeight-(h+u)),b=Hn(d),x={rootMargin:-p+"px "+-m+"px "+-g+"px "+-b+"px",threshold:he(0,we(1,c))||1};let M=!0;function C(y){const w=y[0].intersectionRatio;if(w!==c){if(!M)return a();w?a(!1,w):i=setTimeout(()=>{a(!1,1e-7)},100)}M=!1}try{e=new IntersectionObserver(C,{...x,root:s.ownerDocument})}catch{e=new IntersectionObserver(C,x)}e.observe(n)}return a(!0),o}function cu(n,t,e,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:r=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,d=Ki(n),h=s||o?[...d?en(d):[],...en(t)]:[];h.forEach(_=>{s&&_.addEventListener("scroll",e,{passive:!0}),o&&_.addEventListener("resize",e)});const f=d&&r?lu(d,e):null;let u=-1,p=null;a&&(p=new ResizeObserver(_=>{let[x]=_;x&&x.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{p&&p.observe(t)})),e()}),d&&!c&&p.observe(d),p.observe(t));let m,g=c?ue(n):null;c&&b();function b(){const _=ue(n);g&&(_.x!==g.x||_.y!==g.y||_.width!==g.width||_.height!==g.height)&&e(),g=_,m=requestAnimationFrame(b)}return e(),()=>{h.forEach(_=>{s&&_.removeEventListener("scroll",e),o&&_.removeEventListener("resize",e)}),f&&f(),p&&p.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const La=(n,t,e)=>{const i=new Map,s={platform:ru,...e},o={...s.platform,_c:i};return Wf(n,t,{...s,platform:o})};function Gi(n){var t;return(t=n==null?void 0:n.$el)!=null?t:n}function du(n){return{name:"arrow",options:n,fn(t){const e=Gi(l.unref(n.element));return e==null?{}:Yf({element:e,padding:n.padding}).fn(t)}}}function $a(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ra(n,t){const e=$a(n);return Math.round(t*e)/e}function hu(n,t,e){e===void 0&&(e={});const i=e.whileElementsMounted,s=l.computed(()=>{var k;return(k=l.unref(e.open))!=null?k:!0}),o=l.computed(()=>l.unref(e.middleware)),a=l.computed(()=>{var k;return(k=l.unref(e.placement))!=null?k:"bottom"}),r=l.computed(()=>{var k;return(k=l.unref(e.strategy))!=null?k:"absolute"}),c=l.computed(()=>{var k;return(k=l.unref(e.transform))!=null?k:!0}),d=l.computed(()=>Gi(n.value)),h=l.computed(()=>Gi(t.value)),f=l.ref(0),u=l.ref(0),p=l.ref(r.value),m=l.ref(a.value),g=l.shallowRef({}),b=l.ref(!1),_=l.computed(()=>{const k={position:p.value,left:"0",top:"0"};if(!h.value)return k;const S=Ra(h.value,f.value),V=Ra(h.value,u.value);return c.value?{...k,transform:"translate("+S+"px, "+V+"px)",...$a(h.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:S+"px",top:V+"px"}});let x;function M(){d.value==null||h.value==null||La(d.value,h.value,{middleware:o.value,placement:a.value,strategy:r.value}).then(k=>{f.value=k.x,u.value=k.y,p.value=k.strategy,m.value=k.placement,g.value=k.middlewareData,b.value=!0})}function C(){typeof x=="function"&&(x(),x=void 0)}function y(){if(C(),i===void 0){M();return}if(d.value!=null&&h.value!=null){x=i(d.value,h.value,M);return}}function w(){s.value||(b.value=!1)}return l.watch([o,a,r],M,{flush:"sync"}),l.watch([d,h],y,{flush:"sync"}),l.watch(s,w,{flush:"sync"}),l.getCurrentScope()&&l.onScopeDispose(C),{x:l.shallowReadonly(f),y:l.shallowReadonly(u),strategy:l.shallowReadonly(p),placement:l.shallowReadonly(m),middlewareData:l.shallowReadonly(g),isPositioned:l.shallowReadonly(b),floatingStyles:_,update:M}}function fu(n){for(;n;){if(uu(n))return n;n=n.parentElement}return document.scrollingElement}function uu(n){if(!n||n.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(n);return t.overflowY==="scroll"||t.overflowY==="auto"&&n.scrollHeight>n.clientHeight}class pu{constructor(t,e){v(this,"onScroll");v(this,"scrollParent");this.onScroll=e,this.scrollParent=fu(t)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const mu={class:"fm-menu__wrapper"},gu=l.defineComponent({__name:"FmMenu",props:{showMenu:{type:Boolean,default:!1},placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1}},emits:["dropdown-changed"],setup(n,{expose:t,emit:e}){const i=n,s=l.ref(!1),o=l.ref(null),a=l.ref(null),{floatingStyles:r}=hu(o,a,{middleware:[Da(4),Sa()],placement:i.placement,whileElementsMounted:cu});let c;t({show:()=>{s.value||(s.value=!0,e("dropdown-changed",s.value))},hide:()=>{s.value&&(s.value=!1,e("dropdown-changed",s.value))}});const d=()=>{i.disabled||(s.value=!s.value,e("dropdown-changed",s.value))},h=u=>{if(!s.value)return;const p=u.path||u.composedPath();for(const m of p)if(m==o.value||m==a.value)return;s.value=!1,e("dropdown-changed",s.value)},f=()=>{e("dropdown-changed",!1)};return l.watch(()=>i.showMenu,u=>s.value=u),l.onMounted(()=>{s.value=i.showMenu,window.addEventListener("click",h),c=new pu(o.value,f),c.bindScroll()}),l.onUnmounted(()=>{window.removeEventListener("click",h),c.unbindScroll()}),(u,p)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"anchorEl",ref:o,class:"fm-menu",onClick:d},[l.renderSlot(u.$slots,"menu-button",{},void 0,!0)],512),s.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"menuEl",ref:a,class:l.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":s.value}),style:l.normalizeStyle(l.unref(r))},[l.renderSlot(u.$slots,"menu-wrapper",{},()=>[l.createElementVNode("div",mu,[l.renderSlot(u.$slots,"menu-content",{},void 0,!0)])],!0)],6)):l.createCommentVNode("",!0)]))}}),Bg="",Ct=it(gu,[["__scopeId","data-v-02f0b378"]]),bu={class:"fm-checkbox"},yu={class:"fm-checkbox--wrapper"},_u={class:"fm-checkbox__input--container"},xu=["checked","disabled","indeterminate"],ku={key:0,class:"fm-checkbox__label-container"},wu={class:"fm-typo-body-lg-400"},Cu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},za=l.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=l.computed(()=>e.indeterminate?"remove":e.modelValue?"check_small":"");function s(){e.disabled||t("update:modelValue",!e.modelValue)}return(o,a)=>(l.openBlock(),l.createElementBlock("div",bu,[l.createElementVNode("label",yu,[l.createElementVNode("div",_u,[l.createElementVNode("input",{class:l.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,xu),e.indeterminate||e.modelValue?(l.openBlock(),l.createBlock(R,{key:0,class:"fm-checkbox__input--checkmark",name:i.value,size:"md",color:"#FFFFFF"},null,8,["name"])):l.createCommentVNode("",!0)]),e.label?(l.openBlock(),l.createElementBlock("div",ku,[l.renderSlot(o.$slots,"label"),l.createElementVNode("div",wu,l.toDisplayString(e.label),1),e.sublabel?(l.openBlock(),l.createElementBlock("div",Cu,l.toDisplayString(e.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])]))}}),vg="",Mu={class:"fm-menu-item--left"},Su={key:0,class:"fm-menu-item--right"},Du=l.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)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{class:l.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":o.modelValue&&!o.hasCheckbox,"fm-menu-item--disabled":o.disabled}),onClick:i},[l.createElementVNode("div",Mu,[!o.hasCheckbox&&o.icon?(l.openBlock(),l.createBlock(R,{key:0,name:o.icon,size:"md",color:o.disabled?"#C7C7CC":o.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","color"])):l.createCommentVNode("",!0),o.hasCheckbox?(l.openBlock(),l.createBlock(za,{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"])):l.createCommentVNode("",!0),l.renderSlot(o.$slots,"label",{},()=>[l.createElementVNode("div",null,[l.createElementVNode("div",{class:l.normalizeClass(`fm-typo-body-lg-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-primary"}`)},l.toDisplayString(o.label),3),o.sublabel?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(`fm-typo-body-md-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-secondary"}`)},l.toDisplayString(o.sublabel),3)):l.createCommentVNode("",!0)])],!0)]),o.expandable?(l.openBlock(),l.createElementBlock("div",Su,[l.createVNode(R,{name:"chevron_right",size:"md",color:o.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):l.createCommentVNode("",!0)],2)]))}}),Pg="",Gt=it(Du,[["__scopeId","data-v-94ed27b3"]]),Eu={class:"fm-calendar p-12 rounded-lg shadow-light-neutral-300 w-[360px]"},Vu={class:"w-max"},Bu={class:"flex h-40 justify-between px-4 py-8"},vu={class:"flex gap-4 items-center"},Pu={class:"fm-typo-body-lg-700"},Ou={class:"h-[264px] w-[160px]"},Au={class:"fm-typo-body-lg-700"},Fu={class:"h-[264px] w-[160px]"},Tu={class:"flex gap-4 items-center justify-center"},Nu={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Lu=["onClick"],$u={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},Ru=l.defineComponent({__name:"FmDatePicker",props:{modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=l.ref(null),s=l.ref(!1),o=l.ref(ct().startOf("month")),a=l.ref(!1),r=l.ref(!1),c=g=>{i.value=g},d=()=>{t("update:modelValue",i.value.format("YYYY-MM-DD")),s.value=!1},h=()=>{i.value=e.modelValue?ct(e.modelValue):null,s.value=!1},f=g=>{const b=[],_=g.endOf("month"),x=g.month();let M=g.startOf("week"),C=[];for(;M.isBefore(_.endOf("week"));)M.day()===0&&C.length>0&&(b.push(C),C=[]),C.push({date:M,isCurrentMonth:M.month()===x}),M=M.add(1,"day");return C.length>0&&b.push(C),b},u=g=>{a.value=!1,r.value=!1,o.value=g},p=l.computed(()=>Array.from(Array(7),(g,b)=>ct().day(b).format("ddd"))),m=l.computed(()=>{let g=-5;const b=[];for(;g!=5;)b.push(o.value.add(g,"year")),g++;return b});return l.onMounted(()=>{e.modelValue&&(i.value=ct(e.modelValue,"YYYY-MM-DD"))}),(g,b)=>(l.openBlock(),l.createBlock(Ct,{"show-menu":s.value,disabled:g.disabled,onDropdownChanged:b[4]||(b[4]=_=>s.value=_)},{"menu-button":l.withCtx(()=>[l.createElementVNode("label",null,[g.label?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-typo-body-lg-400 mb-4",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},l.toDisplayString(e.label),3)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":s.value,"fm-date-picker__container--disabled":e.disabled}])},[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":g.modelValue?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString(g.modelValue?l.unref(ct)(g.modelValue).format("D MMM YYYY"):"DD MM YYYY"),3)],2)])]),"menu-wrapper":l.withCtx(()=>[l.createElementVNode("div",Eu,[l.createElementVNode("div",Vu,[l.createElementVNode("div",Bu,[l.createElementVNode("div",vu,[l.createVNode(Ct,{"show-menu":a.value,onDropdownChanged:b[0]||(b[0]=_=>a.value=_)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",a.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",Pu,l.toDisplayString(o.value.format("MMMM")),1),l.createVNode(R,{name:a.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",Ou,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(_,x)=>o.value.month(x)),_=>(l.openBlock(),l.createElementBlock("li",{key:_.format("MMMM")},[l.createVNode(Gt,{"model-value":o.value.format("MMMM")===_.format("MMMM"),label:_.format("MMMM"),"onUpdate:modelValue":x=>u(_)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(Ct,{"show-menu":r.value,onDropdownChanged:b[1]||(b[1]=_=>r.value=_)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",r.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",Au,l.toDisplayString(o.value.format("YYYY")),1),l.createVNode(R,{name:r.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",Fu,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m.value,_=>(l.openBlock(),l.createElementBlock("li",{key:_.format("YYYY")},[l.createVNode(Gt,{"model-value":o.value.format("YYYY")===_.format("YYYY"),label:_.format("YYYY"),"onUpdate:modelValue":x=>u(_)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),l.createElementVNode("div",Tu,[l.createVNode(R,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[2]||(b[2]=()=>u(o.value.subtract(1,"month")))}),l.createVNode(R,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[3]||(b[3]=()=>u(o.value.add(1,"month")))})])]),l.createElementVNode("div",null,[l.createElementVNode("div",Nu,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p.value,_=>(l.openBlock(),l.createElementBlock("div",{key:_,class:"fm-calendar__cell"},l.toDisplayString(_),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f(o.value),(_,x)=>(l.openBlock(),l.createElementBlock("div",{key:x,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_,M=>(l.openBlock(),l.createElementBlock("div",{key:M.date.date(),class:"fm-calendar__cell"},[M.isCurrentMonth?(l.openBlock(),l.createElementBlock("button",{key:0,class:l.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":M.date.isSame(i.value)}]),onClick:()=>c(M.date)},l.toDisplayString(M.date.date()),11,Lu)):l.createCommentVNode("",!0)]))),128))]))),128))])])]),l.createElementVNode("div",$u,[l.createVNode(bt,{label:"Cancel",size:"md",variant:"tertiary",onClick:h}),l.createVNode(bt,{label:"OK",size:"md",variant:"primary",disabled:!i.value,onClick:d},null,8,["disabled"])])])]),_:1},8,["show-menu","disabled"]))}}),Og="",zu=it(Ru,[["__scopeId","data-v-3f29c4a8"]]),Iu=n=>(l.pushScopeId("data-v-105cdff3"),n=n(),l.popScopeId(),n),Wu={class:"flex gap-1 items-center relative w-full"},Yu={class:"w-full"},Hu=Iu(()=>l.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)),ju={class:"w-full"},Uu={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[720px]"},Xu={class:"flex gap-24"},qu={class:"w-max"},Ku={class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},Gu={class:"flex gap-4 items-center"},Ju={class:"fm-typo-body-lg-700"},Zu={class:"h-[264px] w-[160px]"},Qu={class:"fm-typo-body-lg-700"},tp={class:"h-[264px] w-[160px]"},ep={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},np=["onClick","onMouseover"],ip={class:"w-max"},sp={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},op={class:"flex gap-4 items-center"},ap={class:"fm-typo-body-lg-700"},rp={class:"h-[264px] w-[160px]"},lp={class:"fm-typo-body-lg-700"},cp={class:"h-[264px] w-[160px]"},dp={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},hp=["onClick","onMouseover"],fp={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},up=l.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=l.ref({startDate:null,endDate:null}),s=l.ref(!1),o=l.ref(ct().startOf("month")),a=l.ref(ct().startOf("month").add(1,"month")),r=l.ref(null),c=l.ref(!1),d=l.ref(!1),h=l.ref(!1),f=l.ref(!1),u=y=>{if(i.value.startDate&&i.value.endDate){i.value={startDate:y,endDate:null};return}if(!i.value.startDate&&!i.value.endDate)i.value.startDate=y;else if(y.isBefore(i.value.startDate)){const w=i.value.startDate;i.value={startDate:y,endDate:w}}else i.value.endDate=y},p=()=>{t("update:modelValue",{startDate:i.value.startDate.format("YYYY-MM-DD"),endDate:i.value.endDate.format("YYYY-MM-DD")}),s.value=!1},m=()=>{var y,w;i.value={startDate:(y=e.modelValue)!=null&&y.startDate?ct(e.modelValue.startDate,"YYYY-MM-DD"):null,endDate:(w=e.modelValue)!=null&&w.endDate?ct(e.modelValue.endDate,"YYYY-MM-DD"):null},s.value=!1},g=y=>{const w=[],k=y.endOf("month"),S=y.month();let V=y.startOf("week"),P=[];for(;V.isBefore(k.endOf("week"));)V.day()===0&&P.length>0&&(w.push(P),P=[]),P.push({date:V,isCurrentMonth:V.month()===S}),V=V.add(1,"day");return P.length>0&&w.push(P),w},b=(y,w)=>{c.value=!1,h.value=!1,d.value=!1,f.value=!1,y==="left"?(o.value=w,a.value=w.add(1,"month")):y==="right"&&(a.value=w,o.value=w.subtract(1,"month"))},_=l.computed(()=>Array.from(Array(7),(y,w)=>ct().day(w).format("ddd"))),x=y=>{const w=i.value.startDate,k=i.value.endDate;r.value=w&&k?null:r.value;const S=r.value,V=w==null?void 0:w.isSame(y),P=k==null?void 0:k.isSame(y),A=S==null?void 0:S.isSame(y);return{"fm-calendar__cell__button--selected":V&&P||V&&!k,"fm-calendar__cell__button--selected-start":V&&k&&!(V&&P)||w&&!k&&V&&(S==null?void 0:S.isAfter(w))||w&&!k&&A&&(S==null?void 0:S.isBefore(w)),"fm-calendar__cell__button--selected-end":P&&w&&!(V&&P)||w&&!k&&V&&(S==null?void 0:S.isBefore(w))||w&&!k&&A&&(S==null?void 0:S.isAfter(w)),"fm-calendar__cell__button--selected-between":w&&(k||S)&&k?y.isAfter(w)&&y.isBefore(k):y.isAfter(S)&&y.isBefore(w)||y.isBefore(S)&&y.isAfter(w)}},M=y=>{r.value=y},C=l.computed(()=>{let y=-5;const w=[];for(;y!=5;)w.push(o.value.add(y,"year")),y++;return w});return l.watch(()=>e.modelValue,()=>{var y,w;return i.value={startDate:(y=e.modelValue)!=null&&y.startDate?ct(e.modelValue.startDate,"YYYY-MM-DD"):null,endDate:(w=e.modelValue)!=null&&w.endDate?ct(e.modelValue.endDate,"YYYY-MM-DD"):null}}),l.onMounted(()=>{var y;(y=e.modelValue)!=null&&y.startDate&&e.modelValue.endDate&&(i.value={startDate:ct(e.modelValue.startDate,"YYYY-MM-DD"),endDate:ct(e.modelValue.endDate,"YYYY-MM-DD")})}),(y,w)=>(l.openBlock(),l.createBlock(Ct,{"show-menu":s.value,disabled:y.disabled,onDropdownChanged:w[6]||(w[6]=k=>s.value=k)},{"menu-button":l.withCtx(()=>{var k,S,V,P;return[l.createElementVNode("div",Wu,[l.createElementVNode("label",Yu,[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},l.toDisplayString(e.label),3),l.createElementVNode("div",{class:l.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":s.value,"fm-date-picker__container--disabled":e.disabled}])},[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":(k=y.modelValue)!=null&&k.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((S=y.modelValue)!=null&&S.startDate?l.unref(ct)(y.modelValue.startDate).format("D MMM YYYY"):"DD MM YYYY"),3)],2)]),Hu,l.createElementVNode("label",ju,[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},l.toDisplayString(e.label),3),l.createElementVNode("div",{class:l.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":s.value,"fm-date-picker__container--disabled":e.disabled}])},[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":(V=y.modelValue)!=null&&V.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((P=y.modelValue)!=null&&P.endDate?l.unref(ct)(y.modelValue.endDate).format("D MMM YYYY"):"DD MM YYYY"),3)],2)])])]}),"menu-wrapper":l.withCtx(()=>[l.createElementVNode("div",Uu,[l.createElementVNode("div",Xu,[l.createElementVNode("div",qu,[l.createElementVNode("div",Ku,[l.createElementVNode("div",Gu,[l.createVNode(R,{class:"cursor-pointer select-none",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:w[0]||(w[0]=()=>b("left",o.value.subtract(1,"month")))}),l.createVNode(Ct,{"show-menu":c.value,onDropdownChanged:w[1]||(w[1]=k=>c.value=k)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",c.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",Ju,l.toDisplayString(o.value.format("MMMM")),1),l.createVNode(R,{name:c.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",Zu,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(k,S)=>o.value.month(S)),k=>(l.openBlock(),l.createElementBlock("li",{key:k.format("MMMM")},[l.createVNode(Gt,{"model-value":o.value.format("MMMM")===k.format("MMMM"),label:k.format("MMMM"),"onUpdate:modelValue":S=>b("left",k)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(Ct,{"show-menu":h.value,onDropdownChanged:w[2]||(w[2]=k=>h.value=k)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",h.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",Qu,l.toDisplayString(o.value.format("YYYY")),1),l.createVNode(R,{name:h.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",tp,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(C.value,k=>(l.openBlock(),l.createElementBlock("li",{key:k.format("YYYY")},[l.createVNode(Gt,{"model-value":o.value.format("YYYY")===k.format("YYYY"),label:k.format("YYYY"),"onUpdate:modelValue":S=>b("left",k)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])])]),l.createElementVNode("div",null,[l.createElementVNode("div",ep,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_.value,k=>(l.openBlock(),l.createElementBlock("div",{key:k,class:"fm-calendar__cell"},l.toDisplayString(k),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(g(o.value),(k,S)=>(l.openBlock(),l.createElementBlock("div",{key:S,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(k,V=>(l.openBlock(),l.createElementBlock("div",{key:V.date.date(),class:"fm-calendar__cell"},[V.isCurrentMonth?(l.openBlock(),l.createElementBlock("button",{key:0,class:l.normalizeClass(["fm-calendar__cell__button",x(V.date)]),onClick:()=>u(V.date),onMouseover:P=>M(V.date)},l.toDisplayString(V.date.date()),43,np)):l.createCommentVNode("",!0)]))),128))]))),128))])])]),l.createElementVNode("div",ip,[l.createElementVNode("div",sp,[l.createElementVNode("div",op,[l.createVNode(Ct,{"show-menu":d.value,onDropdownChanged:w[3]||(w[3]=k=>d.value=k)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",d.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",ap,l.toDisplayString(a.value.format("MMMM")),1),l.createVNode(R,{name:d.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",rp,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(k,S)=>a.value.month(S)),k=>(l.openBlock(),l.createElementBlock("li",{key:k.format("MMMM")},[l.createVNode(Gt,{"model-value":a.value.format("MMMM")===k.format("MMMM"),label:k.format("MMMM"),"onUpdate:modelValue":S=>b("right",k)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(Ct,{"show-menu":f.value,onDropdownChanged:w[4]||(w[4]=k=>f.value=k)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",f.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",lp,l.toDisplayString(a.value.format("YYYY")),1),l.createVNode(R,{name:f.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",cp,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(C.value,k=>(l.openBlock(),l.createElementBlock("li",{key:k.format("YYYY")},[l.createVNode(Gt,{"model-value":a.value.format("YYYY")===k.format("YYYY"),label:k.format("YYYY"),"onUpdate:modelValue":S=>b("right",k)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),l.createVNode(R,{class:"cursor-pointer select-none",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:w[5]||(w[5]=()=>b("left",o.value.add(1,"month")))})]),l.createElementVNode("div",null,[l.createElementVNode("div",dp,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_.value,k=>(l.openBlock(),l.createElementBlock("div",{key:k,class:"fm-calendar__cell"},l.toDisplayString(k),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(g(a.value),(k,S)=>(l.openBlock(),l.createElementBlock("div",{key:S,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(k,V=>(l.openBlock(),l.createElementBlock("div",{key:V.date.date(),class:"fm-calendar__cell"},[V.isCurrentMonth?(l.openBlock(),l.createElementBlock("button",{key:0,class:l.normalizeClass(["fm-calendar__cell__button",x(V.date)]),onClick:()=>u(V.date),onMouseover:P=>M(V.date)},l.toDisplayString(V.date.date()),43,hp)):l.createCommentVNode("",!0)]))),128))]))),128))])])])]),l.createElementVNode("div",fp,[l.createVNode(bt,{label:"Cancel",size:"md",variant:"tertiary",onClick:m}),l.createVNode(bt,{label:"OK",size:"md",variant:"primary",disabled:!i.value.startDate||!i.value.endDate,onClick:p},null,8,["disabled"])])])]),_:1},8,["show-menu","disabled"]))}}),Ag="",pp=it(up,[["__scopeId","data-v-105cdff3"]]),mp={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},gp={class:"overflow-y-auto"},bp={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},yp=l.defineComponent({__name:"FmDialog",props:{modelValue:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},minWidth:{default:280},closeButton:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=l.ref(null),s=o=>{e.overlay&&i.value&&o.target===i.value&&t("update:modelValue",!1)};return(o,a)=>(l.openBlock(),l.createBlock(l.Transition,null,{default:l.withCtx(()=>[o.modelValue?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:i,class:l.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":o.overlay}),onClick:a[1]||(a[1]=r=>s(r))},[l.createElementVNode("div",{class:l.normalizeClass(`fm-dialog min-w-[${o.minWidth}px]`)},[l.createElementVNode("div",mp,[l.renderSlot(o.$slots,"dialog-header"),o.closeButton?(l.openBlock(),l.createBlock(R,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:a[0]||(a[0]=r=>t("update:modelValue",!1))})):l.createCommentVNode("",!0)]),l.createElementVNode("div",gp,[l.renderSlot(o.$slots,"dialog-content")]),l.createElementVNode("div",bp,[l.renderSlot(o.$slots,"dialog-footer")])],2)],2)):l.createCommentVNode("",!0)]),_:3}))}}),Fg="",_p={class:"fm-drop-field"},xp=["accept","disabled"],kp=l.defineComponent({__name:"FmDropField",props:{label:{default:""},disabled:{type:Boolean,default:!1},accept:{default:""},maxFileSize:{default:8e6}},emits:["file-upload","file-rejected"],setup(n,{emit:t}){const e=n,i=l.ref(!1),s=l.ref(),o=l.ref(),a=l.ref(),r=C=>{e.disabled||(C.stopPropagation(),C.preventDefault())},c=C=>{e.disabled||(C.stopPropagation(),C.preventDefault(),i.value=!0)},d=C=>{e.disabled||(C.stopPropagation(),C.preventDefault(),i.value=!1)},h=C=>{e.disabled||(C.stopPropagation(),C.preventDefault(),i.value=!1,f(C))},f=C=>{var w;a.value=((w=C.dataTransfer)==null?void 0:w.files)??C.target.files;const y=a.value;if(s.value=p(y[0]),o.value=m(y[0]),s.value&&o.value)t("file-upload",y[0]);else{const k=u();t("file-rejected",[{file:y[0],reason:k}])}},u=()=>{const C=[];return s.value||C.push("invalid-type"),o.value||C.push("invalid-size"),C},p=C=>{if(!e.accept)return!0;const y=e.accept.split(",").map(w=>w.trim());for(const w of y)if(g(w)){if(_(w)===_(C.type))return!0}else if(b(C)===w||C.type===w)return!0;return!1},m=C=>C.size<=e.maxFileSize,g=C=>C.indexOf("*")!==-1,b=C=>"."+C.name.split(".").pop(),_=C=>C.substring(0,C.indexOf("/")),x=l.computed(()=>{if(i.value)return"Drop file to upload";if(s.value){if(!o.value)return`File size exceeds ${e.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),M=l.computed(()=>a.value?!s.value||!o.value:!1);return(C,y)=>(l.openBlock(),l.createElementBlock("label",_p,[l.renderSlot(C.$slots,"label",{},()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[C.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},l.toDisplayString(C.label),3)],!0),l.createElementVNode("div",{class:l.normalizeClass(["fm-drop-field__container",{"fm-drop-field__container--dragging":i.value,"fm-drop-field__container--invalid":M.value&&!C.disabled,"fm-drop-field__container--disabled":C.disabled}]),onDragenter:r,onDragover:c,onDragleave:d,onDrop:h},[(i.value||M.value)&&!C.disabled?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass({"fm-typo-body-lg-700":!0,"text-fm-color-primary":i.value,"text-fm-color-typo-error":M.value})},l.toDisplayString(x.value),3)):(l.openBlock(),l.createBlock(bt,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:C.disabled},null,8,["disabled"])),l.renderSlot(C.$slots,"accept-text",{},()=>[e.accept?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-typo-body-md-400",[C.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},l.toDisplayString(`Accepts ${e.accept}`),3)):l.createCommentVNode("",!0)],!0),l.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:C.accept,disabled:C.disabled,onChange:f},null,40,xp)],34),l.renderSlot(C.$slots,"helper-text",{},()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-sm-400",[C.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},l.toDisplayString(`Max size ${e.maxFileSize*1e-6}mb`),3)],!0)]))}}),Tg="",wp=it(kp,[["__scopeId","data-v-31c17193"]]),Cp={},Mp={class:"flex-grow"};function Sp(n,t){return l.openBlock(),l.createElementBlock("div",Mp)}const Ia=it(Cp,[["render",Sp]]),Wa=Symbol.for("fm:form"),Ya=Symbol.for("fm:radio-group"),Ha=Symbol.for("fm:stepper"),ja=Symbol.for("fm:dialog"),Dp={install:n=>{const t={open:e=>{const i={primary:[],secondary:[],tertiary:[]},s={onPrimary:d=>(i.primary.push(d),s),onSecondary:d=>(i.secondary.push(d),s),onTertiary:d=>(i.tertiary.push(d),s)};function o(){a&&l.render(null,a),a=null,c=null}let a=document.createElement("div");document.body.appendChild(a);const r=l.markRaw(Ua);let c=l.createVNode(r,{...e,unmount:o,storedFunctions:i});return c.appContext=n._context,l.render(c,a),s}};n.config.globalProperties.$dialog=t,n.provide(ja,t)}},Ep={key:0,class:"block"},Vp={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Bp={class:"fm-typo-title-md-700 text-fm-color-typo-primary"},vp={key:0,class:"overflow-y-auto"},Pp={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},Op={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},Ua=l.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{},primaryActions:{default:null},secondaryActions:{default:null},tertiaryActions:{default:null},overlay:{type:Boolean,default:!0},closeButton:{type:Boolean,default:!0},minWidth:{default:280},dialogComponent:{default:null},contentComponent:{default:null},dialogComponentProps:{},contentComponentProps:{},unmount:{},storedFunctions:{}},emits:["dialog-opened","dialog-closed"],setup(n,{emit:t}){const e=n,i=l.ref(!0),s=l.ref(null),o=()=>{e.overlay&&(e.unmount(),t("dialog-closed"))},a=c=>{s.value&&c.target===s.value&&o()},r=(c,d)=>{e.storedFunctions[d].forEach(h=>h()),c.close&&o()};return l.onMounted(()=>{t("dialog-opened")}),(c,d)=>(l.openBlock(),l.createBlock(l.Transition,null,{default:l.withCtx(()=>[i.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:s,class:l.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":c.overlay}),onClick:a},[c.dialogComponent?(l.openBlock(),l.createElementBlock("div",Ep,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(c.dialogComponent),l.normalizeProps(l.guardReactiveProps(c.dialogComponentProps)),null,16))])):(l.openBlock(),l.createElementBlock("div",{key:1,class:"fm-dialog",style:l.normalizeStyle({"min-width":`${e.minWidth}px`})},[l.createElementVNode("div",Vp,[l.createElementVNode("div",Bp,l.toDisplayString(c.title),1),c.closeButton?(l.openBlock(),l.createBlock(R,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:o})):l.createCommentVNode("",!0)]),c.contentComponent?(l.openBlock(),l.createElementBlock("div",vp,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(c.contentComponent),l.normalizeProps(l.guardReactiveProps(c.contentComponentProps)),null,16))])):(l.openBlock(),l.createElementBlock("div",Pp,l.toDisplayString(c.message),1)),l.createElementVNode("div",Op,[c.tertiaryActions?(l.openBlock(),l.createBlock(bt,{key:0,class:"sm:w-full xs:w-full",variant:"tertiary",label:c.tertiaryActions.text,size:"md",onClick:d[0]||(d[0]=h=>r(c.tertiaryActions,"tertiary"))},null,8,["label"])):l.createCommentVNode("",!0),l.createVNode(Ia,{class:"sm:hidden xs:hidden"}),c.secondaryActions?(l.openBlock(),l.createBlock(bt,{key:1,class:"sm:w-full xs:w-full",variant:"secondary",label:c.secondaryActions.text,size:"md",onClick:d[1]||(d[1]=h=>r(c.secondaryActions,"secondary"))},null,8,["label"])):l.createCommentVNode("",!0),c.primaryActions?(l.openBlock(),l.createBlock(bt,{key:2,class:"sm:w-full xs:w-full",variant:"primary",label:c.primaryActions.text,size:"md",onClick:d[2]||(d[2]=h=>r(c.primaryActions,"primary"))},null,8,["label"])):l.createCommentVNode("",!0)])],4))],2)):l.createCommentVNode("",!0)]),_:1}))}}),Ng="",Ap={class:"w-full"},Fp=l.defineComponent({__name:"FmField",props:{leadingIcon:{default:""},trailingIcon:{default:""},activeClass:{default:""},disabled:{type:Boolean,default:!1},iconColor:{default:"black"}},setup(n){return(t,e)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({"fm-field":!0,"fm-field--disabled":t.disabled,activeClass:t.activeClass})},[l.createVNode(R,{name:t.leadingIcon,size:"md",color:t.disabled?"disabled":t.iconColor},null,8,["name","color"]),l.createElementVNode("div",Ap,[l.renderSlot(t.$slots,"default",{},void 0,!0)]),l.createVNode(R,{name:t.trailingIcon,size:"md",color:t.disabled?"disabled":t.iconColor},null,8,["name","color"])],2))}}),Lg="",Xa=it(Fp,[["__scopeId","data-v-fae4e7ce"]]),Tp=["onSubmit","onReset"],Np=l.defineComponent({__name:"FmForm",emits:["validation-reset","validation-success","validation-failed","reset"],setup(n,{expose:t,emit:e}){const i=l.ref([]),s=l.ref(0),o=()=>{let c=[];for(let d=0;d<i.value.length;d++){const h=i.value[d];c=[...c,...h.validate()]}c.length?e("validation-failed",c):e("validation-success")},a=()=>{for(let c=0;c<i.value.length;c++){const d=i.value[c];d.resetValue(),d.resetValidation()}e("reset")};return t({validateInputs:o,resetInputsValidation:()=>{for(let c=0;c<i.value.length;c++)i.value[c].resetValidation();e("validation-reset")}}),l.provide(Wa,{register({validate:c,resetValidation:d,resetValue:h}){return i.value.push({componentId:s.value,validate:c,resetValidation:d,resetValue:h}),s.value++},unregister(c){i.value.filter(d=>d.componentId!==c)}}),(c,d)=>(l.openBlock(),l.createElementBlock("form",{onSubmit:l.withModifiers(o,["prevent"]),onReset:l.withModifiers(a,["prevent"])},[l.renderSlot(c.$slots,"default")],40,Tp))}}),Lp={class:"fm-radio-btn"},$p={class:"fm-radio-btn__input--container"},Rp=["value","disabled","checked"],zp={class:"py-8"},Ip={class:"fm-typo-body-lg-400"},Wp={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},Yp=l.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=l.ref(),s=l.inject(Ya,null),o=()=>{r.value||(s?s.updateValue(e.value):t("update:modelValue",e.value))},a=()=>{i.value&&s&&(i.value.checked=s.groupValue.value===e.value)};l.onMounted(()=>{s&&s.register(a)});const r=l.computed(()=>s?s.getDisabled():e.disabled);return(c,d)=>{const h=l.resolveDirective("wave");return l.openBlock(),l.createElementBlock("div",Lp,[l.createElementVNode("label",{class:l.normalizeClass({"fm-radio-btn--wrapper":!0,"cursor-not-allowed text-fm-color-typo-disabled":r.value,"cursor-pointer":!r.value}),onClick:o},[l.withDirectives((l.openBlock(),l.createElementBlock("div",$p,[l.createElementVNode("input",{ref_key:"inputEl",ref:i,class:"fm-radio-btn__input--btn",type:"radio",value:c.value,disabled:r.value,checked:c.value===c.modelValue},null,8,Rp)])),[[h,!r.value]]),l.createElementVNode("div",zp,[l.renderSlot(c.$slots,"label",{},()=>[l.createElementVNode("div",Ip,l.toDisplayString(c.label),1),c.sublabel?(l.openBlock(),l.createElementBlock("div",Wp,l.toDisplayString(c.sublabel),1)):l.createCommentVNode("",!0)],!0)])],2)])}}}),$g="",Hp=it(Yp,[["__scopeId","data-v-94f94580"]]);function nn(n,t,e,i=null,s=null){const o=l.ref(),a=l.inject(Wa,null),r=l.ref(!0),c=(d=s)=>{r.value=!0,t(),d&&typeof d=="function"&&d(),e("update:modelValue",i)};return l.onMounted(()=>{a&&(o.value=a.register({validate:n,resetValidation:t,resetValue:c}))}),l.onUnmounted(()=>{a&&a.unregister(o.value)}),{isPristine:r,resetValue:c}}function sn(n){const t=l.ref([]),e=l.ref();function i(){const a=[];if(n.rules&&n.rules.length>0)for(const r of n.rules){const d=(typeof r=="function"?r:()=>r)(e.value);d!==!0&&a.push(d)}return t.value=a,t.value}function s(){t.value=[]}function o(a){e.value=a}return{validate:i,resetValidation:s,errorMessages:t,setValidationValue:o}}const jp={class:"fm-text-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},Up={key:0},Xp={key:1},qp=l.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},helperText:{default:""},disabled:{type:Boolean,default:!1},label:{},rules:{default:()=>[n=>!!n||"This field is required"]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=l.ref(),s=l.ref([]),o=()=>{i.value=null,s.value.forEach(f=>f())},{validate:a,errorMessages:r,resetValidation:c,setValidationValue:d}=sn(e),{isPristine:h}=nn(a,c,t,"",o);return l.provide(Ya,{groupValue:i,getDisabled:()=>e.disabled,register(f){s.value.push(f)},updateValue(f){i.value=f,s.value.forEach(u=>u()),t("update:modelValue",f)}}),l.watch(()=>e.modelValue,()=>{h.value=!1,i.value=e.modelValue,s.value.forEach(f=>f())}),l.onMounted(()=>{d(e.modelValue)}),(f,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({"flex items-center gap-16 justify-start":f.inline})},[l.renderSlot(f.$slots,"default"),l.createElementVNode("div",jp,[l.unref(r).length===0?(l.openBlock(),l.createElementBlock("div",Up,[l.renderSlot(f.$slots,"helper-text",{},()=>[l.createTextVNode(l.toDisplayString(f.helperText),1)])])):(l.openBlock(),l.createElementBlock("div",Xp,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(r),p=>(l.openBlock(),l.createElementBlock("div",{key:p,class:"flex gap-4 items-center text-fm-color-typo-error"},[l.createVNode(R,{name:"error",color:"#FF3B30",size:"sm"}),l.createElementVNode("span",null,l.toDisplayString(p),1)]))),128))]))])],2))}}),Kp={class:"w-[280px]"},Gp=l.defineComponent({__name:"FmSelect",props:{modelValue:{},label:{},items:{},disabled:{type:Boolean,default:!1},multiselect:{type:Boolean,default:!1},placement:{default:"bottom-start"},placeholder:{default:""}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=l.ref(!1),s=(c,d)=>{if(e.multiselect){let h=[];c?h=[...l.toRaw(e.modelValue),d.value]:(h=[...e.modelValue],h=h.filter(f=>JSON.stringify(l.toRaw(f))!==JSON.stringify(d.value))),t("update:modelValue",h)}else i.value=!1,t("update:modelValue",d.value)},o=l.computed(()=>{const c=a.value.map(d=>d.label).join(", ");return c===""?e.placeholder:c}),a=l.computed(()=>e.multiselect?e.items.filter(c=>l.toRaw(e.modelValue).some(d=>r(d,c.value))):e.items.filter(c=>r(e.modelValue,c.value))),r=(c,d)=>JSON.stringify(c)===JSON.stringify(d);return(c,d)=>(l.openBlock(),l.createElementBlock("label",null,[l.createElementVNode("div",null,[l.renderSlot(c.$slots,"label",{},()=>[c.label?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-typo-body-lg-400 mb-4",{"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!c.disabled,"text-fm-color-typo-disabled":c.disabled}])},l.toDisplayString(c.label),3)):l.createCommentVNode("",!0)],!0)]),l.createVNode(Ct,{"show-menu":i.value,disabled:c.disabled,placement:c.placement,onDropdownChanged:d[0]||(d[0]=h=>i.value=h)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass([`${c.disabled?"cursor-not-allowed":"cursor-pointer"} fm-select`])},[l.createElementVNode("div",{class:l.normalizeClass({"fm-select__container":!0,"fm-select__container--expanded":i.value,"fm-select__container--disabled":c.disabled})},[l.createElementVNode("div",{class:l.normalizeClass({"fm-typo-body-lg-400 w-full h-full overflow-hidden text-ellipsis whitespace-nowrap":!0,"text-fm-color-typo-tertiary":!c.modelValue,"text-fm-color-typo-primary":!!c.modelValue})},l.toDisplayString(o.value),3),l.createVNode(R,{name:i.value?"expand_less":"expand_more",size:"md",color:c.disabled?"#C7C7CC":"black"},null,8,["name","color"])],2)],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Kp,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.items,h=>(l.openBlock(),l.createBlock(Gt,{key:h.value,"has-checkbox":c.multiselect,label:h.label,value:h.value,"model-value":a.value.some(f=>r(f.value,h.value)),"onUpdate:modelValue":f=>s(f,h)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))])]),_:1},8,["show-menu","disabled","placement"])]))}}),Rg="",Jp=it(Gp,[["__scopeId","data-v-008c2759"]]),Zp={class:"fm-stepper-field"},Qp={class:"fm-typo-body-lg-400 text-fm-color-typo-primary"},tm={key:0},em=["inputMode","value","placeholder","required","readOnly"],nm={key:0},im={key:0,class:"fm-stepper-field__stepper__container"},sm={key:0,class:"fm-stepper-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},om={key:0},am={key:1},rm=l.defineComponent({__name:"FmStepperField",props:{label:{default:""},modelValue:{},required:{type:Boolean},disabled:{type:Boolean},placeholder:{default:""},helperText:{default:""},inputmode:{default:"numeric"},readonly:{type:Boolean},step:{default:1},min:{default:0},max:{},leadingIcon:{default:""},trailingIcon:{default:""},useGrouping:{type:Boolean,default:!0},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},rules:{default:()=>[]},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,{validate:i,errorMessages:s,resetValidation:o,setValidationValue:a}=sn(e),{isPristine:r}=nn(i,o,t,null),c=l.ref(null),d=l.ref(!1),h=l.ref(!0);let f;const u=l.ref(""),p=y=>{if(y!==""){const w=+y.replace(/,/g,"");return isNaN(w)?null:w}return null},m=y=>f.format(y),g=y=>y>e.max?e.max:y<e.min?e.min:y,b=(y,w)=>{y.preventDefault(),r.value=!1;let S=(p(u.value)??0)+w;S=g(S),a(S),h.value=i().length===0,u.value=m(S),_()},_=()=>{const y=p(u.value);t("update:modelValue",y)},x=()=>{const y=p(u.value);y&&(u.value=m(g(y))),h.value=i().length===0,d.value=!1,_()},M=()=>{var w;const y=p((w=c.value)==null?void 0:w.value);u.value=y!=null?m(y):""},C=y=>{if(![...Array(10).keys()].map(w=>w.toString()).includes(y.key)&&!["Backspace","Tab","Enter",".","-","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(y.key)){y.preventDefault();return}};return l.watch(()=>e.modelValue,y=>{u.value=y!=null?m(y):"",h.value=i().length===0}),l.onMounted(()=>{a(e.modelValue),f=new Intl.NumberFormat("en-MY",{useGrouping:e.useGrouping}),u.value=e.modelValue!=null?m(e.modelValue):""}),(y,w)=>(l.openBlock(),l.createElementBlock("label",Zp,[l.createElementVNode("div",Qp,[l.renderSlot(y.$slots,"label",{},()=>[l.createTextVNode(l.toDisplayString(y.label),1)],!0)]),l.createElementVNode("div",{class:l.normalizeClass({"fm-stepper-field__container":!0,"fm-stepper-field__container--focused":d.value,"fm-stepper-field__container--invalid":!h.value&&!!y.modelValue,"fm-stepper-field__container--valid":y.showValidBorder&&h.value&&!!y.modelValue})},[l.renderSlot(y.$slots,"prepend",{},()=>[y.prependText?(l.openBlock(),l.createElementBlock("div",tm,l.toDisplayString(y.prependText),1)):l.createCommentVNode("",!0),y.leadingIcon?(l.openBlock(),l.createBlock(R,{key:1,name:y.leadingIcon,size:"md",color:y.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):l.createCommentVNode("",!0)],!0),l.createElementVNode("input",{ref_key:"inputEl",ref:c,class:"fm-stepper-field--input",type:"text",inputMode:y.inputmode,value:u.value,placeholder:y.placeholder,required:y.required,readOnly:y.readonly,onInput:M,onFocus:w[0]||(w[0]=()=>d.value=!0),onBlur:x,onKeydown:C},null,40,em),l.renderSlot(y.$slots,"append",{},()=>[l.createElementVNode("div",{class:l.normalizeClass({"mr-32":y.showSteppers})},[y.appendText?(l.openBlock(),l.createElementBlock("div",nm,l.toDisplayString(y.appendText),1)):l.createCommentVNode("",!0),y.trailingIcon?(l.openBlock(),l.createBlock(R,{key:1,name:y.trailingIcon,size:"md",color:y.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):l.createCommentVNode("",!0)],2)],!0),y.showSteppers?(l.openBlock(),l.createElementBlock("div",im,[l.createElementVNode("div",{class:"fm-stepper-field__stepper__item",onMousedown:w[1]||(w[1]=k=>b(k,y.step))},[l.createVNode(R,{name:"expand_less",size:"md",color:y.disabled?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32),l.createElementVNode("div",{class:"fm-stepper-field__stepper__item",onMousedown:w[2]||(w[2]=k=>b(k,-y.step))},[l.createVNode(R,{name:"expand_more",size:"md",color:y.disabled?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32)])):l.createCommentVNode("",!0)],2),y.helperText||l.unref(s).length>0?(l.openBlock(),l.createElementBlock("div",sm,[l.unref(s).length===0?(l.openBlock(),l.createElementBlock("div",om,[l.renderSlot(y.$slots,"helper-text",{},()=>[l.createTextVNode(l.toDisplayString(y.helperText),1)],!0)])):(l.openBlock(),l.createElementBlock("div",am,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(s),k=>(l.openBlock(),l.createElementBlock("div",{key:k,class:"flex gap-4 items-center text-fm-color-typo-error"},[l.createVNode(R,{name:"error",color:"#FF3B30",size:"sm"}),l.createElementVNode("span",null,l.toDisplayString(k),1)]))),128))]))])):l.createCommentVNode("",!0)]))}}),zg="",lm=it(rm,[["__scopeId","data-v-79048fb1"]]),cm={class:"cursor-pointer fm-switch__container"},dm={key:0},hm={class:"fm-typo-body-lg-400"},fm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},um={class:"fm-switch__input--container"},pm=["checked","value","disabled"],mm={key:1},gm={class:"fm-typo-body-lg-400"},bm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},ym=l.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)=>(l.openBlock(),l.createElementBlock("label",cm,[s.labelPlacement==="left"?(l.openBlock(),l.createElementBlock("div",dm,[l.renderSlot(s.$slots,"label",{},void 0,!0),l.createElementVNode("div",hm,l.toDisplayString(s.label),1),s.sublabel?(l.openBlock(),l.createElementBlock("div",fm,l.toDisplayString(s.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",um,[l.createElementVNode("input",{checked:s.modelValue,class:"fm-switch__input--btn",type:"checkbox",value:s.value,disabled:s.disabled,onClick:i},null,8,pm),l.createElementVNode("div",{class:l.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":s.showIcon})},[s.showIcon?(l.openBlock(),l.createBlock(R,{key:0,name:s.modelValue?"check":"close",size:"sm",color:s.disabled?"#C7C7CC":s.modelValue?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):l.createCommentVNode("",!0)],2)]),s.labelPlacement==="right"?(l.openBlock(),l.createElementBlock("div",mm,[l.createElementVNode("div",gm,l.toDisplayString(s.label),1),s.sublabel?(l.openBlock(),l.createElementBlock("div",bm,l.toDisplayString(s.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)]))}}),Ig="",_m=it(ym,[["__scopeId","data-v-77ad1e00"]]),xm={class:"fm-text-field"},km={class:"fm-text-field--label"},wm={key:0},Cm=["value","inputMode","type","placeholder","required","minlength","maxlength","disabled","readOnly"],Mm={key:0},Sm={key:0,class:"fm-text-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},Dm={key:0},Em={key:1};var qa=(n=>(n.required="*",n.optional="(optional)",n))(qa||{});const Vm=l.defineComponent({__name:"FmTextField",props:{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},labelMark:{default:"none"},leadingIcon:{default:()=>({name:"",color:""})},trailingIcon:{default:()=>({name:"",color:""})},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},label:{},modelValue:{},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=l.ref(null),s=l.ref(!1),{validate:o,errorMessages:a,resetValidation:r,setValidationValue:c}=sn(e),{isPristine:d}=nn(o,r,t,""),h=u=>{d.value=!1,u.target.value||r(),c(u.target.value),t("update:modelValue",u.target.value)};l.watch(()=>e.modelValue,()=>{c(e.modelValue),!d.value&&o()});const f=l.computed(()=>a.value.length===0);return l.onMounted(()=>{c(e.modelValue)}),(u,p)=>(l.openBlock(),l.createElementBlock("label",xm,[l.createElementVNode("div",null,[l.createElementVNode("div",km,[l.renderSlot(u.$slots,"label"),l.createElementVNode("span",{class:l.normalizeClass({"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!u.disabled,"text-fm-color-typo-disabled":u.disabled})},l.toDisplayString(u.label),3),u.labelMark!=="none"?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass({"fm-color-typo-tertiary fm-typo-body-md-400":u.labelMark==="optional","fm-color-typo-error fm-typo-body-lg-700":u.labelMark==="required"})},l.toDisplayString(qa[u.labelMark]),3)):l.createCommentVNode("",!0)])]),l.createElementVNode("div",{class:l.normalizeClass({"fm-text-field__container":!0,"fm-text-field__container--focused":s.value,"fm-text-field__container--invalid":!!u.modelValue&&!f.value,"fm-text-field__container--valid":u.showValidBorder&&u.showSuccess&&!!u.modelValue&&f.value,"fm-text-field__container--disabled":u.disabled})},[l.renderSlot(u.$slots,"prepend",{},()=>[u.prependText?(l.openBlock(),l.createElementBlock("div",wm,l.toDisplayString(u.prependText),1)):l.createCommentVNode("",!0),u.leadingIcon.name?(l.openBlock(),l.createBlock(R,{key:1,name:u.leadingIcon.name,size:"md",color:u.leadingIcon.color??(u.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):l.createCommentVNode("",!0)]),l.createElementVNode("input",{ref_key:"inputEl",ref:i,class:l.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!u.disabled,"fm-color-typo-disabled":u.disabled}),value:u.modelValue,inputMode:u.inputmode,type:u.inputmode,placeholder:u.placeholder,required:u.required,minlength:u.minLength,maxlength:u.maxLength,disabled:u.disabled,readOnly:u.readonly,onInput:h,onFocus:p[0]||(p[0]=()=>s.value=!0),onBlur:p[1]||(p[1]=()=>s.value=!1)},null,42,Cm),l.renderSlot(u.$slots,"append",{},()=>[u.appendText?(l.openBlock(),l.createElementBlock("div",Mm,l.toDisplayString(u.appendText),1)):l.createCommentVNode("",!0),u.trailingIcon.name?(l.openBlock(),l.createBlock(R,{key:1,name:u.trailingIcon.name,size:"md",color:u.trailingIcon.color??(u.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):l.createCommentVNode("",!0)])],2),u.helperText||l.unref(a).length>0?(l.openBlock(),l.createElementBlock("div",Sm,[l.unref(a).length===0?(l.openBlock(),l.createElementBlock("div",Dm,[l.renderSlot(u.$slots,"helper-text",{},()=>[l.createTextVNode(l.toDisplayString(u.helperText),1)])])):(l.openBlock(),l.createElementBlock("div",Em,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(a),m=>(l.openBlock(),l.createElementBlock("div",{key:m,class:"flex gap-4 items-center text-fm-color-typo-error"},[l.createVNode(R,{name:"error",color:"#FF3B30",size:"sm"}),l.createElementVNode("span",null,l.toDisplayString(m),1)]))),128))])),l.createElementVNode("div",{class:l.normalizeClass({"fm-color-typo-disabled":u.disabled})},l.toDisplayString(u.maxLength?`${u.modelValue.length} / ${u.maxLength}`:""),3)])):l.createCommentVNode("",!0)]))}}),Wg="",Bm={class:"fm-textarea"},vm={htmlFor:"{this.name}"},Pm={class:"fm-textarea--label"},Om=["value","placeholder","required","minlength","maxlength","readOnly","disabled"],Am={key:0,class:"fm-color-typo-secondary fm-textarea__helper-container fm-typo-body-sm-400"},Fm={key:0},Tm={key:1};var Ka=(n=>(n.required="*",n.optional="(optional)",n))(Ka||{});const Nm=l.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},labelMark:{default:"none"},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=l.ref(!1),{validate:s,errorMessages:o,resetValidation:a,setValidationValue:r}=sn(e),{isPristine:c}=nn(s,a,t,""),d=f=>{c.value=!1,r(f.target.value),t("update:modelValue",f.target.value)},h=l.computed(()=>o.value.length===0);return l.watch(()=>e.modelValue,()=>{c.value||s()}),l.onMounted(()=>{r(e.modelValue)}),(f,u)=>(l.openBlock(),l.createElementBlock("div",Bm,[l.createElementVNode("label",vm,[l.createElementVNode("div",Pm,[l.renderSlot(f.$slots,"label"),l.createElementVNode("span",{class:l.normalizeClass({"fm-typo-body-lg-400":!0,"fm-color-typo-primary":!f.disabled,"fm-color-typo-disabled":f.disabled})},l.toDisplayString(f.label),3),f.labelMark!=="none"?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass({"fm-color-typo-tertiary fm-typo-body-md-400":f.labelMark==="optional","fm-color-typo-error fm-typo-body-lg-700":f.labelMark==="required"})},l.toDisplayString(Ka[f.labelMark]),3)):l.createCommentVNode("",!0)])]),l.createElementVNode("div",{class:l.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":i.value,"fm-textarea__container--invalid":!!f.modelValue&&!h.value,"fm-textarea__container--valid":f.showValidBorder&&f.showSuccess&&!!f.modelValue&&h.value,"fm-textarea__container--disabled":f.disabled})},[l.createElementVNode("textarea",{class:l.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!f.disabled,"fm-color-typo-disabled":f.disabled}),value:f.modelValue,placeholder:f.placeholder,required:f.required,minlength:f.minLength,maxlength:f.maxLength,readOnly:f.readonly,disabled:f.disabled,onInput:d,onFocus:u[0]||(u[0]=()=>i.value=!0),onBlur:u[1]||(u[1]=()=>i.value=!1)},null,42,Om)],2),f.helperText||l.unref(o).length>0?(l.openBlock(),l.createElementBlock("div",Am,[l.unref(o).length===0?(l.openBlock(),l.createElementBlock("div",Fm,[l.renderSlot(f.$slots,"helper-text",{},()=>[l.createTextVNode(l.toDisplayString(f.helperText),1)])])):(l.openBlock(),l.createElementBlock("div",Tm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(o),p=>(l.openBlock(),l.createElementBlock("div",{key:p,class:"flex gap-4 items-center text-fm-color-typo-error"},[l.createVNode(R,{name:"error",color:"#FF3B30",size:"sm"}),l.createElementVNode("span",null,l.toDisplayString(p),1)]))),128))])),l.createElementVNode("div",{class:l.normalizeClass({"fm-color-typo-disabled":f.disabled})},l.toDisplayString(f.maxLength?`${f.modelValue.length} / ${f.maxLength}`:""),3)])):l.createCommentVNode("",!0)]))}}),Yg="",Lm=l.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(n){return(t,e)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({"fm-list--separator":t.separator,activeClass:t.activeClass})},[l.renderSlot(t.$slots,"default",{},void 0,!0)],2))}}),Hg="",$m=it(Lm,[["__scopeId","data-v-884ba127"]]),Rm=l.defineComponent({__name:"FmListItem",props:{tag:{default:"div"},clickable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},activeClass:{default:""}},setup(n){const t=n;return(e,i)=>{const s=l.resolveDirective("wave");return l.withDirectives((l.openBlock(),l.createBlock(t.tag,{class:l.normalizeClass({"fm-list-item":!0,"fm-list-item--disabled":e.disabled,"cursor-pointer":e.clickable&&!e.disabled,"cursor-not-allowed":e.clickable&&e.disabled,activeClass:e.activeClass})},{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},8,["class"])),[[s,e.clickable&&!e.disabled]])}}}),jg="",zm=it(Rm,[["__scopeId","data-v-f565b558"]]),Im={class:"fm-progress-indicator relative"},Wm=["data-progress"],Ym={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},Ga=l.defineComponent({__name:"FmProgressIndicator",props:{modelValue:{type:Number,required:!0}},setup(n){const t=n,e=l.ref(null),i=l.computed(()=>`${t.modelValue/100*360}deg`),s=o=>{e.value&&e.value.style.setProperty("--progress",o)};return l.onMounted(()=>{s(i.value)}),l.onUpdated(()=>{s(i.value)}),l.watch(i,async o=>{s(o)}),(o,a)=>(l.openBlock(),l.createElementBlock("div",Im,[l.createElementVNode("div",{ref_key:"progress",ref:e,class:"fm-progress-circular w-full","data-progress":i.value},null,8,Wm),l.createElementVNode("div",Ym,[l.renderSlot(o.$slots,"default")])]))}}),Ug="",Hm={class:"flex"},jm={key:0,class:"mt-8"},Um=l.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=l.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=l.computed(()=>e.title?{text:e.title,classes:"fm-typo-body-lg-700"}:{text:e.description,classes:""}),o=l.computed(()=>e.bgColor?Zn(e.bgColor)?{style:{backgroundColor:e.bgColor}}:{class:`bg-fm-color-${e.bgColor}`}:{class:`bg-fm-color-${i.value.bgColor}`}),a=l.computed(()=>e.color?Zn(e.color)?{style:{color:e.color}}:{class:`text-fm-color-${e.color}`}:{class:`text-fm-color-${i.value.actionColor}`});return(r,c)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(o.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[l.createElementVNode("div",Hm,[i.value.icon?(l.openBlock(),l.createBlock(R,{key:0,name:i.value.icon.name,color:e.color??i.value.icon.color,class:"mr-12"},null,8,["name","color"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(`${s.value.classes} grow ellipsis`)},l.toDisplayString(s.value.text),3),e.dismissable?(l.openBlock(),l.createBlock(R,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:c[0]||(c[0]=()=>t("onDismiss"))})):l.createCommentVNode("",!0)]),e.title&&e.description?(l.openBlock(),l.createElementBlock("div",jm,l.toDisplayString(e.description),1)):l.createCommentVNode("",!0),l.renderSlot(r.$slots,"actions",{},()=>[e.action?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[l.createElementVNode("span",{class:"cursor-pointer",onClick:c[1]||(c[1]=()=>t("onAction"))},l.toDisplayString(e.action),1)],16)):l.createCommentVNode("",!0)],!0)],16))}}),Xg="",Xm=it(Um,[["__scopeId","data-v-b6db34bb"]]),qm={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},Ja=l.defineComponent({__name:"FmStepHeader",props:{title:{type:String,required:!0},description:{type:String,default:void 0},disabled:{type:Boolean,default:!1},titleBold:{type:Boolean,default:!1}},setup(n){return(t,e)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex flex-col",n.disabled?"text-fm-color-typo-disabled":""])},[l.createElementVNode("div",{class:l.normalizeClass(["fm-step-title line-clamp-2",n.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},l.toDisplayString(n.title),3),n.description?(l.openBlock(),l.createElementBlock("div",qm,l.toDisplayString(n.description),1)):l.createCommentVNode("",!0)],2))}}),Km=["data-title","data-description","data-disabled","onClick"],Gm={class:"flex fm-step-container gap-12 grow"},Jm=l.defineComponent({__name:"FmStep",props:{title:{type:String,required:!0},description:{type:String,default:void 0},value:{type:Number,required:!0},complete:{type:Function,required:!0},error:{type:Function,default:void 0},disabled:{type:Function,default:void 0}},setup(n){const t=n,{currentStep:e,goToStep:i}=l.inject(Ha);function s(){o.value||i(t.value)}const o=l.computed(()=>t.disabled?t.disabled():!1),a=l.computed(()=>t.error?t.error():!1),r=l.computed(()=>e()===t.value),c=l.computed(()=>t.complete()),d=l.computed(()=>r.value||c.value||e()>t.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),h=l.computed(()=>r.value?{className:"bg-fm-color-primary"}:a.value?{config:{name:"warning",color:"system-error-300"}}:o.value?{className:"border-2 border-fm-color-neutral-gray-200"}:c.value?{config:{name:"check_small",color:"primary"},className:"border-2 border-fm-color-primary"}:{className:"border-2 border-fm-color-neutral-gray-300"});return(f,u)=>{const p=l.resolveDirective("wave");return l.withDirectives((l.openBlock(),l.createElementBlock("div",{"data-title":n.title,"data-description":n.description,"data-disabled":o.value,class:l.normalizeClass(`fm-step gap-4 grow ${o.value?"cursor-not-allowed":"cursor-pointer"}`),onClick:l.withModifiers(s,["stop"])},[l.createElementVNode("div",null,[l.createElementVNode("div",{class:l.normalizeClass(`fm-step-indicator ${d.value}`)},null,2)]),l.createElementVNode("div",Gm,[l.createElementVNode("div",{class:l.normalizeClass(["flex fm-step-container-icon h-[24px] items-center justify-center min-h-[24px] min-w-[24px] relative rounded-full w-[24px]",h.value.className])},[h.value.config?(l.openBlock(),l.createBlock(R,{key:0,name:h.value.config.name,color:h.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):l.createCommentVNode("",!0)],2),l.createVNode(Ja,{title:n.title,description:n.description,disabled:o.value,class:"grow"},null,8,["title","description","disabled"])])],10,Km)),[[p,!o.value]])}}}),qg="",Zm=it(Jm,[["__scopeId","data-v-ee172cad"]]),Qm={class:"hidden items-center xs:flex"},tg={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},eg=l.defineComponent({__name:"FmStepper",props:{modelValue:{type:Number,required:!0},orientation:{type:String,default:"horizontal"}},emits:["update:model-value"],setup(n,{emit:t}){const e=n,i=h=>{t("update:model-value",h)};l.provide(Ha,{currentStep:()=>e.modelValue,goToStep:i});const s=l.ref(),o=l.ref([]),a=l.computed(()=>o.value[e.modelValue-1]),r=l.computed(()=>e.modelValue/o.value.length*100),c=l.computed(()=>`${e.modelValue} of ${o.value.length}`),d=()=>{var f;const h=Array.from(((f=s.value)==null?void 0:f.querySelectorAll(":scope > .fm-step"))??[]);o.value=h.map(u=>({title:u.dataset.title??"",description:u.dataset.description,disabled:u.dataset.disabled=="true"}))};return l.onMounted(()=>{d()}),(h,f)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(`fm-stepper fm-stepper__${n.orientation}`)},[l.createElementVNode("div",{ref_key:"stepperRef",ref:s,class:l.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${n.orientation==="vertical"?"flex-col":""}`)},[l.renderSlot(h.$slots,"default")],2),l.createElementVNode("div",Qm,[l.createVNode(Ga,{"model-value":r.value,class:"mr-12",style:{"min-width":"60px"}},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(c.value),1)]),_:1},8,["model-value"]),a.value?(l.openBlock(),l.createBlock(Ja,{key:0,class:"grow","title-bold":"",title:a.value.title,description:a.value.description,disabled:a.value.disabled},null,8,["title","description","disabled"])):l.createCommentVNode("",!0)]),h.$slots.contents?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${n.orientation==="vertical"?"w-2/3":""}`)},[l.renderSlot(h.$slots,"contents"),l.createElementVNode("div",tg,[l.renderSlot(h.$slots,"actions")])],2)):l.createCommentVNode("",!0)],2))}}),ng={class:"flex flex-col fm-time-input items-center"},ig=["value"],sg=l.defineComponent({__name:"TimeInput",props:{modelValue:{type:String,required:!0},min:{type:Number,required:!0},max:{type:Number,required:!0}},emits:["update:model-value","update:cycle"],setup(n,{emit:t}){const e=n,i=l.ref();function s(d){i.value&&(i.value.value=d)}l.watch(()=>e.modelValue,s);function o(){if(!i.value)return;const d=a(i.value.value);if(d==null||d>e.max||d<e.min){s(e.modelValue);return}t("update:model-value",d)}function a(d){return d&&/^\d+$/.test(d)?Number(d):null}function r(){t("update:model-value",a(e.modelValue)+1)}function c(){t("update:model-value",a(e.modelValue)-1)}return(d,h)=>(l.openBlock(),l.createElementBlock("div",ng,[l.createElementVNode("div",{class:"fm-time-input__scroller",onClick:r},[l.createVNode(R,{name:"expand_less",size:"lg"})]),l.createElementVNode("input",{ref_key:"inputRef",ref:i,value:e.modelValue,onInput:o},null,40,ig),l.createElementVNode("div",{class:"fm-time-input__scroller",onClick:c},[l.createVNode(R,{name:"expand_more",size:"lg"})])]))}}),Kg="",Za=it(sg,[["__scopeId","data-v-35e4eeb2"]]);var Rt=(n=>(n.AM="AM",n.PM="PM",n))(Rt||{});function Jt(n){return n.toString().padStart(2,"0")}const og={class:"flex fm-time-input gap-16 items-center"},ag=l.createElementVNode("div",{class:"fm-typo-title-sm-700"}," : ",-1),rg={class:"fm-time-input-periods"},lg=["onClick"],Qa=l.defineComponent({__name:"FmTimeInput",props:{modelValue:{type:Object,required:!0}},emits:["update:model-value"],setup(n,{emit:t}){const e=n;function i(s){const o={hours:s.hours??e.modelValue.hours,minutes:s.minutes??e.modelValue.minutes,period:s.period??e.modelValue.period},a=e.modelValue.hours;(a===12&&o.hours===11||a===11&&o.hours===12)&&(o.period=e.modelValue.period===Rt.AM?Rt.PM:Rt.AM),o.hours>12?o.hours=1:o.hours<1&&(o.hours=12),o.minutes>59?o.minutes=0:o.minutes<0&&(o.minutes=59),t("update:model-value",o)}return(s,o)=>(l.openBlock(),l.createElementBlock("div",og,[l.createVNode(Za,{"model-value":l.unref(Jt)(n.modelValue.hours),min:1,max:12,"onUpdate:modelValue":o[0]||(o[0]=a=>i({hours:a}))},null,8,["model-value"]),ag,l.createVNode(Za,{"model-value":l.unref(Jt)(n.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":o[1]||(o[1]=a=>i({minutes:a}))},null,8,["model-value"]),l.createElementVNode("div",rg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Rt),a=>(l.openBlock(),l.createElementBlock("div",{key:a,class:l.normalizeClass([{"fm-time-input-period__selected":a===n.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>i({period:a})},l.toDisplayString(a),11,lg))),128))])]))}}),Gg="",cg={class:"fm-time-picker"},dg={class:"flex gap-8"},hg={class:"flex flex-col",style:{width:"343px"}},fg=l.createElementVNode("div",{class:"fm-typo-body-xl-700 pt-12 px-12"}," Enter time ",-1),ug={class:"flex justify-center w-full"},pg={class:"flex justify-end pb-12"},mg=l.defineComponent({__name:"FmTimePicker",props:{modelValue:{type:[null,String],default:null}},emits:["update:model-value"],setup(n,{emit:t}){const e=n,i=l.ref(null),s=l.computed(()=>{if(!e.modelValue)return null;const{hours:p,minutes:m,period:g}=r(e.modelValue);return`${Jt(p)}:${Jt(m)} ${g}`});function o(){if(!i.value){t("update:model-value",null);return}const{hours:p,minutes:m,period:g}=i.value,b=a(p,m,g);t("update:model-value",b),h()}function a(p,m,g){let b=p;return g===Rt.PM?b=p===12?p:p+12:p===12&&(b=0),`${Jt(b)}:${Jt(m)}`}l.onMounted(()=>{e.modelValue&&(i.value=r(e.modelValue))}),l.watch(()=>e.modelValue,p=>{p&&(i.value=r(p))});function r(p){const[m,g,b]=c(p).split(":");return{hours:Number(m),minutes:Number(g),period:b}}function c(p){const[m,g]=p.split(":"),b=Number(m),_=Number(g),x=b>11?Rt.PM:Rt.AM;let M=b;return M===0?M=12:M>12&&(M-=12),`${Jt(M)}:${Jt(_)}:${x}`}const d=l.ref();function h(){var p;(p=d.value)==null||p.hide()}const f=l.ref(!1);function u(p){p||(i.value=e.modelValue?r(e.modelValue):null),f.value=p}return(p,m)=>(l.openBlock(),l.createElementBlock("div",cg,[l.createVNode(Ct,{ref_key:"dropdownRef",ref:d,onDropdownChanged:u},{"menu-button":l.withCtx(()=>[l.createVNode(Xa,null,{default:l.withCtx(()=>[l.createElementVNode("div",dg,[l.createVNode(R,{name:"schedule",outline:!f.value},null,8,["outline"]),l.createElementVNode("div",{class:l.normalizeClass(["grow",{"text-fm-color-typo-disabled":!s.value}])},l.toDisplayString(s.value??"HH:MM"),3)])]),_:1})]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",hg,[fg,l.createElementVNode("div",ug,[l.createVNode(Qa,{"model-value":i.value??{hours:0,minutes:0,period:l.unref(Rt).AM},class:"py-16","onUpdate:modelValue":m[0]||(m[0]=g=>i.value=g)},null,8,["model-value"])]),l.createElementVNode("div",pg,[l.createVNode(bt,{label:"Cancel",variant:"tertiary",onClick:h}),l.createVNode(bt,{label:"Confirm",variant:"tertiary",onClick:o})])])]),_:1},512)]))}}),Jg="",gg={class:"px-2 py-0"},bg={key:0,class:"fm-typo-body-xl-700"},yg={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},_g={FmBreadcrumb:ir,FmButton:bt,FmButtonGroup:mr,FmCard:yr,FmCardActions:_r,FmCardSection:xr,FmCardTitle:Zi,FmLineChart:Pf,FmDatePicker:zu,FmDateRangePicker:pp,FmDialog:yp,FmDropField:wp,FmDynamicDialog:Ua,FmCheckbox:za,FmField:Xa,FmForm:Np,FmRadio:Hp,FmRadioGroup:qp,FmSelect:Jp,FmStepperField:lm,FmSwitch:_m,FmTextField:Vm,FmTextarea:Nm,FmIcon:R,FmList:$m,FmListItem:zm,FmMenu:Ct,FmMenuItem:Gt,FmProgressIndicator:Ga,FmSnackbar:Xm,FmSpacer:Ia,FmStep:Zm,FmStepper:eg,FmTimeInput:Qa,FmTimePicker:mg,FmTooltip:l.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=l.ref(null),i=l.ref(null),s=l.ref(null),o=async()=>{var _,x,M,C;const{x:p,y:m,placement:g,middlewareData:b}=await La(e.value,i.value,{placement:t.beak,middleware:[Da(10),Sa(),jf({padding:5}),t.hasArrow?du({element:s.value,padding:10}):null]});if(Object.assign(i.value.style,{left:`${p}px`,top:`${m}px`}),t.hasArrow){const y={top:"bottom",right:"left",bottom:"top",left:"right"}[g.split("-")[0]];Object.assign(s.value.style,{left:((_=b.arrow)==null?void 0:_.x)!=null?`${(x=b.arrow)==null?void 0:x.x}px`:"",top:((M=b.arrow)==null?void 0:M.y)!=null?`${(C=b.arrow)==null?void 0:C.y}px`:"",right:"",bottom:"",background:t.variant==="rich"?"#FFF":"#1C1C1E",[y]:"-4px"})}},a=l.ref(!1),r=l.ref(0),c=l.ref(0),d=l.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"})),h=()=>{clearTimeout(c.value),r.value=window.setTimeout(()=>{a.value=!0},500)},f=()=>{clearTimeout(r.value),c.value=window.setTimeout(()=>a.value=!1,1500)},u=()=>{clearTimeout(c.value),a.value=!0};return l.watchEffect(()=>{a.value?(o(),window.addEventListener("resize",o)):window.removeEventListener("resize",o)}),(p,m)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"tooltipContainer",ref:e,class:"cursor-pointer flex items-center justify-center relative w-max",onMouseenter:h,onMouseleave:f},[l.renderSlot(p.$slots,"default")],544),l.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:l.normalizeStyle(d.value),onMouseenter:u,onMouseleave:f},[l.createElementVNode("div",null,[l.createElementVNode("div",gg,[p.variant=="rich"?(l.openBlock(),l.createElementBlock("div",bg,l.toDisplayString(p.titleText),1)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(p.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},l.toDisplayString(p.contentText),3)]),p.variant=="rich"?(l.openBlock(),l.createElementBlock("div",yg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p.actionButtons,(g,b)=>(l.openBlock(),l.createElementBlock("div",{key:b},[l.createVNode(bt,{variant:"tertiary",label:g.label,onClick:g.handler},null,8,["label","onClick"])]))),128))])):l.createCommentVNode("",!0)]),l.createElementVNode("div",{ref_key:"arrowEl",ref:s,class:"-rotate-45 absolute h-3 w-3"},null,512)],36)]))}})};function xg(){const n=l.inject(ja);if(!n)throw new Error("No provider");return n}const kg=n=>{n.use(ut,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),n.use(Dp),Object.entries(_g).forEach(([t,e])=>{n.component(t,e)})};nt.uiPlugin=kg,nt.useDialog=xg,nt.useFormChild=nn,nt.useValidation=sn,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"})});
|
|
25
|
+
`):n}function wf(n,t){const{element:e,datasetIndex:s,index:i}=t,o=n.getDatasetMeta(s).controller,{label:a,value:l}=o.getLabelAndValue(i);return{chart:n,label:a,parsed:o.getParsed(i),raw:n.data.datasets[s].data[i],formattedValue:l,dataset:o.getDataset(),dataIndex:i,datasetIndex:s,element:e}}function ga(n,t){const e=n.chart.ctx,{body:s,footer:i,title:o}=n,{boxWidth:a,boxHeight:l}=t,c=nt(t.bodyFont),d=nt(t.titleFont),h=nt(t.footerFont),f=o.length,u=i.length,p=s.length,m=rt(t.padding);let g=m.height,b=0,y=s.reduce((k,x)=>k+x.before.length+x.lines.length+x.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),y){const k=t.displayColors?Math.max(l,c.lineHeight):c.lineHeight;g+=p*k+(y-p)*c.lineHeight+(y-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let w=0;const _=function(k){b=Math.max(b,e.measureText(k).width+w)};return e.save(),e.font=d.string,Y(n.title,_),e.font=c.string,Y(n.beforeBody.concat(n.afterBody),_),w=t.displayColors?a+2+t.boxPadding:0,Y(s,k=>{Y(k.before,_),Y(k.lines,_),Y(k.after,_)}),w=0,e.font=h.string,Y(n.footer,_),e.restore(),b+=m.width,{width:b,height:g}}function Cf(n,t){const{y:e,height:s}=t;return e<s/2?"top":e>n.height-s/2?"bottom":"center"}function Mf(n,t,e,s){const{x:i,width:o}=s,a=e.caretSize+e.caretPadding;if(n==="left"&&i+o+a>t.width||n==="right"&&i-o-a<0)return!0}function Sf(n,t,e,s){const{x:i,width:o}=e,{width:a,chartArea:{left:l,right:c}}=n;let d="center";return s==="center"?d=i<=(l+c)/2?"left":"right":i<=o/2?d="left":i>=a-o/2&&(d="right"),Mf(d,n,t,e)&&(d="center"),d}function ba(n,t,e){const s=e.yAlign||t.yAlign||Cf(n,e);return{xAlign:e.xAlign||t.xAlign||Sf(n,t,e,s),yAlign:s}}function Df(n,t){let{x:e,width:s}=n;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Bf(n,t,e){let{y:s,height:i}=n;return t==="top"?s+=e:t==="bottom"?s-=i+e:s-=i/2,s}function ya(n,t,e,s){const{caretSize:i,caretPadding:o,cornerRadius:a}=n,{xAlign:l,yAlign:c}=e,d=i+o,{topLeft:h,topRight:f,bottomLeft:u,bottomRight:p}=oe(a);let m=Df(t,l);const g=Bf(t,c,d);return c==="center"?l==="left"?m+=d:l==="right"&&(m-=d):l==="left"?m-=Math.max(h,u)+i:l==="right"&&(m+=Math.max(f,p)+i),{x:it(m,0,s.width-t.width),y:it(g,0,s.height-t.height)}}function In(n,t,e){const s=rt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-s.right:n.x+s.left}function _a(n){return Bt([],Rt(n))}function vf(n,t,e){return qt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function xa(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const ka={beforeTitle:Ot,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:Ot,beforeBody:Ot,beforeLabel:Ot,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:Ot,afterBody:Ot,beforeFooter:Ot,footer:Ot,afterFooter:Ot};function dt(n,t,e,s){const i=n[t].call(e,s);return typeof i>"u"?ka[t].call(e,s):i}class Is extends $t{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),i=s.enabled&&e.options.animation&&s.animations,o=new co(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=vf(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,i=dt(s,"beforeTitle",this,t),o=dt(s,"title",this,t),a=dt(s,"afterTitle",this,t);let l=[];return l=Bt(l,Rt(i)),l=Bt(l,Rt(o)),l=Bt(l,Rt(a)),l}getBeforeBody(t,e){return _a(dt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,i=[];return Y(t,o=>{const a={before:[],lines:[],after:[]},l=xa(s,o);Bt(a.before,Rt(dt(l,"beforeLabel",this,o))),Bt(a.lines,dt(l,"label",this,o)),Bt(a.after,Rt(dt(l,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,e){return _a(dt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,i=dt(s,"beforeFooter",this,t),o=dt(s,"footer",this,t),a=dt(s,"afterFooter",this,t);let l=[];return l=Bt(l,Rt(i)),l=Bt(l,Rt(o)),l=Bt(l,Rt(a)),l}_createItems(t){const e=this._active,s=this.chart.data,i=[],o=[],a=[];let l=[],c,d;for(c=0,d=e.length;c<d;++c)l.push(wf(this.chart,e[c]));return t.filter&&(l=l.filter((h,f,u)=>t.filter(h,f,u,s))),t.itemSort&&(l=l.sort((h,f)=>t.itemSort(h,f,s))),Y(l,h=>{const f=xa(t.callbacks,h);i.push(dt(f,"labelColor",this,h)),o.push(dt(f,"labelPointStyle",this,h)),a.push(dt(f,"labelTextColor",this,h))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const s=this.options.setContext(this.getContext()),i=this._active;let o,a=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const l=Ge[s.position].call(this,i,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);const c=this._size=ga(this,s),d=Object.assign({},l,c),h=ba(this.chart,s,d),f=ya(s,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,i){const o=this.getCaretPosition(t,s,i);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:i,yAlign:o}=this,{caretSize:a,cornerRadius:l}=s,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:f}=oe(l),{x:u,y:p}=t,{width:m,height:g}=e;let b,y,w,_,k,x;return o==="center"?(k=p+g/2,i==="left"?(b=u,y=b-a,_=k+a,x=k-a):(b=u+m,y=b+a,_=k-a,x=k+a),w=b):(i==="left"?y=u+Math.max(c,h)+a:i==="right"?y=u+m-Math.max(d,f)-a:y=this.caretX,o==="top"?(_=p,k=_-a,b=y-a,w=y+a):(_=p+g,k=_+a,b=y+a,w=y-a),x=_),{x1:b,x2:y,x3:w,y1:_,y2:k,y3:x}}drawTitle(t,e,s){const i=this.title,o=i.length;let a,l,c;if(o){const d=we(s.rtl,this.x,this.width);for(t.x=In(this,s.titleAlign,s),e.textAlign=d.textAlign(s.titleAlign),e.textBaseline="middle",a=nt(s.titleFont),l=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,c=0;c<o;++c)e.fillText(i[c],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,c+1===o&&(t.y+=s.titleMarginBottom-l)}}_drawColorBox(t,e,s,i,o){const a=this.labelColors[s],l=this.labelPointStyles[s],{boxHeight:c,boxWidth:d}=o,h=nt(o.bodyFont),f=In(this,"left",o),u=i.x(f),p=c<h.lineHeight?(h.lineHeight-c)/2:0,m=e.y+p;if(o.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=i.leftForLtr(u,d)+d/2,y=m+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,bs(t,g,b,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,bs(t,g,b,y)}else{t.lineWidth=z(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 g=i.leftForLtr(u,d),b=i.leftForLtr(i.xPlus(u,1),d-2),y=oe(a.borderRadius);Object.values(y).some(w=>w!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Le(t,{x:g,y:m,w:d,h:c,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Le(t,{x:b,y:m+1,w:d-2,h:c-2,radius:y}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,m,d,c),t.strokeRect(g,m,d,c),t.fillStyle=a.backgroundColor,t.fillRect(b,m+1,d-2,c-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:i}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:h}=s,f=nt(s.bodyFont);let u=f.lineHeight,p=0;const m=we(s.rtl,this.x,this.width),g=function(S){e.fillText(S,m.x(t.x+p),t.y+u/2),t.y+=u+o},b=m.textAlign(a);let y,w,_,k,x,M,C;for(e.textAlign=a,e.textBaseline="middle",e.font=f.string,t.x=In(this,b,s),e.fillStyle=s.bodyColor,Y(this.beforeBody,g),p=l&&b!=="right"?a==="center"?d/2+h:d+2+h:0,k=0,M=i.length;k<M;++k){for(y=i[k],w=this.labelTextColors[k],e.fillStyle=w,Y(y.before,g),_=y.lines,l&&_.length&&(this._drawColorBox(e,t,k,m,s),u=Math.max(f.lineHeight,c)),x=0,C=_.length;x<C;++x)g(_[x]),u=f.lineHeight;Y(y.after,g)}p=0,u=f.lineHeight,Y(this.afterBody,g),t.y-=o}drawFooter(t,e,s){const i=this.footer,o=i.length;let a,l;if(o){const c=we(s.rtl,this.x,this.width);for(t.x=In(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=c.textAlign(s.footerAlign),e.textBaseline="middle",a=nt(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,l=0;l<o;++l)e.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,i){const{xAlign:o,yAlign:a}=this,{x:l,y:c}=t,{width:d,height:h}=s,{topLeft:f,topRight:u,bottomLeft:p,bottomRight:m}=oe(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(l+f,c),a==="top"&&this.drawCaret(t,e,s,i),e.lineTo(l+d-u,c),e.quadraticCurveTo(l+d,c,l+d,c+u),a==="center"&&o==="right"&&this.drawCaret(t,e,s,i),e.lineTo(l+d,c+h-m),e.quadraticCurveTo(l+d,c+h,l+d-m,c+h),a==="bottom"&&this.drawCaret(t,e,s,i),e.lineTo(l+p,c+h),e.quadraticCurveTo(l,c+h,l,c+h-p),a==="center"&&o==="left"&&this.drawCaret(t,e,s,i),e.lineTo(l,c+f),e.quadraticCurveTo(l,c,l+f,c),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,i=s&&s.x,o=s&&s.y;if(i||o){const a=Ge[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=ga(this,t),c=Object.assign({},a,this._size),d=ba(e,t,c),h=ya(t,c,d,e);(i._to!==h.x||o._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=rt(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,i,e),to(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),eo(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,i=t.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),o=!fn(s,i),a=this._positionChanged(i,e);(o||a)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,s),l=this._positionChanged(a,t),c=e||!fn(a,o)||l;return c&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),c}_getActiveElements(t,e,s,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return e;const a=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:s,caretY:i,options:o}=this,a=Ge[o.position].call(this,t,e);return a!==!1&&(s!==a.x||i!==a.y)}}V(Is,"positioners",Ge);var Ef={id:"tooltip",_element:Is,positioners:Ge,afterInit(n,t,e){e&&(n.tooltip=new Is({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:ka},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"]},Vf=Object.freeze({__proto__:null,Colors:Ih,Decimation:Hh,Filler:ff,Legend:yf,SubTitle:kf,Title:xf,Tooltip:Ef});const Pf=(n,t,e,s)=>(typeof t=="string"?(e=n.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Of(n,t,e,s){const i=n.indexOf(t);if(i===-1)return Pf(n,t,e,s);const o=n.lastIndexOf(t);return i!==o?e:i}const Af=(n,t)=>n===null?null:it(Math.round(n),0,t);function wa(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Ws extends he{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:i,label:o}of e)s[i]===o&&s.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(I(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Of(s,t,R(e,t),this._addedLabels),Af(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(i=this.getLabels().length-1)),this.min=s,this.max=i}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,i=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)i.push({value:a});return i}getLabelForValue(t){return wa.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}}V(Ws,"id","category"),V(Ws,"defaults",{ticks:{callback:wa}});function Ff(n,t){const e=[],{bounds:i,step:o,min:a,max:l,precision:c,count:d,maxTicks:h,maxDigits:f,includeBounds:u}=n,p=o||1,m=h-1,{min:g,max:b}=t,y=!I(a),w=!I(l),_=!I(d),k=(b-g)/(f+1);let x=Mi((b-g)/m/p)*p,M,C,S,v;if(x<1e-14&&!y&&!w)return[{value:g},{value:b}];v=Math.ceil(b/x)-Math.floor(g/x),v>m&&(x=Mi(v*x/m/p)*p),I(c)||(M=Math.pow(10,c),x=Math.ceil(x*M)/M),i==="ticks"?(C=Math.floor(g/x)*x,S=Math.ceil(b/x)*x):(C=g,S=b),y&&w&&o&&Bl((l-a)/o,x/1e3)?(v=Math.round(Math.min((l-a)/x,h)),x=(l-a)/v,C=a,S=l):_?(C=y?a:C,S=w?l:S,v=d-1,x=(S-C)/v):(v=(S-C)/x,Ae(v,Math.round(v),x/1e3)?v=Math.round(v):v=Math.ceil(v));const P=Math.max(Di(x),Di(C));M=Math.pow(10,I(c)?P:c),C=Math.round(C*M)/M,S=Math.round(S*M)/M;let A=0;for(y&&(u&&C!==a?(e.push({value:a}),C<a&&A++,Ae(Math.round((C+A*x)*M)/M,a,Ca(a,k,n))&&A++):C<a&&A++);A<v;++A){const T=Math.round((C+A*x)*M)/M;if(w&&T>l)break;e.push({value:T})}return w&&u&&S!==l?e.length&&Ae(e[e.length-1].value,l,Ca(l,k,n))?e[e.length-1].value=l:e.push({value:l}):(!w||S===l)&&e.push({value:S}),e}function Ca(n,t,{horizontal:e,minRotation:s}){const i=Ct(s),o=(e?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+n).length;return Math.min(t/o,a)}class Wn extends he{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:s}=this.getUserBounds();let{min:i,max:o}=this;const a=c=>i=e?i:c,l=c=>o=s?o:c;if(t){const c=St(i),d=St(o);c<0&&d<0?l(0):c>0&&d>0&&a(0)}if(i===o){let c=o===0?1:Math.abs(o*.05);l(o+c),t||a(i-c)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,i;return s?(i=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),e=e||11),e&&(i=Math.min(e,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const i={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=Ff(i,o);return t.bounds==="ticks"&&Si(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,s=this.max;if(super.configure(),this.options.offset&&t.length){const i=(s-e)/Math.max(t.length-1,1)/2;e-=i,s+=i}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return Te(t,this.chart.options.locale,this.options.ticks.format)}}class Ys extends Wn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?t:0,this.max=J(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=Ct(this.options.ticks.minRotation),i=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}V(Ys,"id","linear"),V(Ys,"defaults",{ticks:{callback:gn.formatters.numeric}});const Je=n=>Math.floor(Xt(n)),fe=(n,t)=>Math.pow(10,Je(n)+t);function Ma(n){return n/Math.pow(10,Je(n))===1}function Sa(n,t,e){const s=Math.pow(10,e),i=Math.floor(n/s);return Math.ceil(t/s)-i}function Nf(n,t){const e=t-n;let s=Je(e);for(;Sa(n,t,s)>10;)s++;for(;Sa(n,t,s)<10;)s--;return Math.min(s,Je(n))}function Tf(n,{min:t,max:e}){t=pt(n.min,t);const s=[],i=Je(t);let o=Nf(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),c=i>o?Math.pow(10,i):0,d=Math.round((t-c)*a)/a,h=Math.floor((t-c)/l/10)*l*10;let f=Math.floor((d-h)/Math.pow(10,o)),u=pt(n.min,Math.round((c+h+f*Math.pow(10,o))*a)/a);for(;u<e;)s.push({value:u,major:Ma(u),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,a=o>=0?1:a),u=Math.round((c+h+f*Math.pow(10,o))*a)/a;const p=pt(n.max,u);return s.push({value:p,major:Ma(p),significand:f}),s}class js extends he{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const s=Wn.prototype.parse.apply(this,[t,e]);if(s===0){this._zero=!0;return}return J(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?Math.max(0,t):null,this.max=J(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!J(this._userMin)&&(this.min=t===fe(this.min,0)?fe(this.min,-1):fe(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,i=this.max;const o=l=>s=t?s:l,a=l=>i=e?i:l;s===i&&(s<=0?(o(1),a(10)):(o(fe(s,-1)),a(fe(i,1)))),s<=0&&o(fe(i,-1)),i<=0&&a(fe(s,1)),this.min=s,this.max=i}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=Tf(e,this);return t.bounds==="ticks"&&Si(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":Te(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Xt(t),this._valueRange=Xt(this.max)-Xt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Xt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}V(js,"id","logarithmic"),V(js,"defaults",{ticks:{callback:gn.formatters.logarithmic,major:{enabled:!0}}});function Hs(n){const t=n.ticks;if(t.display&&n.display){const e=rt(t.backdropPadding);return R(t.font&&t.font.size,Z.font.size)+e.height}return 0}function $f(n,t,e){return e=X(e)?e:[e],{w:jl(n,t.string,e),h:e.length*t.lineHeight}}function Da(n,t,e,s,i){return n===s||n===i?{start:t-e/2,end:t+e/2}:n<s||n>i?{start:t-e,end:t}:{start:t,end:t+e}}function Lf(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),s=[],i=[],o=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?q/o:0;for(let c=0;c<o;c++){const d=a.setContext(n.getPointLabelContext(c));i[c]=d.padding;const h=n.getPointPosition(c,n.drawingArea+i[c],l),f=nt(d.font),u=$f(n.ctx,f,n._pointLabels[c]);s[c]=u;const p=mt(n.getIndexAngle(c)+l),m=Math.round(cs(p)),g=Da(m,h.x,u.w,0,180),b=Da(m,h.y,u.h,90,270);Rf(e,t,p,g,b)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Wf(n,s,i)}function Rf(n,t,e,s,i){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let l=0,c=0;s.start<t.l?(l=(t.l-s.start)/o,n.l=Math.min(n.l,t.l-l)):s.end>t.r&&(l=(s.end-t.r)/o,n.r=Math.max(n.r,t.r+l)),i.start<t.t?(c=(t.t-i.start)/a,n.t=Math.min(n.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/a,n.b=Math.max(n.b,t.b+c))}function zf(n,t,e){const s=n.drawingArea,{extra:i,additionalAngle:o,padding:a,size:l}=e,c=n.getPointPosition(t,s+i+a,o),d=Math.round(cs(mt(c.angle+tt))),h=Hf(c.y,l.h,d),f=Yf(d),u=jf(c.x,l.w,f);return{visible:!0,x:c.x,y:h,textAlign:f,left:u,top:h,right:u+l.w,bottom:h+l.h}}function If(n,t){if(!t)return!0;const{left:e,top:s,right:i,bottom:o}=n;return!(Nt({x:e,y:s},t)||Nt({x:e,y:o},t)||Nt({x:i,y:s},t)||Nt({x:i,y:o},t))}function Wf(n,t,e){const s=[],i=n._pointLabels.length,o=n.options,{centerPointLabels:a,display:l}=o.pointLabels,c={extra:Hs(o)/2,additionalAngle:a?q/i:0};let d;for(let h=0;h<i;h++){c.padding=e[h],c.size=t[h];const f=zf(n,h,c);s.push(f),l==="auto"&&(f.visible=If(f,d),f.visible&&(d=f))}return s}function Yf(n){return n===0||n===180?"center":n<180?"left":"right"}function jf(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Hf(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Uf(n,t,e){const{left:s,top:i,right:o,bottom:a}=e,{backdropColor:l}=t;if(!I(l)){const c=oe(t.borderRadius),d=rt(t.backdropPadding);n.fillStyle=l;const h=s-d.left,f=i-d.top,u=o-s+d.width,p=a-i+d.height;Object.values(c).some(m=>m!==0)?(n.beginPath(),Le(n,{x:h,y:f,w:u,h:p,radius:c}),n.fill()):n.fillRect(h,f,u,p)}}function Xf(n,t){const{ctx:e,options:{pointLabels:s}}=n;for(let i=t-1;i>=0;i--){const o=n._pointLabelItems[i];if(!o.visible)continue;const a=s.setContext(n.getPointLabelContext(i));Uf(e,a,o);const l=nt(a.font),{x:c,y:d,textAlign:h}=o;ie(e,n._pointLabels[i],c,d+l.lineHeight/2,l,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Ba(n,t,e,s){const{ctx:i}=n;if(e)i.arc(n.xCenter,n.yCenter,t,0,K);else{let o=n.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let a=1;a<s;a++)o=n.getPointPosition(a,t),i.lineTo(o.x,o.y)}}function qf(n,t,e,s,i){const o=n.ctx,a=t.circular,{color:l,lineWidth:c}=t;!a&&!s||!l||!c||e<0||(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash(i.dash),o.lineDashOffset=i.dashOffset,o.beginPath(),Ba(n,e,a,s),o.closePath(),o.stroke(),o.restore())}function Kf(n,t,e){return qt(n,{label:e,index:t,type:"pointLabel"})}class Ze extends Wn{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=rt(Hs(this.options)/2),e=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(e,s)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=J(t)&&!isNaN(t)?t:0,this.max=J(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Hs(this.options))}generateTickLabels(t){Wn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{const i=H(this.options.pointLabels.callback,[e,s],this);return i||i===0?i:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?Lf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,i))}getIndexAngle(t){const e=K/(this._pointLabels.length||1),s=this.options.startAngle||0;return mt(t*e+Ct(s))}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 s=e[t];return Kf(this.getContext(),t,s)}}getPointPosition(t,e,s=0){const i=this.getIndexAngle(t)-tt+s;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:s,right:i,bottom:o}=this._pointLabelItems[t];return{left:e,top:s,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const s=this.ctx;s.save(),s.beginPath(),Ba(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:s,grid:i,border:o}=e,a=this._pointLabels.length;let l,c,d;if(e.pointLabels.display&&Xf(this,a),i.display&&this.ticks.forEach((h,f)=>{if(f!==0){c=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(f),p=i.setContext(u),m=o.setContext(u);qf(this,p,c,a,m)}}),s.display){for(t.save(),l=a-1;l>=0;l--){const h=s.setContext(this.getPointLabelContext(l)),{color:f,lineWidth:u}=h;!u||!f||(t.lineWidth=u,t.strokeStyle=f,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,c=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),d=this.getPointPosition(l,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;const i=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&!e.reverse)return;const d=s.setContext(this.getContext(c)),h=nt(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const f=rt(d.backdropPadding);t.fillRect(-a/2-f.left,-o-h.size/2-f.top,a+f.width,h.size+f.height)}ie(t,l.label,0,-o,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}V(Ze,"id","radialLinear"),V(Ze,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:gn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),V(Ze,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),V(Ze,"descriptors",{angleLines:{_fallback:"grid"}});const Yn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ht=Object.keys(Yn);function va(n,t){return n-t}function Ea(n,t){if(I(t))return null;const e=n._adapter,{parser:s,round:i,isoWeekday:o}=n._parseOpts;let a=t;return typeof s=="function"&&(a=s(a)),J(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(i&&(a=i==="week"&&(_e(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,i)),+a)}function Va(n,t,e,s){const i=ht.length;for(let o=ht.indexOf(n);o<i-1;++o){const a=Yn[ht[o]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=s)return ht[o]}return ht[i-1]}function Gf(n,t,e,s,i){for(let o=ht.length-1;o>=ht.indexOf(e);o--){const a=ht[o];if(Yn[a].common&&n._adapter.diff(i,s,a)>=t-1)return a}return ht[e?ht.indexOf(e):0]}function Jf(n){for(let t=ht.indexOf(n)+1,e=ht.length;t<e;++t)if(Yn[ht[t]].common)return ht[t]}function Pa(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:s,hi:i}=hs(e,t),o=e[s]>=t?e[s]:e[i];n[o]=!0}}function Zf(n,t,e,s){const i=n._adapter,o=+i.startOf(t[0].value,s),a=t[t.length-1].value;let l,c;for(l=o;l<=a;l=+i.add(l,1,s))c=e[l],c>=0&&(t[c].major=!0);return t}function Oa(n,t,e){const s=[],i={},o=t.length;let a,l;for(a=0;a<o;++a)l=t[a],i[l]=a,s.push({value:l,major:!1});return o===0||!e?s:Zf(n,s,i,e)}class Qe extends he{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),i=this._adapter=new ad._date(t.adapters.date);i.init(e),Pe(s.displayFormats,i.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Ea(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:i,max:o,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(i=Math.min(i,d.min)),!l&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),i=J(i)&&!isNaN(i)?i:+e.startOf(Date.now(),s),o=J(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,i=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,a=this.max,l=Pl(i,o,a);return this._unit=e.unit||(s.autoSkip?Va(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Gf(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Jf(this._unit),this.initOffsets(i),t.reverse&&l.reverse(),Oa(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?e=1-i:e=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=it(e,0,a),s=it(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,i=this.options,o=i.time,a=o.unit||Va(o.minUnit,e,s,this._getLabelCapacity(e)),l=R(i.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,d=_e(c)||c===!0,h={};let f=e,u,p;if(d&&(f=+t.startOf(f,"isoWeek",c)),f=+t.startOf(f,d?"day":a),t.diff(s,e,a)>1e5*l)throw new Error(e+" and "+s+" are too far apart with stepSize of "+l+" "+a);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(u=f,p=0;u<s;u=+t.add(u,l,a),p++)Pa(h,u,m);return(u===s||i.bounds==="ticks"||p===1)&&Pa(h,u,m),Object.keys(h).sort(va).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,o=this._unit,a=e||i[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,s,i){const o=this.options,a=o.ticks.callback;if(a)return H(a,[t,e,s],this);const l=o.time.displayFormats,c=this._unit,d=this._majorUnit,h=c&&l[c],f=d&&l[d],u=s[e],p=d&&f&&u&&u.major;return this._adapter.format(t,i||(p?f:h))}generateTickLabels(t){let e,s,i;for(e=0,s=t.length;e<s;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,i=Ct(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(i),a=Math.sin(i),l=this._resolveTickFontOptions(0).size;return{w:s*o+l*a,h:s*a+l*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,i=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,Oa(this,[t],this._majorUnit),i),a=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(e=0,s=i.length;e<s;++e)t=t.concat(i[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const i=this.getLabels();for(e=0,s=i.length;e<s;++e)t.push(Ea(this,i[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Vi(t.sort(va))}}V(Qe,"id","time"),V(Qe,"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 jn(n,t,e){let s=0,i=n.length-1,o,a,l,c;e?(t>=n[s].pos&&t<=n[i].pos&&({lo:s,hi:i}=Ft(n,"pos",t)),{pos:o,time:l}=n[s],{pos:a,time:c}=n[i]):(t>=n[s].time&&t<=n[i].time&&({lo:s,hi:i}=Ft(n,"time",t)),{time:o,pos:l}=n[s],{time:a,pos:c}=n[i]);const d=a-o;return d?l+(c-l)*(t-o)/d:l}class Us extends Qe{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=jn(e,this.min),this._tableRange=jn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,i=[],o=[];let a,l,c,d,h;for(a=0,l=t.length;a<l;++a)d=t[a],d>=e&&d<=s&&i.push(d);if(i.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,l=i.length;a<l;++a)h=i[a+1],c=i[a-1],d=i[a],Math.round((h+c)/2)!==d&&o.push({time:d,pos:a/(l-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(jn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return jn(this._table,s*this._tableRange+this._minPos,!0)}}V(Us,"id","timeseries"),V(Us,"defaults",Qe.defaults);var Qf=Object.freeze({__proto__:null,CategoryScale:Ws,LinearScale:Ys,LogarithmicScale:js,RadialLinearScale:Ze,TimeScale:Qe,TimeSeriesScale:Us});const tu=[od,Nh,Vf,Qf];Lt.register(...tu);const eu={class:"px-24 py-16"},nu={class:"flex flex-col gap-8"},su={class:"fm-color-typo-primary fm-typo-body-lg-400"},iu={class:"fm-color-typo-secondary fm-typo-body-md-400"},ou=r.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{}},setup(n){const t=n,e=r.ref(null);let s=null;r.watch([()=>t.xAxis,()=>t.datasets],()=>{s&&(s.data.datasets=t.datasets,s.data.labels=t.xAxis.categories,s.update())});function i(d,h){const f=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(d);if(f)return`rgba(${parseInt(f[1],16)},${parseInt(f[2],16)},${parseInt(f[3],16)},${h})`;if(d.startsWith("rgb")){const u=d.split(",");if(u.length===3)return[...u.slice(0,2),u[2].replace(")",`,${h})`)].join(",");if(u.length===4)return[...u.slice(0,3),`${h})`].join(",")}return""}function o(d){const h=getComputedStyle(document.documentElement).getPropertyValue(`--${d}`)||d;return h.startsWith("rgb")||h.startsWith("#")?h:null}function a({context:d,color:h}){const{ctx:f,chartArea:u}=d.chart;if(!u)return;const p=f==null?void 0:f.createLinearGradient(0,0,0,u.height);return p.addColorStop(0,i(h,.5)),p.addColorStop(1,i(h,0)),p}const l=r.computed(()=>({labels:t.xAxis.categories,datasets:t.datasets.map(d=>{const h=o(d.color)??"";return{...d,backgroundColor:h?f=>a({context:f,color:h}):"",borderColor:h,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));function c(){e.value&&(s=new Lt(e.value,{type:"line",data:l.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 r.onMounted(()=>{c()}),(d,h)=>(r.openBlock(),r.createElementBlock("div",eu,[r.createElementVNode("div",nu,[r.createElementVNode("div",su,r.toDisplayString(d.name),1),r.createElementVNode("div",iu,r.toDisplayString(d.paragraph),1)]),r.createElementVNode("canvas",{ref_key:"canvas",ref:e},null,512)]))}});function au(){var n;return(n=r.getCurrentInstance())==null?void 0:n.emit}function xt(n,t){const e=au(),s=r.ref(n[t]);return r.watch(()=>n[t],()=>{s.value=n[t]}),r.computed({get(){return s.value},set(o){s.value=o,e==null||e(`update:${t}`,o)}})}const ru={class:"fm-checkbox"},lu={class:"fm-checkbox--wrapper"},cu={class:"fm-checkbox__input--container"},du=["checked","disabled","indeterminate"],hu={key:0,class:"fm-checkbox__label-container"},fu={class:"fm-typo-body-lg-400"},uu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Aa=r.defineComponent({__name:"FmCheckbox",props:{modelValue:{type:[Boolean,Array]},label:{},sublabel:{default:""},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},value:{}},emits:["update:modelValue","update:indeterminate"],setup(n){const t=n,e=xt(t,"modelValue"),s=xt(t,"indeterminate"),i=Array.isArray(e.value),o=r.ref(i?e.value.some(d=>a(d,t.value)):e.value),a=(d,h)=>JSON.stringify(d)===JSON.stringify(h),l=r.computed(()=>{const d=i?e.value.some(h=>a(h,t.value)):e.value;return s.value&&!d?"remove":e.value?"check_small":""});function c(){if(t.disabled)return;s.value=!1,o.value=!o.value;let d=e.value;i?d=o.value?d.concat(t.value):d.filter(h=>!a(h,t.value)):d=o.value,e.value=d}return r.watch(()=>e.value,()=>{o.value=i?e.value.some(d=>a(d,t.value)):e.value}),(d,h)=>(r.openBlock(),r.createElementBlock("div",ru,[r.createElementVNode("label",lu,[r.createElementVNode("div",cu,[r.createElementVNode("input",{class:r.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":o.value}),type:"checkbox",checked:o.value,disabled:t.disabled,indeterminate:r.unref(s),onClick:c},null,10,du),r.unref(s)||o.value?(r.openBlock(),r.createBlock(L,{key:0,class:"fm-checkbox__input--checkmark",name:l.value,size:"md",color:"#FFFFFF"},null,8,["name"])):r.createCommentVNode("",!0)]),t.label?(r.openBlock(),r.createElementBlock("div",hu,[r.renderSlot(d.$slots,"label"),r.createElementVNode("div",fu,r.toDisplayString(t.label),1),t.sublabel?(r.openBlock(),r.createElementBlock("div",uu,r.toDisplayString(t.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)])]))}}),qg="";var pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Fa={exports:{}};(function(n,t){(function(e,s){n.exports=s()})(pu,function(){var e=1e3,s=6e4,i=36e5,o="millisecond",a="second",l="minute",c="hour",d="day",h="week",f="month",u="quarter",p="year",m="date",g="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,w={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(F){var B=["th","st","nd","rd"],D=F%100;return"["+F+(B[(D-20)%10]||B[D]||B[0])+"]"}},_=function(F,B,D){var E=String(F);return!E||E.length>=B?F:""+Array(B+1-E.length).join(D)+F},k={s:_,z:function(F){var B=-F.utcOffset(),D=Math.abs(B),E=Math.floor(D/60),O=D%60;return(B<=0?"+":"-")+_(E,2,"0")+":"+_(O,2,"0")},m:function F(B,D){if(B.date()<D.date())return-F(D,B);var E=12*(D.year()-B.year())+(D.month()-B.month()),O=B.clone().add(E,f),N=D-O<0,$=B.clone().add(E+(N?-1:1),f);return+(-(E+(D-O)/(N?O-$:$-O))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:f,y:p,w:h,d,D:m,h:c,m:l,s:a,ms:o,Q:u}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},x="en",M={};M[x]=w;var C="$isDayjsObject",S=function(F){return F instanceof T||!(!F||!F[C])},v=function F(B,D,E){var O;if(!B)return x;if(typeof B=="string"){var N=B.toLowerCase();M[N]&&(O=N),D&&(M[N]=D,O=N);var $=B.split("-");if(!O&&$.length>1)return F($[0])}else{var W=B.name;M[W]=B,O=W}return!E&&O&&(x=O),O||!E&&x},P=function(F,B){if(S(F))return F.clone();var D=typeof B=="object"?B:{};return D.date=F,D.args=arguments,new T(D)},A=k;A.l=v,A.i=S,A.w=function(F,B){return P(F,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var T=function(){function F(D){this.$L=v(D.locale,null,!0),this.parse(D),this.$x=this.$x||D.x||{},this[C]=!0}var B=F.prototype;return B.parse=function(D){this.$d=function(E){var O=E.date,N=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 $=O.match(b);if($){var W=$[2]-1||0,j=($[7]||"0").substring(0,3);return N?new Date(Date.UTC($[1],W,$[3]||1,$[4]||0,$[5]||0,$[6]||0,j)):new Date($[1],W,$[3]||1,$[4]||0,$[5]||0,$[6]||0,j)}}return new Date(O)}(D),this.init()},B.init=function(){var D=this.$d;this.$y=D.getFullYear(),this.$M=D.getMonth(),this.$D=D.getDate(),this.$W=D.getDay(),this.$H=D.getHours(),this.$m=D.getMinutes(),this.$s=D.getSeconds(),this.$ms=D.getMilliseconds()},B.$utils=function(){return A},B.isValid=function(){return this.$d.toString()!==g},B.isSame=function(D,E){var O=P(D);return this.startOf(E)<=O&&O<=this.endOf(E)},B.isAfter=function(D,E){return P(D)<this.startOf(E)},B.isBefore=function(D,E){return this.endOf(E)<P(D)},B.$g=function(D,E,O){return A.u(D)?this[E]:this.set(O,D)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(D,E){var O=this,N=!!A.u(E)||E,$=A.p(D),W=function(be,ft){var te=A.w(O.$u?Date.UTC(O.$y,ft,be):new Date(O.$y,ft,be),O);return N?te:te.endOf(d)},j=function(be,ft){return A.w(O.toDate()[be].apply(O.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(ft)),O)},G=this.$W,Q=this.$M,ot=this.$D,wt="set"+(this.$u?"UTC":"");switch($){case p:return N?W(1,0):W(31,11);case f:return N?W(1,Q):W(0,Q+1);case h:var ge=this.$locale().weekStart||0,an=(G<ge?G+7:G)-ge;return W(N?ot-an:ot+(6-an),Q);case d:case m:return j(wt+"Hours",0);case c:return j(wt+"Minutes",1);case l:return j(wt+"Seconds",2);case a:return j(wt+"Milliseconds",3);default:return this.clone()}},B.endOf=function(D){return this.startOf(D,!1)},B.$set=function(D,E){var O,N=A.p(D),$="set"+(this.$u?"UTC":""),W=(O={},O[d]=$+"Date",O[m]=$+"Date",O[f]=$+"Month",O[p]=$+"FullYear",O[c]=$+"Hours",O[l]=$+"Minutes",O[a]=$+"Seconds",O[o]=$+"Milliseconds",O)[N],j=N===d?this.$D+(E-this.$W):E;if(N===f||N===p){var G=this.clone().set(m,1);G.$d[W](j),G.init(),this.$d=G.set(m,Math.min(this.$D,G.daysInMonth())).$d}else W&&this.$d[W](j);return this.init(),this},B.set=function(D,E){return this.clone().$set(D,E)},B.get=function(D){return this[A.p(D)]()},B.add=function(D,E){var O,N=this;D=Number(D);var $=A.p(E),W=function(Q){var ot=P(N);return A.w(ot.date(ot.date()+Math.round(Q*D)),N)};if($===f)return this.set(f,this.$M+D);if($===p)return this.set(p,this.$y+D);if($===d)return W(1);if($===h)return W(7);var j=(O={},O[l]=s,O[c]=i,O[a]=e,O)[$]||1,G=this.$d.getTime()+D*j;return A.w(G,this)},B.subtract=function(D,E){return this.add(-1*D,E)},B.format=function(D){var E=this,O=this.$locale();if(!this.isValid())return O.invalidDate||g;var N=D||"YYYY-MM-DDTHH:mm:ssZ",$=A.z(this),W=this.$H,j=this.$m,G=this.$M,Q=O.weekdays,ot=O.months,wt=O.meridiem,ge=function(ft,te,rn,es){return ft&&(ft[te]||ft(E,N))||rn[te].slice(0,es)},an=function(ft){return A.s(W%12||12,ft,"0")},be=wt||function(ft,te,rn){var es=ft<12?"AM":"PM";return rn?es.toLowerCase():es};return N.replace(y,function(ft,te){return te||function(rn){switch(rn){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 ge(O.monthsShort,G,ot,3);case"MMMM":return ge(ot,G);case"D":return E.$D;case"DD":return A.s(E.$D,2,"0");case"d":return String(E.$W);case"dd":return ge(O.weekdaysMin,E.$W,Q,2);case"ddd":return ge(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 an(1);case"hh":return an(2);case"a":return be(W,j,!0);case"A":return be(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 $}return null}(ft)||$.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(D,E,O){var N,$=this,W=A.p(E),j=P(D),G=(j.utcOffset()-this.utcOffset())*s,Q=this-j,ot=function(){return A.m($,j)};switch(W){case p:N=ot()/12;break;case f:N=ot();break;case u:N=ot()/3;break;case h:N=(Q-G)/6048e5;break;case d:N=(Q-G)/864e5;break;case c:N=Q/i;break;case l:N=Q/s;break;case a:N=Q/e;break;default:N=Q}return O?N:A.a(N)},B.daysInMonth=function(){return this.endOf(f).$D},B.$locale=function(){return M[this.$L]},B.locale=function(D,E){if(!D)return this.$L;var O=this.clone(),N=v(D,E,!0);return N&&(O.$L=N),O},B.clone=function(){return A.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},F}(),U=T.prototype;return P.prototype=U,[["$ms",o],["$s",a],["$m",l],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(F){U[F[1]]=function(B){return this.$g(B,F[0],F[1])}}),P.extend=function(F,B){return F.$i||(F(B,T,P),F.$i=!0),P},P.locale=v,P.isDayjs=S,P.unix=function(F){return P(1e3*F)},P.en=M[x],P.Ls=M,P.p={},P})})(Fa);var gu=Fa.exports;const ct=mu(gu),Me=Math.min,ue=Math.max,Hn=Math.round,Un=Math.floor,Jt=n=>({x:n,y:n}),bu={left:"right",right:"left",bottom:"top",top:"bottom"},yu={start:"end",end:"start"};function Xs(n,t,e){return ue(n,Me(t,e))}function tn(n,t){return typeof n=="function"?n(t):n}function pe(n){return n.split("-")[0]}function en(n){return n.split("-")[1]}function Na(n){return n==="x"?"y":"x"}function qs(n){return n==="y"?"height":"width"}function Xn(n){return["top","bottom"].includes(pe(n))?"y":"x"}function Ks(n){return Na(Xn(n))}function _u(n,t,e){e===void 0&&(e=!1);const s=en(n),i=Ks(n),o=qs(i);let a=i==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=qn(a)),[a,qn(a)]}function xu(n){const t=qn(n);return[Gs(n),t,Gs(t)]}function Gs(n){return n.replace(/start|end/g,t=>yu[t])}function ku(n,t,e){const s=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(n){case"top":case"bottom":return e?t?i:s:t?s:i;case"left":case"right":return t?o:a;default:return[]}}function wu(n,t,e,s){const i=en(n);let o=ku(pe(n),e==="start",s);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Gs)))),o}function qn(n){return n.replace(/left|right|bottom|top/g,t=>bu[t])}function Cu(n){return{top:0,right:0,bottom:0,left:0,...n}}function Ta(n){return typeof n!="number"?Cu(n):{top:n,right:n,bottom:n,left:n}}function Kn(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function $a(n,t,e){let{reference:s,floating:i}=n;const o=Xn(t),a=Ks(t),l=qs(a),c=pe(t),d=o==="y",h=s.x+s.width/2-i.width/2,f=s.y+s.height/2-i.height/2,u=s[l]/2-i[l]/2;let p;switch(c){case"top":p={x:h,y:s.y-i.height};break;case"bottom":p={x:h,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:f};break;case"left":p={x:s.x-i.width,y:f};break;default:p={x:s.x,y:s.y}}switch(en(t)){case"start":p[a]-=u*(e&&d?-1:1);break;case"end":p[a]+=u*(e&&d?-1:1);break}return p}const Mu=async(n,t,e)=>{const{placement:s="bottom",strategy:i="absolute",middleware:o=[],platform:a}=e,l=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:n,floating:t,strategy:i}),{x:h,y:f}=$a(d,s,c),u=s,p={},m=0;for(let g=0;g<l.length;g++){const{name:b,fn:y}=l[g],{x:w,y:_,data:k,reset:x}=await y({x:h,y:f,initialPlacement:s,placement:u,strategy:i,middlewareData:p,rects:d,platform:a,elements:{reference:n,floating:t}});if(h=w??h,f=_??f,p={...p,[b]:{...p[b],...k}},x&&m<=50){m++,typeof x=="object"&&(x.placement&&(u=x.placement),x.rects&&(d=x.rects===!0?await a.getElementRects({reference:n,floating:t,strategy:i}):x.rects),{x:h,y:f}=$a(d,u,c)),g=-1;continue}}return{x:h,y:f,placement:u,strategy:i,middlewareData:p}};async function La(n,t){var e;t===void 0&&(t={});const{x:s,y:i,platform:o,rects:a,elements:l,strategy:c}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:p=0}=tn(t,n),m=Ta(p),b=l[u?f==="floating"?"reference":"floating":f],y=Kn(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(l.floating)),boundary:d,rootBoundary:h,strategy:c})),w=f==="floating"?{...a.floating,x:s,y:i}:a.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),k=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},x=Kn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:_,strategy:c}):w);return{top:(y.top-x.top+m.top)/k.y,bottom:(x.bottom-y.bottom+m.bottom)/k.y,left:(y.left-x.left+m.left)/k.x,right:(x.right-y.right+m.right)/k.x}}const Su=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:s,placement:i,rects:o,platform:a,elements:l,middlewareData:c}=t,{element:d,padding:h=0}=tn(n,t)||{};if(d==null)return{};const f=Ta(h),u={x:e,y:s},p=Ks(i),m=qs(p),g=await a.getDimensions(d),b=p==="y",y=b?"top":"left",w=b?"bottom":"right",_=b?"clientHeight":"clientWidth",k=o.reference[m]+o.reference[p]-u[p]-o.floating[m],x=u[p]-o.reference[p],M=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let C=M?M[_]:0;(!C||!await(a.isElement==null?void 0:a.isElement(M)))&&(C=l.floating[_]||o.floating[m]);const S=k/2-x/2,v=C/2-g[m]/2-1,P=Me(f[y],v),A=Me(f[w],v),T=P,U=C-g[m]-A,F=C/2-g[m]/2+S,B=Xs(T,F,U),D=!c.arrow&&en(i)!=null&&F!=B&&o.reference[m]/2-(F<T?P:A)-g[m]/2<0,E=D?F<T?F-T:F-U:0;return{[p]:u[p]+E,data:{[p]:B,centerOffset:F-B-E,...D&&{alignmentOffset:E}},reset:D}}}),Ra=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,s;const{placement:i,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=tn(n,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};const y=pe(i),w=pe(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=u||(w||!g?[qn(l)]:xu(l));!u&&m!=="none"&&k.push(...wu(l,g,m,_));const x=[l,...k],M=await La(t,b),C=[];let S=((s=o.flip)==null?void 0:s.overflows)||[];if(h&&C.push(M[y]),f){const T=_u(i,a,_);C.push(M[T[0]],M[T[1]])}if(S=[...S,{placement:i,overflows:C}],!C.every(T=>T<=0)){var v,P;const T=(((v=o.flip)==null?void 0:v.index)||0)+1,U=x[T];if(U)return{data:{index:T,overflows:S},reset:{placement:U}};let F=(P=S.filter(B=>B.overflows[0]<=0).sort((B,D)=>B.overflows[1]-D.overflows[1])[0])==null?void 0:P.placement;if(!F)switch(p){case"bestFit":{var A;const B=(A=S.map(D=>[D.placement,D.overflows.filter(E=>E>0).reduce((E,O)=>E+O,0)]).sort((D,E)=>D[1]-E[1])[0])==null?void 0:A[0];B&&(F=B);break}case"initialPlacement":F=l;break}if(i!==F)return{reset:{placement:F}}}return{}}}};async function Du(n,t){const{placement:e,platform:s,elements:i}=n,o=await(s.isRTL==null?void 0:s.isRTL(i.floating)),a=pe(e),l=en(e),c=Xn(e)==="y",d=["left","top"].includes(a)?-1:1,h=o&&c?-1:1,f=tn(t,n);let{mainAxis:u,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*h,y:u*d}:{x:u*d,y:p*h}}const za=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){const{x:e,y:s}=t,i=await Du(t,n);return{x:e+i.x,y:s+i.y,data:i}}}},Bu=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:s,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:y,y:w}=b;return{x:y,y:w}}},...c}=tn(n,t),d={x:e,y:s},h=await La(t,c),f=Xn(pe(i)),u=Na(f);let p=d[u],m=d[f];if(o){const b=u==="y"?"top":"left",y=u==="y"?"bottom":"right",w=p+h[b],_=p-h[y];p=Xs(w,p,_)}if(a){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=m+h[b],_=m-h[y];m=Xs(w,m,_)}const g=l.fn({...t,[u]:p,[f]:m});return{...g,data:{x:g.x-e,y:g.y-s}}}}};function Zt(n){return Ia(n)?(n.nodeName||"").toLowerCase():"#document"}function gt(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function zt(n){var t;return(t=(Ia(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Ia(n){return n instanceof Node||n instanceof gt(n).Node}function It(n){return n instanceof Element||n instanceof gt(n).Element}function vt(n){return n instanceof HTMLElement||n instanceof gt(n).HTMLElement}function Wa(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof gt(n).ShadowRoot}function nn(n){const{overflow:t,overflowX:e,overflowY:s,display:i}=kt(n);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(i)}function vu(n){return["table","td","th"].includes(Zt(n))}function Js(n){const t=Zs(),e=kt(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(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function Eu(n){let t=Se(n);for(;vt(t)&&!Gn(t);){if(Js(t))return t;t=Se(t)}return null}function Zs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Gn(n){return["html","body","#document"].includes(Zt(n))}function kt(n){return gt(n).getComputedStyle(n)}function Jn(n){return It(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function Se(n){if(Zt(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Wa(n)&&n.host||zt(n);return Wa(t)?t.host:t}function Ya(n){const t=Se(n);return Gn(t)?n.ownerDocument?n.ownerDocument.body:n.body:vt(t)&&nn(t)?t:Ya(t)}function sn(n,t,e){var s;t===void 0&&(t=[]),e===void 0&&(e=!0);const i=Ya(n),o=i===((s=n.ownerDocument)==null?void 0:s.body),a=gt(i);return o?t.concat(a,a.visualViewport||[],nn(i)?i:[],a.frameElement&&e?sn(a.frameElement):[]):t.concat(i,sn(i,[],e))}function ja(n){const t=kt(n);let e=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=vt(n),o=i?n.offsetWidth:e,a=i?n.offsetHeight:s,l=Hn(e)!==o||Hn(s)!==a;return l&&(e=o,s=a),{width:e,height:s,$:l}}function Qs(n){return It(n)?n:n.contextElement}function De(n){const t=Qs(n);if(!vt(t))return Jt(1);const e=t.getBoundingClientRect(),{width:s,height:i,$:o}=ja(t);let a=(o?Hn(e.width):e.width)/s,l=(o?Hn(e.height):e.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Vu=Jt(0);function Ha(n){const t=gt(n);return!Zs()||!t.visualViewport?Vu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Pu(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==gt(n)?!1:t}function me(n,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);const i=n.getBoundingClientRect(),o=Qs(n);let a=Jt(1);t&&(s?It(s)&&(a=De(s)):a=De(n));const l=Pu(o,e,s)?Ha(o):Jt(0);let c=(i.left+l.x)/a.x,d=(i.top+l.y)/a.y,h=i.width/a.x,f=i.height/a.y;if(o){const u=gt(o),p=s&&It(s)?gt(s):s;let m=u.frameElement;for(;m&&s&&p!==u;){const g=De(m),b=m.getBoundingClientRect(),y=kt(m),w=b.left+(m.clientLeft+parseFloat(y.paddingLeft))*g.x,_=b.top+(m.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,d*=g.y,h*=g.x,f*=g.y,c+=w,d+=_,m=gt(m).frameElement}}return Kn({width:h,height:f,x:c,y:d})}function Ou(n){let{rect:t,offsetParent:e,strategy:s}=n;const i=vt(e),o=zt(e);if(e===o)return t;let a={scrollLeft:0,scrollTop:0},l=Jt(1);const c=Jt(0);if((i||!i&&s!=="fixed")&&((Zt(e)!=="body"||nn(o))&&(a=Jn(e)),vt(e))){const d=me(e);l=De(e),c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+c.x,y:t.y*l.y-a.scrollTop*l.y+c.y}}function Au(n){return Array.from(n.getClientRects())}function Ua(n){return me(zt(n)).left+Jn(n).scrollLeft}function Fu(n){const t=zt(n),e=Jn(n),s=n.ownerDocument.body,i=ue(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=ue(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let a=-e.scrollLeft+Ua(n);const l=-e.scrollTop;return kt(s).direction==="rtl"&&(a+=ue(t.clientWidth,s.clientWidth)-i),{width:i,height:o,x:a,y:l}}function Nu(n,t){const e=gt(n),s=zt(n),i=e.visualViewport;let o=s.clientWidth,a=s.clientHeight,l=0,c=0;if(i){o=i.width,a=i.height;const d=Zs();(!d||d&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:l,y:c}}function Tu(n,t){const e=me(n,!0,t==="fixed"),s=e.top+n.clientTop,i=e.left+n.clientLeft,o=vt(n)?De(n):Jt(1),a=n.clientWidth*o.x,l=n.clientHeight*o.y,c=i*o.x,d=s*o.y;return{width:a,height:l,x:c,y:d}}function Xa(n,t,e){let s;if(t==="viewport")s=Nu(n,e);else if(t==="document")s=Fu(zt(n));else if(It(t))s=Tu(t,e);else{const i=Ha(n);s={...t,x:t.x-i.x,y:t.y-i.y}}return Kn(s)}function qa(n,t){const e=Se(n);return e===t||!It(e)||Gn(e)?!1:kt(e).position==="fixed"||qa(e,t)}function $u(n,t){const e=t.get(n);if(e)return e;let s=sn(n,[],!1).filter(l=>It(l)&&Zt(l)!=="body"),i=null;const o=kt(n).position==="fixed";let a=o?Se(n):n;for(;It(a)&&!Gn(a);){const l=kt(a),c=Js(a);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||nn(a)&&!c&&qa(n,a))?s=s.filter(h=>h!==a):i=l,a=Se(a)}return t.set(n,s),s}function Lu(n){let{element:t,boundary:e,rootBoundary:s,strategy:i}=n;const a=[...e==="clippingAncestors"?$u(t,this._c):[].concat(e),s],l=a[0],c=a.reduce((d,h)=>{const f=Xa(t,h,i);return d.top=ue(f.top,d.top),d.right=Me(f.right,d.right),d.bottom=Me(f.bottom,d.bottom),d.left=ue(f.left,d.left),d},Xa(t,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ru(n){return ja(n)}function zu(n,t,e){const s=vt(t),i=zt(t),o=e==="fixed",a=me(n,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=Jt(0);if(s||!s&&!o)if((Zt(t)!=="body"||nn(i))&&(l=Jn(t)),s){const d=me(t,!0,o,t);c.x=d.x+t.clientLeft,c.y=d.y+t.clientTop}else i&&(c.x=Ua(i));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function Ka(n,t){return!vt(n)||kt(n).position==="fixed"?null:t?t(n):n.offsetParent}function Ga(n,t){const e=gt(n);if(!vt(n))return e;let s=Ka(n,t);for(;s&&vu(s)&&kt(s).position==="static";)s=Ka(s,t);return s&&(Zt(s)==="html"||Zt(s)==="body"&&kt(s).position==="static"&&!Js(s))?e:s||Eu(n)||e}const Iu=async function(n){let{reference:t,floating:e,strategy:s}=n;const i=this.getOffsetParent||Ga,o=this.getDimensions;return{reference:zu(t,await i(e),s),floating:{x:0,y:0,...await o(e)}}};function Wu(n){return kt(n).direction==="rtl"}const Yu={convertOffsetParentRelativeRectToViewportRelativeRect:Ou,getDocumentElement:zt,getClippingRect:Lu,getOffsetParent:Ga,getElementRects:Iu,getClientRects:Au,getDimensions:Ru,getScale:De,isElement:It,isRTL:Wu};function ju(n,t){let e=null,s;const i=zt(n);function o(){clearTimeout(s),e&&e.disconnect(),e=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const{left:d,top:h,width:f,height:u}=n.getBoundingClientRect();if(l||t(),!f||!u)return;const p=Un(h),m=Un(i.clientWidth-(d+f)),g=Un(i.clientHeight-(h+u)),b=Un(d),w={rootMargin:-p+"px "+-m+"px "+-g+"px "+-b+"px",threshold:ue(0,Me(1,c))||1};let _=!0;function k(x){const M=x[0].intersectionRatio;if(M!==c){if(!_)return a();M?a(!1,M):s=setTimeout(()=>{a(!1,1e-7)},100)}_=!1}try{e=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{e=new IntersectionObserver(k,w)}e.observe(n)}return a(!0),o}function Hu(n,t,e,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=Qs(n),h=i||o?[...d?sn(d):[],...sn(t)]:[];h.forEach(y=>{i&&y.addEventListener("scroll",e,{passive:!0}),o&&y.addEventListener("resize",e)});const f=d&&l?ju(d,e):null;let u=-1,p=null;a&&(p=new ResizeObserver(y=>{let[w]=y;w&&w.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{p&&p.observe(t)})),e()}),d&&!c&&p.observe(d),p.observe(t));let m,g=c?me(n):null;c&&b();function b(){const y=me(n);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&e(),g=y,m=requestAnimationFrame(b)}return e(),()=>{h.forEach(y=>{i&&y.removeEventListener("scroll",e),o&&y.removeEventListener("resize",e)}),f&&f(),p&&p.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const Ja=(n,t,e)=>{const s=new Map,i={platform:Yu,...e},o={...i.platform,_c:s};return Mu(n,t,{...i,platform:o})};function ti(n){var t;return(t=n==null?void 0:n.$el)!=null?t:n}function Uu(n){return{name:"arrow",options:n,fn(t){const e=ti(r.unref(n.element));return e==null?{}:Su({element:e,padding:n.padding}).fn(t)}}}function Za(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Qa(n,t){const e=Za(n);return Math.round(t*e)/e}function Xu(n,t,e){e===void 0&&(e={});const s=e.whileElementsMounted,i=r.computed(()=>{var C;return(C=r.unref(e.open))!=null?C:!0}),o=r.computed(()=>r.unref(e.middleware)),a=r.computed(()=>{var C;return(C=r.unref(e.placement))!=null?C:"bottom"}),l=r.computed(()=>{var C;return(C=r.unref(e.strategy))!=null?C:"absolute"}),c=r.computed(()=>{var C;return(C=r.unref(e.transform))!=null?C:!0}),d=r.computed(()=>ti(n.value)),h=r.computed(()=>ti(t.value)),f=r.ref(0),u=r.ref(0),p=r.ref(l.value),m=r.ref(a.value),g=r.shallowRef({}),b=r.ref(!1),y=r.computed(()=>{const C={position:p.value,left:"0",top:"0"};if(!h.value)return C;const S=Qa(h.value,f.value),v=Qa(h.value,u.value);return c.value?{...C,transform:"translate("+S+"px, "+v+"px)",...Za(h.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:S+"px",top:v+"px"}});let w;function _(){d.value==null||h.value==null||Ja(d.value,h.value,{middleware:o.value,placement:a.value,strategy:l.value}).then(C=>{f.value=C.x,u.value=C.y,p.value=C.strategy,m.value=C.placement,g.value=C.middlewareData,b.value=!0})}function k(){typeof w=="function"&&(w(),w=void 0)}function x(){if(k(),s===void 0){_();return}if(d.value!=null&&h.value!=null){w=s(d.value,h.value,_);return}}function M(){i.value||(b.value=!1)}return r.watch([o,a,l],_,{flush:"sync"}),r.watch([d,h],x,{flush:"sync"}),r.watch(i,M,{flush:"sync"}),r.getCurrentScope()&&r.onScopeDispose(k),{x:r.shallowReadonly(f),y:r.shallowReadonly(u),strategy:r.shallowReadonly(p),placement:r.shallowReadonly(m),middlewareData:r.shallowReadonly(g),isPositioned:r.shallowReadonly(b),floatingStyles:y,update:_}}function qu(n){for(;n;){if(Ku(n))return n;n=n.parentElement}return document.scrollingElement}function Ku(n){if(!n||n.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(n);return t.overflowY==="scroll"||t.overflowY==="auto"&&n.scrollHeight>n.clientHeight}class Gu{constructor(t,e){V(this,"onScroll");V(this,"scrollParent");this.onScroll=e,this.scrollParent=qu(t)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const Ju={class:"fm-menu__wrapper"},Zu=r.defineComponent({__name:"FmMenu",props:{showMenu:{type:Boolean,default:!1},placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1}},emits:["dropdown-changed"],setup(n,{expose:t,emit:e}){const s=n,i=r.ref(!1),o=r.ref(null),a=r.ref(null),{floatingStyles:l}=Xu(o,a,{middleware:[za(4),Ra()],placement:s.placement,whileElementsMounted:Hu});let c;t({show:()=>{i.value||(i.value=!0,e("dropdown-changed",i.value))},hide:()=>{i.value&&(i.value=!1,e("dropdown-changed",i.value))}});const d=u=>{u.preventDefault(),u.stopPropagation(),!s.disabled&&(i.value=!i.value,e("dropdown-changed",i.value))},h=u=>{if(!i.value)return;const p=u.path||u.composedPath();for(const m of p)if(m==o.value||m==a.value)return;i.value=!1,e("dropdown-changed",i.value)},f=()=>{e("dropdown-changed",!1)};return r.watch(()=>s.showMenu,u=>i.value=u),r.onMounted(()=>{i.value=s.showMenu,window.addEventListener("click",h),c=new Gu(o.value,f),c.bindScroll()}),r.onUnmounted(()=>{window.removeEventListener("click",h),c.unbindScroll()}),(u,p)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"anchorEl",ref:o,class:"fm-menu",onClick:d},[r.renderSlot(u.$slots,"menu-button",{},void 0,!0)],512),i.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menuEl",ref:a,class:r.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":i.value}),style:r.normalizeStyle(r.unref(l))},[r.renderSlot(u.$slots,"menu-wrapper",{},()=>[r.createElementVNode("div",Ju,[r.renderSlot(u.$slots,"menu-content",{},void 0,!0)])],!0)],6)):r.createCommentVNode("",!0)]))}}),Kg="",bt=et(Zu,[["__scopeId","data-v-6ad9d23d"]]),Qu={class:"fm-menu-item--left"},tp={key:0,class:"fm-menu-item--right"},ep=r.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,s=r.ref(!1),i=l=>{l.preventDefault(),!e.disabled&&t("update:modelValue",!e.modelValue)},o=()=>{t("update:modelValue",e.modelValue)};function a(l){s.value=l}return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{class:r.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":l.modelValue&&!l.hasCheckbox,"fm-menu-item--disabled":l.disabled}),onClick:i,onMousedown:c[1]||(c[1]=()=>a(!0)),onMouseup:c[2]||(c[2]=()=>a(!1)),onMouseleave:c[3]||(c[3]=()=>a(!1))},[r.createElementVNode("div",Qu,[!l.hasCheckbox&&l.icon?(r.openBlock(),r.createBlock(L,{key:0,name:l.icon,size:"md",outline:!s.value&&!l.modelValue,color:l.disabled?"#C7C7CC":l.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),l.hasCheckbox?(r.openBlock(),r.createBlock(Aa,{key:1,"model-value":l.modelValue,name:"something",label:"",sublabel:"",value:"",indeterminate:!1,disabled:l.disabled,"onUpdate:modelValue":o,onClick:c[0]||(c[0]=d=>d.preventDefault())},null,8,["model-value","disabled"])):r.createCommentVNode("",!0),r.renderSlot(l.$slots,"label",{},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-typo-body-lg-400 ${l.disabled?"fm-color-typo-disabled":"fm-color-typo-primary"}`)},r.toDisplayString(l.label),3),l.sublabel?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`fm-typo-body-md-400 ${l.disabled?"fm-color-typo-disabled":"fm-color-typo-secondary"}`)},r.toDisplayString(l.sublabel),3)):r.createCommentVNode("",!0)])],!0)]),r.renderSlot(l.$slots,"append",{},void 0,!0),l.expandable?(r.openBlock(),r.createElementBlock("div",tp,[r.createVNode(L,{name:"chevron_right",size:"md",color:l.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):r.createCommentVNode("",!0)],34)]))}}),Gg="",Et=et(ep,[["__scopeId","data-v-a50682bb"]]),np={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[360px]"},sp={class:"w-max"},ip={class:"flex h-40 justify-between px-4 py-8"},op={class:"flex gap-4 items-center"},ap={class:"fm-typo-body-lg-700"},rp={class:"h-[264px] w-[160px]"},lp={class:"fm-typo-body-lg-700"},cp={class:"h-[264px] w-[160px]"},dp={class:"flex gap-4 items-center justify-center"},hp={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},fp=["onClick"],up={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},pp=r.defineComponent({__name:"FmDatePicker",props:{modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n){const t=n,e=xt(t,"modelValue"),s=r.ref(ct(e.value,"YYYY-MM-DD")),i=r.ref(!1),o=r.ref(ct().startOf("month")),a=r.ref(!1),l=r.ref(!1),c=g=>{s.value=g},d=()=>{e.value=s.value.format("YYYY-MM-DD"),i.value=!1},h=()=>{s.value=e.value?ct(e.value):null,i.value=!1},f=g=>{const b=[],y=g.endOf("month"),w=g.month();let _=g.startOf("week"),k=[];for(;_.isBefore(y.endOf("week"));)_.day()===0&&k.length>0&&(b.push(k),k=[]),k.push({date:_,isCurrentMonth:_.month()===w}),_=_.add(1,"day");return k.length>0&&b.push(k),b},u=g=>{a.value=!1,l.value=!1,o.value=g},p=r.computed(()=>Array.from(Array(7),(g,b)=>ct().day(b).format("ddd"))),m=r.computed(()=>{let g=-5;const b=[];for(;g!=5;)b.push(o.value.add(g,"year")),g++;return b});return(g,b)=>(r.openBlock(),r.createBlock(bt,{"show-menu":i.value,disabled:g.disabled,onDropdownChanged:b[4]||(b[4]=y=>i.value=y)},{"menu-button":r.withCtx(()=>[r.createElementVNode("label",null,[g.label?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-lg-400 mb-4",[t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(t.label),3)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":i.value,"fm-date-picker__container--disabled":t.disabled}])},[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":r.unref(e)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString(r.unref(e)?r.unref(ct)(r.unref(e)).format("D MMM YYYY"):"DD MM YYYY"),3)],2)])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",np,[r.createElementVNode("div",sp,[r.createElementVNode("div",ip,[r.createElementVNode("div",op,[r.createVNode(bt,{"show-menu":a.value,onDropdownChanged:b[0]||(b[0]=y=>a.value=y)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",a.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",ap,r.toDisplayString(o.value.format("MMMM")),1),r.createVNode(L,{name:a.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",rp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(y,w)=>o.value.month(w)),y=>(r.openBlock(),r.createElementBlock("li",{key:y.format("MMMM")},[r.createVNode(Et,{"model-value":o.value.format("MMMM")===y.format("MMMM"),label:y.format("MMMM"),"onUpdate:modelValue":w=>u(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(bt,{"show-menu":l.value,onDropdownChanged:b[1]||(b[1]=y=>l.value=y)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",l.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",lp,r.toDisplayString(o.value.format("YYYY")),1),r.createVNode(L,{name:l.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",cp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,y=>(r.openBlock(),r.createElementBlock("li",{key:y.format("YYYY")},[r.createVNode(Et,{"model-value":o.value.format("YYYY")===y.format("YYYY"),label:y.format("YYYY"),"onUpdate:modelValue":w=>u(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),r.createElementVNode("div",dp,[r.createVNode(L,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[2]||(b[2]=()=>u(o.value.subtract(1,"month")))}),r.createVNode(L,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[3]||(b[3]=()=>u(o.value.add(1,"month")))})])]),r.createElementVNode("div",null,[r.createElementVNode("div",hp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.value,y=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"fm-calendar__cell"},r.toDisplayString(y),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f(o.value),(y,w)=>(r.openBlock(),r.createElementBlock("div",{key:w,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y,_=>(r.openBlock(),r.createElementBlock("div",{key:_.date.date(),class:"fm-calendar__cell"},[_.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":_.date.isSame(s.value)}]),onClick:()=>c(_.date)},r.toDisplayString(_.date.date()),11,fp)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",up,[r.createVNode(yt,{label:"Cancel",size:"md",variant:"tertiary",onClick:h}),r.createVNode(yt,{label:"OK",size:"md",variant:"primary",disabled:!s.value,onClick:d},null,8,["disabled"])])])]),_:1},8,["show-menu","disabled"]))}}),Jg="",mp=et(pp,[["__scopeId","data-v-2094a2ee"]]),gp=n=>(r.pushScopeId("data-v-72f90844"),n=n(),r.popScopeId(),n),bp={class:"flex gap-1 items-center relative w-full"},yp={class:"w-full"},_p=gp(()=>r.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)),xp={class:"w-full"},kp={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[720px]"},wp={class:"flex gap-24"},Cp={class:"w-max"},Mp={class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},Sp={class:"flex gap-4 items-center"},Dp={class:"fm-typo-body-lg-700"},Bp={class:"h-[264px] w-[160px]"},vp={class:"fm-typo-body-lg-700"},Ep={class:"h-[264px] w-[160px]"},Vp={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Pp=["onClick","onMouseover"],Op={class:"w-max"},Ap={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},Fp={class:"flex gap-4 items-center"},Np={class:"fm-typo-body-lg-700"},Tp={class:"h-[264px] w-[160px]"},$p={class:"fm-typo-body-lg-700"},Lp={class:"h-[264px] w-[160px]"},Rp={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},zp=["onClick","onMouseover"],Ip={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},Wp=r.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n){const t=n,e=xt(t,"modelValue"),s=r.ref({startDate:ct(e.value.startDate,"YYYY-MM-DD"),endDate:ct(e.value.endDate,"YYYY-MM-DD")}),i=r.ref(!1),o=r.ref(ct().startOf("month")),a=r.ref(ct().startOf("month").add(1,"month")),l=r.ref(null),c=r.ref(!1),d=r.ref(!1),h=r.ref(!1),f=r.ref(!1),u=x=>{if(s.value.startDate&&s.value.endDate){s.value={startDate:x,endDate:null};return}if(!s.value.startDate&&!s.value.endDate)s.value.startDate=x;else if(x.isBefore(s.value.startDate)){const M=s.value.startDate;s.value={startDate:x,endDate:M}}else s.value.endDate=x},p=()=>{e.value={startDate:s.value.startDate.format("YYYY-MM-DD"),endDate:s.value.endDate.format("YYYY-MM-DD")},i.value=!1},m=()=>{var x,M;s.value={startDate:(x=e.value)!=null&&x.startDate?ct(e.value.startDate,"YYYY-MM-DD"):null,endDate:(M=e.value)!=null&&M.endDate?ct(e.value.endDate,"YYYY-MM-DD"):null},i.value=!1},g=x=>{const M=[],C=x.endOf("month"),S=x.month();let v=x.startOf("week"),P=[];for(;v.isBefore(C.endOf("week"));)v.day()===0&&P.length>0&&(M.push(P),P=[]),P.push({date:v,isCurrentMonth:v.month()===S}),v=v.add(1,"day");return P.length>0&&M.push(P),M},b=(x,M)=>{c.value=!1,h.value=!1,d.value=!1,f.value=!1,x==="left"?(o.value=M,a.value=M.add(1,"month")):x==="right"&&(a.value=M,o.value=M.subtract(1,"month"))},y=r.computed(()=>Array.from(Array(7),(x,M)=>ct().day(M).format("ddd"))),w=x=>{const M=s.value.startDate,C=s.value.endDate;l.value=M&&C?null:l.value;const S=l.value,v=M==null?void 0:M.isSame(x),P=C==null?void 0:C.isSame(x),A=S==null?void 0:S.isSame(x);return{"fm-calendar__cell__button--selected":v&&P||v&&!C,"fm-calendar__cell__button--selected-start":v&&C&&!(v&&P)||M&&!C&&v&&(S==null?void 0:S.isAfter(M))||M&&!C&&A&&(S==null?void 0:S.isBefore(M)),"fm-calendar__cell__button--selected-end":P&&M&&!(v&&P)||M&&!C&&v&&(S==null?void 0:S.isBefore(M))||M&&!C&&A&&(S==null?void 0:S.isAfter(M)),"fm-calendar__cell__button--selected-between":M&&(C||S)&&C?x.isAfter(M)&&x.isBefore(C):x.isAfter(S)&&x.isBefore(M)||x.isBefore(S)&&x.isAfter(M)}},_=x=>{l.value=x},k=r.computed(()=>{let x=-5;const M=[];for(;x!=5;)M.push(o.value.add(x,"year")),x++;return M});return r.watch(()=>e.value,()=>{var x,M;return s.value={startDate:(x=e.value)!=null&&x.startDate?ct(e.value.startDate,"YYYY-MM-DD"):null,endDate:(M=e.value)!=null&&M.endDate?ct(e.value.endDate,"YYYY-MM-DD"):null}}),(x,M)=>(r.openBlock(),r.createBlock(bt,{"show-menu":i.value,disabled:x.disabled,onDropdownChanged:M[6]||(M[6]=C=>i.value=C)},{"menu-button":r.withCtx(()=>{var C,S,v,P;return[r.createElementVNode("div",bp,[r.createElementVNode("label",yp,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(t.label),3),r.createElementVNode("div",{class:r.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":i.value,"fm-date-picker__container--disabled":t.disabled}])},[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":(C=r.unref(e))!=null&&C.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((S=r.unref(e))!=null&&S.startDate?r.unref(ct)(r.unref(e).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)],2)]),_p,r.createElementVNode("label",xp,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(t.label),3),r.createElementVNode("div",{class:r.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":i.value,"fm-date-picker__container--disabled":t.disabled}])},[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":(v=r.unref(e))!=null&&v.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((P=r.unref(e))!=null&&P.endDate?r.unref(ct)(r.unref(e).endDate).format("D MMM YYYY"):"DD MM YYYY"),3)],2)])])]}),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",kp,[r.createElementVNode("div",wp,[r.createElementVNode("div",Cp,[r.createElementVNode("div",Mp,[r.createElementVNode("div",Sp,[r.createVNode(L,{class:"cursor-pointer select-none",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:M[0]||(M[0]=()=>b("left",o.value.subtract(1,"month")))}),r.createVNode(bt,{"show-menu":c.value,onDropdownChanged:M[1]||(M[1]=C=>c.value=C)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",c.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",Dp,r.toDisplayString(o.value.format("MMMM")),1),r.createVNode(L,{name:c.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Bp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(C,S)=>o.value.month(S)),C=>(r.openBlock(),r.createElementBlock("li",{key:C.format("MMMM")},[r.createVNode(Et,{"model-value":o.value.format("MMMM")===C.format("MMMM"),label:C.format("MMMM"),"onUpdate:modelValue":S=>b("left",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(bt,{"show-menu":h.value,onDropdownChanged:M[2]||(M[2]=C=>h.value=C)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",h.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",vp,r.toDisplayString(o.value.format("YYYY")),1),r.createVNode(L,{name:h.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Ep,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,C=>(r.openBlock(),r.createElementBlock("li",{key:C.format("YYYY")},[r.createVNode(Et,{"model-value":o.value.format("YYYY")===C.format("YYYY"),label:C.format("YYYY"),"onUpdate:modelValue":S=>b("left",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])])]),r.createElementVNode("div",null,[r.createElementVNode("div",Vp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,C=>(r.openBlock(),r.createElementBlock("div",{key:C,class:"fm-calendar__cell"},r.toDisplayString(C),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g(o.value),(C,S)=>(r.openBlock(),r.createElementBlock("div",{key:S,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C,v=>(r.openBlock(),r.createElementBlock("div",{key:v.date.date(),class:"fm-calendar__cell"},[v.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",w(v.date)]),onClick:()=>u(v.date),onMouseover:P=>_(v.date)},r.toDisplayString(v.date.date()),43,Pp)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",Op,[r.createElementVNode("div",Ap,[r.createElementVNode("div",Fp,[r.createVNode(bt,{"show-menu":d.value,onDropdownChanged:M[3]||(M[3]=C=>d.value=C)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",d.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",Np,r.toDisplayString(a.value.format("MMMM")),1),r.createVNode(L,{name:d.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Tp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(C,S)=>a.value.month(S)),C=>(r.openBlock(),r.createElementBlock("li",{key:C.format("MMMM")},[r.createVNode(Et,{"model-value":a.value.format("MMMM")===C.format("MMMM"),label:C.format("MMMM"),"onUpdate:modelValue":S=>b("right",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(bt,{"show-menu":f.value,onDropdownChanged:M[4]||(M[4]=C=>f.value=C)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",f.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",$p,r.toDisplayString(a.value.format("YYYY")),1),r.createVNode(L,{name:f.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Lp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,C=>(r.openBlock(),r.createElementBlock("li",{key:C.format("YYYY")},[r.createVNode(Et,{"model-value":a.value.format("YYYY")===C.format("YYYY"),label:C.format("YYYY"),"onUpdate:modelValue":S=>b("right",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),r.createVNode(L,{class:"cursor-pointer select-none",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:M[5]||(M[5]=()=>b("left",o.value.add(1,"month")))})]),r.createElementVNode("div",null,[r.createElementVNode("div",Rp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,C=>(r.openBlock(),r.createElementBlock("div",{key:C,class:"fm-calendar__cell"},r.toDisplayString(C),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g(a.value),(C,S)=>(r.openBlock(),r.createElementBlock("div",{key:S,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C,v=>(r.openBlock(),r.createElementBlock("div",{key:v.date.date(),class:"fm-calendar__cell"},[v.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",w(v.date)]),onClick:()=>u(v.date),onMouseover:P=>_(v.date)},r.toDisplayString(v.date.date()),43,zp)):r.createCommentVNode("",!0)]))),128))]))),128))])])])]),r.createElementVNode("div",Ip,[r.createVNode(yt,{label:"Cancel",size:"md",variant:"tertiary",onClick:m}),r.createVNode(yt,{label:"OK",size:"md",variant:"primary",disabled:!s.value.startDate||!s.value.endDate,onClick:p},null,8,["disabled"])])])]),_:1},8,["show-menu","disabled"]))}}),Zg="",Yp=et(Wp,[["__scopeId","data-v-72f90844"]]),jp={class:"w-full"},Hp=r.defineComponent({__name:"FmField",props:{tag:{default:"div"},prependIcon:{default:""},appendIcon:{default:""},invalid:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1}},setup(n){const t=n;return(e,s)=>(r.openBlock(),r.createBlock(t.tag,{class:r.normalizeClass({"fm-field":!0,"fm-field--focused":e.focused,"fm-field--invalid":e.invalid,"fm-field--valid":e.showValidBorder&&!e.invalid,"fm-field--disabled":e.disabled}),tabindex:"0"},{default:r.withCtx(()=>[r.renderSlot(e.$slots,"prepend",{},()=>[r.createVNode(L,{name:e.prependIcon,size:"md",color:e.disabled?"disabled":"neutral-black"},null,8,["name","color"])],!0),r.createElementVNode("div",jp,[r.renderSlot(e.$slots,"default",{},void 0,!0)]),r.renderSlot(e.$slots,"append",{},()=>[r.createVNode(L,{name:e.appendIcon,size:"md",color:e.disabled?"disabled":"neutral-black"},null,8,["name","color"])],!0)]),_:3},8,["class"]))}}),Qg="",ei=et(Hp,[["__scopeId","data-v-2d283fa0"]]),Up=["onSubmit","onReset"],Xp=r.defineComponent({__name:"FmForm",emits:["validation-reset","validation-success","validation-failed","reset"],setup(n,{expose:t,emit:e}){const s=r.ref([]),i=r.ref(0),o=()=>{let c=[];for(let d=0;d<s.value.length;d++){const h=s.value[d];c=[...c,...h.validate()]}c.length?e("validation-failed",c):e("validation-success")},a=()=>{for(let c=0;c<s.value.length;c++)s.value[c].resetValue();e("reset")};return t({validateInputs:o,resetInputsValidation:()=>{for(let c=0;c<s.value.length;c++)s.value[c].resetValidation();e("validation-reset")},resetInputs:a}),r.provide(ri,{register({validate:c,resetValidation:d,resetValue:h}){return s.value.push({componentId:i.value,validate:c,resetValidation:d,resetValue:h}),i.value++},unregister(c){s.value.filter(d=>d.componentId!==c)}}),(c,d)=>(r.openBlock(),r.createElementBlock("form",{onSubmit:r.withModifiers(o,["prevent"]),onReset:r.withModifiers(a,["prevent"])},[r.renderSlot(c.$slots,"default")],40,Up))}}),qp={class:"flex gap-4"},Zn=r.defineComponent({__name:"FmHelperText",props:{text:{default:""},disabled:{type:Boolean,default:!1},state:{default:"none"},errorMessages:{default:()=>[]}},setup(n){const t=n,e=r.computed(()=>t.state==="success"?"check_circle":t.state==="warning"?"warning":t.state==="error"?"error":""),s=r.computed(()=>t.state==="success"?"text-fm-color-system-success-300":t.state==="warning"?"text-fm-color-system-warning-300":t.state==="error"?"text-fm-color-system-error-300":"");return(i,o)=>i.text||i.errorMessages.length===0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-sm-400",{"text-fm-color-typo-disabled":i.disabled,"text-fm-color-typo-secondary":i.state==="none"&&!i.disabled,"text-fm-color-typo-success":i.state==="success"&&!i.disabled,"text-fm-color-typo-warning":i.state==="warning"&&!i.disabled,"text-fm-color-typo-error":i.state==="error"&&!i.disabled}])},[i.errorMessages.length===0?r.renderSlot(i.$slots,"default",{key:0},()=>[r.createElementVNode("div",qp,[e.value?(r.openBlock(),r.createBlock(L,{key:0,size:"sm",name:e.value,class:r.normalizeClass(["mt-[2px]",s.value])},null,8,["name","class"])):r.createCommentVNode("",!0),r.createElementVNode("span",null,r.toDisplayString(i.text),1)])]):r.renderSlot(i.$slots,"default",{key:1},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.errorMessages,a=>(r.openBlock(),r.createElementBlock("div",{key:a,class:"flex gap-4 text-fm-color-typo-error"},[r.createVNode(L,{size:"sm",name:"error",class:"mt-[2px] text-fm-color-system-error-300"}),r.createElementVNode("span",null,r.toDisplayString(a),1)]))),128))])],2)):r.createCommentVNode("",!0)}}),Kp={class:"px-2 py-0"},Gp={key:0,class:"fm-typo-body-xl-700"},Jp={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},tr=r.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},beak:{default:"top"},hasArrow:{type:Boolean,default:!0},titleText:{default:"Title"},contentText:{},actionButtons:{default:null},disabled:{type:Boolean,default:!1}},setup(n){const t=n,e=r.ref(null),s=r.ref(null),i=r.ref(null),o=async()=>{var y,w,_,k;const{x:p,y:m,placement:g,middlewareData:b}=await Ja(e.value,s.value,{placement:t.beak,middleware:[za(10),Ra(),Bu({padding:5}),t.hasArrow?Uu({element:i.value,padding:10}):null]});if(Object.assign(s.value.style,{left:`${p}px`,top:`${m}px`}),t.hasArrow){const x={top:"bottom",right:"left",bottom:"top",left:"right"}[g.split("-")[0]];Object.assign(i.value.style,{left:((y=b.arrow)==null?void 0:y.x)!=null?`${(w=b.arrow)==null?void 0:w.x}px`:"",top:((_=b.arrow)==null?void 0:_.y)!=null?`${(k=b.arrow)==null?void 0:k.y}px`:"",right:"",bottom:"",background:t.variant==="rich"?"#FFF":"#1C1C1E",[x]:"-4px"})}},a=r.ref(!1),l=r.ref(0),c=r.ref(0),d=r.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"})),h=()=>{clearTimeout(c.value),l.value=window.setTimeout(()=>{a.value=!0},500)},f=()=>{clearTimeout(l.value),c.value=window.setTimeout(()=>a.value=!1,1500)},u=()=>{clearTimeout(c.value),a.value=!0};return r.watchEffect(()=>{a.value?(o(),window.addEventListener("resize",o)):window.removeEventListener("resize",o)}),(p,m)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"tooltipContainer",ref:e,class:r.normalizeClass(["cursor-pointer flex items-center justify-center relative w-max",{"cursor-not-allowed pointer-events-none":p.disabled}]),onMouseenter:h,onMouseleave:f},[r.renderSlot(p.$slots,"default")],34),r.createElementVNode("div",{ref_key:"tooltip",ref:s,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:r.normalizeStyle(d.value),onMouseenter:u,onMouseleave:f},[r.createElementVNode("div",null,[r.createElementVNode("div",Kp,[p.variant=="rich"?(r.openBlock(),r.createElementBlock("div",Gp,r.toDisplayString(p.titleText),1)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(p.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},r.toDisplayString(p.contentText),3)]),p.variant=="rich"?(r.openBlock(),r.createElementBlock("div",Jp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.actionButtons,(g,b)=>(r.openBlock(),r.createElementBlock("div",{key:b},[r.createVNode(yt,{variant:"tertiary",label:g.label,onClick:g.handler},null,8,["label","onClick"])]))),128))])):r.createCommentVNode("",!0)]),r.createElementVNode("div",{ref_key:"arrowEl",ref:i,class:"-rotate-45 absolute h-3 w-3"},null,512)],36)]))}}),Qn=r.defineComponent({__name:"FmLabel",props:{label:{default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""}},setup(n){return(t,e)=>t.label?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-lg-400 flex gap-4",t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary",{"items-center":t.info}])},[r.renderSlot(t.$slots,"default",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.label),1),t.required?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(["fm-typo-body-lg-700",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-error"])}," * ",2)):r.createCommentVNode("",!0),t.optional?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-md-400",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-tertiary"])}," (optional) ",2)):r.createCommentVNode("",!0),t.info?(r.openBlock(),r.createBlock(tr,{key:2,beak:"top","content-text":t.info,disabled:t.disabled},{default:r.withCtx(()=>[r.createVNode(L,{name:"info",size:"sm",class:r.normalizeClass(["fm-typo-body-md-400",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-neutral-gray-300"])},null,8,["class"])]),_:1},8,["content-text","disabled"])):r.createCommentVNode("",!0)])],2)):r.createCommentVNode("",!0)}}),Zp={class:"flex flex-col gap-4"},Qp=r.defineComponent({__name:"FmFormGroup",props:{modelValue:{},rules:{default:()=>[]},focused:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{default:""},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""},helperText:{default:""},helperState:{default:"none"},errorMessages:{default:()=>[]}},setup(n){const t=n,e=r.computed(()=>({label:t.label,disabled:t.disabled,required:t.required,optional:t.optional,info:t.info})),s=r.computed(()=>({text:t.helperText,disabled:t.disabled,state:t.helperState,errorMessages:t.errorMessages}));return(i,o)=>(r.openBlock(),r.createElementBlock("label",Zp,[r.createVNode(Qn,r.normalizeProps(r.guardReactiveProps(e.value)),{default:r.withCtx(()=>[r.renderSlot(i.$slots,"label")]),_:3},16),r.renderSlot(i.$slots,"default"),r.createVNode(Zn,r.normalizeProps(r.guardReactiveProps(s.value)),{default:r.withCtx(()=>[r.renderSlot(i.$slots,"helper-text")]),_:3},16)]))}}),tm={class:"fm-radio-btn"},em={class:"fm-radio-btn__input--container"},nm=["value","disabled","checked"],sm={class:"py-8"},im={class:"fm-typo-body-lg-400"},om={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},am=r.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n){const t=n,e=xt(t,"modelValue"),s=r.ref(),i=r.inject(li,null),o=()=>{a.value||(i?i.updateValue(t.value):e.value=t.value)},a=r.computed(()=>i?i.getDisabled():t.disabled),l=r.computed(()=>i?t.value===i.groupValue.value:e.value===t.value);return(c,d)=>{const h=r.resolveDirective("wave");return r.openBlock(),r.createElementBlock("div",tm,[r.createElementVNode("label",{class:r.normalizeClass({"fm-radio-btn--wrapper":!0,"cursor-not-allowed text-fm-color-typo-disabled":a.value,"cursor-pointer":!a.value}),onClick:o},[r.withDirectives((r.openBlock(),r.createElementBlock("div",em,[r.createElementVNode("input",{ref_key:"inputEl",ref:s,class:"fm-radio-btn__input--btn",type:"radio",value:c.value,disabled:a.value,checked:l.value},null,8,nm)])),[[h,!a.value]]),r.createElementVNode("div",sm,[r.renderSlot(c.$slots,"label",{},()=>[r.createElementVNode("div",im,r.toDisplayString(c.label),1),c.sublabel?(r.openBlock(),r.createElementBlock("div",om,r.toDisplayString(c.sublabel),1)):r.createCommentVNode("",!0)],!0)])],2)])}}}),tb="",rm=et(am,[["__scopeId","data-v-24fa5bf9"]]);function er(n,t){const e=r.ref([]);function s(){const o=[];if(t&&t.length>0)for(const a of t){const c=(typeof a=="function"?a:()=>a)(n.value);c!==!0&&o.push(c)}return e.value=o,e.value}function i(){e.value=[]}return{validate:s,resetValidation:i,errorMessages:e}}function on(n,t,e=null,s=null){let i=null;const o=r.ref(!0),a=r.inject(ri,null),{validate:l,resetValidation:c,errorMessages:d}=er(n,t),h=(u=s)=>{o.value=!0,c(),u&&typeof u=="function"&&u(),n.value=e},f=()=>{o.value=!1,l()};return r.onMounted(()=>{a&&(i=a.register({validate:l,resetValidation:c,resetValue:h})),e=e??n.value}),r.onUnmounted(()=>{a&&a.unregister(i)}),r.watch(()=>n.value,()=>{o.value=!1,l()}),{validate:l,resetValidation:c,errorMessages:d,resetValue:h,isPristine:o,onBlur:f}}const lm={class:"fm-text-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},cm={key:0},dm={key:1},hm=r.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},helperText:{default:""},disabled:{type:Boolean,default:!1},label:{},focused:{type:Boolean},rules:{default:()=>[n=>!!n||"This field is required"]},helperState:{}},emits:["update:modelValue"],setup(n){const t=n,e=xt(t,"modelValue"),{errorMessages:s}=on(e,t.rules);return r.provide(li,{groupValue:e,getDisabled:()=>t.disabled,updateValue(i){e.value=i}}),(i,o)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{class:r.normalizeClass({"flex items-center gap-16 justify-start":i.inline})},[r.renderSlot(i.$slots,"default")],2),r.createElementVNode("div",lm,[r.unref(s).length===0?(r.openBlock(),r.createElementBlock("div",cm,[r.renderSlot(i.$slots,"helper-text",{},()=>[r.createTextVNode(r.toDisplayString(i.helperText),1)])])):(r.openBlock(),r.createElementBlock("div",dm,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),a=>(r.openBlock(),r.createElementBlock("div",{key:a,class:"flex gap-4 items-center text-fm-color-typo-error"},[r.createVNode(L,{name:"error",color:"#FF3B30",size:"sm"}),r.createElementVNode("span",null,r.toDisplayString(a),1)]))),128))]))])]))}});function Vt(n,t){return typeof n!="object"&&typeof t!="object"?n===t:Object.keys(n).length!==Object.keys(t).length?!1:Object.keys(n).every(e=>Vt(n[e],t[e]))}const fm={class:"flex flex-col gap-4 justify-center"},um={class:"w-[280px]"},pm=r.defineComponent({__name:"FmSelect",props:{modelValue:{},label:{},items:{},disabled:{type:Boolean,default:!1},multiselect:{type:Boolean,default:!1},placement:{default:"bottom-start"},placeholder:{default:"Select item"}},emits:["update:modelValue"],setup(n){const t=n,e=xt(t,"modelValue"),s=r.ref(!1),i=(d,h)=>{if(t.multiselect){let f=[];d?f=e.value.length===0?[h]:t.items.filter(u=>e.value.some(p=>Vt(u.value,p)||Vt(u.value,h.value))):f=t.items.filter(u=>e.value.some(p=>Vt(u.value,p)&&!Vt(u.value,h.value))),e.value=f.map(u=>u.value)}else s.value=!1,e.value=h.value},o=d=>{const h=[...e.value].filter((f,u)=>u!==d);e.value=h},a=r.computed(()=>t.multiselect?t.items.filter(d=>r.toRaw(e.value).some(h=>Vt(h,d.value))):t.items.filter(d=>Vt(e.value,d.value))),l=r.computed(()=>t.items.filter(d=>e.value.some(h=>Vt(d.value,h))).map(d=>({label:d.label}))),c=r.computed(()=>{var d;return t.multiselect?t.placeholder:((d=t.items.find(h=>Vt(h.value,e.value)))==null?void 0:d.label)??t.placeholder});return(d,h)=>(r.openBlock(),r.createElementBlock("label",fm,[r.renderSlot(d.$slots,"label",{},()=>[d.label?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-lg-400",{"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!d.disabled,"text-fm-color-typo-disabled":d.disabled}])},r.toDisplayString(d.label),3)):r.createCommentVNode("",!0)],!0),r.createVNode(bt,{"show-menu":s.value,disabled:d.disabled,placement:d.placement,onDropdownChanged:h[0]||(h[0]=f=>s.value=f)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([`${d.disabled?"cursor-not-allowed":"cursor-pointer"} fm-select`])},[r.createElementVNode("div",{class:r.normalizeClass({"fm-select__container":!0,"fm-select__container--expanded":s.value,"fm-select__container--disabled":d.disabled})},[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400 h-full overflow-hidden text-ellipsis w-full whitespace-nowrap",{"text-fm-color-typo-tertiary":(d.multiselect||!r.unref(e))&&!d.disabled,"text-fm-color-typo-primary":!d.multiselect&&r.unref(e)&&!d.disabled,"text-fm-color-typo-disabled":d.disabled}])},r.toDisplayString(c.value),3),r.createVNode(L,{name:s.value?"expand_less":"expand_more",size:"md",color:d.disabled?"#C7C7CC":"black"},null,8,["name","color"])],2)],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",um,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.items,f=>(r.openBlock(),r.createBlock(Et,{key:f.value,"has-checkbox":d.multiselect,label:f.label,value:f.value,"model-value":a.value.some(u=>r.unref(Vt)(u.value,f.value)),"onUpdate:modelValue":u=>i(u,f)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))])]),_:1},8,["show-menu","disabled","placement"]),d.multiselect&&a.value.length>0?(r.openBlock(),r.createBlock(oi,{key:0,items:l.value,removable:"",disabled:d.disabled,onChipClosed:o},null,8,["items","disabled"])):r.createCommentVNode("",!0)]))}}),eb="",mm=et(pm,[["__scopeId","data-v-fbac56ef"]]),gm={class:"fm-stepper-field"},bm={class:"fm-typo-body-lg-400 text-fm-color-typo-primary"},ym={key:0},_m=["inputMode","value","placeholder","readOnly"],xm={key:0},km={key:0,class:"fm-stepper-field__stepper__container"},wm={key:0,class:"fm-stepper-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},Cm={key:0},Mm={key:1},Sm=r.defineComponent({__name:"FmStepperField",props:{label:{default:""},modelValue:{},disabled:{type:Boolean},placeholder:{default:""},helperText:{default:""},inputmode:{default:"numeric"},readonly:{type:Boolean},step:{default:1},min:{default:0},max:{},leadingIcon:{default:""},trailingIcon:{default:""},useGrouping:{type:Boolean,default:!0},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},rules:{default:()=>[]},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""}},emits:["update:modelValue"],setup(n){const t=n,e=xt(t,"modelValue"),{errorMessages:s,validate:i,isPristine:o}=on(e,t.rules),a=r.ref(null),l=r.ref(!1),c=r.ref(!0);let d;const h=r.ref(""),f=_=>{if(_!==""){const k=+_.replace(/,/g,"");return isNaN(k)?null:k}return null},u=_=>d.format(_),p=_=>_>t.max?t.max:_<t.min?t.min:_,m=(_,k)=>{_.preventDefault(),o.value=!1;let M=(f(h.value)??0)+k;M=p(M),c.value=i().length===0,h.value=u(M),g()},g=()=>{const _=f(h.value);e.value=_},b=()=>{const _=f(h.value);_&&(h.value=u(p(_))),c.value=i().length===0,l.value=!1,g()},y=()=>{var k;const _=f((k=a.value)==null?void 0:k.value);h.value=_!=null?u(_):""},w=_=>{if(![...Array(10).keys()].map(k=>k.toString()).includes(_.key)&&!["Backspace","Tab","Enter",".","-","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(_.key)){_.preventDefault();return}};return r.watch(()=>e.value,_=>{o.value||(h.value=_!=null?u(_):"",c.value=i().length===0)}),r.onMounted(()=>{d=new Intl.NumberFormat("en-MY",{useGrouping:t.useGrouping}),h.value=e.value!=null?u(e.value):""}),(_,k)=>(r.openBlock(),r.createElementBlock("label",gm,[r.createElementVNode("div",bm,[r.renderSlot(_.$slots,"label",{},()=>[r.createTextVNode(r.toDisplayString(_.label),1)],!0)]),r.createElementVNode("div",{class:r.normalizeClass({"fm-stepper-field__container":!0,"fm-stepper-field__container--focused":l.value,"fm-stepper-field__container--invalid":!c.value&&!!r.unref(e),"fm-stepper-field__container--valid":_.showValidBorder&&c.value&&!!r.unref(e)})},[r.renderSlot(_.$slots,"prepend",{},()=>[_.prependText?(r.openBlock(),r.createElementBlock("div",ym,r.toDisplayString(_.prependText),1)):r.createCommentVNode("",!0),_.leadingIcon?(r.openBlock(),r.createBlock(L,{key:1,name:_.leadingIcon,size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):r.createCommentVNode("",!0)],!0),r.createElementVNode("input",{ref_key:"inputEl",ref:a,class:"fm-stepper-field--input",type:"text",inputMode:_.inputmode,value:h.value,placeholder:_.placeholder,readOnly:_.readonly,onInput:y,onFocus:k[0]||(k[0]=()=>l.value=!0),onBlur:b,onKeydown:w},null,40,_m),r.renderSlot(_.$slots,"append",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex items-center justify-center",{"mr-32":_.showSteppers}])},[_.appendText?(r.openBlock(),r.createElementBlock("div",xm,r.toDisplayString(_.appendText),1)):r.createCommentVNode("",!0),_.trailingIcon?(r.openBlock(),r.createBlock(L,{key:1,name:_.trailingIcon,size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):r.createCommentVNode("",!0)],2)],!0),_.showSteppers?(r.openBlock(),r.createElementBlock("div",km,[r.createElementVNode("div",{class:"fm-stepper-field__stepper__item",onMousedown:k[1]||(k[1]=x=>m(x,_.step))},[r.createVNode(L,{name:"expand_less",size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32),r.createElementVNode("div",{class:"fm-stepper-field__stepper__item",onMousedown:k[2]||(k[2]=x=>m(x,-_.step))},[r.createVNode(L,{name:"expand_more",size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32)])):r.createCommentVNode("",!0)],2),_.helperText||r.unref(s).length>0?(r.openBlock(),r.createElementBlock("div",wm,[r.unref(s).length===0?(r.openBlock(),r.createElementBlock("div",Cm,[r.renderSlot(_.$slots,"helper-text",{},()=>[r.createTextVNode(r.toDisplayString(_.helperText),1)],!0)])):(r.openBlock(),r.createElementBlock("div",Mm,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),x=>(r.openBlock(),r.createElementBlock("div",{key:x,class:"flex gap-4 items-center text-fm-color-typo-error"},[r.createVNode(L,{name:"error",color:"#FF3B30",size:"sm"}),r.createElementVNode("span",null,r.toDisplayString(x),1)]))),128))]))])):r.createCommentVNode("",!0)]))}}),nb="",Dm=et(Sm,[["__scopeId","data-v-9bd564fa"]]),Bm={class:"cursor-pointer fm-switch__container"},vm={key:0},Em={class:"fm-typo-body-lg-400"},Vm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Pm={class:"fm-switch__input--container"},Om=["checked","value","disabled"],Am={key:1},Fm={class:"fm-typo-body-lg-400"},Nm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Tm=r.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){const t=n,e=xt(t,"modelValue"),s=()=>{t.disabled||(e.value=!e.value)};return(i,o)=>(r.openBlock(),r.createElementBlock("label",Bm,[i.labelPlacement==="left"?(r.openBlock(),r.createElementBlock("div",vm,[r.renderSlot(i.$slots,"label",{},void 0,!0),r.createElementVNode("div",Em,r.toDisplayString(i.label),1),i.sublabel?(r.openBlock(),r.createElementBlock("div",Vm,r.toDisplayString(i.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",Pm,[r.createElementVNode("input",{checked:r.unref(e),class:"fm-switch__input--btn",type:"checkbox",value:i.value,disabled:i.disabled,onClick:s},null,8,Om),r.createElementVNode("div",{class:r.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":i.showIcon})},[i.showIcon?(r.openBlock(),r.createBlock(L,{key:0,name:r.unref(e)?"check":"close",size:"sm",color:i.disabled?"#C7C7CC":r.unref(e)?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):r.createCommentVNode("",!0)],2)]),i.labelPlacement==="right"?(r.openBlock(),r.createElementBlock("div",Am,[r.createElementVNode("div",Fm,r.toDisplayString(i.label),1),i.sublabel?(r.openBlock(),r.createElementBlock("div",Nm,r.toDisplayString(i.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]))}}),sb="",$m=et(Tm,[["__scopeId","data-v-924bfa9d"]]),Lm={class:"cursor-pointer fm-text-field"},Rm=["value","inputMode","type","placeholder","minlength","maxlength","disabled","readOnly"],zm={key:0,class:"fm-text-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},Im=r.defineComponent({__name:"FmTextField",props:{placeholder:{default:""},minLength:{default:0},maxLength:{default:NaN},inputmode:{default:"text"},readonly:{type:Boolean,default:!1},labelMark:{default:"none"},prependIcon:{default:""},appendIcon:{default:""},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=r.ref(null),s=xt(t,"modelValue"),i=r.ref(!1),{errorMessages:o,isPristine:a,onBlur:l}=on(s,t.rules),c=f=>{a.value=!1,s.value=f.target.value},d=()=>{i.value=!1,l()},h=r.computed(()=>o.value.length===0);return(f,u)=>(r.openBlock(),r.createElementBlock("label",Lm,[r.renderSlot(f.$slots,"label",{},()=>[r.createVNode(Qn,{label:f.label,disabled:f.disabled,required:f.labelMark==="required",optional:f.labelMark==="optional",info:f.labelInfo},null,8,["label","disabled","required","optional","info"])]),r.createVNode(ei,{class:"cursor-text","append-icon":f.appendIcon,"prepend-icon":f.prependIcon,focused:i.value,invalid:!h.value,"show-valid-border":f.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(f.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(f.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("input",{ref_key:"inputEl",ref:e,class:r.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!f.disabled,"fm-color-typo-disabled":f.disabled}),value:r.unref(s),inputMode:f.inputmode,type:f.inputmode,placeholder:f.placeholder,minlength:f.minLength,maxlength:f.maxLength,disabled:f.disabled,readOnly:f.readonly,onInput:c,onFocus:u[0]||(u[0]=()=>i.value=!0),onBlur:d},null,42,Rm)]),_:3},8,["append-icon","prepend-icon","focused","invalid","show-valid-border"]),f.helperText||r.unref(o).length>0?(r.openBlock(),r.createElementBlock("div",zm,[r.createVNode(Zn,{text:f.helperText,"error-messages":r.unref(o),disabled:f.disabled,state:f.helperState},null,8,["text","error-messages","disabled","state"]),r.createElementVNode("div",{class:r.normalizeClass({"fm-color-typo-disabled":f.disabled})},r.toDisplayString(f.maxLength?`${r.unref(s).length} / ${f.maxLength}`:""),3)])):r.createCommentVNode("",!0)]))}}),ib="",Wm={class:"fm-textarea"},Ym=["value","placeholder","minlength","maxlength","readOnly","disabled"],jm={key:0,class:"fm-color-typo-secondary fm-textarea__helper-container fm-typo-body-sm-400"},Hm=r.defineComponent({__name:"FmTextarea",props:{label:{default:""},modelValue:{default:""},disabled:{type:Boolean,default:!1},placeholder:{default:""},minLength:{default:0},maxLength:{default:NaN},readonly:{type:Boolean,default:!1},labelMark:{default:"none"},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},labelInfo:{default:""},helperText:{default:""},helperState:{default:"none"},focused:{type:Boolean},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n){const t=n,e=xt(t,"modelValue"),s=r.ref(!1),{validate:i,resetValidation:o,errorMessages:a,isPristine:l,onBlur:c}=on(e,t.rules),d=u=>{l.value=!1,u.target.value||o(),e.value=u.target.value},h=()=>{s.value=!1,c()},f=r.computed(()=>a.value.length===0);return r.watch(()=>e.value,()=>{l.value||i()}),(u,p)=>(r.openBlock(),r.createElementBlock("label",Wm,[r.renderSlot(u.$slots,"label",{},()=>[r.createVNode(Qn,{label:u.label,disabled:u.disabled,required:u.labelMark==="required",optional:u.labelMark==="optional",info:u.labelInfo},null,8,["label","disabled","required","optional","info"])]),r.createElementVNode("div",{class:r.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":s.value,"fm-textarea__container--invalid":!!r.unref(e)&&!f.value,"fm-textarea__container--valid":u.showValidBorder&&u.showSuccess&&!!r.unref(e)&&f.value,"fm-textarea__container--disabled":u.disabled})},[r.createElementVNode("textarea",{class:r.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!u.disabled,"fm-color-typo-disabled":u.disabled}),value:r.unref(e),placeholder:u.placeholder,minlength:u.minLength,maxlength:u.maxLength,readOnly:u.readonly,disabled:u.disabled,onInput:d,onFocus:p[0]||(p[0]=()=>s.value=!0),onBlur:h},null,42,Ym)],2),u.helperText||r.unref(a).length>0?(r.openBlock(),r.createElementBlock("div",jm,[r.createVNode(Zn,{text:u.helperText,"error-messages":r.unref(a),disabled:u.disabled,state:u.helperState},null,8,["text","error-messages","disabled","state"]),r.createElementVNode("div",{class:r.normalizeClass({"fm-color-typo-disabled":u.disabled})},r.toDisplayString(u.maxLength?`${r.unref(e).length} / ${u.maxLength}`:""),3)])):r.createCommentVNode("",!0)]))}}),ob="",Um={class:"flex flex-col fm-time-input items-center"},Xm=["value"],qm=r.defineComponent({__name:"TimeInput",props:{modelValue:{type:String,required:!0},min:{type:Number,required:!0},max:{type:Number,required:!0}},emits:["update:model-value","update:cycle"],setup(n,{emit:t}){const e=n,s=r.ref();function i(d){s.value&&(s.value.value=d)}r.watch(()=>e.modelValue,i);function o(){if(!s.value)return;const d=a(s.value.value);if(d==null||d>e.max||d<e.min){i(e.modelValue);return}t("update:model-value",d)}function a(d){return d&&/^\d+$/.test(d)?Number(d):null}function l(){t("update:model-value",a(e.modelValue)+1)}function c(){t("update:model-value",a(e.modelValue)-1)}return(d,h)=>(r.openBlock(),r.createElementBlock("div",Um,[r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:l},[r.createVNode(L,{name:"expand_less",size:"lg"})]),r.createElementVNode("input",{ref_key:"inputRef",ref:s,value:e.modelValue,onInput:o},null,40,Xm),r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:c},[r.createVNode(L,{name:"expand_more",size:"lg"})])]))}}),ab="",nr=et(qm,[["__scopeId","data-v-e8ddb125"]]);var Wt=(n=>(n.AM="AM",n.PM="PM",n))(Wt||{});function Qt(n){return n.toString().padStart(2,"0")}const Km={class:"flex fm-time-input gap-16 items-center"},Gm=r.createElementVNode("div",{class:"fm-typo-title-sm-700"}," : ",-1),Jm={class:"fm-time-input-periods"},Zm=["onClick"],sr=r.defineComponent({__name:"FmTimeInput",props:{modelValue:{type:Object,required:!0}},emits:["update:model-value"],setup(n,{emit:t}){const e=n;function s(i){const o={hours:i.hours??e.modelValue.hours,minutes:i.minutes??e.modelValue.minutes,period:i.period??e.modelValue.period},a=e.modelValue.hours;(a===12&&o.hours===11||a===11&&o.hours===12)&&(o.period=e.modelValue.period===Wt.AM?Wt.PM:Wt.AM),o.hours>12?o.hours=1:o.hours<1&&(o.hours=12),o.minutes>59?o.minutes=0:o.minutes<0&&(o.minutes=59),t("update:model-value",o)}return(i,o)=>(r.openBlock(),r.createElementBlock("div",Km,[r.createVNode(nr,{"model-value":r.unref(Qt)(n.modelValue.hours),min:1,max:12,"onUpdate:modelValue":o[0]||(o[0]=a=>s({hours:a}))},null,8,["model-value"]),Gm,r.createVNode(nr,{"model-value":r.unref(Qt)(n.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":o[1]||(o[1]=a=>s({minutes:a}))},null,8,["model-value"]),r.createElementVNode("div",Jm,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Wt),a=>(r.openBlock(),r.createElementBlock("div",{key:a,class:r.normalizeClass([{"fm-time-input-period__selected":a===n.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>s({period:a})},r.toDisplayString(a),11,Zm))),128))])]))}}),rb="",Qm={class:"fm-time-picker"},tg={class:"flex gap-8"},eg={class:"flex flex-col",style:{width:"343px"}},ng=r.createElementVNode("div",{class:"fm-typo-body-xl-700 pt-12 px-12"}," Enter time ",-1),sg={class:"flex justify-center w-full"},ig={class:"flex justify-end pb-12"},og=r.defineComponent({__name:"FmTimePicker",props:{modelValue:{type:[null,String],default:null}},emits:["update:modelValue"],setup(n){const e=xt(n,"modelValue"),s=r.ref(null),i=r.computed(()=>{if(!e.value)return null;const{hours:p,minutes:m,period:g}=l(e.value);return`${Qt(p)}:${Qt(m)} ${g}`});function o(){if(!s.value){e.value=null;return}const{hours:p,minutes:m,period:g}=s.value,b=a(p,m,g);e.value=b,h()}function a(p,m,g){let b=p;return g===Wt.PM?b=p===12?p:p+12:p===12&&(b=0),`${Qt(b)}:${Qt(m)}`}r.onMounted(()=>{e.value&&(s.value=l(e.value))}),r.watch(()=>e.value,p=>{p&&(s.value=l(p))});function l(p){const[m,g,b]=c(p).split(":");return{hours:Number(m),minutes:Number(g),period:b}}function c(p){const[m,g]=p.split(":"),b=Number(m),y=Number(g),w=b>11?Wt.PM:Wt.AM;let _=b;return _===0?_=12:_>12&&(_-=12),`${Qt(_)}:${Qt(y)}:${w}`}const d=r.ref();function h(){var p;(p=d.value)==null||p.hide()}const f=r.ref(!1);function u(p){p?s.value=l(e.value??"00:00"):s.value=e.value?l(e.value):null,f.value=p}return(p,m)=>(r.openBlock(),r.createElementBlock("div",Qm,[r.createVNode(bt,{ref_key:"dropdownRef",ref:d,onDropdownChanged:u},{"menu-button":r.withCtx(()=>[r.createVNode(ei,null,{default:r.withCtx(()=>[r.createElementVNode("div",tg,[r.createVNode(L,{name:"schedule",outline:!f.value},null,8,["outline"]),r.createElementVNode("div",{class:r.normalizeClass(["grow",{"text-fm-color-typo-disabled":!i.value}])},r.toDisplayString(i.value??"HH:MM"),3)])]),_:1})]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",eg,[ng,r.createElementVNode("div",sg,[r.createVNode(sr,{"model-value":s.value??{hours:0,minutes:0,period:r.unref(Wt).AM},class:"py-16","onUpdate:modelValue":m[0]||(m[0]=g=>s.value=g)},null,8,["model-value"])]),r.createElementVNode("div",ig,[r.createVNode(yt,{label:"Cancel",variant:"tertiary",onClick:h}),r.createVNode(yt,{label:"Confirm",variant:"tertiary",onClick:o})])])]),_:1},512)]))}}),lb="",ag=r.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass({"fm-list--separator":t.separator,activeClass:t.activeClass})},[r.renderSlot(t.$slots,"default",{},void 0,!0)],2))}}),cb="",rg=et(ag,[["__scopeId","data-v-884ba127"]]),lg=r.defineComponent({__name:"FmListItem",props:{tag:{default:"div"},clickable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},activeClass:{default:""}},setup(n){const t=n;return(e,s)=>{const i=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createBlock(t.tag,{class:r.normalizeClass({"fm-list-item":!0,"fm-list-item--disabled":e.disabled,"cursor-pointer":e.clickable&&!e.disabled,"cursor-not-allowed":e.clickable&&e.disabled,activeClass:e.activeClass})},{default:r.withCtx(()=>[r.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},8,["class"])),[[i,e.clickable&&!e.disabled]])}}}),db="",cg=et(lg,[["__scopeId","data-v-f565b558"]]),dg={class:"fm-progress-indicator relative"},hg=["data-progress"],fg={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},ir=r.defineComponent({__name:"FmProgressIndicator",props:{modelValue:{type:Number,required:!0}},setup(n){const t=n,e=r.ref(null),s=r.computed(()=>`${t.modelValue/100*360}deg`),i=o=>{e.value&&e.value.style.setProperty("--progress",o)};return r.onMounted(()=>{i(s.value)}),r.onUpdated(()=>{i(s.value)}),r.watch(s,async o=>{i(o)}),(o,a)=>(r.openBlock(),r.createElementBlock("div",dg,[r.createElementVNode("div",{ref_key:"progress",ref:e,class:"fm-progress-circular w-full","data-progress":s.value},null,8,hg),r.createElementVNode("div",fg,[r.renderSlot(o.$slots,"default")])]))}}),hb="",ug={class:"flex"},pg={key:0,class:"mt-8"},mg=r.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,s=r.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}`)}}),i=r.computed(()=>e.title?{text:e.title,classes:"fm-typo-body-lg-700"}:{text:e.description,classes:""}),o=r.computed(()=>e.bgColor?ns(e.bgColor)?{style:{backgroundColor:e.bgColor}}:{class:`bg-fm-color-${e.bgColor}`}:{class:`bg-fm-color-${s.value.bgColor}`}),a=r.computed(()=>e.color?ns(e.color)?{style:{color:e.color}}:{class:`text-fm-color-${e.color}`}:{class:`text-fm-color-${s.value.actionColor}`});return(l,c)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(o.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[r.createElementVNode("div",ug,[s.value.icon?(r.openBlock(),r.createBlock(L,{key:0,name:s.value.icon.name,color:e.color??s.value.icon.color,class:"mr-12"},null,8,["name","color"])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(`${i.value.classes} grow ellipsis`)},r.toDisplayString(i.value.text),3),e.dismissable?(r.openBlock(),r.createBlock(L,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:c[0]||(c[0]=()=>t("onDismiss"))})):r.createCommentVNode("",!0)]),e.title&&e.description?(r.openBlock(),r.createElementBlock("div",pg,r.toDisplayString(e.description),1)):r.createCommentVNode("",!0),r.renderSlot(l.$slots,"actions",{},()=>[e.action?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[r.createElementVNode("span",{class:"cursor-pointer",onClick:c[1]||(c[1]=()=>t("onAction"))},r.toDisplayString(e.action),1)],16)):r.createCommentVNode("",!0)],!0)],16))}}),fb="",gg=et(mg,[["__scopeId","data-v-b6db34bb"]]),bg={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},or=r.defineComponent({__name:"FmStepHeader",props:{title:{type:String,required:!0},description:{type:String,default:void 0},disabled:{type:Boolean,default:!1},titleBold:{type:Boolean,default:!1}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex flex-col",n.disabled?"text-fm-color-typo-disabled":""])},[r.createElementVNode("div",{class:r.normalizeClass(["fm-step-title line-clamp-2",n.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},r.toDisplayString(n.title),3),n.description?(r.openBlock(),r.createElementBlock("div",bg,r.toDisplayString(n.description),1)):r.createCommentVNode("",!0)],2))}}),yg=["data-title","data-description","data-disabled","onClick"],_g={class:"flex fm-step-container gap-12 grow"},xg=r.defineComponent({__name:"FmStep",props:{title:{type:String,required:!0},description:{type:String,default:void 0},value:{type:Number,required:!0},complete:{type:Function,required:!0},error:{type:Function,default:void 0},disabled:{type:Function,default:void 0}},setup(n){const t=n,{currentStep:e,goToStep:s}=r.inject(ci);function i(){o.value||s(t.value)}const o=r.computed(()=>t.disabled?t.disabled():!1),a=r.computed(()=>t.error?t.error():!1),l=r.computed(()=>e()===t.value),c=r.computed(()=>t.complete()),d=r.computed(()=>l.value||c.value||e()>t.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),h=r.computed(()=>l.value?{className:"bg-fm-color-primary"}:a.value?{config:{name:"warning",color:"system-error-300"}}:o.value?{className:"border-2 border-fm-color-neutral-gray-200"}:c.value?{config:{name:"check_small",color:"primary"},className:"border-2 border-fm-color-primary"}:{className:"border-2 border-fm-color-neutral-gray-300"});return(f,u)=>{const p=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{"data-title":n.title,"data-description":n.description,"data-disabled":o.value,class:r.normalizeClass(`fm-step gap-4 grow ${o.value?"cursor-not-allowed":"cursor-pointer"}`),onClick:r.withModifiers(i,["stop"])},[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-step-indicator ${d.value}`)},null,2)]),r.createElementVNode("div",_g,[r.createElementVNode("div",{class:r.normalizeClass(["flex fm-step-container-icon h-[24px] items-center justify-center min-h-[24px] min-w-[24px] relative rounded-full w-[24px]",h.value.className])},[h.value.config?(r.openBlock(),r.createBlock(L,{key:0,name:h.value.config.name,color:h.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):r.createCommentVNode("",!0)],2),r.createVNode(or,{title:n.title,description:n.description,disabled:o.value,class:"grow"},null,8,["title","description","disabled"])])],10,yg)),[[p,!o.value]])}}}),ub="",kg=et(xg,[["__scopeId","data-v-ee172cad"]]),wg={class:"hidden items-center xs:flex"},Cg={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},Mg=r.defineComponent({__name:"FmStepper",props:{modelValue:{type:Number,required:!0},orientation:{type:String,default:"horizontal"}},emits:["update:model-value"],setup(n,{emit:t}){const e=n,s=h=>{t("update:model-value",h)};r.provide(ci,{currentStep:()=>e.modelValue,goToStep:s});const i=r.ref(),o=r.ref([]),a=r.computed(()=>o.value[e.modelValue-1]),l=r.computed(()=>e.modelValue/o.value.length*100),c=r.computed(()=>`${e.modelValue} of ${o.value.length}`),d=()=>{var f;const h=Array.from(((f=i.value)==null?void 0:f.querySelectorAll(":scope > .fm-step"))??[]);o.value=h.map(u=>({title:u.dataset.title??"",description:u.dataset.description,disabled:u.dataset.disabled=="true"}))};return r.onMounted(()=>{d()}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(`fm-stepper fm-stepper__${n.orientation}`)},[r.createElementVNode("div",{ref_key:"stepperRef",ref:i,class:r.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${n.orientation==="vertical"?"flex-col":""}`)},[r.renderSlot(h.$slots,"default")],2),r.createElementVNode("div",wg,[r.createVNode(ir,{"model-value":l.value,class:"mr-12",style:{"min-width":"60px"}},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(c.value),1)]),_:1},8,["model-value"]),a.value?(r.openBlock(),r.createBlock(or,{key:0,class:"grow","title-bold":"",title:a.value.title,description:a.value.description,disabled:a.value.disabled},null,8,["title","description","disabled"])):r.createCommentVNode("",!0)]),h.$slots.contents?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${n.orientation==="vertical"?"w-2/3":""}`)},[r.renderSlot(h.$slots,"contents"),r.createElementVNode("div",Cg,[r.renderSlot(h.$slots,"actions")])],2)):r.createCommentVNode("",!0)],2))}});let Sg=0;function Dg(){return Sg++}const Bg=n=>(r.pushScopeId("data-v-50625760"),n=n(),r.popScopeId(),n),vg=["disabled"],Eg=[Bg(()=>r.createElementVNode("div",{class:"fm-tab__indicator"},null,-1))],Vg={class:"max-w-[360px] min-w-[186px]"},Pg=r.defineComponent({__name:"FmTab",props:{modelValue:{default:null},label:{default:""},vertical:{type:Boolean,default:!1},icon:{default:""},disabled:{type:Boolean,default:!1},badge:{default:0},value:{default:()=>Dg()},children:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=r.ref(!1),i=r.ref(!1);function o(h){s.value=h}const a=()=>{e.disabled||e.children.length>0||t("update:modelValue",e.value)},l=h=>{e.children.length!==0&&(i.value=h)},c=r.computed(()=>e.children.length>0?e.children.some(h=>h.value===e.modelValue):e.modelValue===e.value),d=h=>{i.value=!1,t("update:modelValue",h)};return(h,f)=>(r.openBlock(),r.createBlock(bt,{"show-menu":i.value,disabled:h.children.length===0,class:r.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":h.vertical}]),placement:h.vertical?"right-start":"bottom-start",onDropdownChanged:l},{"menu-button":r.withCtx(()=>[r.createElementVNode("button",{class:r.normalizeClass(["fm-tab",`fm-tab--${h.vertical?"vertical":"horizontal"}`,h.disabled?"cursor-not-allowed":"cursor-pointer",{"fm-tab--selected":c.value}]),disabled:h.disabled,onMousedown:f[0]||(f[0]=()=>o(!0)),onMouseup:f[1]||(f[1]=()=>o(!1)),onMouseleave:f[2]||(f[2]=()=>o(!1)),onClick:a},[r.renderSlot(h.$slots,"prepend",{},void 0,!0),h.icon?(r.openBlock(),r.createBlock(L,{key:0,name:h.icon,outline:!s.value&&!c.value,color:h.disabled?"neutral-gray-200":c.value?"primary":"neutral-black",size:"md"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),h.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-lg-700 text-fm-color-typo-primary col-start-2 row-start-1",c.value?"visible":"invisible"])},r.toDisplayString(h.label),3)):r.createCommentVNode("",!0),h.label?(r.openBlock(),r.createElementBlock("span",{key:2,class:r.normalizeClass(["fm-typo-body-lg-400 col-start-2 row-start-1",h.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary",!c.value||h.disabled?"visible":"invisible"])},r.toDisplayString(h.label),3)):r.createCommentVNode("",!0),h.badge?(r.openBlock(),r.createBlock(ln,{key:3,value:h.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0),h.children.length>0?(r.openBlock(),r.createBlock(L,{key:4,size:"md",name:i.value?"expand_less":"expand_more"},null,8,["name"])):r.createCommentVNode("",!0),r.renderSlot(h.$slots,"append",{},void 0,!0),c.value?(r.openBlock(),r.createElementBlock("div",{key:5,class:r.normalizeClass([`fm-tab__indicator__wrapper--${h.vertical?"vertical":"horizontal"}`])},Eg,2)):r.createCommentVNode("",!0)],42,vg)]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",Vg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.children,u=>r.renderSlot(h.$slots,"list-item",r.normalizeProps(r.guardReactiveProps(u)),()=>[r.createVNode(Et,{"model-value":e.modelValue===u.value,label:u.label,icon:u.icon,disabled:u.disabled,onClick:p=>d(u.value)},{append:r.withCtx(()=>[u.badge?(r.openBlock(),r.createBlock(ln,{key:0,value:u.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])],!0)),256))])]),_:3},8,["show-menu","disabled","class","placement"]))}}),mb="",ar=et(Pg,[["__scopeId","data-v-50625760"]]),Og=r.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"}," More ",-1),Ag={class:"max-w-[360px] min-w-[186px]"},Fg={FmBadge:ln,FmBreadcrumb:ur,FmButton:yt,FmButtonGroup:Sr,FmCard:vr,FmCardActions:Er,FmCardSection:Vr,FmCardTitle:si,FmChip:ii,FmChipGroup:oi,FmDialog:Fr,FmDropField:Lr,FmDynamicDialog:hi,FmLineChart:ou,FmCheckbox:Aa,FmDatePicker:mp,FmDateRangePicker:Yp,FmField:ei,FmForm:Xp,FmFormGroup:Qp,FmHelperText:Zn,FmLabel:Qn,FmRadio:rm,FmRadioGroup:hm,FmSelect:mm,FmStepperField:Dm,FmSwitch:$m,FmTextField:Im,FmTextarea:Hm,FmTimeInput:sr,FmTimePicker:og,FmIcon:L,FmList:rg,FmListItem:cg,FmMenu:bt,FmMenuItem:Et,FmProgressIndicator:ir,FmSnackbar:gg,FmSpacer:ai,FmStep:kg,FmStepper:Mg,FmTab:ar,FmTabs:r.defineComponent({__name:"FmTabs",props:{modelValue:{default:null},items:{},vertical:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showMoreAt:{default:6}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=r.ref(!1),i=r.computed(()=>({vertical:e.vertical,disabled:e.disabled})),o=r.computed(()=>e.items.slice(0,e.showMoreAt)),a=r.computed(()=>e.items.slice(e.showMoreAt)),l=c=>{s.value=!1,t("update:modelValue",c)};return(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex",c.vertical?"flex-col":"flex-row items-center"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,h=>r.renderSlot(c.$slots,"default",r.normalizeProps(r.guardReactiveProps({...h,tabsProps:i.value})),()=>[r.createVNode(ar,r.mergeProps({"model-value":e.modelValue},{children:h.children,label:h.label,icon:h.icon,disabled:h.disabled,badge:h.badge,value:h.value,tabsProps:i.value},{disabled:h.disabled===void 0?c.disabled:h.disabled,vertical:c.vertical,"onUpdate:modelValue":d[0]||(d[0]=f=>t("update:modelValue",f))}),null,16,["model-value","disabled","vertical"])])),256)),a.value.length>0?(r.openBlock(),r.createBlock(bt,{key:0,"show-menu":s.value,class:r.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":c.vertical}]),placement:c.vertical?"right-start":"bottom-start",onDropdownChanged:d[1]||(d[1]=h=>s.value=h)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex gap-8 hover:bg-fm-color-opacity-sm items-center px-16 rounded-sm",[c.vertical?"h-40":"h-[46px]"]])},[r.createVNode(L,{name:"more_vert"}),Og],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",Ag,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,h=>r.renderSlot(c.$slots,"list-item",r.normalizeProps(r.guardReactiveProps(h)),()=>[r.createVNode(Et,{"model-value":e.modelValue===h.value,label:h.label,icon:h.icon,disabled:h.disabled,onClick:f=>l(h.value)},{append:r.withCtx(()=>[h.badge?(r.openBlock(),r.createBlock(ln,{key:0,value:h.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])])),256))])]),_:3},8,["show-menu","class","placement"])):r.createCommentVNode("",!0)],2))}}),FmTooltip:tr};function Ng(){const n=r.inject(di);if(!n)throw new Error("No provider");return n}const Tg=n=>{n.use(ut,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),n.use(Wr),Object.entries(Fg).forEach(([t,e])=>{n.component(t,e)})};st.uiPlugin=Tg,st.useDialog=Ng,st.useFormChild=on,st.useValidation=er,Object.defineProperty(st,Symbol.toStringTag,{value:"Module"})});
|