@feedmepos/ui-library 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/form/calendar/FmDateRangeYearMonthPicker.vue.d.ts +20 -0
- package/dist/components/form/{date-picker → calendar/date-picker}/FmDatePicker.vue.d.ts +1 -1
- package/dist/components/form/{date-range-picker → calendar/date-range-picker}/FmDateRangePicker.vue.d.ts +34 -2
- package/dist/components/form/calendar/helper.d.ts +7 -0
- package/dist/components/form/switch/FmSwitch.vue.d.ts +4 -1
- package/dist/components/menu/menu-component/FmMenu.vue.d.ts +3 -0
- package/dist/components/popover/FmPopover.vue.d.ts +55 -0
- package/dist/components.d.ts +121 -18
- package/dist/federation/{FmButton-afd1cea0.css → FmButton-8296a892.css} +1 -1
- package/dist/federation/FmDatePicker-05290165.css +1 -0
- package/dist/federation/FmDateRangePicker-4f8fd43e.css +1 -0
- package/dist/federation/{FmForm.vue_vue_type_script_setup_true_lang-e713d2fd.js → FmForm.vue_vue_type_script_setup_true_lang-68c21486.js} +1 -1
- package/dist/federation/{FmFormGroup.vue_vue_type_script_setup_true_lang-0e7854d6.js → FmFormGroup.vue_vue_type_script_setup_true_lang-c64b2755.js} +1 -1
- package/dist/federation/{FmLabel.vue_vue_type_script_setup_true_lang-394da53f.js → FmLabel.vue_vue_type_script_setup_true_lang-9da27688.js} +1 -1
- package/dist/federation/FmMenu-3b65256e.css +1 -0
- package/dist/federation/FmMenuItem-3ff57d41.css +1 -0
- package/dist/federation/{FmRadioGroup.vue_vue_type_script_setup_true_lang-8bf88b4a.js → FmRadioGroup.vue_vue_type_script_setup_true_lang-1eea435c.js} +1 -1
- package/dist/federation/{FmSelect.vue_vue_type_script_setup_true_lang-e44b1c3e.js → FmSelect.vue_vue_type_script_setup_true_lang-5ed984b3.js} +1 -1
- package/dist/federation/{FmStepper.vue_vue_type_script_setup_true_lang-28a3c5d6.js → FmStepper.vue_vue_type_script_setup_true_lang-7a7fd083.js} +1 -1
- package/dist/federation/{FmSwitch-ea705ff8.css → FmSwitch-30641580.css} +1 -1
- package/dist/federation/{FmTable.vue_vue_type_script_setup_true_lang-0c3ac7d5.js → FmTable.vue_vue_type_script_setup_true_lang-36679d9d.js} +1 -1
- package/dist/federation/{FmTabs.vue_vue_type_script_setup_true_lang-ba363af6.js → FmTabs.vue_vue_type_script_setup_true_lang-2f707ea6.js} +1 -1
- package/dist/federation/{FmTextField.vue_vue_type_style_index_0_lang-534a781c.js → FmTextField.vue_vue_type_style_index_0_lang-4ee9ac83.js} +1 -1
- package/dist/federation/{FmTimePicker.vue_vue_type_script_setup_true_lang-b5de36fa.js → FmTimePicker.vue_vue_type_script_setup_true_lang-f148eabb.js} +1 -1
- package/dist/federation/{FmTooltip.vue_vue_type_script_setup_true_lang-ca997db3.js → FmTooltip.vue_vue_type_script_setup_true_lang-4469b83d.js} +1 -1
- package/dist/federation/{__federation_expose_FmButton-a5e2a51f.js → __federation_expose_FmButton-47d8ad97.js} +2 -2
- package/dist/federation/__federation_expose_FmDatePicker-36f8e77d.js +1 -0
- package/dist/federation/__federation_expose_FmDateRangePicker-c9f29e4c.js +1 -0
- package/dist/federation/{__federation_expose_FmDropField-7c76401d.js → __federation_expose_FmDropField-d7a84492.js} +1 -1
- package/dist/federation/{__federation_expose_FmDynamicDialog-02e51f7c.js → __federation_expose_FmDynamicDialog-552e9689.js} +1 -1
- package/dist/federation/{__federation_expose_FmForm-fb68dbb5.js → __federation_expose_FmForm-d832108c.js} +1 -1
- package/dist/federation/{__federation_expose_FmFormGroup-7f69a13c.js → __federation_expose_FmFormGroup-b86e693c.js} +1 -1
- package/dist/federation/{__federation_expose_FmLabel-a57534bc.js → __federation_expose_FmLabel-3920bc70.js} +1 -1
- package/dist/federation/__federation_expose_FmMenu-83a2f7f9.js +1 -0
- package/dist/federation/__federation_expose_FmMenuItem-dab7a9bf.js +1 -0
- package/dist/federation/{__federation_expose_FmRadio-2d446893.js → __federation_expose_FmRadio-260108d3.js} +1 -1
- package/dist/federation/{__federation_expose_FmRadioGroup-dedd8076.js → __federation_expose_FmRadioGroup-63a133e6.js} +1 -1
- package/dist/federation/{__federation_expose_FmSelect-2243c372.js → __federation_expose_FmSelect-dae2a9d1.js} +1 -1
- package/dist/federation/{__federation_expose_FmStep-5c91d371.js → __federation_expose_FmStep-491ce0aa.js} +1 -1
- package/dist/federation/{__federation_expose_FmStepper-8f080712.js → __federation_expose_FmStepper-0d3fdad5.js} +1 -1
- package/dist/federation/{__federation_expose_FmStepperField-978d9248.js → __federation_expose_FmStepperField-29d30922.js} +1 -1
- package/dist/federation/{__federation_expose_FmSwitch-b47dde9c.js → __federation_expose_FmSwitch-7457e541.js} +1 -1
- package/dist/federation/{__federation_expose_FmTab-13f768b6.js → __federation_expose_FmTab-0dc371f2.js} +1 -1
- package/dist/federation/{__federation_expose_FmTable-12eb38a9.js → __federation_expose_FmTable-817dfa3f.js} +1 -1
- package/dist/federation/{__federation_expose_FmTabs-d76cc0dc.js → __federation_expose_FmTabs-b7a1a6bb.js} +1 -1
- package/dist/federation/{__federation_expose_FmTextField-c8d3c680.js → __federation_expose_FmTextField-cebd7ff7.js} +1 -1
- package/dist/federation/{__federation_expose_FmTextarea-3ddf8da1.js → __federation_expose_FmTextarea-9c4303ed.js} +1 -1
- package/dist/federation/{__federation_expose_FmTimePicker-766e0af5.js → __federation_expose_FmTimePicker-927c416b.js} +1 -1
- package/dist/federation/{__federation_expose_FmTooltip-fb507214.js → __federation_expose_FmTooltip-1a584510.js} +1 -1
- package/dist/federation/{dialog-plugin-fa9a753b.js → dialog-plugin-fd90bdfd.js} +1 -1
- package/dist/federation/feedmepos-ui-components.js +1 -1
- package/dist/federation/helper-89a4a8fa.js +1 -0
- package/dist/federation/helper-cda9b8da.css +1 -0
- package/dist/federation/{index-9e7ee072.js → index-29c58620.js} +4 -4
- package/dist/federation/index-65a07791.css +1 -0
- package/dist/federation/{provider-keys-24913f12.js → provider-keys-f2cfeb97.js} +1 -1
- package/dist/feedmepos-ui-library.js +4772 -4551
- package/dist/feedmepos-ui-library.umd.cjs +9 -9
- package/dist/global-components.d.ts +52 -52
- package/dist/style.css +1 -1
- package/dist/utils/provider-keys.d.ts +2 -1
- package/package.json +1 -1
- package/dist/federation/FmDatePicker-4f691ee2.css +0 -1
- package/dist/federation/FmDateRangePicker-63b44ee5.css +0 -1
- package/dist/federation/FmMenu-16edf003.css +0 -1
- package/dist/federation/FmMenuItem-1ff2c242.css +0 -1
- package/dist/federation/__federation_expose_FmDatePicker-402fd49b.js +0 -1
- package/dist/federation/__federation_expose_FmDateRangePicker-67f5732f.js +0 -1
- package/dist/federation/__federation_expose_FmMenu-74c3cd63.js +0 -1
- package/dist/federation/__federation_expose_FmMenuItem-41a59b64.js +0 -1
- package/dist/federation/dayjs.min-5433e12a.js +0 -1
- package/dist/federation/index-9483053f.css +0 -1
- /package/dist/components/form/{date-picker → calendar/date-picker}/FmDatePicker.stories.d.ts +0 -0
- /package/dist/components/form/{date-range-picker → calendar/date-range-picker}/FmDateRangePicker.stories.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Hy=Object.defineProperty;var jy=(ie,l,Ue)=>l in ie?Hy(ie,l,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):ie[l]=Ue;var F=(ie,l,Ue)=>(jy(ie,typeof l!="symbol"?l+"":l,Ue),Ue);(function(ie,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],l):(ie=typeof globalThis<"u"?globalThis:ie||self,l(ie["feedmepos-ui-library"]={},ie.Vue,ie.VueRouter))})(this,function(ie,l,Ue){var mo;"use strict";const Wy="",Ti={directive:"wave",color:"currentColor",initialOpacity:.2,finalOpacity:.1,duration:.4,dissolveDuration:.15,easing:"ease-out",cancellationPeriod:75,trigger:"auto",tagName:"div"},ma=t=>"config"in t&&"globalProperties"in t.config,ba=t=>{let e;return t==="vue2"?e=!1:t==="vue3"?e=!0:e=ma(t),e?{mounted:"mounted",updated:"updated"}:{mounted:"inserted",updated:"componentUpdated"}},zi=t=>typeof t=="string"&&t!=="auto",Hi=(t,e)=>{t.dataset.vWaveBoundary=zi(e)?e:"true"},ya=({borderTopLeftRadius:t,borderTopRightRadius:e,borderBottomLeftRadius:n,borderBottomRightRadius:o},i)=>{const s=document.createElement(i);return s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.display="block",s.style.position="absolute",s.style.borderRadius=`${t} ${e} ${o} ${n}`,s.style.overflow="hidden",s.style.pointerEvents="none",s.style.webkitMaskImage="-webkit-radial-gradient(white, black)",s},_a=(t,e,n,o)=>{const i=document.createElement("div");return i.style.position="absolute",i.style.width=`${n}px`,i.style.height=`${n}px`,i.style.top=`${e}px`,i.style.left=`${t}px`,i.style.background=o.color,i.style.borderRadius="50%",i.style.opacity=`${o.initialOpacity}`,i.style.transform="translate(-50%,-50%) scale(0)",i.style.transition=`transform ${o.duration}s ${o.easing}, opacity ${o.duration}s ${o.easing}`,i};function bn(t,e,n,o){const i=t-n,s=e-o;return Math.sqrt(i*i+s*s)}function xa(t,e,{width:n,height:o}){const i=bn(t,e,0,0),s=bn(t,e,n,0),r=bn(t,e,0,o),a=bn(t,e,n,o);return Math.max(i,s,r,a)}const wa=({x:t,y:e},{top:n,left:o})=>({x:t-o,y:e-n}),yo="vWaveCountInternal";function Ca(t){const e=_o(t);ji(t,e+1)}function ka(t){const e=_o(t);ji(t,e-1)}function ji(t,e){t.dataset[yo]=e.toString()}function _o(t){var e;return parseInt((e=t.dataset[yo])!==null&&e!==void 0?e:"0",10)}function Sa(t){delete t.dataset[yo]}const xo=(t,e,n)=>{const o=e.getBoundingClientRect(),i=window.getComputedStyle(e),{x:s,y:r}=wa(t,o),a=2.05*xa(s,r,o),c=ya(i,n.tagName),d=_a(s,r,a,n);Ca(e);let u="";i.position==="static"&&(e.style.position&&(u=e.style.position),e.style.position="relative"),c.appendChild(d),e.appendChild(c);let f=!1;const p=b=>{typeof b<"u"&&(document.removeEventListener("pointerup",p),document.removeEventListener("pointercancel",p)),f?h():f=!0},h=()=>{d.style.transition=`opacity ${n.dissolveDuration}s linear`,d.style.opacity="0",setTimeout(()=>{c.remove(),ka(e),_o(e)===0&&(Sa(e),e.style.position=u)},n.dissolveDuration*1e3)};document.addEventListener("pointerup",p),document.addEventListener("pointercancel",p);const g=setTimeout(()=>{document.removeEventListener("pointercancel",m),requestAnimationFrame(()=>{d.style.transform="translate(-50%,-50%) scale(1)",d.style.opacity=`${n.finalOpacity}`,setTimeout(()=>p(),n.duration*1e3)})},n.cancellationPeriod),m=()=>{clearTimeout(g),c.remove(),document.removeEventListener("pointerup",p),document.removeEventListener("pointercancel",p),document.removeEventListener("pointercancel",m)};document.addEventListener("pointercancel",m)},At=new WeakMap,Wi=(t={},e="vue3")=>{const n=Object.assign(Object.assign({},Ti),t),o=ba(e),i=a=>{const c=a.currentTarget.dataset.vWaveTrigger;document.querySelectorAll(`[data-v-wave-boundary="${c}"]`).forEach(u=>xo(a,u,Object.assign(Object.assign({},n),At.get(u))))},s={[o.mounted](a,{value:c={}}){var d;At.set(a,c),Hi(a,(d=c&&c.trigger)!==null&&d!==void 0?d:n.trigger),a.addEventListener("pointerdown",u=>{if(At.get(a)===!1)return;const f=Object.assign(Object.assign({},n),At.get(a));if(f.trigger===!1)return xo(u,a,f);if(zi(f.trigger))return;const p=a.querySelector('[data-v-wave-trigger="true"]');!p&&f.trigger===!0||p&&!u.composedPath().includes(p)||xo(u,a,f)})},[o.updated](a,{value:c={}}){var d;At.set(a,c),Hi(a,(d=c&&c.trigger)!==null&&d!==void 0?d:n.trigger)}},r={[o.mounted](a,{arg:c="true"}){a.dataset.vWaveTrigger=c,c!=="true"&&a.addEventListener("pointerdown",i)},[o.updated](a,{arg:c="true"}){a.dataset.vWaveTrigger=c,c==="true"?a.removeEventListener("pointerdown",i):a.addEventListener("pointerdown",i)}};return{wave:s,vWave:s,waveTrigger:r,vWaveTrigger:r}},va={install(t,e={}){if(this.installed)return;this.installed=!0;const n=Object.assign(Object.assign({},Ti),e),{vWave:o,vWaveTrigger:i}=Wi(n,t);t.directive(n.directive,o),t.directive(`${n.directive}-trigger`,i)},installed:!1,createLocalWaveDirective:Wi},Ma={class:"gap-8 inline-flex items-center relative select-none"},Ea={key:0,class:"fm-typo-body-sm-400 justify-center"},Da=l.defineComponent({__name:"FmBadge",props:{inline:{type:Boolean,default:!1},value:{default:null},variant:{default:"neutral"}},setup(t){const e=t,n=l.computed(()=>e.value&&e.value>99?"99+":e.value);return(o,i)=>(l.openBlock(),l.createElementBlock("div",Ma,[l.renderSlot(o.$slots,"default",{},void 0,!0),l.createElementVNode("div",{class:l.normalizeClass(["fm-badge",`fm-badge--${o.variant}`,{absolute:!o.inline,"top-0 right-0 w-[6px] h-[6px]":e.value===null,"top-[-2px] right-[-4px] w-[16px] h-[16px]":e.value&&e.value<10,"top-[-2px] right-[-12px] px-4 h-[20px] min-w-[24px]":e.value&&e.value>10&&e.value<100,"top-[-2px] right-[-20px] px-4 h-[20px] min-w-[24px]":e.value&&e.value>99}])},[e.value!==null?(l.openBlock(),l.createElementBlock("span",Ea,l.toDisplayString(n.value),1)):l.createCommentVNode("",!0)],2)]))}}),Yy="",Q=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},yn=Q(Da,[["__scopeId","data-v-02018628"]]),Va={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},Ra=["onMouseenter"],Fa={key:0},Ba=l.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(t){const e=Ue.useRoute(),n=Ue.useRouter();l.onMounted(async()=>{await n.isReady();const g=o.items.findIndex(m=>m.route==e.path);g!=-1&&!o.items[g].disabled&&(i.value=g)});const o=t,i=l.ref(-1),s=l.ref(-1),r=l.ref(" / "),a=l.ref("... /"),c=l.ref(!1),d=g=>i.value===g?"selected":s.value===g?"hovered":o.items[g].disabled?"disabled":"default",u=g=>{o.items[g].disabled||(i.value=g)},f=g=>g!=o.items.length-1,p=g=>!c.value&&o.items.length>5&&g>=2&&g<o.items.length-2,h=()=>{c.value=!c.value};return(g,m)=>{const b=l.resolveComponent("RouterLink");return l.openBlock(),l.createElementBlock("nav",null,[l.createElementVNode("ul",Va,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(g.items,(x,y)=>(l.openBlock(),l.createElementBlock("li",{key:y,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:w=>s.value=y,onMouseleave:m[0]||(m[0]=w=>s.value=-1)},[p(y)?y===3&&!c.value?(l.openBlock(),l.createElementBlock("a",{key:1,onClick:h},l.toDisplayString(a.value),1)):l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(b,{key:0,class:l.normalizeClass(d(y)),to:x.disabled?"":x.route,onClick:w=>u(y)},{default:l.withCtx(()=>[l.createElementVNode("span",null,l.toDisplayString(x.label),1),f(y)?(l.openBlock(),l.createElementBlock("span",Fa,l.toDisplayString(r.value),1)):l.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,Ra))),128))])])}}}),Gy="",$a=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,Pa=/^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}[)]$/,Aa=/^^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*[)]$/,Oa=/^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*[)]$/,Na=/^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 wo(t){return[$a,Pa,Aa,Oa,Na].some(e=>e.test(t))}const Ia=l.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(t){const e=t,n=l.computed(()=>{const s=[],r={};return s.push(o()),s.push(i()),wo(e.color)?r.color=e.color:s.push(`text-fm-color-${e.color}`),{class:s.join(" "),style:r}});function o(){return`fm-icon--${e.outline?"outlined":"rounded"}`}function i(){return`fm-icon--${e.size}`}return(s,r)=>(l.openBlock(),l.createElementBlock("span",l.mergeProps(n.value,{class:"fm-icon"}),l.toDisplayString(e.name),17))}}),Uy="",L=Q(Ia,[["__scopeId","data-v-fd802d37"]]),La={class:"relative"},Ta={class:"absolute h-full left-0 top-0 w-full",viewBox:"0 0 18 18"},za=["stroke-width"];var Yi=(t=>(t[t.md=2.5]="md",t[t.lg=2]="lg",t[t.xl=1.75]="xl",t))(Yi||{});const Ha=l.defineComponent({__name:"FmProgress",props:{size:{default:"md"},color:{default:"primary"}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",La,[l.createElementVNode("div",{class:l.normalizeClass(`fm-progress--${e.size} text-fm-color-${e.color}`)},[(l.openBlock(),l.createElementBlock("svg",Ta,[l.createElementVNode("circle",{class:"fm-progress--indetermindate","stroke-width":Yi[e.size],fill:"none",stroke:"currentColor",cx:"50%",cy:"50%",r:7.75,"stroke-linecap":"round","stroke-dasharray":"10 200","stroke-dashoffset":"0"},null,8,za)]))],2)]))}}),qy="",ja=Q(Ha,[["__scopeId","data-v-ef86ac9c"]]),Wa=["disabled","type"],Ya={class:"-translate-x-1/2 -translate-y-1/2 absolute left-1/2 top-1/2 transform"},Ga=l.defineComponent({__name:"FmButton",props:{variant:{default:"primary"},label:{default:""},icon:{default:""},size:{default:"lg"},disabled:{type:Boolean,default:!1},iconColor:{default:""},type:{default:"button"},iconPosition:{default:"prepend"},prependIcon:{default:""},appendIcon:{default:""},loading:{type:Boolean,default:!1}},setup(t){const e=t,n=l.ref(!1),o=l.computed(()=>`${i[e.variant]} ${e.disabled?"cursor-not-allowed":"cursor-pointer"}`),i={primary:"bg-fm-color-primary text-fm-color-typo-white rounded-lg",secondary:"bg-transparent rounded-lg border-1 border-fm-color-neutral-black",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white rounded-lg",tertiary:"bg-transparent text-fm-color-typo-primary rounded-lg",plain:"bg-transparent text-fm-color-primary",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white rounded-xxxl min-h-56 min-w-56 !p-16"};function s(r){n.value=r}return(r,a)=>{const c=l.resolveDirective("wave");return l.withDirectives((l.openBlock(),l.createElementBlock("button",{ref:"buttonEl",class:l.normalizeClass(`
|
|
1
|
+
var Zy=Object.defineProperty;var Jy=(le,l,Qe)=>l in le?Zy(le,l,{enumerable:!0,configurable:!0,writable:!0,value:Qe}):le[l]=Qe;var $=(le,l,Qe)=>(Jy(le,typeof l!="symbol"?l+"":l,Qe),Qe);(function(le,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],l):(le=typeof globalThis<"u"?globalThis:le||self,l(le["feedmepos-ui-library"]={},le.Vue,le.VueRouter))})(this,function(le,l,Qe){var ko;"use strict";const Qy="",Xs={directive:"wave",color:"currentColor",initialOpacity:.2,finalOpacity:.1,duration:.4,dissolveDuration:.15,easing:"ease-out",cancellationPeriod:75,trigger:"auto",tagName:"div"},Ma=t=>"config"in t&&"globalProperties"in t.config,Da=t=>{let e;return t==="vue2"?e=!1:t==="vue3"?e=!0:e=Ma(t),e?{mounted:"mounted",updated:"updated"}:{mounted:"inserted",updated:"componentUpdated"}},Ks=t=>typeof t=="string"&&t!=="auto",Zs=(t,e)=>{t.dataset.vWaveBoundary=Ks(e)?e:"true"},Ea=({borderTopLeftRadius:t,borderTopRightRadius:e,borderBottomLeftRadius:n,borderBottomRightRadius:o},s)=>{const i=document.createElement(s);return i.style.top="0",i.style.left="0",i.style.width="100%",i.style.height="100%",i.style.display="block",i.style.position="absolute",i.style.borderRadius=`${t} ${e} ${o} ${n}`,i.style.overflow="hidden",i.style.pointerEvents="none",i.style.webkitMaskImage="-webkit-radial-gradient(white, black)",i},Va=(t,e,n,o)=>{const s=document.createElement("div");return s.style.position="absolute",s.style.width=`${n}px`,s.style.height=`${n}px`,s.style.top=`${e}px`,s.style.left=`${t}px`,s.style.background=o.color,s.style.borderRadius="50%",s.style.opacity=`${o.initialOpacity}`,s.style.transform="translate(-50%,-50%) scale(0)",s.style.transition=`transform ${o.duration}s ${o.easing}, opacity ${o.duration}s ${o.easing}`,s};function Cn(t,e,n,o){const s=t-n,i=e-o;return Math.sqrt(s*s+i*i)}function Ra(t,e,{width:n,height:o}){const s=Cn(t,e,0,0),i=Cn(t,e,n,0),r=Cn(t,e,0,o),a=Cn(t,e,n,o);return Math.max(s,i,r,a)}const Ba=({x:t,y:e},{top:n,left:o})=>({x:t-o,y:e-n}),So="vWaveCountInternal";function Fa(t){const e=vo(t);Js(t,e+1)}function $a(t){const e=vo(t);Js(t,e-1)}function Js(t,e){t.dataset[So]=e.toString()}function vo(t){var e;return parseInt((e=t.dataset[So])!==null&&e!==void 0?e:"0",10)}function Pa(t){delete t.dataset[So]}const Mo=(t,e,n)=>{const o=e.getBoundingClientRect(),s=window.getComputedStyle(e),{x:i,y:r}=Ba(t,o),a=2.05*Ra(i,r,o),c=Ea(s,n.tagName),d=Va(i,r,a,n);Fa(e);let u="";s.position==="static"&&(e.style.position&&(u=e.style.position),e.style.position="relative"),c.appendChild(d),e.appendChild(c);let f=!1;const p=b=>{typeof b<"u"&&(document.removeEventListener("pointerup",p),document.removeEventListener("pointercancel",p)),f?h():f=!0},h=()=>{d.style.transition=`opacity ${n.dissolveDuration}s linear`,d.style.opacity="0",setTimeout(()=>{c.remove(),$a(e),vo(e)===0&&(Pa(e),e.style.position=u)},n.dissolveDuration*1e3)};document.addEventListener("pointerup",p),document.addEventListener("pointercancel",p);const g=setTimeout(()=>{document.removeEventListener("pointercancel",m),requestAnimationFrame(()=>{d.style.transform="translate(-50%,-50%) scale(1)",d.style.opacity=`${n.finalOpacity}`,setTimeout(()=>p(),n.duration*1e3)})},n.cancellationPeriod),m=()=>{clearTimeout(g),c.remove(),document.removeEventListener("pointerup",p),document.removeEventListener("pointercancel",p),document.removeEventListener("pointercancel",m)};document.addEventListener("pointercancel",m)},Lt=new WeakMap,Qs=(t={},e="vue3")=>{const n=Object.assign(Object.assign({},Xs),t),o=Da(e),s=a=>{const c=a.currentTarget.dataset.vWaveTrigger;document.querySelectorAll(`[data-v-wave-boundary="${c}"]`).forEach(u=>Mo(a,u,Object.assign(Object.assign({},n),Lt.get(u))))},i={[o.mounted](a,{value:c={}}){var d;Lt.set(a,c),Zs(a,(d=c&&c.trigger)!==null&&d!==void 0?d:n.trigger),a.addEventListener("pointerdown",u=>{if(Lt.get(a)===!1)return;const f=Object.assign(Object.assign({},n),Lt.get(a));if(f.trigger===!1)return Mo(u,a,f);if(Ks(f.trigger))return;const p=a.querySelector('[data-v-wave-trigger="true"]');!p&&f.trigger===!0||p&&!u.composedPath().includes(p)||Mo(u,a,f)})},[o.updated](a,{value:c={}}){var d;Lt.set(a,c),Zs(a,(d=c&&c.trigger)!==null&&d!==void 0?d:n.trigger)}},r={[o.mounted](a,{arg:c="true"}){a.dataset.vWaveTrigger=c,c!=="true"&&a.addEventListener("pointerdown",s)},[o.updated](a,{arg:c="true"}){a.dataset.vWaveTrigger=c,c==="true"?a.removeEventListener("pointerdown",s):a.addEventListener("pointerdown",s)}};return{wave:i,vWave:i,waveTrigger:r,vWaveTrigger:r}},Aa={install(t,e={}){if(this.installed)return;this.installed=!0;const n=Object.assign(Object.assign({},Xs),e),{vWave:o,vWaveTrigger:s}=Qs(n,t);t.directive(n.directive,o),t.directive(`${n.directive}-trigger`,s)},installed:!1,createLocalWaveDirective:Qs},Oa={class:"gap-8 inline-flex items-center relative select-none"},Na={key:0,class:"fm-typo-body-sm-400 justify-center"},Ia=l.defineComponent({__name:"FmBadge",props:{inline:{type:Boolean,default:!1},value:{default:null},variant:{default:"neutral"}},setup(t){const e=t,n=l.computed(()=>e.value&&e.value>99?"99+":e.value);return(o,s)=>(l.openBlock(),l.createElementBlock("div",Oa,[l.renderSlot(o.$slots,"default",{},void 0,!0),l.createElementVNode("div",{class:l.normalizeClass(["fm-badge",`fm-badge--${o.variant}`,{absolute:!o.inline,"top-0 right-0 w-[6px] h-[6px]":e.value===null,"top-[-2px] right-[-4px] w-[16px] h-[16px]":e.value&&e.value<10,"top-[-2px] right-[-12px] px-4 h-[20px] min-w-[24px]":e.value&&e.value>10&&e.value<100,"top-[-2px] right-[-20px] px-4 h-[20px] min-w-[24px]":e.value&&e.value>99}])},[e.value!==null?(l.openBlock(),l.createElementBlock("span",Na,l.toDisplayString(n.value),1)):l.createCommentVNode("",!0)],2)]))}}),e_="",te=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},kn=te(Ia,[["__scopeId","data-v-02018628"]]),La={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},Ta=["onMouseenter"],za={key:0},Ha=l.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(t){const e=Qe.useRoute(),n=Qe.useRouter();l.onMounted(async()=>{await n.isReady();const g=o.items.findIndex(m=>m.route==e.path);g!=-1&&!o.items[g].disabled&&(s.value=g)});const o=t,s=l.ref(-1),i=l.ref(-1),r=l.ref(" / "),a=l.ref("... /"),c=l.ref(!1),d=g=>s.value===g?"selected":i.value===g?"hovered":o.items[g].disabled?"disabled":"default",u=g=>{o.items[g].disabled||(s.value=g)},f=g=>g!=o.items.length-1,p=g=>!c.value&&o.items.length>5&&g>=2&&g<o.items.length-2,h=()=>{c.value=!c.value};return(g,m)=>{const b=l.resolveComponent("RouterLink");return l.openBlock(),l.createElementBlock("nav",null,[l.createElementVNode("ul",La,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(g.items,(y,_)=>(l.openBlock(),l.createElementBlock("li",{key:_,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:w=>i.value=_,onMouseleave:m[0]||(m[0]=w=>i.value=-1)},[p(_)?_===3&&!c.value?(l.openBlock(),l.createElementBlock("a",{key:1,onClick:h},l.toDisplayString(a.value),1)):l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(b,{key:0,class:l.normalizeClass(d(_)),to:y.disabled?"":y.route,onClick:w=>u(_)},{default:l.withCtx(()=>[l.createElementVNode("span",null,l.toDisplayString(y.label),1),f(_)?(l.openBlock(),l.createElementBlock("span",za,l.toDisplayString(r.value),1)):l.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,Ta))),128))])])}}}),t_="",ja=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,Wa=/^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}[)]$/,Ya=/^^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*[)]$/,Ga=/^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*[)]$/,Ua=/^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 Do(t){return[ja,Wa,Ya,Ga,Ua].some(e=>e.test(t))}const qa=l.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(t){const e=t,n=l.computed(()=>{const i=[],r={};return i.push(o()),i.push(s()),Do(e.color)?r.color=e.color:i.push(`text-fm-color-${e.color}`),{class:i.join(" "),style:r}});function o(){return`fm-icon--${e.outline?"outlined":"rounded"}`}function s(){return`fm-icon--${e.size}`}return(i,r)=>(l.openBlock(),l.createElementBlock("span",l.mergeProps(n.value,{class:"fm-icon"}),l.toDisplayString(e.name),17))}}),n_="",H=te(qa,[["__scopeId","data-v-fd802d37"]]),Xa={class:"relative"},Ka={class:"absolute h-full left-0 top-0 w-full",viewBox:"0 0 18 18"},Za=["stroke-width"];var ei=(t=>(t[t.md=2.5]="md",t[t.lg=2]="lg",t[t.xl=1.75]="xl",t))(ei||{});const Ja=l.defineComponent({__name:"FmProgress",props:{size:{default:"md"},color:{default:"primary"}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",Xa,[l.createElementVNode("div",{class:l.normalizeClass(`fm-progress--${e.size} text-fm-color-${e.color}`)},[(l.openBlock(),l.createElementBlock("svg",Ka,[l.createElementVNode("circle",{class:"fm-progress--indetermindate","stroke-width":ei[e.size],fill:"none",stroke:"currentColor",cx:"50%",cy:"50%",r:7.75,"stroke-linecap":"round","stroke-dasharray":"10 200","stroke-dashoffset":"0"},null,8,Za)]))],2)]))}}),o_="",Qa=te(Ja,[["__scopeId","data-v-ef86ac9c"]]),ec=["disabled","type"],tc={class:"-translate-x-1/2 -translate-y-1/2 absolute left-1/2 top-1/2 transform"},nc=l.defineComponent({__name:"FmButton",props:{variant:{default:"primary"},label:{default:""},icon:{default:""},size:{default:"lg"},disabled:{type:Boolean,default:!1},iconColor:{default:""},type:{default:"button"},iconPosition:{default:"prepend"},prependIcon:{default:""},appendIcon:{default:""},loading:{type:Boolean,default:!1}},setup(t){const e=t,n=l.ref(!1),o=l.computed(()=>`${s[e.variant]} ${e.disabled?"cursor-not-allowed":"cursor-pointer"}`),s={primary:"bg-fm-color-primary text-fm-color-typo-white rounded-lg",secondary:"bg-transparent rounded-lg border-1 border-fm-color-neutral-black",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white rounded-lg",tertiary:"bg-transparent text-fm-color-typo-primary rounded-lg",plain:"bg-transparent text-fm-color-primary",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white rounded-xxxl min-h-56 min-w-56 !p-16"};function i(r){n.value=r}return(r,a)=>{const c=l.resolveDirective("wave");return l.withDirectives((l.openBlock(),l.createElementBlock("button",{ref:"buttonEl",class:l.normalizeClass(`
|
|
2
2
|
fm-btn
|
|
3
3
|
${o.value}
|
|
4
4
|
fm-btn--${r.size}
|
|
@@ -6,24 +6,24 @@ var Hy=Object.defineProperty;var jy=(ie,l,Ue)=>l in ie?Hy(ie,l,{enumerable:!0,co
|
|
|
6
6
|
fm-btn--${r.variant}
|
|
7
7
|
${r.disabled||r.loading?"fm-btn--disabled":""}
|
|
8
8
|
${n.value&&r.variant==="plain"?"!text-fm-color-system-warning-400":""}
|
|
9
|
-
`),disabled:r.disabled,type:r.type,onMousedown:a[0]||(a[0]=()=>s(!0)),onMouseup:a[1]||(a[1]=()=>s(!1)),onMouseleave:a[2]||(a[2]=()=>s(!1))},[r.icon&&r.iconPosition==="prepend"||r.prependIcon?(l.openBlock(),l.createBlock(L,{key:0,class:l.normalizeClass({invisible:r.loading}),name:r.icon||r.prependIcon,outline:!n.value,color:r.disabled?"neutral-gray-200":r.iconColor??"",size:"md"},null,8,["class","name","outline","color"])):l.createCommentVNode("",!0),r.label?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-lg-700",{invisible:r.loading}])},l.toDisplayString(r.label),3)):l.createCommentVNode("",!0),r.icon&&r.iconPosition==="append"||r.appendIcon?(l.openBlock(),l.createBlock(L,{key:2,class:l.normalizeClass({invisible:r.loading}),name:r.icon||r.appendIcon,outline:!n.value,color:r.disabled?"neutral-gray-200":r.iconColor??"",size:"md"},null,8,["class","name","outline","color"])):l.createCommentVNode("",!0),l.createElementVNode("div",Ya,[r.loading?(l.openBlock(),l.createBlock(ja,{key:0,size:"md",color:"neutral-gray-300"})):l.createCommentVNode("",!0)])],42,Wa)),[[c,!r.disabled&&!r.loading&&r.variant!=="plain"]])}}}),Xy="",fe=Q(Ga,[["__scopeId","data-v-ac44a4b8"]]),Ua={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},qa=["v-wave","disabled","onClick","onMousedown"],Xa=l.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=d=>{o("update:modelValue",d)},s=l.ref(null),r=d=>{s.value=d},a=d=>d.disabled||n.disabled,c=d=>JSON.stringify(d)===JSON.stringify(n.modelValue);return(d,u)=>(l.openBlock(),l.createElementBlock("div",Ua,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d.items,(f,p)=>(l.openBlock(),l.createElementBlock("button",{key:p,"v-wave":a(f),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":c(f),"hover:bg-fm-color-neutral-white cursor-not-allowed":a(f)}]),disabled:a(f),onClick:h=>i(f),onMousedown:h=>r(f),onMouseup:u[0]||(u[0]=h=>r(null)),onMouseleave:u[1]||(u[1]=h=>r(null))},[f.icon?(l.openBlock(),l.createBlock(L,{key:0,name:f.icon,size:"md",color:a(f)?"neutral-gray-200":c(f)?"primary":"",outline:JSON.stringify(s.value)!==JSON.stringify(f)&&!c(f)},null,8,["name","color","outline"])):l.createCommentVNode("",!0),f.label?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-lg-700",[a(f)?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},l.toDisplayString(f.label),3)):l.createCommentVNode("",!0)],42,qa))),128))]))}}),Ka={class:"grow"},Gi=l.defineComponent({__name:"FmCardTitle",props:{padding:{type:String,default:"p-16"}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-title",t.padding])},[l.createElementVNode("div",Ka,[l.renderSlot(e.$slots,"default")]),l.renderSlot(e.$slots,"actions")],2))}}),Za={class:"fm-typo-title-md-700 grow"},Ja=l.defineComponent({__name:"FmCard",props:{title:{type:String,default:void 0},variant:{type:String,default:"elevated"},horizontal:{type:Boolean,default:!1}},setup(t){const e=t,n=l.useSlots();return(o,i)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex-nowrap fm-card",`${t.variant==="elevated"?"fm-shadow-light-400":"border-1"} ${t.horizontal?"fm-card--horizontal":""}`])},[l.renderSlot(o.$slots,"header",{title:e.title},()=>[t.title||l.unref(n)["header-title"]||l.unref(n)["header-actions"]?(l.openBlock(),l.createBlock(Gi,{key:0},{actions:l.withCtx(()=>[l.renderSlot(o.$slots,"header-actions")]),default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(o.$slots,"header-title",{title:e.title},()=>[l.createElementVNode("div",Za,l.toDisplayString(e.title),1)])])]),_:3})):l.createCommentVNode("",!0)]),l.renderSlot(o.$slots,"default"),l.renderSlot(o.$slots,"actions")],2))}}),Ky="",Qa=l.defineComponent({__name:"FmCardActions",props:{alignment:{type:String,default:"right"},padding:{type:String,default:"p-16"}},setup(t){const e=t,n=l.computed(()=>{switch(e.alignment){case"left":return"justify-start";case"right":return"justify-end";case"center":return"justify-center";default:return""}});return(o,i)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-actions",`${n.value} ${t.padding}`])},[l.renderSlot(o.$slots,"default")],2))}}),ec=l.defineComponent({__name:"FmCardSection",props:{padding:{type:String,default:"p-16"}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-section",t.padding])},[l.renderSlot(e.$slots,"default")],2))}}),Ui=l.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(t,{emit:e}){const n=t,o=e,i=l.ref(!1),s=l.ref(!1);function r(d){n.selectable&&(s.value=d)}const a=()=>{!n.selectable||n.disabled||(i.value=!i.value)},c=()=>{n.disabled||o("chip-closed")};return l.onMounted(()=>{i.value=n.selected}),l.watch(()=>n.selected,()=>{i.value=n.selected}),(d,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["inline-flex rounded-md items-center gap-4 justify-center max-w-[200px]",i.value&&!d.disabled?"bg-fm-color-neutral-black":"bg-fm-color-neutral-gray-100",d.compact?"h-[22px] px-8":"h-[30px] px-8 py-4",{"bg-fm-color-neutral-gray-100 cursor-not-allowed":d.disabled,"cursor-pointer":d.selectable&&!d.disabled,"hover:bg-fm-color-opacity-sm":!i.value&&!d.disabled&&d.selectable}]),onClick:a,onMousedown:u[0]||(u[0]=()=>r(!0)),onMouseup:u[1]||(u[1]=()=>r(!1)),onMouseleave:u[2]||(u[2]=()=>r(!1))},[l.renderSlot(d.$slots,"default",{},()=>[d.icon?(l.openBlock(),l.createBlock(L,{key:0,name:d.icon,size:"sm",outline:!s.value&&!i.value,color:d.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),d.label?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["fm-typo-body-md-700 select-none text-ellipsis overflow-hidden whitespace-nowrap",d.disabled?"text-fm-color-typo-disabled":i.value?"text-fm-color-typo-white":"text-fm-color-typo-primary"])},l.toDisplayString(d.label),3)):l.createCommentVNode("",!0)]),d.removable?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["flex items-center justify-center rounded-xxxl",!i.value&&!d.disabled?"hover:bg-fm-color-opacity-sm":"",{"cursor-not-allowed":d.disabled,"cursor-pointer":d.selectable&&!d.disabled}]),onClick:c},[l.createVNode(L,{name:"close",size:"sm",color:d.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black"},null,8,["color"])],2)):l.createCommentVNode("",!0)],34))}}),qi=l.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(t,{emit:e}){const n=t,o=e,i=l.ref(null),s=l.ref(0),r=l.ref(null),a=l.ref(),c=()=>{var p,h;if(!i.value)return;const u=i.value.getBoundingClientRect();s.value>0&&r.value&&((p=a.value)==null||p.splice(r.value,1)),s.value=0;let f=0;Array.from(i.value.children).forEach((g,m)=>{const b=g.getBoundingClientRect(),x=b.y-u.y;f=Math.max(b.height*2+4,f),x>f&&(s.value+=1,r.value=r.value===null?m:m-s.value)}),s.value>0&&r.value&&((h=a.value)==null||h.splice(r.value,0,{label:`+${s.value}`,removable:!1,selectable:!1,compact:n.compact}))},d=u=>{o("chip-closed",u)};return l.onMounted(()=>{a.value=n.items,c(),new ResizeObserver(()=>{c()}).observe(i.value)}),l.watch(()=>n.items,()=>{a.value=n.items,c()}),(u,f)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"chipsContainer",ref:i,class:l.normalizeClass(["flex flex-wrap gap-4 items-center overflow-y-hidden",u.compact?"max-h-48":"max-h-64"])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,(p,h)=>(l.openBlock(),l.createBlock(Ui,{key:h,label:p.label,icon:p.icon,selected:p.selected,removable:p.removable!==void 0?p.removable:u.removable,selectable:p.selectable!==void 0?p.selectable:u.selectable,disabled:p.disabled!==void 0?p.disabled:u.disabled,compact:u.compact,onChipClosed:g=>d(h)},null,8,["label","icon","selected","removable","selectable","disabled","compact","onChipClosed"]))),128))],2))}}),tc={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},nc={class:"overflow-y-auto"},oc={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},ic=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(t,{emit:e}){const n=t,o=e,i=l.ref(null),s=r=>{n.overlay&&i.value&&r.target===i.value&&o("update:modelValue",!1)};return(r,a)=>(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createVNode(l.Transition,null,{default:l.withCtx(()=>[r.modelValue?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:i,class:l.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":r.overlay}),onClick:a[1]||(a[1]=c=>s(c))},[l.createElementVNode("div",{class:l.normalizeClass(`fm-dialog min-w-[${r.minWidth}px]`)},[l.createElementVNode("div",tc,[l.renderSlot(r.$slots,"dialog-header"),r.closeButton?(l.openBlock(),l.createBlock(L,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:a[0]||(a[0]=c=>o("update:modelValue",!1))})):l.createCommentVNode("",!0)]),l.createElementVNode("div",nc,[l.renderSlot(r.$slots,"dialog-content")]),l.createElementVNode("div",oc,[l.renderSlot(r.$slots,"dialog-footer")])],2)],2)):l.createCommentVNode("",!0)]),_:3})]))}}),Zy="",sc={class:"fm-drop-field"},rc=["accept","disabled"],lc=l.defineComponent({__name:"FmDropField",props:{label:{default:""},disabled:{type:Boolean,default:!1},accept:{default:""},maxFileSize:{default:8e6}},emits:["file-upload","file-rejected"],setup(t,{emit:e}){const n=t,o=e,i=l.ref(!1),s=l.ref(),r=l.ref(),a=l.ref(),c=_=>{n.disabled||(_.stopPropagation(),_.preventDefault())},d=_=>{n.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!0)},u=_=>{n.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!1)},f=_=>{n.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!1,p(_))},p=_=>{var v;a.value=((v=_.dataTransfer)==null?void 0:v.files)??_.target.files;const C=a.value;if(s.value=g(C[0]),r.value=m(C[0]),s.value&&r.value)o("file-upload",C[0]);else{const k=h();o("file-rejected",[{file:C[0],reason:k}])}},h=()=>{const _=[];return s.value||_.push("invalid-type"),r.value||_.push("invalid-size"),_},g=_=>{if(!n.accept)return!0;const C=n.accept.split(",").map(v=>v.trim());for(const v of C)if(b(v)){if(y(v)===y(_.type))return!0}else if(x(_)===v||_.type===v)return!0;return!1},m=_=>_.size<=n.maxFileSize,b=_=>_.indexOf("*")!==-1,x=_=>"."+_.name.split(".").pop(),y=_=>_.substring(0,_.indexOf("/")),w=l.computed(()=>{if(i.value)return"Drop file to upload";if(s.value){if(!r.value)return`File size exceeds ${n.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),S=l.computed(()=>a.value?!s.value||!r.value:!1);return(_,C)=>(l.openBlock(),l.createElementBlock("label",sc,[l.renderSlot(_.$slots,"label",{},()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[_.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},l.toDisplayString(_.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":S.value&&!_.disabled,"fm-drop-field__container--disabled":_.disabled}]),onDragenter:c,onDragover:d,onDragleave:u,onDrop:f},[(i.value||S.value)&&!_.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":S.value})},l.toDisplayString(w.value),3)):(l.openBlock(),l.createBlock(fe,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:_.disabled},null,8,["disabled"])),l.renderSlot(_.$slots,"accept-text",{},()=>[n.accept?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-typo-body-md-400",[_.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},l.toDisplayString(`Accepts ${n.accept}`),3)):l.createCommentVNode("",!0)],!0),l.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:_.accept,disabled:_.disabled,onChange:p},null,40,rc)],34),l.renderSlot(_.$slots,"helper-text",{},()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-sm-400",[_.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},l.toDisplayString(`Max size ${n.maxFileSize*1e-6}mb`),3)],!0)]))}}),Jy="",ac=Q(lc,[["__scopeId","data-v-c914dc32"]]),cc={},dc={class:"flex-grow"};function uc(t,e){return l.openBlock(),l.createElementBlock("div",dc)}const Xi=Q(cc,[["render",uc]]),Ki=Symbol.for("fm:form"),Zi=Symbol.for("fm:radio-group"),Ji=Symbol.for("fm:stepper"),Qi=Symbol.for("fm:dialog"),es=Symbol.for("fm:menu"),fc={install:t=>{const e={currentDialog:{vNode:null,container:null},open:n=>{const o={primary:[],secondary:[],tertiary:[]},i={onPrimary:d=>(o.primary.push(d),i),onSecondary:d=>(o.secondary.push(d),i),onTertiary:d=>(o.tertiary.push(d),i)};function s(){r&&l.render(null,r),r=null,c=null}let r=document.createElement("div");document.body.appendChild(r);const a=l.markRaw(ts);let c=l.createVNode(a,{...n,unmount:s,storedFunctions:o});return c.appContext=t._context,l.render(c,r),e.currentDialog.vNode=c,e.currentDialog.container=r,i},close:()=>{const{vNode:n,container:o}=e.currentDialog;n===null&&o===null||(o&&l.render(null,o),e.currentDialog={vNode:null,container:null})}};t.config.globalProperties.$dialog=e,t.provide(Qi,e)}},hc={key:0,class:"block relative"},pc={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},gc={class:"fm-typo-title-md-700 text-fm-color-typo-primary"},mc={key:0,class:"overflow-y-auto"},bc={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},yc={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},ts=l.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(t,{emit:e}){const n=l.ref(!0),o=t,i=e,s=l.ref(null),r=()=>{o.overlay&&o.unmount()},a=d=>{s.value&&d.target===s.value&&r()},c=(d,u)=>{o.storedFunctions[u].forEach(f=>f()),d.close&&r()};return l.onMounted(()=>{i("dialog-opened")}),l.onUnmounted(()=>{i("dialog-closed")}),(d,u)=>(l.openBlock(),l.createBlock(l.Transition,null,{default:l.withCtx(()=>[n.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:s,class:l.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":d.overlay}),onClick:a},[d.dialogComponent?(l.openBlock(),l.createElementBlock("div",hc,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(d.dialogComponent),l.normalizeProps(l.guardReactiveProps(d.dialogComponentProps)),null,16)),d.closeButton?(l.openBlock(),l.createBlock(L,{key:0,class:"absolute cursor-pointer right-[12px] top-[18px]",name:"close",size:"md",onClick:r})):l.createCommentVNode("",!0)])):(l.openBlock(),l.createElementBlock("div",{key:1,class:"fm-dialog",style:l.normalizeStyle({"min-width":`${o.minWidth}px`})},[l.createElementVNode("div",pc,[l.createElementVNode("div",gc,l.toDisplayString(d.title),1),d.closeButton?(l.openBlock(),l.createBlock(L,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:r})):l.createCommentVNode("",!0)]),d.contentComponent?(l.openBlock(),l.createElementBlock("div",mc,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(d.contentComponent),l.normalizeProps(l.guardReactiveProps(d.contentComponentProps)),null,16))])):(l.openBlock(),l.createElementBlock("div",bc,l.toDisplayString(d.message),1)),l.createElementVNode("div",yc,[d.tertiaryActions?(l.openBlock(),l.createBlock(fe,{key:0,class:"sm:w-full xs:w-full",variant:"tertiary",label:d.tertiaryActions.text,size:"md",onClick:u[0]||(u[0]=f=>c(d.tertiaryActions,"tertiary"))},null,8,["label"])):l.createCommentVNode("",!0),l.createVNode(Xi,{class:"sm:hidden xs:hidden"}),d.secondaryActions?(l.openBlock(),l.createBlock(fe,{key:1,class:"sm:w-full xs:w-full",variant:"secondary",label:d.secondaryActions.text,size:"md",onClick:u[1]||(u[1]=f=>c(d.secondaryActions,"secondary"))},null,8,["label"])):l.createCommentVNode("",!0),d.primaryActions?(l.openBlock(),l.createBlock(fe,{key:2,class:"sm:w-full xs:w-full",variant:"primary",label:d.primaryActions.text,size:"md",onClick:u[2]||(u[2]=f=>c(d.primaryActions,"primary"))},null,8,["label"])):l.createCommentVNode("",!0)])],4))],2)):l.createCommentVNode("",!0)]),_:1}))}}),Qy="";/*!
|
|
9
|
+
`),disabled:r.disabled,type:r.type,onMousedown:a[0]||(a[0]=()=>i(!0)),onMouseup:a[1]||(a[1]=()=>i(!1)),onMouseleave:a[2]||(a[2]=()=>i(!1))},[r.icon&&r.iconPosition==="prepend"||r.prependIcon?(l.openBlock(),l.createBlock(H,{key:0,class:l.normalizeClass({invisible:r.loading}),name:r.icon||r.prependIcon,outline:!n.value,color:r.disabled?"neutral-gray-200":r.iconColor??"",size:"md"},null,8,["class","name","outline","color"])):l.createCommentVNode("",!0),r.label?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-lg-700 line-clamp-1",{invisible:r.loading}])},l.toDisplayString(r.label),3)):l.createCommentVNode("",!0),r.icon&&r.iconPosition==="append"||r.appendIcon?(l.openBlock(),l.createBlock(H,{key:2,class:l.normalizeClass({invisible:r.loading}),name:r.icon||r.appendIcon,outline:!n.value,color:r.disabled?"neutral-gray-200":r.iconColor??"",size:"md"},null,8,["class","name","outline","color"])):l.createCommentVNode("",!0),l.createElementVNode("div",tc,[r.loading?(l.openBlock(),l.createBlock(Qa,{key:0,size:"md",color:"neutral-gray-300"})):l.createCommentVNode("",!0)])],42,ec)),[[c,!r.disabled&&!r.loading&&r.variant!=="plain"]])}}}),s_="",ge=te(nc,[["__scopeId","data-v-adf16e5a"]]),oc={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},sc=["v-wave","disabled","onClick","onMousedown"],ic=l.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,s=d=>{o("update:modelValue",d)},i=l.ref(null),r=d=>{i.value=d},a=d=>d.disabled||n.disabled,c=d=>JSON.stringify(d)===JSON.stringify(n.modelValue);return(d,u)=>(l.openBlock(),l.createElementBlock("div",oc,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d.items,(f,p)=>(l.openBlock(),l.createElementBlock("button",{key:p,"v-wave":a(f),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":c(f),"hover:bg-fm-color-neutral-white cursor-not-allowed":a(f)}]),disabled:a(f),onClick:h=>s(f),onMousedown:h=>r(f),onMouseup:u[0]||(u[0]=h=>r(null)),onMouseleave:u[1]||(u[1]=h=>r(null))},[f.icon?(l.openBlock(),l.createBlock(H,{key:0,name:f.icon,size:"md",color:a(f)?"neutral-gray-200":c(f)?"primary":"",outline:JSON.stringify(i.value)!==JSON.stringify(f)&&!c(f)},null,8,["name","color","outline"])):l.createCommentVNode("",!0),f.label?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-lg-700",[a(f)?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},l.toDisplayString(f.label),3)):l.createCommentVNode("",!0)],42,sc))),128))]))}}),rc={class:"grow"},ti=l.defineComponent({__name:"FmCardTitle",props:{padding:{type:String,default:"p-16"}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-title",t.padding])},[l.createElementVNode("div",rc,[l.renderSlot(e.$slots,"default")]),l.renderSlot(e.$slots,"actions")],2))}}),lc={class:"fm-typo-title-md-700 grow"},ac=l.defineComponent({__name:"FmCard",props:{title:{type:String,default:void 0},variant:{type:String,default:"elevated"},horizontal:{type:Boolean,default:!1}},setup(t){const e=t,n=l.useSlots();return(o,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex-nowrap fm-card",`${t.variant==="elevated"?"fm-shadow-light-400":"border-1"} ${t.horizontal?"fm-card--horizontal":""}`])},[l.renderSlot(o.$slots,"header",{title:e.title},()=>[t.title||l.unref(n)["header-title"]||l.unref(n)["header-actions"]?(l.openBlock(),l.createBlock(ti,{key:0},{actions:l.withCtx(()=>[l.renderSlot(o.$slots,"header-actions")]),default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(o.$slots,"header-title",{title:e.title},()=>[l.createElementVNode("div",lc,l.toDisplayString(e.title),1)])])]),_:3})):l.createCommentVNode("",!0)]),l.renderSlot(o.$slots,"default"),l.renderSlot(o.$slots,"actions")],2))}}),i_="",cc=l.defineComponent({__name:"FmCardActions",props:{alignment:{type:String,default:"right"},padding:{type:String,default:"p-16"}},setup(t){const e=t,n=l.computed(()=>{switch(e.alignment){case"left":return"justify-start";case"right":return"justify-end";case"center":return"justify-center";default:return""}});return(o,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-actions",`${n.value} ${t.padding}`])},[l.renderSlot(o.$slots,"default")],2))}}),dc=l.defineComponent({__name:"FmCardSection",props:{padding:{type:String,default:"p-16"}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-section",t.padding])},[l.renderSlot(e.$slots,"default")],2))}}),ni=l.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(t,{emit:e}){const n=t,o=e,s=l.ref(!1),i=l.ref(!1);function r(d){n.selectable&&(i.value=d)}const a=()=>{!n.selectable||n.disabled||(s.value=!s.value)},c=()=>{n.disabled||o("chip-closed")};return l.onMounted(()=>{s.value=n.selected}),l.watch(()=>n.selected,()=>{s.value=n.selected}),(d,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["inline-flex rounded-md items-center gap-4 justify-center max-w-[200px]",s.value&&!d.disabled?"bg-fm-color-neutral-black":"bg-fm-color-neutral-gray-100",d.compact?"h-[22px] px-8":"h-[30px] px-8 py-4",{"bg-fm-color-neutral-gray-100 cursor-not-allowed":d.disabled,"cursor-pointer":d.selectable&&!d.disabled,"hover:bg-fm-color-opacity-sm":!s.value&&!d.disabled&&d.selectable}]),onClick:a,onMousedown:u[0]||(u[0]=()=>r(!0)),onMouseup:u[1]||(u[1]=()=>r(!1)),onMouseleave:u[2]||(u[2]=()=>r(!1))},[l.renderSlot(d.$slots,"default",{},()=>[d.icon?(l.openBlock(),l.createBlock(H,{key:0,name:d.icon,size:"sm",outline:!i.value&&!s.value,color:d.disabled?"neutral-gray-200":s.value?"neutral-white":"neutral-black"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),d.label?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["fm-typo-body-md-700 select-none text-ellipsis overflow-hidden whitespace-nowrap",d.disabled?"text-fm-color-typo-disabled":s.value?"text-fm-color-typo-white":"text-fm-color-typo-primary"])},l.toDisplayString(d.label),3)):l.createCommentVNode("",!0)]),d.removable?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["flex items-center justify-center rounded-xxxl",!s.value&&!d.disabled?"hover:bg-fm-color-opacity-sm":"",{"cursor-not-allowed":d.disabled,"cursor-pointer":d.selectable&&!d.disabled}]),onClick:c},[l.createVNode(H,{name:"close",size:"sm",color:d.disabled?"neutral-gray-200":s.value?"neutral-white":"neutral-black"},null,8,["color"])],2)):l.createCommentVNode("",!0)],34))}}),oi=l.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(t,{emit:e}){const n=t,o=e,s=l.ref(null),i=l.ref(0),r=l.ref(null),a=l.ref(),c=()=>{var p,h;if(!s.value)return;const u=s.value.getBoundingClientRect();i.value>0&&r.value&&((p=a.value)==null||p.splice(r.value,1)),i.value=0;let f=0;Array.from(s.value.children).forEach((g,m)=>{const b=g.getBoundingClientRect(),y=b.y-u.y;f=Math.max(b.height*2+4,f),y>f&&(i.value+=1,r.value=r.value===null?m:m-i.value)}),i.value>0&&r.value&&((h=a.value)==null||h.splice(r.value,0,{label:`+${i.value}`,removable:!1,selectable:!1,compact:n.compact}))},d=u=>{o("chip-closed",u)};return l.onMounted(()=>{a.value=n.items,c(),new ResizeObserver(()=>{c()}).observe(s.value)}),l.watch(()=>n.items,()=>{a.value=n.items,c()}),(u,f)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"chipsContainer",ref:s,class:l.normalizeClass(["flex flex-wrap gap-4 items-center overflow-y-hidden",u.compact?"max-h-48":"max-h-64"])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,(p,h)=>(l.openBlock(),l.createBlock(ni,{key:h,label:p.label,icon:p.icon,selected:p.selected,removable:p.removable!==void 0?p.removable:u.removable,selectable:p.selectable!==void 0?p.selectable:u.selectable,disabled:p.disabled!==void 0?p.disabled:u.disabled,compact:u.compact,onChipClosed:g=>d(h)},null,8,["label","icon","selected","removable","selectable","disabled","compact","onChipClosed"]))),128))],2))}}),uc={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},fc={class:"overflow-y-auto"},hc={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},pc=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(t,{emit:e}){const n=t,o=e,s=l.ref(null),i=r=>{n.overlay&&s.value&&r.target===s.value&&o("update:modelValue",!1)};return(r,a)=>(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createVNode(l.Transition,null,{default:l.withCtx(()=>[r.modelValue?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:s,class:l.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":r.overlay}),onClick:a[1]||(a[1]=c=>i(c))},[l.createElementVNode("div",{class:l.normalizeClass(`fm-dialog min-w-[${r.minWidth}px]`)},[l.createElementVNode("div",uc,[l.renderSlot(r.$slots,"dialog-header"),r.closeButton?(l.openBlock(),l.createBlock(H,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:a[0]||(a[0]=c=>o("update:modelValue",!1))})):l.createCommentVNode("",!0)]),l.createElementVNode("div",fc,[l.renderSlot(r.$slots,"dialog-content")]),l.createElementVNode("div",hc,[l.renderSlot(r.$slots,"dialog-footer")])],2)],2)):l.createCommentVNode("",!0)]),_:3})]))}}),r_="",gc={class:"fm-drop-field"},mc=["accept","disabled"],bc=l.defineComponent({__name:"FmDropField",props:{label:{default:""},disabled:{type:Boolean,default:!1},accept:{default:""},maxFileSize:{default:8e6}},emits:["file-upload","file-rejected"],setup(t,{emit:e}){const n=t,o=e,s=l.ref(!1),i=l.ref(),r=l.ref(),a=l.ref(),c=x=>{n.disabled||(x.stopPropagation(),x.preventDefault())},d=x=>{n.disabled||(x.stopPropagation(),x.preventDefault(),s.value=!0)},u=x=>{n.disabled||(x.stopPropagation(),x.preventDefault(),s.value=!1)},f=x=>{n.disabled||(x.stopPropagation(),x.preventDefault(),s.value=!1,p(x))},p=x=>{var v;a.value=((v=x.dataTransfer)==null?void 0:v.files)??x.target.files;const E=a.value;if(i.value=g(E[0]),r.value=m(E[0]),i.value&&r.value)o("file-upload",E[0]);else{const R=h();o("file-rejected",[{file:E[0],reason:R}])}},h=()=>{const x=[];return i.value||x.push("invalid-type"),r.value||x.push("invalid-size"),x},g=x=>{if(!n.accept)return!0;const E=n.accept.split(",").map(v=>v.trim());for(const v of E)if(b(v)){if(_(v)===_(x.type))return!0}else if(y(x)===v||x.type===v)return!0;return!1},m=x=>x.size<=n.maxFileSize,b=x=>x.indexOf("*")!==-1,y=x=>"."+x.name.split(".").pop(),_=x=>x.substring(0,x.indexOf("/")),w=l.computed(()=>{if(s.value)return"Drop file to upload";if(i.value){if(!r.value)return`File size exceeds ${n.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),S=l.computed(()=>a.value?!i.value||!r.value:!1);return(x,E)=>(l.openBlock(),l.createElementBlock("label",gc,[l.renderSlot(x.$slots,"label",{},()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[x.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},l.toDisplayString(x.label),3)],!0),l.createElementVNode("div",{class:l.normalizeClass(["fm-drop-field__container",{"fm-drop-field__container--dragging":s.value,"fm-drop-field__container--invalid":S.value&&!x.disabled,"fm-drop-field__container--disabled":x.disabled}]),onDragenter:c,onDragover:d,onDragleave:u,onDrop:f},[(s.value||S.value)&&!x.disabled?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass({"fm-typo-body-lg-700":!0,"text-fm-color-primary":s.value,"text-fm-color-typo-error":S.value})},l.toDisplayString(w.value),3)):(l.openBlock(),l.createBlock(ge,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:x.disabled},null,8,["disabled"])),l.renderSlot(x.$slots,"accept-text",{},()=>[n.accept?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-typo-body-md-400",[x.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},l.toDisplayString(`Accepts ${n.accept}`),3)):l.createCommentVNode("",!0)],!0),l.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:x.accept,disabled:x.disabled,onChange:p},null,40,mc)],34),l.renderSlot(x.$slots,"helper-text",{},()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-sm-400",[x.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},l.toDisplayString(`Max size ${n.maxFileSize*1e-6}mb`),3)],!0)]))}}),l_="",yc=te(bc,[["__scopeId","data-v-c914dc32"]]),_c={},xc={class:"flex-grow"};function wc(t,e){return l.openBlock(),l.createElementBlock("div",xc)}const si=te(_c,[["render",wc]]),ii=Symbol.for("fm:form"),ri=Symbol.for("fm:radio-group"),li=Symbol.for("fm:stepper"),ai=Symbol.for("fm:dialog"),ci=Symbol.for("fm:menu"),di=Symbol.for("fm:menu-to-item"),Cc={install:t=>{const e={currentDialog:{vNode:null,container:null},open:n=>{const o={primary:[],secondary:[],tertiary:[]},s={onPrimary:d=>(o.primary.push(d),s),onSecondary:d=>(o.secondary.push(d),s),onTertiary:d=>(o.tertiary.push(d),s)};function i(){r&&l.render(null,r),r=null,c=null}let r=document.createElement("div");document.body.appendChild(r);const a=l.markRaw(ui);let c=l.createVNode(a,{...n,unmount:i,storedFunctions:o});return c.appContext=t._context,l.render(c,r),e.currentDialog.vNode=c,e.currentDialog.container=r,s},close:()=>{const{vNode:n,container:o}=e.currentDialog;n===null&&o===null||(o&&l.render(null,o),e.currentDialog={vNode:null,container:null})}};t.config.globalProperties.$dialog=e,t.provide(ai,e)}},kc={key:0,class:"block relative"},Sc={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},vc={class:"fm-typo-title-md-700 text-fm-color-typo-primary"},Mc={key:0,class:"overflow-y-auto"},Dc={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},Ec={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},ui=l.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(t,{emit:e}){const n=l.ref(!0),o=t,s=e,i=l.ref(null),r=()=>{o.overlay&&o.unmount()},a=d=>{i.value&&d.target===i.value&&r()},c=(d,u)=>{o.storedFunctions[u].forEach(f=>f()),d.close&&r()};return l.onMounted(()=>{s("dialog-opened")}),l.onUnmounted(()=>{s("dialog-closed")}),(d,u)=>(l.openBlock(),l.createBlock(l.Transition,null,{default:l.withCtx(()=>[n.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:i,class:l.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":d.overlay}),onClick:a},[d.dialogComponent?(l.openBlock(),l.createElementBlock("div",kc,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(d.dialogComponent),l.normalizeProps(l.guardReactiveProps(d.dialogComponentProps)),null,16)),d.closeButton?(l.openBlock(),l.createBlock(H,{key:0,class:"absolute cursor-pointer right-[12px] top-[18px]",name:"close",size:"md",onClick:r})):l.createCommentVNode("",!0)])):(l.openBlock(),l.createElementBlock("div",{key:1,class:"fm-dialog",style:l.normalizeStyle({"min-width":`${o.minWidth}px`})},[l.createElementVNode("div",Sc,[l.createElementVNode("div",vc,l.toDisplayString(d.title),1),d.closeButton?(l.openBlock(),l.createBlock(H,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:r})):l.createCommentVNode("",!0)]),d.contentComponent?(l.openBlock(),l.createElementBlock("div",Mc,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(d.contentComponent),l.normalizeProps(l.guardReactiveProps(d.contentComponentProps)),null,16))])):(l.openBlock(),l.createElementBlock("div",Dc,l.toDisplayString(d.message),1)),l.createElementVNode("div",Ec,[d.tertiaryActions?(l.openBlock(),l.createBlock(ge,{key:0,class:"sm:w-full xs:w-full",variant:"tertiary",label:d.tertiaryActions.text,size:"md",onClick:u[0]||(u[0]=f=>c(d.tertiaryActions,"tertiary"))},null,8,["label"])):l.createCommentVNode("",!0),l.createVNode(si,{class:"sm:hidden xs:hidden"}),d.secondaryActions?(l.openBlock(),l.createBlock(ge,{key:1,class:"sm:w-full xs:w-full",variant:"secondary",label:d.secondaryActions.text,size:"md",onClick:u[1]||(u[1]=f=>c(d.secondaryActions,"secondary"))},null,8,["label"])):l.createCommentVNode("",!0),d.primaryActions?(l.openBlock(),l.createBlock(ge,{key:2,class:"sm:w-full xs:w-full",variant:"primary",label:d.primaryActions.text,size:"md",onClick:u[2]||(u[2]=f=>c(d.primaryActions,"primary"))},null,8,["label"])):l.createCommentVNode("",!0)])],4))],2)):l.createCommentVNode("",!0)]),_:1}))}}),a_="";/*!
|
|
10
10
|
* @kurkle/color v0.3.2
|
|
11
11
|
* https://github.com/kurkle/color#readme
|
|
12
12
|
* (c) 2023 Jukka Kurkela
|
|
13
13
|
* Released under the MIT License
|
|
14
|
-
*/function
|
|
14
|
+
*/function Tt(t){return t+.5|0}const et=(t,e,n)=>Math.max(Math.min(t,n),e);function zt(t){return et(Tt(t*2.55),0,255)}function tt(t){return et(Tt(t*255),0,255)}function Ie(t){return et(Tt(t/2.55)/100,0,1)}function fi(t){return et(Tt(t*100),0,100)}const Se={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},Eo=[..."0123456789ABCDEF"],Vc=t=>Eo[t&15],Rc=t=>Eo[(t&240)>>4]+Eo[t&15],Sn=t=>(t&240)>>4===(t&15),Bc=t=>Sn(t.r)&&Sn(t.g)&&Sn(t.b)&&Sn(t.a);function Fc(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&Se[t[1]]*17,g:255&Se[t[2]]*17,b:255&Se[t[3]]*17,a:e===5?Se[t[4]]*17:255}:(e===7||e===9)&&(n={r:Se[t[1]]<<4|Se[t[2]],g:Se[t[3]]<<4|Se[t[4]],b:Se[t[5]]<<4|Se[t[6]],a:e===9?Se[t[7]]<<4|Se[t[8]]:255})),n}const $c=(t,e)=>t<255?e(t):"";function Pc(t){var e=Bc(t)?Vc:Rc;return t?"#"+e(t.r)+e(t.g)+e(t.b)+$c(t.a,e):void 0}const Ac=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hi(t,e,n){const o=e*Math.min(n,1-n),s=(i,r=(i+t/30)%12)=>n-o*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Oc(t,e,n){const o=(s,i=(s+t/60)%6)=>n-n*e*Math.max(Math.min(i,4-i,1),0);return[o(5),o(3),o(1)]}function Nc(t,e,n){const o=hi(t,1,.5);let s;for(e+n>1&&(s=1/(e+n),e*=s,n*=s),s=0;s<3;s++)o[s]*=1-e-n,o[s]+=e;return o}function Ic(t,e,n,o,s){return t===s?(e-n)/o+(e<n?6:0):e===s?(n-t)/o+2:(t-e)/o+4}function Vo(t){const n=t.r/255,o=t.g/255,s=t.b/255,i=Math.max(n,o,s),r=Math.min(n,o,s),a=(i+r)/2;let c,d,u;return i!==r&&(u=i-r,d=a>.5?u/(2-i-r):u/(i+r),c=Ic(n,o,s,u,i),c=c*60+.5),[c|0,d||0,a]}function Ro(t,e,n,o){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,o)).map(tt)}function Bo(t,e,n){return Ro(hi,t,e,n)}function Lc(t,e,n){return Ro(Nc,t,e,n)}function Tc(t,e,n){return Ro(Oc,t,e,n)}function pi(t){return(t%360+360)%360}function zc(t){const e=Ac.exec(t);let n=255,o;if(!e)return;e[5]!==o&&(n=e[6]?zt(+e[5]):tt(+e[5]));const s=pi(+e[2]),i=+e[3]/100,r=+e[4]/100;return e[1]==="hwb"?o=Lc(s,i,r):e[1]==="hsv"?o=Tc(s,i,r):o=Bo(s,i,r),{r:o[0],g:o[1],b:o[2],a:n}}function Hc(t,e){var n=Vo(t);n[0]=pi(n[0]+e),n=Bo(n),t.r=n[0],t.g=n[1],t.b=n[2]}function jc(t){if(!t)return;const e=Vo(t),n=e[0],o=fi(e[1]),s=fi(e[2]);return t.a<255?`hsla(${n}, ${o}%, ${s}%, ${Ie(t.a)})`:`hsl(${n}, ${o}%, ${s}%)`}const gi={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"},mi={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 Wc(){const t={},e=Object.keys(mi),n=Object.keys(gi);let o,s,i,r,a;for(o=0;o<e.length;o++){for(r=a=e[o],s=0;s<n.length;s++)i=n[s],a=a.replace(i,gi[i]);i=parseInt(mi[r],16),t[a]=[i>>16&255,i>>8&255,i&255]}return t}let vn;function Yc(t){vn||(vn=Wc(),vn.transparent=[0,0,0,0]);const e=vn[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Gc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Uc(t){const e=Gc.exec(t);let n=255,o,s,i;if(e){if(e[7]!==o){const r=+e[7];n=e[8]?zt(r):et(r*255,0,255)}return o=+e[1],s=+e[3],i=+e[5],o=255&(e[2]?zt(o):et(o,0,255)),s=255&(e[4]?zt(s):et(s,0,255)),i=255&(e[6]?zt(i):et(i,0,255)),{r:o,g:s,b:i,a:n}}}function qc(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Ie(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Fo=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Vt=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Xc(t,e,n){const o=Vt(Ie(t.r)),s=Vt(Ie(t.g)),i=Vt(Ie(t.b));return{r:tt(Fo(o+n*(Vt(Ie(e.r))-o))),g:tt(Fo(s+n*(Vt(Ie(e.g))-s))),b:tt(Fo(i+n*(Vt(Ie(e.b))-i))),a:t.a+n*(e.a-t.a)}}function Mn(t,e,n){if(t){let o=Vo(t);o[e]=Math.max(0,Math.min(o[e]+o[e]*n,e===0?360:1)),o=Bo(o),t.r=o[0],t.g=o[1],t.b=o[2]}}function bi(t,e){return t&&Object.assign(e||{},t)}function yi(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=tt(t[3]))):(e=bi(t,{r:0,g:0,b:0,a:1}),e.a=tt(e.a)),e}function Kc(t){return t.charAt(0)==="r"?Uc(t):zc(t)}class Ht{constructor(e){if(e instanceof Ht)return e;const n=typeof e;let o;n==="object"?o=yi(e):n==="string"&&(o=Fc(e)||Yc(e)||Kc(e)),this._rgb=o,this._valid=!!o}get valid(){return this._valid}get rgb(){var e=bi(this._rgb);return e&&(e.a=Ie(e.a)),e}set rgb(e){this._rgb=yi(e)}rgbString(){return this._valid?qc(this._rgb):void 0}hexString(){return this._valid?Pc(this._rgb):void 0}hslString(){return this._valid?jc(this._rgb):void 0}mix(e,n){if(e){const o=this.rgb,s=e.rgb;let i;const r=n===i?.5:n,a=2*r-1,c=o.a-s.a,d=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;i=1-d,o.r=255&d*o.r+i*s.r+.5,o.g=255&d*o.g+i*s.g+.5,o.b=255&d*o.b+i*s.b+.5,o.a=r*o.a+(1-r)*s.a,this.rgb=o}return this}interpolate(e,n){return e&&(this._rgb=Xc(this._rgb,e._rgb,n)),this}clone(){return new Ht(this.rgb)}alpha(e){return this._rgb.a=tt(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=Tt(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Mn(this._rgb,2,e),this}darken(e){return Mn(this._rgb,2,-e),this}saturate(e){return Mn(this._rgb,1,e),this}desaturate(e){return Mn(this._rgb,1,-e),this}rotate(e){return Hc(this._rgb,e),this}}/*!
|
|
15
15
|
* Chart.js v4.4.1
|
|
16
16
|
* https://www.chartjs.org
|
|
17
17
|
* (c) 2023 Chart.js Contributors
|
|
18
18
|
* Released under the MIT License
|
|
19
|
-
*/function Pe(){}const zc=(()=>{let t=0;return()=>t++})();function H(t){return t===null||typeof t>"u"}function q(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function z(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function ee(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function ye(t,e){return ee(t)?t:e}function T(t,e){return typeof t>"u"?e:t}const Hc=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,cs=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function G(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function W(t,e,n,o){let i,s,r;if(q(t))if(s=t.length,o)for(i=s-1;i>=0;i--)e.call(n,t[i],i);else for(i=0;i<s;i++)e.call(n,t[i],i);else if(z(t))for(r=Object.keys(t),s=r.length,i=0;i<s;i++)e.call(n,t[r[i]],r[i])}function Cn(t,e){let n,o,i,s;if(!t||!e||t.length!==e.length)return!1;for(n=0,o=t.length;n<o;++n)if(i=t[n],s=e[n],i.datasetIndex!==s.datasetIndex||i.index!==s.index)return!1;return!0}function kn(t){if(q(t))return t.map(kn);if(z(t)){const e=Object.create(null),n=Object.keys(t),o=n.length;let i=0;for(;i<o;++i)e[n[i]]=kn(t[n[i]]);return e}return t}function ds(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function jc(t,e,n,o){if(!ds(t))return;const i=e[t],s=n[t];z(i)&&z(s)?Lt(i,s,o):e[t]=kn(s)}function Lt(t,e,n){const o=q(e)?e:[e],i=o.length;if(!z(t))return t;n=n||{};const s=n.merger||jc;let r;for(let a=0;a<i;++a){if(r=o[a],!z(r))continue;const c=Object.keys(r);for(let d=0,u=c.length;d<u;++d)s(c[d],t,r,n)}return t}function Tt(t,e){return Lt(t,e,{merger:Wc})}function Wc(t,e,n){if(!ds(t))return;const o=e[t],i=n[t];z(o)&&z(i)?Tt(o,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=kn(i))}const us={"":t=>t,x:t=>t.x,y:t=>t.y};function Yc(t){const e=t.split("."),n=[];let o="";for(const i of e)o+=i,o.endsWith("\\")?o=o.slice(0,-1)+".":(n.push(o),o="");return n}function Gc(t){const e=Yc(t);return n=>{for(const o of e){if(o==="")break;n=n&&n[o]}return n}}function Ke(t,e){return(us[e]||(us[e]=Gc(e)))(t)}function Eo(t){return t.charAt(0).toUpperCase()+t.slice(1)}const zt=t=>typeof t<"u",Ze=t=>typeof t=="function",fs=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function Uc(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const X=Math.PI,K=2*X,qc=K+X,Sn=Number.POSITIVE_INFINITY,Xc=X/180,ne=X/2,ct=X/4,hs=X*2/3,Je=Math.log10,Ve=Math.sign;function Ht(t,e,n){return Math.abs(t-e)<n}function ps(t){const e=Math.round(t);t=Ht(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Je(t))),o=t/n;return(o<=1?1:o<=2?2:o<=5?5:10)*n}function Kc(t){const e=[],n=Math.sqrt(t);let o;for(o=1;o<n;o++)t%o===0&&(e.push(o),e.push(t/o));return n===(n|0)&&e.push(n),e.sort((i,s)=>i-s).pop(),e}function Et(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Zc(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function gs(t,e,n){let o,i,s;for(o=0,i=t.length;o<i;o++)s=t[o][n],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function ve(t){return t*(X/180)}function Do(t){return t*(180/X)}function ms(t){if(!ee(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function bs(t,e){const n=e.x-t.x,o=e.y-t.y,i=Math.sqrt(n*n+o*o);let s=Math.atan2(o,n);return s<-.5*X&&(s+=K),{angle:s,distance:i}}function Vo(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Jc(t,e){return(t-e+qc)%K-X}function _e(t){return(t%K+K)%K}function jt(t,e,n,o){const i=_e(t),s=_e(e),r=_e(n),a=_e(s-i),c=_e(r-i),d=_e(i-s),u=_e(i-r);return i===s||i===r||o&&s===r||a>c&&d<u}function se(t,e,n){return Math.max(e,Math.min(n,t))}function Qc(t){return se(t,-32768,32767)}function Ae(t,e,n,o=1e-6){return t>=Math.min(e,n)-o&&t<=Math.max(e,n)+o}function Ro(t,e,n){n=n||(r=>t[r]<e);let o=t.length-1,i=0,s;for(;o-i>1;)s=i+o>>1,n(s)?i=s:o=s;return{lo:i,hi:o}}const Oe=(t,e,n,o)=>Ro(t,n,o?i=>{const s=t[i][e];return s<n||s===n&&t[i+1][e]===n}:i=>t[i][e]<n),ed=(t,e,n)=>Ro(t,n,o=>t[o][e]>=n);function td(t,e,n){let o=0,i=t.length;for(;o<i&&t[o]<e;)o++;for(;i>o&&t[i-1]>n;)i--;return o>0||i<t.length?t.slice(o,i):t}const ys=["push","pop","shift","splice","unshift"];function nd(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),ys.forEach(n=>{const o="_onData"+Eo(n),i=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...s){const r=i.apply(this,s);return t._chartjs.listeners.forEach(a=>{typeof a[o]=="function"&&a[o](...s)}),r}})})}function _s(t,e){const n=t._chartjs;if(!n)return;const o=n.listeners,i=o.indexOf(e);i!==-1&&o.splice(i,1),!(o.length>0)&&(ys.forEach(s=>{delete t[s]}),delete t._chartjs)}function xs(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const ws=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function Cs(t,e){let n=[],o=!1;return function(...i){n=i,o||(o=!0,ws.call(window,()=>{o=!1,t.apply(e,n)}))}}function od(t,e){let n;return function(...o){return e?(clearTimeout(n),n=setTimeout(t,e,o)):t.apply(this,o),e}}const Fo=t=>t==="start"?"left":t==="end"?"right":"center",le=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,id=(t,e,n,o)=>t===(o?"left":"right")?n:t==="center"?(e+n)/2:e;function ks(t,e,n){const o=e.length;let i=0,s=o;if(t._sorted){const{iScale:r,_parsed:a}=t,c=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();f&&(i=se(Math.min(Oe(a,c,d).lo,n?o:Oe(e,c,r.getPixelForValue(d)).lo),0,o-1)),p?s=se(Math.max(Oe(a,r.axis,u,!0).hi+1,n?0:Oe(e,c,r.getPixelForValue(u),!0).hi+1),i,o)-i:s=o-i}return{start:i,count:s}}function Ss(t){const{xScale:e,yScale:n,_scaleRanges:o}=t,i={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!o)return t._scaleRanges=i,!0;const s=o.xmin!==e.min||o.xmax!==e.max||o.ymin!==n.min||o.ymax!==n.max;return Object.assign(o,i),s}const vn=t=>t===0||t===1,vs=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*K/n)),Ms=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*K/n)+1,Wt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*ne)+1,easeOutSine:t=>Math.sin(t*ne),easeInOutSine:t=>-.5*(Math.cos(X*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>vn(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>vn(t)?t:vs(t,.075,.3),easeOutElastic:t=>vn(t)?t:Ms(t,.075,.3),easeInOutElastic(t){return vn(t)?t:t<.5?.5*vs(t*2,.1125,.45):.5+.5*Ms(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Wt.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Wt.easeInBounce(t*2)*.5:Wt.easeOutBounce(t*2-1)*.5+.5};function Bo(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Es(t){return Bo(t)?t:new It(t)}function $o(t){return Bo(t)?t:new It(t).saturate(.5).darken(.1).hexString()}const sd=["x","y","borderWidth","radius","tension"],rd=["color","borderColor","backgroundColor"];function ld(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:rd},numbers:{type:"number",properties:sd}}),t.describe("animations",{_fallback:"animation"}),t.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:e=>e|0}}}})}function ad(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ds=new Map;function cd(t,e){e=e||{};const n=t+JSON.stringify(e);let o=Ds.get(n);return o||(o=new Intl.NumberFormat(t,e),Ds.set(n,o)),o}function Yt(t,e,n){return cd(e,n).format(t)}const Vs={values(t){return q(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const o=this.chart.options.locale;let i,s=t;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(i="scientific"),s=dd(t,n)}const r=Je(Math.abs(s)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),c={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),Yt(t,o,c)},logarithmic(t,e,n){if(t===0)return"0";const o=n[e].significand||t/Math.pow(10,Math.floor(Je(t)));return[1,2,3,5,10,15].includes(o)||e>.8*n.length?Vs.numeric.call(this,t,e,n):""}};function dd(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var Mn={formatters:Vs};function ud(t){t.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:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.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:Mn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const dt=Object.create(null),Po=Object.create(null);function Gt(t,e){if(!e)return t;const n=e.split(".");for(let o=0,i=n.length;o<i;++o){const s=n[o];t=t[s]||(t[s]=Object.create(null))}return t}function Ao(t,e,n){return typeof e=="string"?Lt(Gt(t,e),n):Lt(Gt(t,""),e)}class fd{constructor(e,n){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=o=>o.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=(o,i)=>$o(i.backgroundColor),this.hoverBorderColor=(o,i)=>$o(i.borderColor),this.hoverColor=(o,i)=>$o(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(e),this.apply(n)}set(e,n){return Ao(this,e,n)}get(e){return Gt(this,e)}describe(e,n){return Ao(Po,e,n)}override(e,n){return Ao(dt,e,n)}route(e,n,o,i){const s=Gt(this,e),r=Gt(this,o),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[a],d=r[i];return z(c)?Object.assign({},d,c):T(c,d)},set(c){this[a]=c}}})}apply(e){e.forEach(n=>n(this))}}var te=new fd({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ld,ad,ud]);function hd(t){return!t||H(t.size)||H(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function En(t,e,n,o,i){let s=e[i];return s||(s=e[i]=t.measureText(i).width,n.push(i)),s>o&&(o=s),o}function pd(t,e,n,o){o=o||{};let i=o.data=o.data||{},s=o.garbageCollect=o.garbageCollect||[];o.font!==e&&(i=o.data={},s=o.garbageCollect=[],o.font=e),t.save(),t.font=e;let r=0;const a=n.length;let c,d,u,f,p;for(c=0;c<a;c++)if(f=n[c],f!=null&&!q(f))r=En(t,i,s,r,f);else if(q(f))for(d=0,u=f.length;d<u;d++)p=f[d],p!=null&&!q(p)&&(r=En(t,i,s,r,p));t.restore();const h=s.length/2;if(h>n.length){for(c=0;c<h;c++)delete i[s[c]];s.splice(0,h)}return r}function ut(t,e,n){const o=t.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((e-i)*o)/o+i}function Rs(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Oo(t,e,n,o){Fs(t,e,n,o,null)}function Fs(t,e,n,o,i){let s,r,a,c,d,u,f,p;const h=e.pointStyle,g=e.rotation,m=e.radius;let b=(g||0)*Xc;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(n,o),t.rotate(b),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),t.restore();return}if(!(isNaN(m)||m<=0)){switch(t.beginPath(),h){default:i?t.ellipse(n,o,i/2,m,0,0,K):t.arc(n,o,m,0,K),t.closePath();break;case"triangle":u=i?i/2:m,t.moveTo(n+Math.sin(b)*u,o-Math.cos(b)*m),b+=hs,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*m),b+=hs,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*m),t.closePath();break;case"rectRounded":d=m*.516,c=m-d,r=Math.cos(b+ct)*c,f=Math.cos(b+ct)*(i?i/2-d:c),a=Math.sin(b+ct)*c,p=Math.sin(b+ct)*(i?i/2-d:c),t.arc(n-f,o-a,d,b-X,b-ne),t.arc(n+p,o-r,d,b-ne,b),t.arc(n+f,o+a,d,b,b+ne),t.arc(n-p,o+r,d,b+ne,b+X),t.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*m,u=i?i/2:c,t.rect(n-u,o-c,2*u,2*c);break}b+=ct;case"rectRot":f=Math.cos(b)*(i?i/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(i?i/2:m),t.moveTo(n-f,o-a),t.lineTo(n+p,o-r),t.lineTo(n+f,o+a),t.lineTo(n-p,o+r),t.closePath();break;case"crossRot":b+=ct;case"cross":f=Math.cos(b)*(i?i/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(i?i/2:m),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+p,o-r),t.lineTo(n-p,o+r);break;case"star":f=Math.cos(b)*(i?i/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(i?i/2:m),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+p,o-r),t.lineTo(n-p,o+r),b+=ct,f=Math.cos(b)*(i?i/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(i?i/2:m),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+p,o-r),t.lineTo(n-p,o+r);break;case"line":r=i?i/2:Math.cos(b)*m,a=Math.sin(b)*m,t.moveTo(n-r,o-a),t.lineTo(n+r,o+a);break;case"dash":t.moveTo(n,o),t.lineTo(n+Math.cos(b)*(i?i/2:m),o+Math.sin(b)*m);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function Ne(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Dn(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Vn(t){t.restore()}function gd(t,e,n,o,i){if(!e)return t.lineTo(n.x,n.y);if(i==="middle"){const s=(e.x+n.x)/2;t.lineTo(s,e.y),t.lineTo(s,n.y)}else i==="after"!=!!o?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function md(t,e,n,o){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(o?e.cp1x:e.cp2x,o?e.cp1y:e.cp2y,o?n.cp2x:n.cp1x,o?n.cp2y:n.cp1y,n.x,n.y)}function bd(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),H(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function yd(t,e,n,o,i){if(i.strikethrough||i.underline){const s=t.measureText(o),r=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,c=n-s.actualBoundingBoxAscent,d=n+s.actualBoundingBoxDescent,u=i.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=i.decorationWidth||2,t.moveTo(r,u),t.lineTo(a,u),t.stroke()}}function _d(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function ft(t,e,n,o,i,s={}){const r=q(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=i.string,bd(t,s),c=0;c<r.length;++c)d=r[c],s.backdrop&&_d(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),H(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,n,o,s.maxWidth)),t.fillText(d,n,o,s.maxWidth),yd(t,n,o,d,s),o+=Number(i.lineHeight);t.restore()}function Ut(t,e){const{x:n,y:o,w:i,h:s,radius:r}=e;t.arc(n+r.topLeft,o+r.topLeft,r.topLeft,1.5*X,X,!0),t.lineTo(n,o+s-r.bottomLeft),t.arc(n+r.bottomLeft,o+s-r.bottomLeft,r.bottomLeft,X,ne,!0),t.lineTo(n+i-r.bottomRight,o+s),t.arc(n+i-r.bottomRight,o+s-r.bottomRight,r.bottomRight,ne,0,!0),t.lineTo(n+i,o+r.topRight),t.arc(n+i-r.topRight,o+r.topRight,r.topRight,0,-ne,!0),t.lineTo(n+r.topLeft,o)}const xd=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,wd=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Cd(t,e){const n=(""+t).match(xd);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const kd=t=>+t||0;function No(t,e){const n={},o=z(e),i=o?Object.keys(e):e,s=z(t)?o?r=>T(t[r],t[e[r]]):r=>t[r]:()=>t;for(const r of i)n[r]=kd(s(r));return n}function Bs(t){return No(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ht(t){return No(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ae(t){const e=Bs(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function oe(t,e){t=t||{},e=e||te.font;let n=T(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let o=T(t.style,e.style);o&&!(""+o).match(wd)&&(console.warn('Invalid font style specified: "'+o+'"'),o=void 0);const i={family:T(t.family,e.family),lineHeight:Cd(T(t.lineHeight,e.lineHeight),n),size:n,style:o,weight:T(t.weight,e.weight),string:""};return i.string=hd(i),i}function qt(t,e,n,o){let i=!0,s,r,a;for(s=0,r=t.length;s<r;++s)if(a=t[s],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),i=!1),n!==void 0&&q(a)&&(a=a[n%a.length],i=!1),a!==void 0))return o&&!i&&(o.cacheable=!1),a}function Sd(t,e,n){const{min:o,max:i}=t,s=cs(e,(i-o)/2),r=(a,c)=>n&&a===0?0:a+c;return{min:r(o,-Math.abs(s)),max:r(i,s)}}function Qe(t,e){return Object.assign(Object.create(t),e)}function Io(t,e=[""],n,o,i=()=>t[0]){const s=n||t;typeof o>"u"&&(o=Ns("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:o,_getTarget:i,override:a=>Io([a,...t],e,s,o)};return new Proxy(r,{deleteProperty(a,c){return delete a[c],delete a._keys,delete t[0][c],!0},get(a,c){return Ps(a,c,()=>Bd(c,e,t,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,c){return Is(a).includes(c)},ownKeys(a){return Is(a)},set(a,c,d){const u=a._storage||(a._storage=i());return a[c]=u[c]=d,delete a._keys,!0}})}function Dt(t,e,n,o){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:$s(t,o),setContext:s=>Dt(t,s,n,o),override:s=>Dt(t.override(s),e,n,o)};return new Proxy(i,{deleteProperty(s,r){return delete s[r],delete t[r],!0},get(s,r,a){return Ps(s,r,()=>Md(s,r,a))},getOwnPropertyDescriptor(s,r){return s._descriptors.allKeys?Reflect.has(t,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,r)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,r){return Reflect.has(t,r)},ownKeys(){return Reflect.ownKeys(t)},set(s,r,a){return t[r]=a,delete s[r],!0}})}function $s(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:o=e.indexable,_allKeys:i=e.allKeys}=t;return{allKeys:i,scriptable:n,indexable:o,isScriptable:Ze(n)?n:()=>n,isIndexable:Ze(o)?o:()=>o}}const vd=(t,e)=>t?t+Eo(e):e,Lo=(t,e)=>z(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Ps(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const o=n();return t[e]=o,o}function Md(t,e,n){const{_proxy:o,_context:i,_subProxy:s,_descriptors:r}=t;let a=o[e];return Ze(a)&&r.isScriptable(e)&&(a=Ed(e,a,t,n)),q(a)&&a.length&&(a=Dd(e,a,t,r.isIndexable)),Lo(e,a)&&(a=Dt(a,i,s&&s[e],r)),a}function Ed(t,e,n,o){const{_proxy:i,_context:s,_subProxy:r,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let c=e(s,r||o);return a.delete(t),Lo(t,c)&&(c=To(i._scopes,i,t,c)),c}function Dd(t,e,n,o){const{_proxy:i,_context:s,_subProxy:r,_descriptors:a}=n;if(typeof s.index<"u"&&o(t))return e[s.index%e.length];if(z(e[0])){const c=e,d=i._scopes.filter(u=>u!==c);e=[];for(const u of c){const f=To(d,i,t,u);e.push(Dt(f,s,r&&r[t],a))}}return e}function As(t,e,n){return Ze(t)?t(e,n):t}const Vd=(t,e)=>t===!0?e:typeof t=="string"?Ke(e,t):void 0;function Rd(t,e,n,o,i){for(const s of e){const r=Vd(n,s);if(r){t.add(r);const a=As(r._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==o)return a}else if(r===!1&&typeof o<"u"&&n!==o)return null}return!1}function To(t,e,n,o){const i=e._rootScopes,s=As(e._fallback,n,o),r=[...t,...i],a=new Set;a.add(o);let c=Os(a,r,n,s||n,o);return c===null||typeof s<"u"&&s!==n&&(c=Os(a,r,s,c,o),c===null)?!1:Io(Array.from(a),[""],i,s,()=>Fd(e,n,o))}function Os(t,e,n,o,i){for(;n;)n=Rd(t,e,n,o,i);return n}function Fd(t,e,n){const o=t._getTarget();e in o||(o[e]={});const i=o[e];return q(i)&&z(n)?n:i||{}}function Bd(t,e,n,o){let i;for(const s of e)if(i=Ns(vd(s,t),n),typeof i<"u")return Lo(t,i)?To(n,o,t,i):i}function Ns(t,e){for(const n of e){if(!n)continue;const o=n[t];if(typeof o<"u")return o}}function Is(t){let e=t._keys;return e||(e=t._keys=$d(t._scopes)),e}function $d(t){const e=new Set;for(const n of t)for(const o of Object.keys(n).filter(i=>!i.startsWith("_")))e.add(o);return Array.from(e)}function Ls(t,e,n,o){const{iScale:i}=t,{key:s="r"}=this._parsing,r=new Array(o);let a,c,d,u;for(a=0,c=o;a<c;++a)d=a+n,u=e[d],r[a]={r:i.parse(Ke(u,s),d)};return r}const Pd=Number.EPSILON||1e-14,Vt=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ts=t=>t==="x"?"y":"x";function Ad(t,e,n,o){const i=t.skip?e:t,s=e,r=n.skip?e:n,a=Vo(s,i),c=Vo(r,s);let d=a/(a+c),u=c/(a+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=o*d,p=o*u;return{previous:{x:s.x-f*(r.x-i.x),y:s.y-f*(r.y-i.y)},next:{x:s.x+p*(r.x-i.x),y:s.y+p*(r.y-i.y)}}}function Od(t,e,n){const o=t.length;let i,s,r,a,c,d=Vt(t,0);for(let u=0;u<o-1;++u)if(c=d,d=Vt(t,u+1),!(!c||!d)){if(Ht(e[u],0,Pd)){n[u]=n[u+1]=0;continue}i=n[u]/e[u],s=n[u+1]/e[u],a=Math.pow(i,2)+Math.pow(s,2),!(a<=9)&&(r=3/Math.sqrt(a),n[u]=i*r*e[u],n[u+1]=s*r*e[u])}}function Nd(t,e,n="x"){const o=Ts(n),i=t.length;let s,r,a,c=Vt(t,0);for(let d=0;d<i;++d){if(r=a,a=c,c=Vt(t,d+1),!a)continue;const u=a[n],f=a[o];r&&(s=(u-r[n])/3,a[`cp1${n}`]=u-s,a[`cp1${o}`]=f-s*e[d]),c&&(s=(c[n]-u)/3,a[`cp2${n}`]=u+s,a[`cp2${o}`]=f+s*e[d])}}function Id(t,e="x"){const n=Ts(e),o=t.length,i=Array(o).fill(0),s=Array(o);let r,a,c,d=Vt(t,0);for(r=0;r<o;++r)if(a=c,c=d,d=Vt(t,r+1),!!c){if(d){const u=d[e]-c[e];i[r]=u!==0?(d[n]-c[n])/u:0}s[r]=a?d?Ve(i[r-1])!==Ve(i[r])?0:(i[r-1]+i[r])/2:i[r-1]:i[r]}Od(t,i,s),Nd(t,s,e)}function Rn(t,e,n){return Math.max(Math.min(t,n),e)}function Ld(t,e){let n,o,i,s,r,a=Ne(t[0],e);for(n=0,o=t.length;n<o;++n)r=s,s=a,a=n<o-1&&Ne(t[n+1],e),s&&(i=t[n],r&&(i.cp1x=Rn(i.cp1x,e.left,e.right),i.cp1y=Rn(i.cp1y,e.top,e.bottom)),a&&(i.cp2x=Rn(i.cp2x,e.left,e.right),i.cp2y=Rn(i.cp2y,e.top,e.bottom)))}function Td(t,e,n,o,i){let s,r,a,c;if(e.spanGaps&&(t=t.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")Id(t,i);else{let d=o?t[t.length-1]:t[0];for(s=0,r=t.length;s<r;++s)a=t[s],c=Ad(d,a,t[Math.min(s+1,r-(o?0:1))%r],e.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,d=a}e.capBezierPoints&&Ld(t,n)}function zo(){return typeof window<"u"&&typeof document<"u"}function Ho(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Fn(t,e,n){let o;return typeof t=="string"?(o=parseInt(t,10),t.indexOf("%")!==-1&&(o=o/100*e.parentNode[n])):o=t,o}const Bn=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function zd(t,e){return Bn(t).getPropertyValue(e)}const Hd=["top","right","bottom","left"];function pt(t,e,n){const o={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=Hd[i];o[s]=parseFloat(t[e+"-"+s+n])||0}return o.width=o.left+o.right,o.height=o.top+o.bottom,o}const jd=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function Wd(t,e){const n=t.touches,o=n&&n.length?n[0]:t,{offsetX:i,offsetY:s}=o;let r=!1,a,c;if(jd(i,s,t.target))a=i,c=s;else{const d=e.getBoundingClientRect();a=o.clientX-d.left,c=o.clientY-d.top,r=!0}return{x:a,y:c,box:r}}function gt(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:o}=e,i=Bn(n),s=i.boxSizing==="border-box",r=pt(i,"padding"),a=pt(i,"border","width"),{x:c,y:d,box:u}=Wd(t,n),f=r.left+(u&&a.left),p=r.top+(u&&a.top);let{width:h,height:g}=e;return s&&(h-=r.width+a.width,g-=r.height+a.height),{x:Math.round((c-f)/h*n.width/o),y:Math.round((d-p)/g*n.height/o)}}function Yd(t,e,n){let o,i;if(e===void 0||n===void 0){const s=Ho(t);if(!s)e=t.clientWidth,n=t.clientHeight;else{const r=s.getBoundingClientRect(),a=Bn(s),c=pt(a,"border","width"),d=pt(a,"padding");e=r.width-d.width-c.width,n=r.height-d.height-c.height,o=Fn(a.maxWidth,s,"clientWidth"),i=Fn(a.maxHeight,s,"clientHeight")}}return{width:e,height:n,maxWidth:o||Sn,maxHeight:i||Sn}}const $n=t=>Math.round(t*10)/10;function Gd(t,e,n,o){const i=Bn(t),s=pt(i,"margin"),r=Fn(i.maxWidth,t,"clientWidth")||Sn,a=Fn(i.maxHeight,t,"clientHeight")||Sn,c=Yd(t,e,n);let{width:d,height:u}=c;if(i.boxSizing==="content-box"){const p=pt(i,"border","width"),h=pt(i,"padding");d-=h.width+p.width,u-=h.height+p.height}return d=Math.max(0,d-s.width),u=Math.max(0,o?d/o:u-s.height),d=$n(Math.min(d,r,c.maxWidth)),u=$n(Math.min(u,a,c.maxHeight)),d&&!u&&(u=$n(d/2)),(e!==void 0||n!==void 0)&&o&&c.height&&u>c.height&&(u=c.height,d=$n(Math.floor(u*o))),{width:d,height:u}}function zs(t,e,n){const o=e||1,i=Math.floor(t.height*o),s=Math.floor(t.width*o);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const r=t.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),t.currentDevicePixelRatio!==o||r.height!==i||r.width!==s?(t.currentDevicePixelRatio=o,r.height=i,r.width=s,t.ctx.setTransform(o,0,0,o,0,0),!0):!1}const Ud=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};zo()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function Hs(t,e){const n=zd(t,e),o=n&&n.match(/^(\d+)(\.\d+)?px$/);return o?+o[1]:void 0}function mt(t,e,n,o){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function qd(t,e,n,o){return{x:t.x+n*(e.x-t.x),y:o==="middle"?n<.5?t.y:e.y:o==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function Xd(t,e,n,o){const i={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},r=mt(t,i,n),a=mt(i,s,n),c=mt(s,e,n),d=mt(r,a,n),u=mt(a,c,n);return mt(d,u,n)}const Kd=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,o){return n-o},leftForLtr(n,o){return n-o}}},Zd=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Rt(t,e,n){return t?Kd(e,n):Zd()}function js(t,e){let n,o;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,o=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=o)}function Ws(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ys(t){return t==="angle"?{between:jt,compare:Jc,normalize:_e}:{between:Ae,compare:(e,n)=>e-n,normalize:e=>e}}function Gs({start:t,end:e,count:n,loop:o,style:i}){return{start:t%n,end:e%n,loop:o&&(e-t+1)%n===0,style:i}}function Jd(t,e,n){const{property:o,start:i,end:s}=n,{between:r,normalize:a}=Ys(o),c=e.length;let{start:d,end:u,loop:f}=t,p,h;if(f){for(d+=c,u+=c,p=0,h=c;p<h&&r(a(e[d%c][o]),i,s);++p)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function Us(t,e,n){if(!n)return[t];const{property:o,start:i,end:s}=n,r=e.length,{compare:a,between:c,normalize:d}=Ys(o),{start:u,end:f,loop:p,style:h}=Jd(t,e,n),g=[];let m=!1,b=null,x,y,w;const S=()=>c(i,w,x)&&a(i,w)!==0,_=()=>a(s,x)===0||c(s,w,x),C=()=>m||S(),v=()=>!m||_();for(let k=u,M=u;k<=f;++k)y=e[k%r],!y.skip&&(x=d(y[o]),x!==w&&(m=c(x,i,s),b===null&&C()&&(b=a(x,i)===0?k:M),b!==null&&v()&&(g.push(Gs({start:b,end:k,loop:p,count:r,style:h})),b=null),M=k,w=x));return b!==null&&g.push(Gs({start:b,end:f,loop:p,count:r,style:h})),g}function qs(t,e){const n=[],o=t.segments;for(let i=0;i<o.length;i++){const s=Us(o[i],t.points,e);s.length&&n.push(...s)}return n}function Qd(t,e,n,o){let i=0,s=e-1;if(n&&!o)for(;i<e&&!t[i].skip;)i++;for(;i<e&&t[i].skip;)i++;for(i%=e,n&&(s+=i);s>i&&t[s%e].skip;)s--;return s%=e,{start:i,end:s}}function eu(t,e,n,o){const i=t.length,s=[];let r=e,a=t[e],c;for(c=e+1;c<=n;++c){const d=t[c%i];d.skip||d.stop?a.skip||(o=!1,s.push({start:e%i,end:(c-1)%i,loop:o}),e=r=d.stop?c:null):(r=c,a.skip&&(e=c)),a=d}return r!==null&&s.push({start:e%i,end:r%i,loop:o}),s}function tu(t,e){const n=t.points,o=t.options.spanGaps,i=n.length;if(!i)return[];const s=!!t._loop,{start:r,end:a}=Qd(n,i,s,o);if(o===!0)return Xs(t,[{start:r,end:a,loop:s}],n,e);const c=a<r?a+i:a,d=!!t._fullLoop&&r===0&&a===i-1;return Xs(t,eu(n,r,c,d),n,e)}function Xs(t,e,n,o){return!o||!o.setContext||!n?e:nu(t,e,n,o)}function nu(t,e,n,o){const i=t._chart.getContext(),s=Ks(t.options),{_datasetIndex:r,options:{spanGaps:a}}=t,c=n.length,d=[];let u=s,f=e[0].start,p=f;function h(g,m,b,x){const y=a?-1:1;if(g!==m){for(g+=c;n[g%c].skip;)g-=y;for(;n[m%c].skip;)m+=y;g%c!==m%c&&(d.push({start:g%c,end:m%c,loop:b,style:x}),u=x,f=m%c)}}for(const g of e){f=a?f:g.start;let m=n[f%c],b;for(p=f+1;p<=g.end;p++){const x=n[p%c];b=Ks(o.setContext(Qe(i,{type:"segment",p0:m,p1:x,p0DataIndex:(p-1)%c,p1DataIndex:p%c,datasetIndex:r}))),ou(b,u)&&h(f,p-1,g.loop,u),m=x,u=b}f<p-1&&h(f,p-1,g.loop,u)}return d}function Ks(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function ou(t,e){if(!e)return!1;const n=[],o=function(i,s){return Bo(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(t,o)!==JSON.stringify(e,o)}/*!
|
|
19
|
+
*/function Le(){}const Zc=(()=>{let t=0;return()=>t++})();function Y(t){return t===null||typeof t>"u"}function J(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function j(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function ne(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function _e(t,e){return ne(t)?t:e}function T(t,e){return typeof t>"u"?e:t}const Jc=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,_i=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Z(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function q(t,e,n,o){let s,i,r;if(J(t))if(i=t.length,o)for(s=i-1;s>=0;s--)e.call(n,t[s],s);else for(s=0;s<i;s++)e.call(n,t[s],s);else if(j(t))for(r=Object.keys(t),i=r.length,s=0;s<i;s++)e.call(n,t[r[s]],r[s])}function Dn(t,e){let n,o,s,i;if(!t||!e||t.length!==e.length)return!1;for(n=0,o=t.length;n<o;++n)if(s=t[n],i=e[n],s.datasetIndex!==i.datasetIndex||s.index!==i.index)return!1;return!0}function En(t){if(J(t))return t.map(En);if(j(t)){const e=Object.create(null),n=Object.keys(t),o=n.length;let s=0;for(;s<o;++s)e[n[s]]=En(t[n[s]]);return e}return t}function xi(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Qc(t,e,n,o){if(!xi(t))return;const s=e[t],i=n[t];j(s)&&j(i)?jt(s,i,o):e[t]=En(i)}function jt(t,e,n){const o=J(e)?e:[e],s=o.length;if(!j(t))return t;n=n||{};const i=n.merger||Qc;let r;for(let a=0;a<s;++a){if(r=o[a],!j(r))continue;const c=Object.keys(r);for(let d=0,u=c.length;d<u;++d)i(c[d],t,r,n)}return t}function Wt(t,e){return jt(t,e,{merger:ed})}function ed(t,e,n){if(!xi(t))return;const o=e[t],s=n[t];j(o)&&j(s)?Wt(o,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=En(s))}const wi={"":t=>t,x:t=>t.x,y:t=>t.y};function td(t){const e=t.split("."),n=[];let o="";for(const s of e)o+=s,o.endsWith("\\")?o=o.slice(0,-1)+".":(n.push(o),o="");return n}function nd(t){const e=td(t);return n=>{for(const o of e){if(o==="")break;n=n&&n[o]}return n}}function nt(t,e){return(wi[e]||(wi[e]=nd(e)))(t)}function $o(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Yt=t=>typeof t<"u",ot=t=>typeof t=="function",Ci=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function od(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Q=Math.PI,ee=2*Q,sd=ee+Q,Vn=Number.POSITIVE_INFINITY,id=Q/180,se=Q/2,pt=Q/4,ki=Q*2/3,st=Math.log10,Re=Math.sign;function Gt(t,e,n){return Math.abs(t-e)<n}function Si(t){const e=Math.round(t);t=Gt(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(st(t))),o=t/n;return(o<=1?1:o<=2?2:o<=5?5:10)*n}function rd(t){const e=[],n=Math.sqrt(t);let o;for(o=1;o<n;o++)t%o===0&&(e.push(o),e.push(t/o));return n===(n|0)&&e.push(n),e.sort((s,i)=>s-i).pop(),e}function Rt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function ld(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function vi(t,e,n){let o,s,i;for(o=0,s=t.length;o<s;o++)i=t[o][n],isNaN(i)||(e.min=Math.min(e.min,i),e.max=Math.max(e.max,i))}function Me(t){return t*(Q/180)}function Po(t){return t*(180/Q)}function Mi(t){if(!ne(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Di(t,e){const n=e.x-t.x,o=e.y-t.y,s=Math.sqrt(n*n+o*o);let i=Math.atan2(o,n);return i<-.5*Q&&(i+=ee),{angle:i,distance:s}}function Ao(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ad(t,e){return(t-e+sd)%ee-Q}function xe(t){return(t%ee+ee)%ee}function Ut(t,e,n,o){const s=xe(t),i=xe(e),r=xe(n),a=xe(i-s),c=xe(r-s),d=xe(s-i),u=xe(s-r);return s===i||s===r||o&&i===r||a>c&&d<u}function ae(t,e,n){return Math.max(e,Math.min(n,t))}function cd(t){return ae(t,-32768,32767)}function Te(t,e,n,o=1e-6){return t>=Math.min(e,n)-o&&t<=Math.max(e,n)+o}function Oo(t,e,n){n=n||(r=>t[r]<e);let o=t.length-1,s=0,i;for(;o-s>1;)i=s+o>>1,n(i)?s=i:o=i;return{lo:s,hi:o}}const ze=(t,e,n,o)=>Oo(t,n,o?s=>{const i=t[s][e];return i<n||i===n&&t[s+1][e]===n}:s=>t[s][e]<n),dd=(t,e,n)=>Oo(t,n,o=>t[o][e]>=n);function ud(t,e,n){let o=0,s=t.length;for(;o<s&&t[o]<e;)o++;for(;s>o&&t[s-1]>n;)s--;return o>0||s<t.length?t.slice(o,s):t}const Ei=["push","pop","shift","splice","unshift"];function fd(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Ei.forEach(n=>{const o="_onData"+$o(n),s=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...i){const r=s.apply(this,i);return t._chartjs.listeners.forEach(a=>{typeof a[o]=="function"&&a[o](...i)}),r}})})}function Vi(t,e){const n=t._chartjs;if(!n)return;const o=n.listeners,s=o.indexOf(e);s!==-1&&o.splice(s,1),!(o.length>0)&&(Ei.forEach(i=>{delete t[i]}),delete t._chartjs)}function Ri(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Bi=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function Fi(t,e){let n=[],o=!1;return function(...s){n=s,o||(o=!0,Bi.call(window,()=>{o=!1,t.apply(e,n)}))}}function hd(t,e){let n;return function(...o){return e?(clearTimeout(n),n=setTimeout(t,e,o)):t.apply(this,o),e}}const No=t=>t==="start"?"left":t==="end"?"right":"center",ue=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,pd=(t,e,n,o)=>t===(o?"left":"right")?n:t==="center"?(e+n)/2:e;function $i(t,e,n){const o=e.length;let s=0,i=o;if(t._sorted){const{iScale:r,_parsed:a}=t,c=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();f&&(s=ae(Math.min(ze(a,c,d).lo,n?o:ze(e,c,r.getPixelForValue(d)).lo),0,o-1)),p?i=ae(Math.max(ze(a,r.axis,u,!0).hi+1,n?0:ze(e,c,r.getPixelForValue(u),!0).hi+1),s,o)-s:i=o-s}return{start:s,count:i}}function Pi(t){const{xScale:e,yScale:n,_scaleRanges:o}=t,s={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!o)return t._scaleRanges=s,!0;const i=o.xmin!==e.min||o.xmax!==e.max||o.ymin!==n.min||o.ymax!==n.max;return Object.assign(o,s),i}const Rn=t=>t===0||t===1,Ai=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*ee/n)),Oi=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*ee/n)+1,qt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*se)+1,easeOutSine:t=>Math.sin(t*se),easeInOutSine:t=>-.5*(Math.cos(Q*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Rn(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Rn(t)?t:Ai(t,.075,.3),easeOutElastic:t=>Rn(t)?t:Oi(t,.075,.3),easeInOutElastic(t){return Rn(t)?t:t<.5?.5*Ai(t*2,.1125,.45):.5+.5*Oi(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-qt.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?qt.easeInBounce(t*2)*.5:qt.easeOutBounce(t*2-1)*.5+.5};function Io(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Ni(t){return Io(t)?t:new Ht(t)}function Lo(t){return Io(t)?t:new Ht(t).saturate(.5).darken(.1).hexString()}const gd=["x","y","borderWidth","radius","tension"],md=["color","borderColor","backgroundColor"];function bd(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:md},numbers:{type:"number",properties:gd}}),t.describe("animations",{_fallback:"animation"}),t.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:e=>e|0}}}})}function yd(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ii=new Map;function _d(t,e){e=e||{};const n=t+JSON.stringify(e);let o=Ii.get(n);return o||(o=new Intl.NumberFormat(t,e),Ii.set(n,o)),o}function Xt(t,e,n){return _d(e,n).format(t)}const Li={values(t){return J(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const o=this.chart.options.locale;let s,i=t;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),i=xd(t,n)}const r=st(Math.abs(i)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),c={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),Xt(t,o,c)},logarithmic(t,e,n){if(t===0)return"0";const o=n[e].significand||t/Math.pow(10,Math.floor(st(t)));return[1,2,3,5,10,15].includes(o)||e>.8*n.length?Li.numeric.call(this,t,e,n):""}};function xd(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var Bn={formatters:Li};function wd(t){t.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:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.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:Bn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const gt=Object.create(null),To=Object.create(null);function Kt(t,e){if(!e)return t;const n=e.split(".");for(let o=0,s=n.length;o<s;++o){const i=n[o];t=t[i]||(t[i]=Object.create(null))}return t}function zo(t,e,n){return typeof e=="string"?jt(Kt(t,e),n):jt(Kt(t,""),e)}class Cd{constructor(e,n){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=o=>o.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=(o,s)=>Lo(s.backgroundColor),this.hoverBorderColor=(o,s)=>Lo(s.borderColor),this.hoverColor=(o,s)=>Lo(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(e),this.apply(n)}set(e,n){return zo(this,e,n)}get(e){return Kt(this,e)}describe(e,n){return zo(To,e,n)}override(e,n){return zo(gt,e,n)}route(e,n,o,s){const i=Kt(this,e),r=Kt(this,o),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[a],d=r[s];return j(c)?Object.assign({},d,c):T(c,d)},set(c){this[a]=c}}})}apply(e){e.forEach(n=>n(this))}}var oe=new Cd({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[bd,yd,wd]);function kd(t){return!t||Y(t.size)||Y(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Fn(t,e,n,o,s){let i=e[s];return i||(i=e[s]=t.measureText(s).width,n.push(s)),i>o&&(o=i),o}function Sd(t,e,n,o){o=o||{};let s=o.data=o.data||{},i=o.garbageCollect=o.garbageCollect||[];o.font!==e&&(s=o.data={},i=o.garbageCollect=[],o.font=e),t.save(),t.font=e;let r=0;const a=n.length;let c,d,u,f,p;for(c=0;c<a;c++)if(f=n[c],f!=null&&!J(f))r=Fn(t,s,i,r,f);else if(J(f))for(d=0,u=f.length;d<u;d++)p=f[d],p!=null&&!J(p)&&(r=Fn(t,s,i,r,p));t.restore();const h=i.length/2;if(h>n.length){for(c=0;c<h;c++)delete s[i[c]];i.splice(0,h)}return r}function mt(t,e,n){const o=t.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((e-s)*o)/o+s}function Ti(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Ho(t,e,n,o){zi(t,e,n,o,null)}function zi(t,e,n,o,s){let i,r,a,c,d,u,f,p;const h=e.pointStyle,g=e.rotation,m=e.radius;let b=(g||0)*id;if(h&&typeof h=="object"&&(i=h.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){t.save(),t.translate(n,o),t.rotate(b),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),t.restore();return}if(!(isNaN(m)||m<=0)){switch(t.beginPath(),h){default:s?t.ellipse(n,o,s/2,m,0,0,ee):t.arc(n,o,m,0,ee),t.closePath();break;case"triangle":u=s?s/2:m,t.moveTo(n+Math.sin(b)*u,o-Math.cos(b)*m),b+=ki,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*m),b+=ki,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*m),t.closePath();break;case"rectRounded":d=m*.516,c=m-d,r=Math.cos(b+pt)*c,f=Math.cos(b+pt)*(s?s/2-d:c),a=Math.sin(b+pt)*c,p=Math.sin(b+pt)*(s?s/2-d:c),t.arc(n-f,o-a,d,b-Q,b-se),t.arc(n+p,o-r,d,b-se,b),t.arc(n+f,o+a,d,b,b+se),t.arc(n-p,o+r,d,b+se,b+Q),t.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*m,u=s?s/2:c,t.rect(n-u,o-c,2*u,2*c);break}b+=pt;case"rectRot":f=Math.cos(b)*(s?s/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(s?s/2:m),t.moveTo(n-f,o-a),t.lineTo(n+p,o-r),t.lineTo(n+f,o+a),t.lineTo(n-p,o+r),t.closePath();break;case"crossRot":b+=pt;case"cross":f=Math.cos(b)*(s?s/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(s?s/2:m),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+p,o-r),t.lineTo(n-p,o+r);break;case"star":f=Math.cos(b)*(s?s/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(s?s/2:m),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+p,o-r),t.lineTo(n-p,o+r),b+=pt,f=Math.cos(b)*(s?s/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(s?s/2:m),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+p,o-r),t.lineTo(n-p,o+r);break;case"line":r=s?s/2:Math.cos(b)*m,a=Math.sin(b)*m,t.moveTo(n-r,o-a),t.lineTo(n+r,o+a);break;case"dash":t.moveTo(n,o),t.lineTo(n+Math.cos(b)*(s?s/2:m),o+Math.sin(b)*m);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function He(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function $n(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Pn(t){t.restore()}function vd(t,e,n,o,s){if(!e)return t.lineTo(n.x,n.y);if(s==="middle"){const i=(e.x+n.x)/2;t.lineTo(i,e.y),t.lineTo(i,n.y)}else s==="after"!=!!o?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function Md(t,e,n,o){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(o?e.cp1x:e.cp2x,o?e.cp1y:e.cp2y,o?n.cp2x:n.cp1x,o?n.cp2y:n.cp1y,n.x,n.y)}function Dd(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Y(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function Ed(t,e,n,o,s){if(s.strikethrough||s.underline){const i=t.measureText(o),r=e-i.actualBoundingBoxLeft,a=e+i.actualBoundingBoxRight,c=n-i.actualBoundingBoxAscent,d=n+i.actualBoundingBoxDescent,u=s.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(r,u),t.lineTo(a,u),t.stroke()}}function Vd(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function bt(t,e,n,o,s,i={}){const r=J(e)?e:[e],a=i.strokeWidth>0&&i.strokeColor!=="";let c,d;for(t.save(),t.font=s.string,Dd(t,i),c=0;c<r.length;++c)d=r[c],i.backdrop&&Vd(t,i.backdrop),a&&(i.strokeColor&&(t.strokeStyle=i.strokeColor),Y(i.strokeWidth)||(t.lineWidth=i.strokeWidth),t.strokeText(d,n,o,i.maxWidth)),t.fillText(d,n,o,i.maxWidth),Ed(t,n,o,d,i),o+=Number(s.lineHeight);t.restore()}function Zt(t,e){const{x:n,y:o,w:s,h:i,radius:r}=e;t.arc(n+r.topLeft,o+r.topLeft,r.topLeft,1.5*Q,Q,!0),t.lineTo(n,o+i-r.bottomLeft),t.arc(n+r.bottomLeft,o+i-r.bottomLeft,r.bottomLeft,Q,se,!0),t.lineTo(n+s-r.bottomRight,o+i),t.arc(n+s-r.bottomRight,o+i-r.bottomRight,r.bottomRight,se,0,!0),t.lineTo(n+s,o+r.topRight),t.arc(n+s-r.topRight,o+r.topRight,r.topRight,0,-se,!0),t.lineTo(n+r.topLeft,o)}const Rd=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Bd=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Fd(t,e){const n=(""+t).match(Rd);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const $d=t=>+t||0;function jo(t,e){const n={},o=j(e),s=o?Object.keys(e):e,i=j(t)?o?r=>T(t[r],t[e[r]]):r=>t[r]:()=>t;for(const r of s)n[r]=$d(i(r));return n}function Hi(t){return jo(t,{top:"y",right:"x",bottom:"y",left:"x"})}function yt(t){return jo(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=Hi(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function re(t,e){t=t||{},e=e||oe.font;let n=T(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let o=T(t.style,e.style);o&&!(""+o).match(Bd)&&(console.warn('Invalid font style specified: "'+o+'"'),o=void 0);const s={family:T(t.family,e.family),lineHeight:Fd(T(t.lineHeight,e.lineHeight),n),size:n,style:o,weight:T(t.weight,e.weight),string:""};return s.string=kd(s),s}function Jt(t,e,n,o){let s=!0,i,r,a;for(i=0,r=t.length;i<r;++i)if(a=t[i],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),s=!1),n!==void 0&&J(a)&&(a=a[n%a.length],s=!1),a!==void 0))return o&&!s&&(o.cacheable=!1),a}function Pd(t,e,n){const{min:o,max:s}=t,i=_i(e,(s-o)/2),r=(a,c)=>n&&a===0?0:a+c;return{min:r(o,-Math.abs(i)),max:r(s,i)}}function it(t,e){return Object.assign(Object.create(t),e)}function Wo(t,e=[""],n,o,s=()=>t[0]){const i=n||t;typeof o>"u"&&(o=Ui("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:o,_getTarget:s,override:a=>Wo([a,...t],e,i,o)};return new Proxy(r,{deleteProperty(a,c){return delete a[c],delete a._keys,delete t[0][c],!0},get(a,c){return Wi(a,c,()=>Hd(c,e,t,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,c){return qi(a).includes(c)},ownKeys(a){return qi(a)},set(a,c,d){const u=a._storage||(a._storage=s());return a[c]=u[c]=d,delete a._keys,!0}})}function Bt(t,e,n,o){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:ji(t,o),setContext:i=>Bt(t,i,n,o),override:i=>Bt(t.override(i),e,n,o)};return new Proxy(s,{deleteProperty(i,r){return delete i[r],delete t[r],!0},get(i,r,a){return Wi(i,r,()=>Od(i,r,a))},getOwnPropertyDescriptor(i,r){return i._descriptors.allKeys?Reflect.has(t,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,r)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(i,r){return Reflect.has(t,r)},ownKeys(){return Reflect.ownKeys(t)},set(i,r,a){return t[r]=a,delete i[r],!0}})}function ji(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:o=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:n,indexable:o,isScriptable:ot(n)?n:()=>n,isIndexable:ot(o)?o:()=>o}}const Ad=(t,e)=>t?t+$o(e):e,Yo=(t,e)=>j(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Wi(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const o=n();return t[e]=o,o}function Od(t,e,n){const{_proxy:o,_context:s,_subProxy:i,_descriptors:r}=t;let a=o[e];return ot(a)&&r.isScriptable(e)&&(a=Nd(e,a,t,n)),J(a)&&a.length&&(a=Id(e,a,t,r.isIndexable)),Yo(e,a)&&(a=Bt(a,s,i&&i[e],r)),a}function Nd(t,e,n,o){const{_proxy:s,_context:i,_subProxy:r,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let c=e(i,r||o);return a.delete(t),Yo(t,c)&&(c=Go(s._scopes,s,t,c)),c}function Id(t,e,n,o){const{_proxy:s,_context:i,_subProxy:r,_descriptors:a}=n;if(typeof i.index<"u"&&o(t))return e[i.index%e.length];if(j(e[0])){const c=e,d=s._scopes.filter(u=>u!==c);e=[];for(const u of c){const f=Go(d,s,t,u);e.push(Bt(f,i,r&&r[t],a))}}return e}function Yi(t,e,n){return ot(t)?t(e,n):t}const Ld=(t,e)=>t===!0?e:typeof t=="string"?nt(e,t):void 0;function Td(t,e,n,o,s){for(const i of e){const r=Ld(n,i);if(r){t.add(r);const a=Yi(r._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==o)return a}else if(r===!1&&typeof o<"u"&&n!==o)return null}return!1}function Go(t,e,n,o){const s=e._rootScopes,i=Yi(e._fallback,n,o),r=[...t,...s],a=new Set;a.add(o);let c=Gi(a,r,n,i||n,o);return c===null||typeof i<"u"&&i!==n&&(c=Gi(a,r,i,c,o),c===null)?!1:Wo(Array.from(a),[""],s,i,()=>zd(e,n,o))}function Gi(t,e,n,o,s){for(;n;)n=Td(t,e,n,o,s);return n}function zd(t,e,n){const o=t._getTarget();e in o||(o[e]={});const s=o[e];return J(s)&&j(n)?n:s||{}}function Hd(t,e,n,o){let s;for(const i of e)if(s=Ui(Ad(i,t),n),typeof s<"u")return Yo(t,s)?Go(n,o,t,s):s}function Ui(t,e){for(const n of e){if(!n)continue;const o=n[t];if(typeof o<"u")return o}}function qi(t){let e=t._keys;return e||(e=t._keys=jd(t._scopes)),e}function jd(t){const e=new Set;for(const n of t)for(const o of Object.keys(n).filter(s=>!s.startsWith("_")))e.add(o);return Array.from(e)}function Xi(t,e,n,o){const{iScale:s}=t,{key:i="r"}=this._parsing,r=new Array(o);let a,c,d,u;for(a=0,c=o;a<c;++a)d=a+n,u=e[d],r[a]={r:s.parse(nt(u,i),d)};return r}const Wd=Number.EPSILON||1e-14,Ft=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ki=t=>t==="x"?"y":"x";function Yd(t,e,n,o){const s=t.skip?e:t,i=e,r=n.skip?e:n,a=Ao(i,s),c=Ao(r,i);let d=a/(a+c),u=c/(a+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=o*d,p=o*u;return{previous:{x:i.x-f*(r.x-s.x),y:i.y-f*(r.y-s.y)},next:{x:i.x+p*(r.x-s.x),y:i.y+p*(r.y-s.y)}}}function Gd(t,e,n){const o=t.length;let s,i,r,a,c,d=Ft(t,0);for(let u=0;u<o-1;++u)if(c=d,d=Ft(t,u+1),!(!c||!d)){if(Gt(e[u],0,Wd)){n[u]=n[u+1]=0;continue}s=n[u]/e[u],i=n[u+1]/e[u],a=Math.pow(s,2)+Math.pow(i,2),!(a<=9)&&(r=3/Math.sqrt(a),n[u]=s*r*e[u],n[u+1]=i*r*e[u])}}function Ud(t,e,n="x"){const o=Ki(n),s=t.length;let i,r,a,c=Ft(t,0);for(let d=0;d<s;++d){if(r=a,a=c,c=Ft(t,d+1),!a)continue;const u=a[n],f=a[o];r&&(i=(u-r[n])/3,a[`cp1${n}`]=u-i,a[`cp1${o}`]=f-i*e[d]),c&&(i=(c[n]-u)/3,a[`cp2${n}`]=u+i,a[`cp2${o}`]=f+i*e[d])}}function qd(t,e="x"){const n=Ki(e),o=t.length,s=Array(o).fill(0),i=Array(o);let r,a,c,d=Ft(t,0);for(r=0;r<o;++r)if(a=c,c=d,d=Ft(t,r+1),!!c){if(d){const u=d[e]-c[e];s[r]=u!==0?(d[n]-c[n])/u:0}i[r]=a?d?Re(s[r-1])!==Re(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Gd(t,s,i),Ud(t,i,e)}function An(t,e,n){return Math.max(Math.min(t,n),e)}function Xd(t,e){let n,o,s,i,r,a=He(t[0],e);for(n=0,o=t.length;n<o;++n)r=i,i=a,a=n<o-1&&He(t[n+1],e),i&&(s=t[n],r&&(s.cp1x=An(s.cp1x,e.left,e.right),s.cp1y=An(s.cp1y,e.top,e.bottom)),a&&(s.cp2x=An(s.cp2x,e.left,e.right),s.cp2y=An(s.cp2y,e.top,e.bottom)))}function Kd(t,e,n,o,s){let i,r,a,c;if(e.spanGaps&&(t=t.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")qd(t,s);else{let d=o?t[t.length-1]:t[0];for(i=0,r=t.length;i<r;++i)a=t[i],c=Yd(d,a,t[Math.min(i+1,r-(o?0:1))%r],e.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,d=a}e.capBezierPoints&&Xd(t,n)}function Uo(){return typeof window<"u"&&typeof document<"u"}function qo(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function On(t,e,n){let o;return typeof t=="string"?(o=parseInt(t,10),t.indexOf("%")!==-1&&(o=o/100*e.parentNode[n])):o=t,o}const Nn=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function Zd(t,e){return Nn(t).getPropertyValue(e)}const Jd=["top","right","bottom","left"];function _t(t,e,n){const o={};n=n?"-"+n:"";for(let s=0;s<4;s++){const i=Jd[s];o[i]=parseFloat(t[e+"-"+i+n])||0}return o.width=o.left+o.right,o.height=o.top+o.bottom,o}const Qd=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function eu(t,e){const n=t.touches,o=n&&n.length?n[0]:t,{offsetX:s,offsetY:i}=o;let r=!1,a,c;if(Qd(s,i,t.target))a=s,c=i;else{const d=e.getBoundingClientRect();a=o.clientX-d.left,c=o.clientY-d.top,r=!0}return{x:a,y:c,box:r}}function xt(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:o}=e,s=Nn(n),i=s.boxSizing==="border-box",r=_t(s,"padding"),a=_t(s,"border","width"),{x:c,y:d,box:u}=eu(t,n),f=r.left+(u&&a.left),p=r.top+(u&&a.top);let{width:h,height:g}=e;return i&&(h-=r.width+a.width,g-=r.height+a.height),{x:Math.round((c-f)/h*n.width/o),y:Math.round((d-p)/g*n.height/o)}}function tu(t,e,n){let o,s;if(e===void 0||n===void 0){const i=qo(t);if(!i)e=t.clientWidth,n=t.clientHeight;else{const r=i.getBoundingClientRect(),a=Nn(i),c=_t(a,"border","width"),d=_t(a,"padding");e=r.width-d.width-c.width,n=r.height-d.height-c.height,o=On(a.maxWidth,i,"clientWidth"),s=On(a.maxHeight,i,"clientHeight")}}return{width:e,height:n,maxWidth:o||Vn,maxHeight:s||Vn}}const In=t=>Math.round(t*10)/10;function nu(t,e,n,o){const s=Nn(t),i=_t(s,"margin"),r=On(s.maxWidth,t,"clientWidth")||Vn,a=On(s.maxHeight,t,"clientHeight")||Vn,c=tu(t,e,n);let{width:d,height:u}=c;if(s.boxSizing==="content-box"){const p=_t(s,"border","width"),h=_t(s,"padding");d-=h.width+p.width,u-=h.height+p.height}return d=Math.max(0,d-i.width),u=Math.max(0,o?d/o:u-i.height),d=In(Math.min(d,r,c.maxWidth)),u=In(Math.min(u,a,c.maxHeight)),d&&!u&&(u=In(d/2)),(e!==void 0||n!==void 0)&&o&&c.height&&u>c.height&&(u=c.height,d=In(Math.floor(u*o))),{width:d,height:u}}function Zi(t,e,n){const o=e||1,s=Math.floor(t.height*o),i=Math.floor(t.width*o);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const r=t.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),t.currentDevicePixelRatio!==o||r.height!==s||r.width!==i?(t.currentDevicePixelRatio=o,r.height=s,r.width=i,t.ctx.setTransform(o,0,0,o,0,0),!0):!1}const ou=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Uo()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function Ji(t,e){const n=Zd(t,e),o=n&&n.match(/^(\d+)(\.\d+)?px$/);return o?+o[1]:void 0}function wt(t,e,n,o){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function su(t,e,n,o){return{x:t.x+n*(e.x-t.x),y:o==="middle"?n<.5?t.y:e.y:o==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function iu(t,e,n,o){const s={x:t.cp2x,y:t.cp2y},i={x:e.cp1x,y:e.cp1y},r=wt(t,s,n),a=wt(s,i,n),c=wt(i,e,n),d=wt(r,a,n),u=wt(a,c,n);return wt(d,u,n)}const ru=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,o){return n-o},leftForLtr(n,o){return n-o}}},lu=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function $t(t,e,n){return t?ru(e,n):lu()}function Qi(t,e){let n,o;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,o=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=o)}function er(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function tr(t){return t==="angle"?{between:Ut,compare:ad,normalize:xe}:{between:Te,compare:(e,n)=>e-n,normalize:e=>e}}function nr({start:t,end:e,count:n,loop:o,style:s}){return{start:t%n,end:e%n,loop:o&&(e-t+1)%n===0,style:s}}function au(t,e,n){const{property:o,start:s,end:i}=n,{between:r,normalize:a}=tr(o),c=e.length;let{start:d,end:u,loop:f}=t,p,h;if(f){for(d+=c,u+=c,p=0,h=c;p<h&&r(a(e[d%c][o]),s,i);++p)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function or(t,e,n){if(!n)return[t];const{property:o,start:s,end:i}=n,r=e.length,{compare:a,between:c,normalize:d}=tr(o),{start:u,end:f,loop:p,style:h}=au(t,e,n),g=[];let m=!1,b=null,y,_,w;const S=()=>c(s,w,y)&&a(s,w)!==0,x=()=>a(i,y)===0||c(i,w,y),E=()=>m||S(),v=()=>!m||x();for(let R=u,P=u;R<=f;++R)_=e[R%r],!_.skip&&(y=d(_[o]),y!==w&&(m=c(y,s,i),b===null&&E()&&(b=a(y,s)===0?R:P),b!==null&&v()&&(g.push(nr({start:b,end:R,loop:p,count:r,style:h})),b=null),P=R,w=y));return b!==null&&g.push(nr({start:b,end:f,loop:p,count:r,style:h})),g}function sr(t,e){const n=[],o=t.segments;for(let s=0;s<o.length;s++){const i=or(o[s],t.points,e);i.length&&n.push(...i)}return n}function cu(t,e,n,o){let s=0,i=e-1;if(n&&!o)for(;s<e&&!t[s].skip;)s++;for(;s<e&&t[s].skip;)s++;for(s%=e,n&&(i+=s);i>s&&t[i%e].skip;)i--;return i%=e,{start:s,end:i}}function du(t,e,n,o){const s=t.length,i=[];let r=e,a=t[e],c;for(c=e+1;c<=n;++c){const d=t[c%s];d.skip||d.stop?a.skip||(o=!1,i.push({start:e%s,end:(c-1)%s,loop:o}),e=r=d.stop?c:null):(r=c,a.skip&&(e=c)),a=d}return r!==null&&i.push({start:e%s,end:r%s,loop:o}),i}function uu(t,e){const n=t.points,o=t.options.spanGaps,s=n.length;if(!s)return[];const i=!!t._loop,{start:r,end:a}=cu(n,s,i,o);if(o===!0)return ir(t,[{start:r,end:a,loop:i}],n,e);const c=a<r?a+s:a,d=!!t._fullLoop&&r===0&&a===s-1;return ir(t,du(n,r,c,d),n,e)}function ir(t,e,n,o){return!o||!o.setContext||!n?e:fu(t,e,n,o)}function fu(t,e,n,o){const s=t._chart.getContext(),i=rr(t.options),{_datasetIndex:r,options:{spanGaps:a}}=t,c=n.length,d=[];let u=i,f=e[0].start,p=f;function h(g,m,b,y){const _=a?-1:1;if(g!==m){for(g+=c;n[g%c].skip;)g-=_;for(;n[m%c].skip;)m+=_;g%c!==m%c&&(d.push({start:g%c,end:m%c,loop:b,style:y}),u=y,f=m%c)}}for(const g of e){f=a?f:g.start;let m=n[f%c],b;for(p=f+1;p<=g.end;p++){const y=n[p%c];b=rr(o.setContext(it(s,{type:"segment",p0:m,p1:y,p0DataIndex:(p-1)%c,p1DataIndex:p%c,datasetIndex:r}))),hu(b,u)&&h(f,p-1,g.loop,u),m=y,u=b}f<p-1&&h(f,p-1,g.loop,u)}return d}function rr(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function hu(t,e){if(!e)return!1;const n=[],o=function(s,i){return Io(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(t,o)!==JSON.stringify(e,o)}/*!
|
|
20
20
|
* Chart.js v4.4.1
|
|
21
21
|
* https://www.chartjs.org
|
|
22
22
|
* (c) 2023 Chart.js Contributors
|
|
23
23
|
* Released under the MIT License
|
|
24
|
-
*/class iu{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,o,i){const s=n.listeners[i],r=n.duration;s.forEach(a=>a({chart:e,initial:n.initial,numSteps:r,currentStep:Math.min(o-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=ws.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((o,i)=>{if(!o.running||!o.items.length)return;const s=o.items;let r=s.length-1,a=!1,c;for(;r>=0;--r)c=s[r],c._active?(c._total>o.duration&&(o.duration=c._total),c.tick(e),a=!0):(s[r]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,o,e,"progress")),s.length||(o.running=!1,this._notify(i,o,e,"complete"),o.initial=!1),n+=s.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let o=n.get(e);return o||(o={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,o)),o}listen(e,n,o){this._getAnims(e).listeners[n].push(o)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((o,i)=>Math.max(o,i._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const o=n.items;let i=o.length-1;for(;i>=0;--i)o[i].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Ie=new iu;const Zs="transparent",su={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const o=Es(t||Zs),i=o.valid&&Es(e||Zs);return i&&i.valid?i.mix(o,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class ru{constructor(e,n,o,i){const s=n[o];i=qt([e.to,i,s,e.from]);const r=qt([e.from,s,i]);this._active=!0,this._fn=e.fn||su[e.type||typeof r],this._easing=Wt[e.easing]||Wt.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=o,this._from=r,this._to=i,this._promises=void 0}active(){return this._active}update(e,n,o){if(this._active){this._notify(!1);const i=this._target[this._prop],s=o-this._start,r=this._duration-s;this._start=o,this._duration=Math.floor(Math.max(r,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=qt([e.to,n,i,e.from]),this._from=qt([e.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,o=this._duration,i=this._prop,s=this._from,r=this._loop,a=this._to;let c;if(this._active=s!==a&&(r||n<o),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}c=n/o%2,c=r&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[i]=this._fn(s,a,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,o)=>{e.push({res:n,rej:o})})}_notify(e){const n=e?"res":"rej",o=this._promises||[];for(let i=0;i<o.length;i++)o[i][n]()}}class Js{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!z(e))return;const n=Object.keys(te.animation),o=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!z(s))return;const r={};for(const a of n)r[a]=s[a];(q(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!o.has(a))&&o.set(a,r)})})}_animateOptions(e,n){const o=n.options,i=au(e,o);if(!i)return[];const s=this._createAnimations(i,o);return o.$shared&&lu(e.options.$animations,o).then(()=>{e.options=o},()=>{}),s}_createAnimations(e,n){const o=this._properties,i=[],s=e.$animations||(e.$animations={}),r=Object.keys(n),a=Date.now();let c;for(c=r.length-1;c>=0;--c){const d=r[c];if(d.charAt(0)==="$")continue;if(d==="options"){i.push(...this._animateOptions(e,n));continue}const u=n[d];let f=s[d];const p=o.get(d);if(f)if(p&&f.active()){f.update(p,u,a);continue}else f.cancel();if(!p||!p.duration){e[d]=u;continue}s[d]=f=new ru(p,e,d,u),i.push(f)}return i}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const o=this._createAnimations(e,n);if(o.length)return Ie.add(this._chart,o),!0}}function lu(t,e){const n=[],o=Object.keys(e);for(let i=0;i<o.length;i++){const s=t[o[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function au(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Qs(t,e){const n=t&&t.options||{},o=n.reverse,i=n.min===void 0?e:0,s=n.max===void 0?e:0;return{start:o?s:i,end:o?i:s}}function cu(t,e,n){if(n===!1)return!1;const o=Qs(t,n),i=Qs(e,n);return{top:i.end,right:o.end,bottom:i.start,left:o.start}}function du(t){let e,n,o,i;return z(t)?(e=t.top,n=t.right,o=t.bottom,i=t.left):e=n=o=i=t,{top:e,right:n,bottom:o,left:i,disabled:t===!1}}function er(t,e){const n=[],o=t._getSortedDatasetMetas(e);let i,s;for(i=0,s=o.length;i<s;++i)n.push(o[i].index);return n}function tr(t,e,n,o={}){const i=t.keys,s=o.mode==="single";let r,a,c,d;if(e!==null){for(r=0,a=i.length;r<a;++r){if(c=+i[r],c===n){if(o.all)continue;break}d=t.values[c],ee(d)&&(s||e===0||Ve(e)===Ve(d))&&(e+=d)}return e}}function uu(t){const e=Object.keys(t),n=new Array(e.length);let o,i,s;for(o=0,i=e.length;o<i;++o)s=e[o],n[o]={x:s,y:t[s]};return n}function nr(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function fu(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function hu(t){const{min:e,max:n,minDefined:o,maxDefined:i}=t.getUserBounds();return{min:o?e:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function pu(t,e,n){const o=t[e]||(t[e]={});return o[n]||(o[n]={})}function or(t,e,n,o){for(const i of e.getMatchingVisibleMetas(o).reverse()){const s=t[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function ir(t,e){const{chart:n,_cachedMeta:o}=t,i=n._stacks||(n._stacks={}),{iScale:s,vScale:r,index:a}=o,c=s.axis,d=r.axis,u=fu(s,r,o),f=e.length;let p;for(let h=0;h<f;++h){const g=e[h],{[c]:m,[d]:b}=g,x=g._stacks||(g._stacks={});p=x[d]=pu(i,u,m),p[a]=b,p._top=or(p,r,!0,o.type),p._bottom=or(p,r,!1,o.type);const y=p._visualValues||(p._visualValues={});y[a]=b}}function jo(t,e){const n=t.scales;return Object.keys(n).filter(o=>n[o].axis===e).shift()}function gu(t,e){return Qe(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function mu(t,e,n){return Qe(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function Xt(t,e){const n=t.controller.index,o=t.vScale&&t.vScale.axis;if(o){e=e||t._parsed;for(const i of e){const s=i._stacks;if(!s||s[o]===void 0||s[o][n]===void 0)return;delete s[o][n],s[o]._visualValues!==void 0&&s[o]._visualValues[n]!==void 0&&delete s[o]._visualValues[n]}}}const Wo=t=>t==="reset"||t==="none",sr=(t,e)=>e?t:Object.assign({},t),bu=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:er(n,!0),values:null};class Me{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=nr(e.vScale,e),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(e){this.index!==e&&Xt(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,o=this.getDataset(),i=(f,p,h,g)=>f==="x"?p:f==="r"?g:h,s=n.xAxisID=T(o.xAxisID,jo(e,"x")),r=n.yAxisID=T(o.yAxisID,jo(e,"y")),a=n.rAxisID=T(o.rAxisID,jo(e,"r")),c=n.indexAxis,d=n.iAxisID=i(c,s,r,a),u=n.vAxisID=i(c,r,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&_s(this._data,this),e._stacked&&Xt(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),o=this._data;if(z(n))this._data=uu(n);else if(o!==n){if(o){_s(o,this);const i=this._cachedMeta;Xt(i),i._parsed=[]}n&&Object.isExtensible(n)&&nd(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,o=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=nr(n.vScale,n),n.stack!==o.stack&&(i=!0,Xt(n),n.stack=o.stack),this._resyncElements(e),(i||s!==n._stacked)&&ir(this,n._parsed)}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),o=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(o,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:o,_data:i}=this,{iScale:s,_stacked:r}=o,a=s.axis;let c=e===0&&n===i.length?!0:o._sorted,d=e>0&&o._parsed[e-1],u,f,p;if(this._parsing===!1)o._parsed=i,o._sorted=!0,p=i;else{q(i[e])?p=this.parseArrayData(o,i,e,n):z(i[e])?p=this.parseObjectData(o,i,e,n):p=this.parsePrimitiveData(o,i,e,n);const h=()=>f[a]===null||d&&f[a]<d[a];for(u=0;u<n;++u)o._parsed[u+e]=f=p[u],c&&(h()&&(c=!1),d=f);o._sorted=c}r&&ir(this,p)}parsePrimitiveData(e,n,o,i){const{iScale:s,vScale:r}=e,a=s.axis,c=r.axis,d=s.getLabels(),u=s===r,f=new Array(i);let p,h,g;for(p=0,h=i;p<h;++p)g=p+o,f[p]={[a]:u||s.parse(d[g],g),[c]:r.parse(n[g],g)};return f}parseArrayData(e,n,o,i){const{xScale:s,yScale:r}=e,a=new Array(i);let c,d,u,f;for(c=0,d=i;c<d;++c)u=c+o,f=n[u],a[c]={x:s.parse(f[0],u),y:r.parse(f[1],u)};return a}parseObjectData(e,n,o,i){const{xScale:s,yScale:r}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,d=new Array(i);let u,f,p,h;for(u=0,f=i;u<f;++u)p=u+o,h=n[p],d[u]={x:s.parse(Ke(h,a),p),y:r.parse(Ke(h,c),p)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,o){const i=this.chart,s=this._cachedMeta,r=n[e.axis],a={keys:er(i,!0),values:n._stacks[e.axis]._visualValues};return tr(a,r,s.index,{mode:o})}updateRangeFromParsed(e,n,o,i){const s=o[n.axis];let r=s===null?NaN:s;const a=i&&o._stacks[n.axis];i&&a&&(i.values=a,r=tr(i,s,this._cachedMeta.index)),e.min=Math.min(e.min,r),e.max=Math.max(e.max,r)}getMinMax(e,n){const o=this._cachedMeta,i=o._parsed,s=o._sorted&&e===o.iScale,r=i.length,a=this._getOtherScale(e),c=bu(n,o,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=hu(a);let p,h;function g(){h=i[p];const m=h[a.axis];return!ee(h[e.axis])||u>m||f<m}for(p=0;p<r&&!(!g()&&(this.updateRangeFromParsed(d,e,h,c),s));++p);if(s){for(p=r-1;p>=0;--p)if(!g()){this.updateRangeFromParsed(d,e,h,c);break}}return d}getAllParsedValues(e){const n=this._cachedMeta._parsed,o=[];let i,s,r;for(i=0,s=n.length;i<s;++i)r=n[i][e.axis],ee(r)&&o.push(r);return o}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,o=n.iScale,i=n.vScale,s=this.getParsed(e);return{label:o?""+o.getLabelForValue(s[o.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=du(T(this.options.clip,cu(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,o=this._cachedMeta,i=o.data||[],s=n.chartArea,r=[],a=this._drawStart||0,c=this._drawCount||i.length-a,d=this.options.drawActiveElementsOnTop;let u;for(o.dataset&&o.dataset.draw(e,s,a,c),u=a;u<a+c;++u){const f=i[u];f.hidden||(f.active&&d?r.push(f):f.draw(e,s))}for(u=0;u<r.length;++u)r[u].draw(e,s)}getStyle(e,n){const o=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(o):this.resolveDataElementOptions(e||0,o)}getContext(e,n,o){const i=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const r=this._cachedMeta.data[e];s=r.$context||(r.$context=mu(this.getContext(),e,r)),s.parsed=this.getParsed(e),s.raw=i.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=gu(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=o,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",o){const i=n==="active",s=this._cachedDataOpts,r=e+"-"+n,a=s[r],c=this.enableOptionSharing&&zt(o);if(a)return sr(a,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),f=i?[`${e}Hover`,"hover",e,""]:[e,""],p=d.getOptionScopes(this.getDataset(),u),h=Object.keys(te.elements[e]),g=()=>this.getContext(o,i,n),m=d.resolveNamedOptions(p,h,g,f);return m.$shared&&(m.$shared=c,s[r]=Object.freeze(sr(m,c))),m}_resolveAnimations(e,n,o){const i=this.chart,s=this._cachedDataOpts,r=`animation-${n}`,a=s[r];if(a)return a;let c;if(i.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),p=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(p,this.getContext(e,o,n))}const d=new Js(i,c&&c.animations);return c&&c._cacheable&&(s[r]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Wo(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const o=this.resolveDataElementOptions(e,n),i=this._sharedOptions,s=this.getSharedOptions(o),r=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,o),{sharedOptions:s,includeOptions:r}}updateElement(e,n,o,i){Wo(i)?Object.assign(e,o):this._resolveAnimations(n,i).update(e,o)}updateSharedOptions(e,n,o){e&&!Wo(n)&&this._resolveAnimations(void 0,n).update(e,o)}_setStyle(e,n,o,i){e.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,o,i).update(e,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(e,n,o){this._setStyle(e,o,"active",!1)}setHoverStyle(e,n,o){this._setStyle(e,o,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,o=this._cachedMeta.data;for(const[a,c,d]of this._syncList)this[a](c,d);this._syncList=[];const i=o.length,s=n.length,r=Math.min(s,i);r&&this.parse(0,r),s>i?this._insertElements(i,s-i,e):s<i&&this._removeElements(s,i-s)}_insertElements(e,n,o=!0){const i=this._cachedMeta,s=i.data,r=e+n;let a;const c=d=>{for(d.length+=n,a=d.length-1;a>=r;a--)d[a]=d[a-n]};for(c(s),a=e;a<r;++a)s[a]=new this.dataElementType;this._parsing&&c(i._parsed),this.parse(e,n),o&&this.updateElements(s,e,n,"reset")}updateElements(e,n,o,i){}_removeElements(e,n){const o=this._cachedMeta;if(this._parsing){const i=o._parsed.splice(e,n);o._stacked&&Xt(o,i)}o.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,o,i]=e;this[n](o,i)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const o=arguments.length-2;o&&this._sync(["_insertElements",e,o])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}F(Me,"defaults",{}),F(Me,"datasetElementType",null),F(Me,"dataElementType",null);function yu(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let o=[];for(let i=0,s=n.length;i<s;i++)o=o.concat(n[i].controller.getAllParsedValues(t));t._cache.$bar=xs(o.sort((i,s)=>i-s))}return t._cache.$bar}function _u(t){const e=t.iScale,n=yu(e,t.type);let o=e._length,i,s,r,a;const c=()=>{r===32767||r===-32768||(zt(a)&&(o=Math.min(o,Math.abs(r-a)||o)),a=r)};for(i=0,s=n.length;i<s;++i)r=e.getPixelForValue(n[i]),c();for(a=void 0,i=0,s=e.ticks.length;i<s;++i)r=e.getPixelForTick(i),c();return o}function xu(t,e,n,o){const i=n.barThickness;let s,r;return H(i)?(s=e.min*n.categoryPercentage,r=n.barPercentage):(s=i*o,r=1),{chunk:s/o,ratio:r,start:e.pixels[t]-s/2}}function wu(t,e,n,o){const i=e.pixels,s=i[t];let r=t>0?i[t-1]:null,a=t<i.length-1?i[t+1]:null;const c=n.categoryPercentage;r===null&&(r=s-(a===null?e.end-e.start:a-s)),a===null&&(a=s+s-r);const d=s-(s-Math.min(r,a))/2*c;return{chunk:Math.abs(a-r)/2*c/o,ratio:n.barPercentage,start:d}}function Cu(t,e,n,o){const i=n.parse(t[0],o),s=n.parse(t[1],o),r=Math.min(i,s),a=Math.max(i,s);let c=r,d=a;Math.abs(r)>Math.abs(a)&&(c=a,d=r),e[n.axis]=d,e._custom={barStart:c,barEnd:d,start:i,end:s,min:r,max:a}}function rr(t,e,n,o){return q(t)?Cu(t,e,n,o):e[n.axis]=n.parse(t,o),e}function lr(t,e,n,o){const i=t.iScale,s=t.vScale,r=i.getLabels(),a=i===s,c=[];let d,u,f,p;for(d=n,u=n+o;d<u;++d)p=e[d],f={},f[i.axis]=a||i.parse(r[d],d),c.push(rr(p,f,s,d));return c}function Yo(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function ku(t,e,n){return t!==0?Ve(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function Su(t){let e,n,o,i,s;return t.horizontal?(e=t.base>t.x,n="left",o="right"):(e=t.base<t.y,n="bottom",o="top"),e?(i="end",s="start"):(i="start",s="end"),{start:n,end:o,reverse:e,top:i,bottom:s}}function vu(t,e,n,o){let i=e.borderSkipped;const s={};if(!i){t.borderSkipped=s;return}if(i===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:c,top:d,bottom:u}=Su(t);i==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===o?i=d:(n._bottom||0)===o?i=u:(s[ar(u,r,a,c)]=!0,i=d)),s[ar(i,r,a,c)]=!0,t.borderSkipped=s}function ar(t,e,n,o){return o?(t=Mu(t,e,n),t=cr(t,n,e)):t=cr(t,e,n),t}function Mu(t,e,n){return t===e?n:t===n?e:t}function cr(t,e,n){return t==="start"?e:t==="end"?n:t}function Eu(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class Pn extends Me{parsePrimitiveData(e,n,o,i){return lr(e,n,o,i)}parseArrayData(e,n,o,i){return lr(e,n,o,i)}parseObjectData(e,n,o,i){const{iScale:s,vScale:r}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?a:c,u=r.axis==="x"?a:c,f=[];let p,h,g,m;for(p=o,h=o+i;p<h;++p)m=n[p],g={},g[s.axis]=s.parse(Ke(m,d),p),f.push(rr(Ke(m,u),g,r,p));return f}updateRangeFromParsed(e,n,o,i){super.updateRangeFromParsed(e,n,o,i);const s=o._custom;s&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,s.min),e.max=Math.max(e.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:o,vScale:i}=n,s=this.getParsed(e),r=s._custom,a=Yo(r)?"["+r.start+", "+r.end+"]":""+i.getLabelForValue(s[i.axis]);return{label:""+o.getLabelForValue(s[o.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,o,i){const s=i==="reset",{index:r,_cachedMeta:{vScale:a}}=this,c=a.getBasePixel(),d=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:p}=this._getSharedOptions(n,i);for(let h=n;h<n+o;h++){const g=this.getParsed(h),m=s||H(g[a.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),b=this._calculateBarIndexPixels(h,u),x=(g._stacks||{})[a.axis],y={horizontal:d,base:m.base,enableBorderRadius:!x||Yo(g._custom)||r===x._top||r===x._bottom,x:d?m.head:b.center,y:d?b.center:m.head,height:d?b.size:Math.abs(m.size),width:d?Math.abs(m.size):b.size};p&&(y.options=f||this.resolveDataElementOptions(h,e[h].active?"active":i));const w=y.options||e[h].options;vu(y,w,x,r),Eu(y,w,u.ratio),this.updateElement(e[h],h,y,i)}}_getStacks(e,n){const{iScale:o}=this._cachedMeta,i=o.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),s=o.options.stacked,r=[],a=c=>{const d=c.controller.getParsed(n),u=d&&d[c.vScale.axis];if(H(u)||isNaN(u))return!0};for(const c of i)if(!(n!==void 0&&a(c))&&((s===!1||r.indexOf(c.stack)===-1||s===void 0&&c.stack===void 0)&&r.push(c.stack),c.index===e))break;return r.length||r.push(void 0),r}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,n,o){const i=this._getStacks(e,o),s=n!==void 0?i.indexOf(n):-1;return s===-1?i.length-1:s}_getRuler(){const e=this.options,n=this._cachedMeta,o=n.iScale,i=[];let s,r;for(s=0,r=n.data.length;s<r;++s)i.push(o.getPixelForValue(this.getParsed(s)[o.axis],s));const a=e.barThickness;return{min:a||_u(n),pixels:i,start:o._startPixel,end:o._endPixel,stackCount:this._getStackCount(),scale:o,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:o,index:i},options:{base:s,minBarLength:r}}=this,a=s||0,c=this.getParsed(e),d=c._custom,u=Yo(d);let f=c[n.axis],p=0,h=o?this.applyStack(n,c,o):f,g,m;h!==f&&(p=h-f,h=f),u&&(f=d.barStart,h=d.barEnd-d.barStart,f!==0&&Ve(f)!==Ve(d.barEnd)&&(p=0),p+=f);const b=!H(s)&&!u?s:p;let x=n.getPixelForValue(b);if(this.chart.getDataVisibility(e)?g=n.getPixelForValue(p+h):g=x,m=g-x,Math.abs(m)<r){m=ku(m,n,a)*r,f===a&&(x-=m/2);const y=n.getPixelForDecimal(0),w=n.getPixelForDecimal(1),S=Math.min(y,w),_=Math.max(y,w);x=Math.max(Math.min(x,_),S),g=x+m,o&&!u&&(c._stacks[n.axis]._visualValues[i]=n.getValueForPixel(g)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const y=Ve(m)*n.getLineWidthForValue(a)/2;x+=y,m-=y}return{size:m,base:x,head:g,center:g+m/2}}_calculateBarIndexPixels(e,n){const o=n.scale,i=this.options,s=i.skipNull,r=T(i.maxBarThickness,1/0);let a,c;if(n.grouped){const d=s?this._getStackCount(e):n.stackCount,u=i.barThickness==="flex"?wu(e,n,i,d):xu(e,n,i,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0);a=u.start+u.chunk*f+u.chunk/2,c=Math.min(r,u.chunk*u.ratio)}else a=o.getPixelForValue(this.getParsed(e)[o.axis],e),c=Math.min(r,n.min*n.ratio);return{base:a-c/2,head:a+c/2,center:a,size:c}}draw(){const e=this._cachedMeta,n=e.vScale,o=e.data,i=o.length;let s=0;for(;s<i;++s)this.getParsed(s)[n.axis]!==null&&o[s].draw(this._ctx)}}F(Pn,"id","bar"),F(Pn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),F(Pn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class An extends Me{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,o,i){const s=super.parsePrimitiveData(e,n,o,i);for(let r=0;r<s.length;r++)s[r]._custom=this.resolveDataElementOptions(r+o).radius;return s}parseArrayData(e,n,o,i){const s=super.parseArrayData(e,n,o,i);for(let r=0;r<s.length;r++){const a=n[o+r];s[r]._custom=T(a[2],this.resolveDataElementOptions(r+o).radius)}return s}parseObjectData(e,n,o,i){const s=super.parseObjectData(e,n,o,i);for(let r=0;r<s.length;r++){const a=n[o+r];s[r]._custom=T(a&&a.r&&+a.r,this.resolveDataElementOptions(r+o).radius)}return s}getMaxOverflow(){const e=this._cachedMeta.data;let n=0;for(let o=e.length-1;o>=0;--o)n=Math.max(n,e[o].size(this.resolveDataElementOptions(o))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart.data.labels||[],{xScale:i,yScale:s}=n,r=this.getParsed(e),a=i.getLabelForValue(r.x),c=s.getLabelForValue(r.y),d=r._custom;return{label:o[e]||"",value:"("+a+", "+c+(d?", "+d:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,o,i){const s=i==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(n,i),u=r.axis,f=a.axis;for(let p=n;p<n+o;p++){const h=e[p],g=!s&&this.getParsed(p),m={},b=m[u]=s?r.getPixelForDecimal(.5):r.getPixelForValue(g[u]),x=m[f]=s?a.getBasePixel():a.getPixelForValue(g[f]);m.skip=isNaN(b)||isNaN(x),d&&(m.options=c||this.resolveDataElementOptions(p,h.active?"active":i),s&&(m.options.radius=0)),this.updateElement(h,p,m,i)}}resolveDataElementOptions(e,n){const o=this.getParsed(e);let i=super.resolveDataElementOptions(e,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const s=i.radius;return n!=="active"&&(i.radius=0),i.radius+=T(o&&o._custom,s),i}}F(An,"id","bubble"),F(An,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),F(An,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Du(t,e,n){let o=1,i=1,s=0,r=0;if(e<K){const a=t,c=a+e,d=Math.cos(a),u=Math.sin(a),f=Math.cos(c),p=Math.sin(c),h=(w,S,_)=>jt(w,a,c,!0)?1:Math.max(S,S*n,_,_*n),g=(w,S,_)=>jt(w,a,c,!0)?-1:Math.min(S,S*n,_,_*n),m=h(0,d,f),b=h(ne,u,p),x=g(X,d,f),y=g(X+ne,u,p);o=(m-x)/2,i=(b-y)/2,s=-(m+x)/2,r=-(b+y)/2}return{ratioX:o,ratioY:i,offsetX:s,offsetY:r}}class bt extends Me{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const o=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=o;else{let s=c=>+o[c];if(z(o[e])){const{key:c="value"}=this._parsing;s=d=>+Ke(o[d],c)}let r,a;for(r=e,a=e+n;r<a;++r)i._parsed[r]=s(r)}}_getRotation(){return ve(this.options.rotation-90)}_getCircumference(){return ve(this.options.circumference)}_getRotationExtents(){let e=K,n=-K;for(let o=0;o<this.chart.data.datasets.length;++o)if(this.chart.isDatasetVisible(o)&&this.chart.getDatasetMeta(o).type===this._type){const i=this.chart.getDatasetMeta(o).controller,s=i._getRotation(),r=i._getCircumference();e=Math.min(e,s),n=Math.max(n,s+r)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:o}=n,i=this._cachedMeta,s=i.data,r=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,a=Math.max((Math.min(o.width,o.height)-r)/2,0),c=Math.min(Hc(this.options.cutout,a),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:g,offsetY:m}=Du(f,u,c),b=(o.width-r)/p,x=(o.height-r)/h,y=Math.max(Math.min(b,x)/2,0),w=cs(this.options.radius,y),S=Math.max(w*c,0),_=(w-S)/this._getVisibleDatasetWeightTotal();this.offsetX=g*w,this.offsetY=m*w,i.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*d,0),this.updateElements(s,0,s.length,e)}_circumference(e,n){const o=this.options,i=this._cachedMeta,s=this._getCircumference();return n&&o.animation.animateRotate||!this.chart.getDataVisibility(e)||i._parsed[e]===null||i.data[e].hidden?0:this.calculateCircumference(i._parsed[e]*s/K)}updateElements(e,n,o,i){const s=i==="reset",r=this.chart,a=r.chartArea,d=r.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,p=s&&d.animateScale,h=p?0:this.innerRadius,g=p?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(n,i);let x=this._getRotation(),y;for(y=0;y<n;++y)x+=this._circumference(y,s);for(y=n;y<n+o;++y){const w=this._circumference(y,s),S=e[y],_={x:u+this.offsetX,y:f+this.offsetY,startAngle:x,endAngle:x+w,circumference:w,outerRadius:g,innerRadius:h};b&&(_.options=m||this.resolveDataElementOptions(y,S.active?"active":i)),x+=w,this.updateElement(S,y,_,i)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let o=0,i;for(i=0;i<n.length;i++){const s=e._parsed[i];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(o+=Math.abs(s))}return o}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?K*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart,i=o.data.labels||[],s=Yt(n._parsed[e],o.options.locale);return{label:i[e]||"",value:s}}getMaxBorderWidth(e){let n=0;const o=this.chart;let i,s,r,a,c;if(!e){for(i=0,s=o.data.datasets.length;i<s;++i)if(o.isDatasetVisible(i)){r=o.getDatasetMeta(i),e=r.data,a=r.controller;break}}if(!e)return 0;for(i=0,s=e.length;i<s;++i)c=a.resolveDataElementOptions(i),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let o=0,i=e.length;o<i;++o){const s=this.resolveDataElementOptions(o);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let o=0;o<e;++o)this.chart.isDatasetVisible(o)&&(n+=this._getRingWeight(o));return n}_getRingWeight(e){return Math.max(T(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}F(bt,"id","doughnut"),F(bt,"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"}),F(bt,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),F(bt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:o,color:i}}=e.legend.options;return n.labels.map((s,r)=>{const c=e.getDatasetMeta(0).controller.getStyle(r);return{text:s,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:i,lineWidth:c.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,n,o){o.chart.toggleDataVisibility(n.index),o.chart.update()}}}});class On extends Me{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:o,data:i=[],_dataset:s}=n,r=this.chart._animationsDisabled;let{start:a,count:c}=ks(n,i,r);this._drawStart=a,this._drawCount=c,Ss(n)&&(a=0,c=i.length),o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!s._decimated,o.points=i;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:d},e),this.updateElements(i,a,c,e)}updateElements(e,n,o,i){const s=i==="reset",{iScale:r,vScale:a,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,i),p=r.axis,h=a.axis,{spanGaps:g,segment:m}=this.options,b=Et(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||i==="none",y=n+o,w=e.length;let S=n>0&&this.getParsed(n-1);for(let _=0;_<w;++_){const C=e[_],v=x?C:{};if(_<n||_>=y){v.skip=!0;continue}const k=this.getParsed(_),M=H(k[h]),V=v[p]=r.getPixelForValue(k[p],_),$=v[h]=s||M?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,k,c):k[h],_);v.skip=isNaN(V)||isNaN($)||M,v.stop=_>0&&Math.abs(k[p]-S[p])>b,m&&(v.parsed=k,v.raw=d.data[_]),f&&(v.options=u||this.resolveDataElementOptions(_,C.active?"active":i)),x||this.updateElement(C,_,v,i),S=k}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,o=n.options&&n.options.borderWidth||0,i=e.data||[];if(!i.length)return o;const s=i[0].size(this.resolveDataElementOptions(0)),r=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(o,s,r)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}F(On,"id","line"),F(On,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(On,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Kt extends Me{constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart,i=o.data.labels||[],s=Yt(n._parsed[e].r,o.options.locale);return{label:i[e]||"",value:s}}parseObjectData(e,n,o,i){return Ls.bind(this)(e,n,o,i)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((o,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,o=e.options,i=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(i/2,0),r=Math.max(o.cutoutPercentage?s/100*o.cutoutPercentage:1,0),a=(s-r)/e.getVisibleDatasetCount();this.outerRadius=s-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,n,o,i){const s=i==="reset",r=this.chart,c=r.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,f=d.yCenter,p=d.getIndexAngle(0)-.5*X;let h=p,g;const m=360/this.countVisibleElements();for(g=0;g<n;++g)h+=this._computeAngle(g,i,m);for(g=n;g<n+o;g++){const b=e[g];let x=h,y=h+this._computeAngle(g,i,m),w=r.getDataVisibility(g)?d.getDistanceFromCenterForValue(this.getParsed(g).r):0;h=y,s&&(c.animateScale&&(w=0),c.animateRotate&&(x=y=p));const S={x:u,y:f,innerRadius:0,outerRadius:w,startAngle:x,endAngle:y,options:this.resolveDataElementOptions(g,b.active?"active":i)};this.updateElement(b,g,S,i)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((o,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(e,n,o){return this.chart.getDataVisibility(e)?ve(this.resolveDataElementOptions(e,n).angle||o):0}}F(Kt,"id","polarArea"),F(Kt,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),F(Kt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:o,color:i}}=e.legend.options;return n.labels.map((s,r)=>{const c=e.getDatasetMeta(0).controller.getStyle(r);return{text:s,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:i,lineWidth:c.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,n,o){o.chart.toggleDataVisibility(n.index),o.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Go extends bt{}F(Go,"id","pie"),F(Go,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Nn extends Me{getLabelAndValue(e){const n=this._cachedMeta.vScale,o=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(o[n.axis])}}parseObjectData(e,n,o,i){return Ls.bind(this)(e,n,o,i)}update(e){const n=this._cachedMeta,o=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(o.points=i,e!=="resize"){const r=this.resolveDatasetElementOptions(e);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:r};this.updateElement(o,void 0,a,e)}this.updateElements(i,0,i.length,e)}updateElements(e,n,o,i){const s=this._cachedMeta.rScale,r=i==="reset";for(let a=n;a<n+o;a++){const c=e[a],d=this.resolveDataElementOptions(a,c.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),f=r?s.xCenter:u.x,p=r?s.yCenter:u.y,h={x:f,y:p,angle:u.angle,skip:isNaN(f)||isNaN(p),options:d};this.updateElement(c,a,h,i)}}}F(Nn,"id","radar"),F(Nn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),F(Nn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class In extends Me{getLabelAndValue(e){const n=this._cachedMeta,o=this.chart.data.labels||[],{xScale:i,yScale:s}=n,r=this.getParsed(e),a=i.getLabelForValue(r.x),c=s.getLabelForValue(r.y);return{label:o[e]||"",value:"("+a+", "+c+")"}}update(e){const n=this._cachedMeta,{data:o=[]}=n,i=this.chart._animationsDisabled;let{start:s,count:r}=ks(n,o,i);if(this._drawStart=s,this._drawCount=r,Ss(n)&&(s=0,r=o.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:c}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!c._decimated,a.points=o;const d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:d},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(o,s,r,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,n,o,i){const s=i==="reset",{iScale:r,vScale:a,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(u),p=this.includeOptions(i,f),h=r.axis,g=a.axis,{spanGaps:m,segment:b}=this.options,x=Et(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||i==="none";let w=n>0&&this.getParsed(n-1);for(let S=n;S<n+o;++S){const _=e[S],C=this.getParsed(S),v=y?_:{},k=H(C[g]),M=v[h]=r.getPixelForValue(C[h],S),V=v[g]=s||k?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,C,c):C[g],S);v.skip=isNaN(M)||isNaN(V)||k,v.stop=S>0&&Math.abs(C[h]-w[h])>x,b&&(v.parsed=C,v.raw=d.data[S]),p&&(v.options=f||this.resolveDataElementOptions(S,_.active?"active":i)),y||this.updateElement(_,S,v,i),w=C}this.updateSharedOptions(f,i,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let a=0;for(let c=n.length-1;c>=0;--c)a=Math.max(a,n[c].size(this.resolveDataElementOptions(c))/2);return a>0&&a}const o=e.dataset,i=o.options&&o.options.borderWidth||0;if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,r)/2}}F(In,"id","scatter"),F(In,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),F(In,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Vu=Object.freeze({__proto__:null,BarController:Pn,BubbleController:An,DoughnutController:bt,LineController:On,PieController:Go,PolarAreaController:Kt,RadarController:Nn,ScatterController:In});function yt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Uo{constructor(e){F(this,"options");this.options=e||{}}static override(e){Object.assign(Uo.prototype,e)}init(){}formats(){return yt()}parse(){return yt()}format(){return yt()}add(){return yt()}diff(){return yt()}startOf(){return yt()}endOf(){return yt()}}var Ru={_date:Uo};function Fu(t,e,n,o){const{controller:i,data:s,_sorted:r}=t,a=i._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&r&&s.length){const c=a._reversePixels?ed:Oe;if(o){if(i._sharedOptions){const d=s[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){const f=c(s,e,n-u),p=c(s,e,n+u);return{lo:f.lo,hi:p.hi}}}}else return c(s,e,n)}return{lo:0,hi:s.length-1}}function Zt(t,e,n,o,i){const s=t.getSortedVisibleDatasetMetas(),r=n[e];for(let a=0,c=s.length;a<c;++a){const{index:d,data:u}=s[a],{lo:f,hi:p}=Fu(s[a],e,r,i);for(let h=f;h<=p;++h){const g=u[h];g.skip||o(g,d,h)}}}function Bu(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(o,i){const s=e?Math.abs(o.x-i.x):0,r=n?Math.abs(o.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(r,2))}}function qo(t,e,n,o,i){const s=[];return!i&&!t.isPointInArea(e)||Zt(t,n,e,function(a,c,d){!i&&!Ne(a,t.chartArea,0)||a.inRange(e.x,e.y,o)&&s.push({element:a,datasetIndex:c,index:d})},!0),s}function $u(t,e,n,o){let i=[];function s(r,a,c){const{startAngle:d,endAngle:u}=r.getProps(["startAngle","endAngle"],o),{angle:f}=bs(r,{x:e.x,y:e.y});jt(f,d,u)&&i.push({element:r,datasetIndex:a,index:c})}return Zt(t,n,e,s),i}function Pu(t,e,n,o,i,s){let r=[];const a=Bu(n);let c=Number.POSITIVE_INFINITY;function d(u,f,p){const h=u.inRange(e.x,e.y,i);if(o&&!h)return;const g=u.getCenterPoint(i);if(!(!!s||t.isPointInArea(g))&&!h)return;const b=a(e,g);b<c?(r=[{element:u,datasetIndex:f,index:p}],c=b):b===c&&r.push({element:u,datasetIndex:f,index:p})}return Zt(t,n,e,d),r}function Xo(t,e,n,o,i,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!o?$u(t,e,n,i):Pu(t,e,n,o,i,s)}function dr(t,e,n,o,i){const s=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return Zt(t,n,e,(c,d,u)=>{c[r](e[n],i)&&(s.push({element:c,datasetIndex:d,index:u}),a=a||c.inRange(e.x,e.y,i))}),o&&!a?[]:s}var Au={evaluateInteractionItems:Zt,modes:{index(t,e,n,o){const i=gt(e,t),s=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?qo(t,i,s,o,r):Xo(t,i,s,!1,o,r),c=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=a[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,e,n,o){const i=gt(e,t),s=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?qo(t,i,s,o,r):Xo(t,i,s,!1,o,r);if(a.length>0){const c=a[0].datasetIndex,d=t.getDatasetMeta(c).data;a=[];for(let u=0;u<d.length;++u)a.push({element:d[u],datasetIndex:c,index:u})}return a},point(t,e,n,o){const i=gt(e,t),s=n.axis||"xy",r=n.includeInvisible||!1;return qo(t,i,s,o,r)},nearest(t,e,n,o){const i=gt(e,t),s=n.axis||"xy",r=n.includeInvisible||!1;return Xo(t,i,s,n.intersect,o,r)},x(t,e,n,o){const i=gt(e,t);return dr(t,i,"x",n.intersect,o)},y(t,e,n,o){const i=gt(e,t);return dr(t,i,"y",n.intersect,o)}}};const ur=["left","top","right","bottom"];function Jt(t,e){return t.filter(n=>n.pos===e)}function fr(t,e){return t.filter(n=>ur.indexOf(n.pos)===-1&&n.box.axis===e)}function Qt(t,e){return t.sort((n,o)=>{const i=e?o:n,s=e?n:o;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function Ou(t){const e=[];let n,o,i,s,r,a;for(n=0,o=(t||[]).length;n<o;++n)i=t[n],{position:s,options:{stack:r,stackWeight:a=1}}=i,e.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:r&&s+r,stackWeight:a});return e}function Nu(t){const e={};for(const n of t){const{stack:o,pos:i,stackWeight:s}=n;if(!o||!ur.includes(i))continue;const r=e[o]||(e[o]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=s}return e}function Iu(t,e){const n=Nu(t),{vBoxMaxWidth:o,hBoxMaxHeight:i}=e;let s,r,a;for(s=0,r=t.length;s<r;++s){a=t[s];const{fullSize:c}=a.box,d=n[a.stack],u=d&&a.stackWeight/d.weight;a.horizontal?(a.width=u?u*o:c&&e.availableWidth,a.height=i):(a.width=o,a.height=u?u*i:c&&e.availableHeight)}return n}function Lu(t){const e=Ou(t),n=Qt(e.filter(d=>d.box.fullSize),!0),o=Qt(Jt(e,"left"),!0),i=Qt(Jt(e,"right")),s=Qt(Jt(e,"top"),!0),r=Qt(Jt(e,"bottom")),a=fr(e,"x"),c=fr(e,"y");return{fullSize:n,leftAndTop:o.concat(s),rightAndBottom:i.concat(c).concat(r).concat(a),chartArea:Jt(e,"chartArea"),vertical:o.concat(i).concat(c),horizontal:s.concat(r).concat(a)}}function hr(t,e,n,o){return Math.max(t[n],e[n])+Math.max(t[o],e[o])}function pr(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Tu(t,e,n,o){const{pos:i,box:s}=n,r=t.maxPadding;if(!z(i)){n.size&&(t[i]-=n.size);const f=o[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?s.height:s.width),n.size=f.size/f.count,t[i]+=n.size}s.getPadding&&pr(r,s.getPadding());const a=Math.max(0,e.outerWidth-hr(r,t,"left","right")),c=Math.max(0,e.outerHeight-hr(r,t,"top","bottom")),d=a!==t.w,u=c!==t.h;return t.w=a,t.h=c,n.horizontal?{same:d,other:u}:{same:u,other:d}}function zu(t){const e=t.maxPadding;function n(o){const i=Math.max(e[o]-t[o],0);return t[o]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function Hu(t,e){const n=e.maxPadding;function o(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(r=>{s[r]=Math.max(e[r],n[r])}),s}return o(t?["left","right"]:["top","bottom"])}function en(t,e,n,o){const i=[];let s,r,a,c,d,u;for(s=0,r=t.length,d=0;s<r;++s){a=t[s],c=a.box,c.update(a.width||e.w,a.height||e.h,Hu(a.horizontal,e));const{same:f,other:p}=Tu(e,n,a,o);d|=f&&i.length,u=u||p,c.fullSize||i.push(a)}return d&&en(i,e,n,o)||u}function Ln(t,e,n,o,i){t.top=n,t.left=e,t.right=e+o,t.bottom=n+i,t.width=o,t.height=i}function gr(t,e,n,o){const i=n.padding;let{x:s,y:r}=e;for(const a of t){const c=a.box,d=o[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/d.weight||1;if(a.horizontal){const f=e.w*u,p=d.size||c.height;zt(d.start)&&(r=d.start),c.fullSize?Ln(c,i.left,r,n.outerWidth-i.right-i.left,p):Ln(c,e.left+d.placed,r,f,p),d.start=r,d.placed+=f,r=c.bottom}else{const f=e.h*u,p=d.size||c.width;zt(d.start)&&(s=d.start),c.fullSize?Ln(c,s,i.top,p,n.outerHeight-i.bottom-i.top):Ln(c,s,e.top+d.placed,p,f),d.start=s,d.placed+=f,s=c.right}}e.x=s,e.y=r}var ce={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,o){if(!t)return;const i=ae(t.options.layout.padding),s=Math.max(e-i.width,0),r=Math.max(n-i.height,0),a=Lu(t.boxes),c=a.vertical,d=a.horizontal;W(t.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=c.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:s,availableHeight:r,vBoxMaxWidth:s/2/u,hBoxMaxHeight:r/2}),p=Object.assign({},i);pr(p,ae(o));const h=Object.assign({maxPadding:p,w:s,h:r,x:i.left,y:i.top},i),g=Iu(c.concat(d),f);en(a.fullSize,h,f,g),en(c,h,f,g),en(d,h,f,g)&&en(c,h,f,g),zu(h),gr(a.leftAndTop,h,f,g),h.x+=h.w,h.y+=h.h,gr(a.rightAndBottom,h,f,g),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},W(a.chartArea,m=>{const b=m.box;Object.assign(b,t.chartArea),b.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class mr{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,o){}removeEventListener(e,n,o){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,o,i){return n=Math.max(0,n||e.width),o=o||e.height,{width:n,height:Math.max(0,i?Math.floor(n/i):o)}}isAttached(e){return!0}updateConfig(e){}}class ju extends mr{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Tn="$chartjs",Wu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},br=t=>t===null||t==="";function Yu(t,e){const n=t.style,o=t.getAttribute("height"),i=t.getAttribute("width");if(t[Tn]={initial:{height:o,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",br(i)){const s=Hs(t,"width");s!==void 0&&(t.width=s)}if(br(o))if(t.style.height==="")t.height=t.width/(e||2);else{const s=Hs(t,"height");s!==void 0&&(t.height=s)}return t}const yr=Ud?{passive:!0}:!1;function Gu(t,e,n){t.addEventListener(e,n,yr)}function Uu(t,e,n){t.canvas.removeEventListener(e,n,yr)}function qu(t,e){const n=Wu[t.type]||t.type,{x:o,y:i}=gt(t,e);return{type:n,chart:e,native:t,x:o!==void 0?o:null,y:i!==void 0?i:null}}function zn(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Xu(t,e,n){const o=t.canvas,i=new MutationObserver(s=>{let r=!1;for(const a of s)r=r||zn(a.addedNodes,o),r=r&&!zn(a.removedNodes,o);r&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Ku(t,e,n){const o=t.canvas,i=new MutationObserver(s=>{let r=!1;for(const a of s)r=r||zn(a.removedNodes,o),r=r&&!zn(a.addedNodes,o);r&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const tn=new Map;let _r=0;function xr(){const t=window.devicePixelRatio;t!==_r&&(_r=t,tn.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Zu(t,e){tn.size||window.addEventListener("resize",xr),tn.set(t,e)}function Ju(t){tn.delete(t),tn.size||window.removeEventListener("resize",xr)}function Qu(t,e,n){const o=t.canvas,i=o&&Ho(o);if(!i)return;const s=Cs((a,c)=>{const d=i.clientWidth;n(a,c),d<i.clientWidth&&n()},window),r=new ResizeObserver(a=>{const c=a[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return r.observe(i),Zu(t,s),r}function Ko(t,e,n){n&&n.disconnect(),e==="resize"&&Ju(t)}function ef(t,e,n){const o=t.canvas,i=Cs(s=>{t.ctx!==null&&n(qu(s,t))},t);return Gu(o,e,i),i}class tf extends mr{acquireContext(e,n){const o=e&&e.getContext&&e.getContext("2d");return o&&o.canvas===e?(Yu(e,n),o):null}releaseContext(e){const n=e.canvas;if(!n[Tn])return!1;const o=n[Tn].initial;["height","width"].forEach(s=>{const r=o[s];H(r)?n.removeAttribute(s):n.setAttribute(s,r)});const i=o.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[Tn],!0}addEventListener(e,n,o){this.removeEventListener(e,n);const i=e.$proxies||(e.$proxies={}),r={attach:Xu,detach:Ku,resize:Qu}[n]||ef;i[n]=r(e,n,o)}removeEventListener(e,n){const o=e.$proxies||(e.$proxies={}),i=o[n];if(!i)return;({attach:Ko,detach:Ko,resize:Ko}[n]||Uu)(e,n,i),o[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,o,i){return Gd(e,n,o,i)}isAttached(e){const n=Ho(e);return!!(n&&n.isConnected)}}function nf(t){return!zo()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?ju:tf}let Le=(mo=class{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(e){const{x:n,y:o}=this.getProps(["x","y"],e);return{x:n,y:o}}hasValue(){return Et(this.x)&&Et(this.y)}getProps(e,n){const o=this.$animations;if(!n||!o)return this;const i={};return e.forEach(s=>{i[s]=o[s]&&o[s].active()?o[s]._to:this[s]}),i}},F(mo,"defaults",{}),F(mo,"defaultRoutes"),mo);function of(t,e){const n=t.options.ticks,o=sf(t),i=Math.min(n.maxTicksLimit||o,o),s=n.major.enabled?lf(e):[],r=s.length,a=s[0],c=s[r-1],d=[];if(r>i)return af(e,d,s,r/i),d;const u=rf(s,e,i);if(r>0){let f,p;const h=r>1?Math.round((c-a)/(r-1)):null;for(Hn(e,d,u,H(h)?0:a-h,a),f=0,p=r-1;f<p;f++)Hn(e,d,u,s[f],s[f+1]);return Hn(e,d,u,c,H(h)?e.length:c+h),d}return Hn(e,d,u),d}function sf(t){const e=t.options.offset,n=t._tickSize(),o=t._length/n+(e?0:1),i=t._maxLength/n;return Math.floor(Math.min(o,i))}function rf(t,e,n){const o=cf(t),i=e.length/n;if(!o)return Math.max(i,1);const s=Kc(o);for(let r=0,a=s.length-1;r<a;r++){const c=s[r];if(c>i)return c}return Math.max(i,1)}function lf(t){const e=[];let n,o;for(n=0,o=t.length;n<o;n++)t[n].major&&e.push(n);return e}function af(t,e,n,o){let i=0,s=n[0],r;for(o=Math.ceil(o),r=0;r<t.length;r++)r===s&&(e.push(t[r]),i++,s=n[i*o])}function Hn(t,e,n,o,i){const s=T(o,0),r=Math.min(T(i,t.length),t.length);let a=0,c,d,u;for(n=Math.ceil(n),i&&(c=i-o,n=c/Math.floor(c/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(d=Math.max(s,0);d<r;d++)d===u&&(e.push(t[d]),a++,u=Math.round(s+a*n))}function cf(t){const e=t.length;let n,o;if(e<2)return!1;for(o=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==o)return!1;return o}const df=t=>t==="left"?"right":t==="right"?"left":t,wr=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,Cr=(t,e)=>Math.min(e||t,t);function kr(t,e){const n=[],o=t.length/e,i=t.length;let s=0;for(;s<i;s+=o)n.push(t[Math.floor(s)]);return n}function uf(t,e,n){const o=t.ticks.length,i=Math.min(e,o-1),s=t._startPixel,r=t._endPixel,a=1e-6;let c=t.getPixelForTick(i),d;if(!(n&&(o===1?d=Math.max(c-s,r-c):e===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(i-1))/2,c+=i<e?d:-d,c<s-a||c>r+a)))return c}function ff(t,e){W(t,n=>{const o=n.gc,i=o.length/2;let s;if(i>e){for(s=0;s<i;++s)delete n.data[o[s]];o.splice(0,i)}})}function nn(t){return t.drawTicks?t.tickLength:0}function Sr(t,e){if(!t.display)return 0;const n=oe(t.font,e),o=ae(t.padding);return(q(t.text)?t.text.length:1)*n.lineHeight+o.height}function hf(t,e){return Qe(t,{scale:e,type:"scale"})}function pf(t,e,n){return Qe(t,{tick:n,index:e,type:"tick"})}function gf(t,e,n){let o=Fo(t);return(n&&e!=="right"||!n&&e==="right")&&(o=df(o)),o}function mf(t,e,n,o){const{top:i,left:s,bottom:r,right:a,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,p,h,g;const m=r-i,b=a-s;if(t.isHorizontal()){if(h=le(o,s,a),z(n)){const x=Object.keys(n)[0],y=n[x];g=u[x].getPixelForValue(y)+m-e}else n==="center"?g=(d.bottom+d.top)/2+m-e:g=wr(t,n,e);p=a-s}else{if(z(n)){const x=Object.keys(n)[0],y=n[x];h=u[x].getPixelForValue(y)-b+e}else n==="center"?h=(d.left+d.right)/2-b+e:h=wr(t,n,e);g=le(o,r,i),f=n==="left"?-ne:ne}return{titleX:h,titleY:g,maxWidth:p,rotation:f}}class _t extends Le{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:o,_suggestedMax:i}=this;return e=ye(e,Number.POSITIVE_INFINITY),n=ye(n,Number.NEGATIVE_INFINITY),o=ye(o,Number.POSITIVE_INFINITY),i=ye(i,Number.NEGATIVE_INFINITY),{min:ye(e,o),max:ye(n,i),minDefined:ee(e),maxDefined:ee(n)}}getMinMax(e){let{min:n,max:o,minDefined:i,maxDefined:s}=this.getUserBounds(),r;if(i&&s)return{min:n,max:o};const a=this.getMatchingVisibleMetas();for(let c=0,d=a.length;c<d;++c)r=a[c].controller.getMinMax(this,e),i||(n=Math.min(n,r.min)),s||(o=Math.max(o,r.max));return n=s&&n>o?o:n,o=i&&n>o?n:o,{min:ye(n,ye(o,n)),max:ye(o,ye(n,o))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){G(this.options.beforeUpdate,[this])}update(e,n,o){const{beginAtZero:i,grace:s,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=o=Object.assign({left:0,right:0,top:0,bottom:0},o),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+o.left+o.right:this.height+o.top+o.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Sd(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?kr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=of(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,o;this.isHorizontal()?(n=this.left,o=this.right):(n=this.top,o=this.bottom,e=!e),this._startPixel=n,this._endPixel=o,this._reversePixels=e,this._length=o-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){G(this.options.afterUpdate,[this])}beforeSetDimensions(){G(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(){G(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),G(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){G(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let o,i,s;for(o=0,i=e.length;o<i;o++)s=e[o],s.label=G(n.callback,[s.value,o,e],this)}afterTickToLabelConversion(){G(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){G(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,o=Cr(this.ticks.length,e.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let r=i,a,c,d;if(!this._isVisible()||!n.display||i>=s||o<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),f=u.widest.width,p=u.highest.height,h=se(this.chart.width-f,0,this.maxWidth);a=e.offset?this.maxWidth/o:h/(o-1),f+6>a&&(a=h/(o-(e.offset?.5:1)),c=this.maxHeight-nn(e.grid)-n.padding-Sr(e.title,this.chart.options.font),d=Math.sqrt(f*f+p*p),r=Do(Math.min(Math.asin(se((u.highest.height+6)/a,-1,1)),Math.asin(se(c/d,-1,1))-Math.asin(se(p/d,-1,1)))),r=Math.max(i,Math.min(s,r))),this.labelRotation=r}afterCalculateLabelRotation(){G(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){G(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:o,title:i,grid:s}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const c=Sr(i,n.options.font);if(a?(e.width=this.maxWidth,e.height=nn(s)+c):(e.height=this.maxHeight,e.width=nn(s)+c),o.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:p}=this._getLabelSizes(),h=o.padding*2,g=ve(this.labelRotation),m=Math.cos(g),b=Math.sin(g);if(a){const x=o.mirror?0:b*f.width+m*p.height;e.height=Math.min(this.maxHeight,e.height+x+h)}else{const x=o.mirror?0:m*f.width+b*p.height;e.width=Math.min(this.maxWidth,e.width+x+h)}this._calculatePadding(d,u,b,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,o,i){const{ticks:{align:s,padding:r},position:a}=this.options,c=this.labelRotation!==0,d=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,h=0;c?d?(p=i*e.width,h=o*n.height):(p=o*e.height,h=i*n.width):s==="start"?h=n.width:s==="end"?p=e.width:s!=="inner"&&(p=e.width/2,h=n.width/2),this.paddingLeft=Math.max((p-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+r)*this.width/(this.width-f),0)}else{let u=n.height/2,f=e.height/2;s==="start"?(u=0,f=e.height):s==="end"&&(u=n.height,f=0),this.paddingTop=u+r,this.paddingBottom=f+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){G(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,o;for(n=0,o=e.length;n<o;n++)H(e[n].label)&&(e.splice(n,1),o--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let o=this.ticks;n<o.length&&(o=kr(o,n)),this._labelSizes=e=this._computeLabelSizes(o,o.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,o){const{ctx:i,_longestTextCache:s}=this,r=[],a=[],c=Math.floor(n/Cr(n,o));let d=0,u=0,f,p,h,g,m,b,x,y,w,S,_;for(f=0;f<n;f+=c){if(g=e[f].label,m=this._resolveTickFontOptions(f),i.font=b=m.string,x=s[b]=s[b]||{data:{},gc:[]},y=m.lineHeight,w=S=0,!H(g)&&!q(g))w=En(i,x.data,x.gc,w,g),S=y;else if(q(g))for(p=0,h=g.length;p<h;++p)_=g[p],!H(_)&&!q(_)&&(w=En(i,x.data,x.gc,w,_),S+=y);r.push(w),a.push(S),d=Math.max(w,d),u=Math.max(S,u)}ff(s,n);const C=r.indexOf(d),v=a.indexOf(u),k=M=>({width:r[M]||0,height:a[M]||0});return{first:k(0),last:k(n-1),widest:k(C),highest:k(v),widths:r,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return Qc(this._alignToPixels?ut(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const o=n[e];return o.$context||(o.$context=pf(this.getContext(),e,o))}return this.$context||(this.$context=hf(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=ve(this.labelRotation),o=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),r=e.autoSkipPadding||0,a=s?s.widest.width+r:0,c=s?s.highest.height+r:0;return this.isHorizontal()?c*o>a*i?a/o:c/i:c*i<a*o?c/o:a/i}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,o=this.chart,i=this.options,{grid:s,position:r,border:a}=i,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),p=nn(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,b=m/2,x=function(E){return ut(o,E,m)};let y,w,S,_,C,v,k,M,V,$,O,U;if(r==="top")y=x(this.bottom),v=this.bottom-p,M=y-b,$=x(e.top)+b,U=e.bottom;else if(r==="bottom")y=x(this.top),$=e.top,U=x(e.bottom)-b,v=y+b,M=this.top+p;else if(r==="left")y=x(this.right),C=this.right-p,k=y-b,V=x(e.left)+b,O=e.right;else if(r==="right")y=x(this.left),V=e.left,O=x(e.right)-b,C=y+b,k=this.left+p;else if(n==="x"){if(r==="center")y=x((e.top+e.bottom)/2+.5);else if(z(r)){const E=Object.keys(r)[0],R=r[E];y=x(this.chart.scales[E].getPixelForValue(R))}$=e.top,U=e.bottom,v=y+b,M=v+p}else if(n==="y"){if(r==="center")y=x((e.left+e.right)/2);else if(z(r)){const E=Object.keys(r)[0],R=r[E];y=x(this.chart.scales[E].getPixelForValue(R))}C=y-b,k=C-p,V=e.left,O=e.right}const P=T(i.ticks.maxTicksLimit,f),D=Math.max(1,Math.ceil(f/P));for(w=0;w<f;w+=D){const E=this.getContext(w),R=s.setContext(E),B=a.setContext(E),A=R.lineWidth,N=R.color,j=B.dash||[],Y=B.dashOffset,Z=R.tickWidth,J=R.tickColor,re=R.tickBorderDash||[],me=R.tickBorderDashOffset;S=uf(this,w,c),S!==void 0&&(_=ut(o,S,A),d?C=k=V=O=_:v=M=$=U=_,h.push({tx1:C,ty1:v,tx2:k,ty2:M,x1:V,y1:$,x2:O,y2:U,width:A,color:N,borderDash:j,borderDashOffset:Y,tickWidth:Z,tickColor:J,tickBorderDash:re,tickBorderDashOffset:me}))}return this._ticksLength=f,this._borderValue=y,h}_computeLabelItems(e){const n=this.axis,o=this.options,{position:i,ticks:s}=o,r=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,p=nn(o.grid),h=p+u,g=f?-u:h,m=-ve(this.labelRotation),b=[];let x,y,w,S,_,C,v,k,M,V,$,O,U="middle";if(i==="top")C=this.bottom-g,v=this._getXAxisLabelAlignment();else if(i==="bottom")C=this.top+g,v=this._getXAxisLabelAlignment();else if(i==="left"){const D=this._getYAxisLabelAlignment(p);v=D.textAlign,_=D.x}else if(i==="right"){const D=this._getYAxisLabelAlignment(p);v=D.textAlign,_=D.x}else if(n==="x"){if(i==="center")C=(e.top+e.bottom)/2+h;else if(z(i)){const D=Object.keys(i)[0],E=i[D];C=this.chart.scales[D].getPixelForValue(E)+h}v=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")_=(e.left+e.right)/2-h;else if(z(i)){const D=Object.keys(i)[0],E=i[D];_=this.chart.scales[D].getPixelForValue(E)}v=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(c==="start"?U="top":c==="end"&&(U="bottom"));const P=this._getLabelSizes();for(x=0,y=a.length;x<y;++x){w=a[x],S=w.label;const D=s.setContext(this.getContext(x));k=this.getPixelForTick(x)+s.labelOffset,M=this._resolveTickFontOptions(x),V=M.lineHeight,$=q(S)?S.length:1;const E=$/2,R=D.color,B=D.textStrokeColor,A=D.textStrokeWidth;let N=v;r?(_=k,v==="inner"&&(x===y-1?N=this.options.reverse?"left":"right":x===0?N=this.options.reverse?"right":"left":N="center"),i==="top"?d==="near"||m!==0?O=-$*V+V/2:d==="center"?O=-P.highest.height/2-E*V+V:O=-P.highest.height+V/2:d==="near"||m!==0?O=V/2:d==="center"?O=P.highest.height/2-E*V:O=P.highest.height-$*V,f&&(O*=-1),m!==0&&!D.showLabelBackdrop&&(_+=V/2*Math.sin(m))):(C=k,O=(1-$)*V/2);let j;if(D.showLabelBackdrop){const Y=ae(D.backdropPadding),Z=P.heights[x],J=P.widths[x];let re=O-Y.top,me=0-Y.left;switch(U){case"middle":re-=Z/2;break;case"bottom":re-=Z;break}switch(v){case"center":me-=J/2;break;case"right":me-=J;break;case"inner":x===y-1?me-=J:x>0&&(me-=J/2);break}j={left:me,top:re,width:J+Y.width,height:Z+Y.height,color:D.backdropColor}}b.push({label:S,font:M,textOffset:O,options:{rotation:m,color:R,strokeColor:B,strokeWidth:A,textAlign:N,textBaseline:U,translation:[_,C],backdrop:j}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-ve(this.labelRotation))return e==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:o,mirror:i,padding:s}}=this.options,r=this._getLabelSizes(),a=e+s,c=r.widest.width;let d,u;return n==="left"?i?(u=this.right+s,o==="near"?d="left":o==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-a,o==="near"?d="right":o==="center"?(d="center",u-=c/2):(d="left",u=this.left)):n==="right"?i?(u=this.left+s,o==="near"?d="right":o==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+a,o==="near"?d="left":o==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:o,top:i,width:s,height:r}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(o,i,s,r),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===e);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const n=this.options.grid,o=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,r;const a=(c,d,u)=>{!u.width||!u.color||(o.save(),o.lineWidth=u.width,o.strokeStyle=u.color,o.setLineDash(u.borderDash||[]),o.lineDashOffset=u.borderDashOffset,o.beginPath(),o.moveTo(c.x,c.y),o.lineTo(d.x,d.y),o.stroke(),o.restore())};if(n.display)for(s=0,r=i.length;s<r;++s){const c=i[s];n.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&a({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:e,ctx:n,options:{border:o,grid:i}}=this,s=o.setContext(this.getContext()),r=o.display?s.width:0;if(!r)return;const a=i.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,p;this.isHorizontal()?(d=ut(e,this.left,r)-r/2,u=ut(e,this.right,a)+a/2,f=p=c):(f=ut(e,this.top,r)-r/2,p=ut(e,this.bottom,a)+a/2,d=u=c),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(d,f),n.lineTo(u,p),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const o=this.ctx,i=this._computeLabelArea();i&&Dn(o,i);const s=this.getLabelItems(e);for(const r of s){const a=r.options,c=r.font,d=r.label,u=r.textOffset;ft(o,d,0,u,c,a)}i&&Vn(o)}drawTitle(){const{ctx:e,options:{position:n,title:o,reverse:i}}=this;if(!o.display)return;const s=oe(o.font),r=ae(o.padding),a=o.align;let c=s.lineHeight/2;n==="bottom"||n==="center"||z(n)?(c+=r.bottom,q(o.text)&&(c+=s.lineHeight*(o.text.length-1))):c+=r.top;const{titleX:d,titleY:u,maxWidth:f,rotation:p}=mf(this,c,n,a);ft(e,o.text,0,0,s,{color:o.color,maxWidth:f,rotation:p,textAlign:gf(a,n,i),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,o=T(e.grid&&e.grid.z,-1),i=T(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==_t.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:o,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),o=this.axis+"AxisID",i=[];let s,r;for(s=0,r=n.length;s<r;++s){const a=n[s];a[o]===this.id&&(!e||a.type===e)&&i.push(a)}return i}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return oe(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class jn{constructor(e,n,o){this.type=e,this.scope=n,this.override=o,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let o;_f(n)&&(o=this.register(n));const i=this.items,s=e.id,r=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in i||(i[s]=e,bf(e,r,o),this.override&&te.override(e.id,e.overrides)),r}get(e){return this.items[e]}unregister(e){const n=this.items,o=e.id,i=this.scope;o in n&&delete n[o],i&&o in te[i]&&(delete te[i][o],this.override&&delete dt[o])}}function bf(t,e,n){const o=Lt(Object.create(null),[n?te.get(n):{},te.get(e),t.defaults]);te.set(e,o),t.defaultRoutes&&yf(e,t.defaultRoutes),t.descriptors&&te.describe(e,t.descriptors)}function yf(t,e){Object.keys(e).forEach(n=>{const o=n.split("."),i=o.pop(),s=[t].concat(o).join("."),r=e[n].split("."),a=r.pop(),c=r.join(".");te.route(s,i,c,a)})}function _f(t){return"id"in t&&"defaults"in t}class xf{constructor(){this.controllers=new jn(Me,"datasets",!0),this.elements=new jn(Le,"elements"),this.plugins=new jn(Object,"plugins"),this.scales=new jn(_t,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,o){[...n].forEach(i=>{const s=o||this._getRegistryForType(i);o||s.isForType(i)||s===this.plugins&&i.id?this._exec(e,s,i):W(i,r=>{const a=o||this._getRegistryForType(r);this._exec(e,a,r)})})}_exec(e,n,o){const i=Eo(e);G(o["before"+i],[],o),n[e](o),G(o["after"+i],[],o)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const o=this._typedRegistries[n];if(o.isForType(e))return o}return this.plugins}_get(e,n,o){const i=n.get(e);if(i===void 0)throw new Error('"'+e+'" is not a registered '+o+".");return i}}var Re=new xf;class wf{constructor(){this._init=[]}notify(e,n,o,i){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const s=i?this._descriptors(e).filter(i):this._descriptors(e),r=this._notify(s,e,n,o);return n==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),r}_notify(e,n,o,i){i=i||{};for(const s of e){const r=s.plugin,a=r[o],c=[n,i,s.options];if(G(a,c,r)===!1&&i.cancelable)return!1}return!0}invalidate(){H(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const o=e&&e.config,i=T(o.options&&o.options.plugins,{}),s=Cf(o);return i===!1&&!n?[]:Sf(e,s,i,n)}_notifyStateChanges(e){const n=this._oldCache||[],o=this._cache,i=(s,r)=>s.filter(a=>!r.some(c=>a.plugin.id===c.plugin.id));this._notify(i(n,o),e,"stop"),this._notify(i(o,n),e,"start")}}function Cf(t){const e={},n=[],o=Object.keys(Re.plugins.items);for(let s=0;s<o.length;s++)n.push(Re.getPlugin(o[s]));const i=t.plugins||[];for(let s=0;s<i.length;s++){const r=i[s];n.indexOf(r)===-1&&(n.push(r),e[r.id]=!0)}return{plugins:n,localIds:e}}function kf(t,e){return!e&&t===!1?null:t===!0?{}:t}function Sf(t,{plugins:e,localIds:n},o,i){const s=[],r=t.getContext();for(const a of e){const c=a.id,d=kf(o[c],i);d!==null&&s.push({plugin:a,options:vf(t.config,{plugin:a,local:n[c]},d,r)})}return s}function vf(t,{plugin:e,local:n},o,i){const s=t.pluginScopeKeys(e),r=t.getOptionScopes(o,s);return n&&e.defaults&&r.push(e.defaults),t.createResolver(r,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Zo(t,e){const n=te.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Mf(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function Ef(t,e){return t===e?"_index_":"_value_"}function vr(t){if(t==="x"||t==="y"||t==="r")return t}function Df(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Jo(t,...e){if(vr(t))return t;for(const n of e){const o=n.axis||Df(n.position)||t.length>1&&vr(t[0].toLowerCase());if(o)return o}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Mr(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function Vf(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(o=>o.xAxisID===t||o.yAxisID===t);if(n.length)return Mr(t,"x",n[0])||Mr(t,"y",n[0])}return{}}function Rf(t,e){const n=dt[t.type]||{scales:{}},o=e.scales||{},i=Zo(t.type,e),s=Object.create(null);return Object.keys(o).forEach(r=>{const a=o[r];if(!z(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const c=Jo(r,a,Vf(r,t),te.scales[a.type]),d=Ef(c,i),u=n.scales||{};s[r]=Tt(Object.create(null),[{axis:c},a,u[c],u[d]])}),t.data.datasets.forEach(r=>{const a=r.type||t.type,c=r.indexAxis||Zo(a,e),u=(dt[a]||{}).scales||{};Object.keys(u).forEach(f=>{const p=Mf(f,c),h=r[p+"AxisID"]||p;s[h]=s[h]||Object.create(null),Tt(s[h],[{axis:p},o[h],u[f]])})}),Object.keys(s).forEach(r=>{const a=s[r];Tt(a,[te.scales[a.type],te.scale])}),s}function Er(t){const e=t.options||(t.options={});e.plugins=T(e.plugins,{}),e.scales=Rf(t,e)}function Dr(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Ff(t){return t=t||{},t.data=Dr(t.data),Er(t),t}const Vr=new Map,Rr=new Set;function Wn(t,e){let n=Vr.get(t);return n||(n=e(),Vr.set(t,n),Rr.add(n)),n}const on=(t,e,n)=>{const o=Ke(e,n);o!==void 0&&t.add(o)};class Bf{constructor(e){this._config=Ff(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Dr(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Er(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Wn(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Wn(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Wn(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,o=this.type;return Wn(`${o}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const o=this._scopeCache;let i=o.get(e);return(!i||n)&&(i=new Map,o.set(e,i)),i}getOptionScopes(e,n,o){const{options:i,type:s}=this,r=this._cachedScopes(e,o),a=r.get(n);if(a)return a;const c=new Set;n.forEach(u=>{e&&(c.add(e),u.forEach(f=>on(c,e,f))),u.forEach(f=>on(c,i,f)),u.forEach(f=>on(c,dt[s]||{},f)),u.forEach(f=>on(c,te,f)),u.forEach(f=>on(c,Po,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Rr.has(n)&&r.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,dt[n]||{},te.datasets[n]||{},{type:n},te,Po]}resolveNamedOptions(e,n,o,i=[""]){const s={$shared:!0},{resolver:r,subPrefixes:a}=Fr(this._resolverCache,e,i);let c=r;if(Pf(r,n)){s.$shared=!1,o=Ze(o)?o():o;const d=this.createResolver(e,o,a);c=Dt(r,o,d)}for(const d of n)s[d]=c[d];return s}createResolver(e,n,o=[""],i){const{resolver:s}=Fr(this._resolverCache,e,o);return z(n)?Dt(s,n,void 0,i):s}}function Fr(t,e,n){let o=t.get(e);o||(o=new Map,t.set(e,o));const i=n.join();let s=o.get(i);return s||(s={resolver:Io(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},o.set(i,s)),s}const $f=t=>z(t)&&Object.getOwnPropertyNames(t).some(e=>Ze(t[e]));function Pf(t,e){const{isScriptable:n,isIndexable:o}=$s(t);for(const i of e){const s=n(i),r=o(i),a=(r||s)&&t[i];if(s&&(Ze(a)||$f(a))||r&&q(a))return!0}return!1}var Af="4.4.1";const Of=["top","bottom","left","right","chartArea"];function Br(t,e){return t==="top"||t==="bottom"||Of.indexOf(t)===-1&&e==="x"}function $r(t,e){return function(n,o){return n[t]===o[t]?n[e]-o[e]:n[t]-o[t]}}function Pr(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),G(n&&n.onComplete,[t],e)}function Nf(t){const e=t.chart,n=e.options.animation;G(n&&n.onProgress,[t],e)}function Ar(t){return zo()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Yn={},Or=t=>{const e=Ar(t);return Object.values(Yn).filter(n=>n.canvas===e).pop()};function If(t,e,n){const o=Object.keys(t);for(const i of o){const s=+i;if(s>=e){const r=t[i];delete t[i],(n>0||s>e)&&(t[s+n]=r)}}}function Lf(t,e,n,o){return!n||t.type==="mouseout"?null:o?e:t}function Gn(t,e,n){return t.options.clip?t[n]:e[n]}function Tf(t,e){const{xScale:n,yScale:o}=t;return n&&o?{left:Gn(n,e,"left"),right:Gn(n,e,"right"),top:Gn(o,e,"top"),bottom:Gn(o,e,"bottom")}:e}class Te{static register(...e){Re.add(...e),Nr()}static unregister(...e){Re.remove(...e),Nr()}constructor(e,n){const o=this.config=new Bf(n),i=Ar(e),s=Or(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const r=o.createResolver(o.chartOptionScopes(),this.getContext());this.platform=new(o.platform||nf(i)),this.platform.updateConfig(o);const a=this.platform.acquireContext(i,r.aspectRatio),c=a&&a.canvas,d=c&&c.height,u=c&&c.width;if(this.id=zc(),this.ctx=a,this.canvas=c,this.width=u,this.height=d,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new wf,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=od(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],Yn[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Ie.listen(this,"complete",Pr),Ie.listen(this,"progress",Nf),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:o,height:i,_aspectRatio:s}=this;return H(e)?n&&s?s:i?o/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Re}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():zs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Rs(this.canvas,this.ctx),this}stop(){return Ie.stop(this),this}resize(e,n){Ie.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const o=this.options,i=this.canvas,s=o.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(i,e,n,s),a=o.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,zs(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),G(o.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};W(n,(o,i)=>{o.id=i})}buildOrUpdateScales(){const e=this.options,n=e.scales,o=this.scales,i=Object.keys(o).reduce((r,a)=>(r[a]=!1,r),{});let s=[];n&&(s=s.concat(Object.keys(n).map(r=>{const a=n[r],c=Jo(r,a),d=c==="r",u=c==="x";return{options:a,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),W(s,r=>{const a=r.options,c=a.id,d=Jo(c,a),u=T(a.type,r.dtype);(a.position===void 0||Br(a.position,d)!==Br(r.dposition))&&(a.position=r.dposition),i[c]=!0;let f=null;if(c in o&&o[c].type===u)f=o[c];else{const p=Re.getScale(u);f=new p({id:c,type:u,ctx:this.ctx,chart:this}),o[f.id]=f}f.init(a,e)}),W(i,(r,a)=>{r||delete o[a]}),W(o,r=>{ce.configure(this,r,r.options),ce.addBox(this,r)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,o=e.length;if(e.sort((i,s)=>i.index-s.index),o>n){for(let i=n;i<o;++i)this._destroyDatasetMeta(i);e.splice(n,o-n)}this._sortedMetasets=e.slice(0).sort($r("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((o,i)=>{n.filter(s=>s===o._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let o,i;for(this._removeUnreferencedMetasets(),o=0,i=n.length;o<i;o++){const s=n[o];let r=this.getDatasetMeta(o);const a=s.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(o),r=this.getDatasetMeta(o)),r.type=a,r.indexAxis=s.indexAxis||Zo(a,this.options),r.order=s.order||0,r.index=o,r.label=""+s.label,r.visible=this.isDatasetVisible(o),r.controller)r.controller.updateIndex(o),r.controller.linkScales();else{const c=Re.getController(a),{datasetElementType:d,dataElementType:u}=te.datasets[a];Object.assign(c,{dataElementType:Re.getElement(u),datasetElementType:d&&Re.getElement(d)}),r.controller=new c(this,o),e.push(r.controller)}}return this._updateMetasets(),e}_resetElements(){W(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const o=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!o.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),p=!i&&s.indexOf(f)===-1;f.buildOrUpdateElements(p),r=Math.max(+f.getMaxOverflow(),r)}r=this._minPadding=o.layout.autoPadding?r:0,this._updateLayout(r),i||W(s,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort($r("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){W(this.scales,e=>{ce.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),o=new Set(e.events);(!fs(n,o)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:o,start:i,count:s}of n){const r=o==="_removeElements"?-s:s;If(e,i,r)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,o=s=>new Set(e.filter(r=>r[0]===s).map((r,a)=>a+","+r.splice(1).join(","))),i=o(0);for(let s=1;s<n;s++)if(!fs(i,o(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ce.update(this,this.width,this.height,e);const n=this.chartArea,o=n.width<=0||n.height<=0;this._layers=[],W(this.boxes,i=>{o&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,o=this.data.datasets.length;n<o;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,o=this.data.datasets.length;n<o;++n)this._updateDataset(n,Ze(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const o=this.getDatasetMeta(e),i={meta:o,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(o.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ie.has(this)?this.attached&&!Ie.running(this)&&Ie.start(this):(this.draw(),Pr({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:o,height:i}=this._resizeBeforeDraw;this._resize(o,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,o=[];let i,s;for(i=0,s=n.length;i<s;++i){const r=n[i];(!e||r.visible)&&o.push(r)}return o}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,o=e._clip,i=!o.disabled,s=Tf(e,this.chartArea),r={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Dn(n,{left:o.left===!1?0:s.left-o.left,right:o.right===!1?this.width:s.right+o.right,top:o.top===!1?0:s.top-o.top,bottom:o.bottom===!1?this.height:s.bottom+o.bottom}),e.controller.draw(),i&&Vn(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return Ne(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,o,i){const s=Au.modes[n];return typeof s=="function"?s(this,e,o,i):[]}getDatasetMeta(e){const n=this.data.datasets[e],o=this._metasets;let i=o.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},o.push(i)),i}getContext(){return this.$context||(this.$context=Qe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const o=this.getDatasetMeta(e);return typeof o.hidden=="boolean"?!o.hidden:!n.hidden}setDatasetVisibility(e,n){const o=this.getDatasetMeta(e);o.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,o){const i=o?"show":"hide",s=this.getDatasetMeta(e),r=s.controller._resolveAnimations(void 0,i);zt(n)?(s.data[n].hidden=!o,this.update()):(this.setDatasetVisibility(e,o),r.update(s,{visible:o}),this.update(a=>a.datasetIndex===e?i:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Ie.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Rs(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Yn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,o=(s,r)=>{n.addEventListener(this,s,r),e[s]=r},i=(s,r,a)=>{s.offsetX=r,s.offsetY=a,this._eventHandler(s)};W(this.options.events,s=>o(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,o=(c,d)=>{n.addEventListener(this,c,d),e[c]=d},i=(c,d)=>{e[c]&&(n.removeEventListener(this,c,d),delete e[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let r;const a=()=>{i("attach",a),this.attached=!0,this.resize(),o("resize",s),o("detach",r)};r=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),o("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){W(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},W(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,o){const i=o?"set":"remove";let s,r,a,c;for(n==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,c=e.length;a<c;++a){r=e[a];const d=r&&this.getDatasetMeta(r.datasetIndex).controller;d&&d[i+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],o=e.map(({datasetIndex:s,index:r})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[r],index:r}});!Cn(o,n)&&(this._active=o,this._lastEvent=null,this._updateHoverStyles(o,n))}notifyPlugins(e,n,o){return this._plugins.notify(this,e,n,o)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,o){const i=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),r=s(n,e),a=o?e:s(e,n);r.length&&this.updateHoverStyle(r,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(e,n){const o={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},i=r=>(r.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",o,i)===!1)return;const s=this._handleEvent(e,n,o.inChartArea);return o.cancelable=!1,this.notifyPlugins("afterEvent",o,i),(s||o.changed)&&this.render(),this}_handleEvent(e,n,o){const{_active:i=[],options:s}=this,r=n,a=this._getActiveElements(e,i,o,r),c=Uc(e),d=Lf(e,this._lastEvent,o,c);o&&(this._lastEvent=null,G(s.onHover,[e,a,this],this),c&&G(s.onClick,[e,a,this],this));const u=!Cn(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=d,u}_getActiveElements(e,n,o,i){if(e.type==="mouseout")return[];if(!o)return n;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,i)}}F(Te,"defaults",te),F(Te,"instances",Yn),F(Te,"overrides",dt),F(Te,"registry",Re),F(Te,"version",Af),F(Te,"getChart",Or);function Nr(){return W(Te.instances,t=>t._plugins.invalidate())}function zf(t,e,n){const{startAngle:o,pixelMargin:i,x:s,y:r,outerRadius:a,innerRadius:c}=e;let d=i/a;t.beginPath(),t.arc(s,r,a,o-d,n+d),c>i?(d=i/c,t.arc(s,r,c,n+d,o-d,!0)):t.arc(s,r,i,n+ne,o-ne),t.closePath(),t.clip()}function Hf(t){return No(t,["outerStart","outerEnd","innerStart","innerEnd"])}function jf(t,e,n,o){const i=Hf(t.options.borderRadius),s=(n-e)/2,r=Math.min(s,o*e/2),a=c=>{const d=(n-Math.min(s,c))*o/2;return se(c,0,Math.min(s,d))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:se(i.innerStart,0,r),innerEnd:se(i.innerEnd,0,r)}}function Ft(t,e,n,o){return{x:n+t*Math.cos(e),y:o+t*Math.sin(e)}}function Un(t,e,n,o,i,s){const{x:r,y:a,startAngle:c,pixelMargin:d,innerRadius:u}=e,f=Math.max(e.outerRadius+o+n-d,0),p=u>0?u+o+n+d:0;let h=0;const g=i-c;if(o){const D=u>0?u-o:0,E=f>0?f-o:0,R=(D+E)/2,B=R!==0?g*R/(R+o):g;h=(g-B)/2}const m=Math.max(.001,g*f-n/X)/f,b=(g-m)/2,x=c+b+h,y=i-b-h,{outerStart:w,outerEnd:S,innerStart:_,innerEnd:C}=jf(e,p,f,y-x),v=f-w,k=f-S,M=x+w/v,V=y-S/k,$=p+_,O=p+C,U=x+_/$,P=y-C/O;if(t.beginPath(),s){const D=(M+V)/2;if(t.arc(r,a,f,M,D),t.arc(r,a,f,D,V),S>0){const A=Ft(k,V,r,a);t.arc(A.x,A.y,S,V,y+ne)}const E=Ft(O,y,r,a);if(t.lineTo(E.x,E.y),C>0){const A=Ft(O,P,r,a);t.arc(A.x,A.y,C,y+ne,P+Math.PI)}const R=(y-C/p+(x+_/p))/2;if(t.arc(r,a,p,y-C/p,R,!0),t.arc(r,a,p,R,x+_/p,!0),_>0){const A=Ft($,U,r,a);t.arc(A.x,A.y,_,U+Math.PI,x-ne)}const B=Ft(v,x,r,a);if(t.lineTo(B.x,B.y),w>0){const A=Ft(v,M,r,a);t.arc(A.x,A.y,w,x-ne,M)}}else{t.moveTo(r,a);const D=Math.cos(M)*f+r,E=Math.sin(M)*f+a;t.lineTo(D,E);const R=Math.cos(V)*f+r,B=Math.sin(V)*f+a;t.lineTo(R,B)}t.closePath()}function Wf(t,e,n,o,i){const{fullCircles:s,startAngle:r,circumference:a}=e;let c=e.endAngle;if(s){Un(t,e,n,o,c,i);for(let d=0;d<s;++d)t.fill();isNaN(a)||(c=r+(a%K||K))}return Un(t,e,n,o,c,i),t.fill(),c}function Yf(t,e,n,o,i){const{fullCircles:s,startAngle:r,circumference:a,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:p}=c,h=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=p,h?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let g=e.endAngle;if(s){Un(t,e,n,o,g,i);for(let m=0;m<s;++m)t.stroke();isNaN(a)||(g=r+(a%K||K))}h&&zf(t,e,g),s||(Un(t,e,n,o,g,i),t.stroke())}class sn extends Le{constructor(n){super();F(this,"circumference");F(this,"endAngle");F(this,"fullCircles");F(this,"innerRadius");F(this,"outerRadius");F(this,"pixelMargin");F(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,n&&Object.assign(this,n)}inRange(n,o,i){const s=this.getProps(["x","y"],i),{angle:r,distance:a}=bs(s,{x:n,y:o}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),h=(this.options.spacing+this.options.borderWidth)/2,m=T(p,d-c)>=K||jt(r,c,d),b=Ae(a,u+h,f+h);return m&&b}getCenterPoint(n){const{x:o,y:i,startAngle:s,endAngle:r,innerRadius:a,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:d,spacing:u}=this.options,f=(s+r)/2,p=(a+c+u+d)/2;return{x:o+Math.cos(f)*p,y:i+Math.sin(f)*p}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:o,circumference:i}=this,s=(o.offset||0)/4,r=(o.spacing||0)/2,a=o.circular;if(this.pixelMargin=o.borderAlign==="inner"?.33:0,this.fullCircles=i>K?Math.floor(i/K):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(X,i||0)),u=s*d;n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,Wf(n,this,u,r,a),Yf(n,this,u,r,a),n.restore()}}F(sn,"id","arc"),F(sn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),F(sn,"defaultRoutes",{backgroundColor:"backgroundColor"}),F(sn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Ir(t,e,n=e){t.lineCap=T(n.borderCapStyle,e.borderCapStyle),t.setLineDash(T(n.borderDash,e.borderDash)),t.lineDashOffset=T(n.borderDashOffset,e.borderDashOffset),t.lineJoin=T(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=T(n.borderWidth,e.borderWidth),t.strokeStyle=T(n.borderColor,e.borderColor)}function Gf(t,e,n){t.lineTo(n.x,n.y)}function Uf(t){return t.stepped?gd:t.tension||t.cubicInterpolationMode==="monotone"?md:Gf}function Lr(t,e,n={}){const o=t.length,{start:i=0,end:s=o-1}=n,{start:r,end:a}=e,c=Math.max(i,r),d=Math.min(s,a),u=i<r&&s<r||i>a&&s>a;return{count:o,start:c,loop:e.loop,ilen:d<c&&!u?o+d-c:d-c}}function qf(t,e,n,o){const{points:i,options:s}=e,{count:r,start:a,loop:c,ilen:d}=Lr(i,n,o),u=Uf(s);let{move:f=!0,reverse:p}=o||{},h,g,m;for(h=0;h<=d;++h)g=i[(a+(p?d-h:h))%r],!g.skip&&(f?(t.moveTo(g.x,g.y),f=!1):u(t,m,g,p,s.stepped),m=g);return c&&(g=i[(a+(p?d:0))%r],u(t,m,g,p,s.stepped)),!!c}function Xf(t,e,n,o){const i=e.points,{count:s,start:r,ilen:a}=Lr(i,n,o),{move:c=!0,reverse:d}=o||{};let u=0,f=0,p,h,g,m,b,x;const y=S=>(r+(d?a-S:S))%s,w=()=>{m!==b&&(t.lineTo(u,b),t.lineTo(u,m),t.lineTo(u,x))};for(c&&(h=i[y(0)],t.moveTo(h.x,h.y)),p=0;p<=a;++p){if(h=i[y(p)],h.skip)continue;const S=h.x,_=h.y,C=S|0;C===g?(_<m?m=_:_>b&&(b=_),u=(f*u+S)/++f):(w(),t.lineTo(S,_),g=C,f=0,m=b=_),x=_}w()}function Qo(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?Xf:qf}function Kf(t){return t.stepped?qd:t.tension||t.cubicInterpolationMode==="monotone"?Xd:mt}function Zf(t,e,n,o){let i=e._path;i||(i=e._path=new Path2D,e.path(i,n,o)&&i.closePath()),Ir(t,e.options),t.stroke(i)}function Jf(t,e,n,o){const{segments:i,options:s}=e,r=Qo(e);for(const a of i)Ir(t,s,a.style),t.beginPath(),r(t,e,a,{start:n,end:n+o-1})&&t.closePath(),t.stroke()}const Qf=typeof Path2D=="function";function eh(t,e,n,o){Qf&&!e.options.segment?Zf(t,e,n,o):Jf(t,e,n,o)}class et extends Le{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,n){const o=this.options;if((o.tension||o.cubicInterpolationMode==="monotone")&&!o.stepped&&!this._pointsUpdated){const i=o.spanGaps?this._loop:this._fullLoop;Td(this._points,o,e,i,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=tu(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,o=e.length;return o&&n[e[o-1].end]}interpolate(e,n){const o=this.options,i=e[n],s=this.points,r=qs(this,{property:n,start:i,end:i});if(!r.length)return;const a=[],c=Kf(o);let d,u;for(d=0,u=r.length;d<u;++d){const{start:f,end:p}=r[d],h=s[f],g=s[p];if(h===g){a.push(h);continue}const m=Math.abs((i-h[n])/(g[n]-h[n])),b=c(h,g,m,o.stepped);b[n]=e[n],a.push(b)}return a.length===1?a[0]:a}pathSegment(e,n,o){return Qo(this)(e,this,n,o)}path(e,n,o){const i=this.segments,s=Qo(this);let r=this._loop;n=n||0,o=o||this.points.length-n;for(const a of i)r&=s(e,this,a,{start:n,end:n+o-1});return!!r}draw(e,n,o,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),eh(e,this,o,i),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}F(et,"id","line"),F(et,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),F(et,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),F(et,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Tr(t,e,n,o){const i=t.options,{[n]:s}=t.getProps([n],o);return Math.abs(e-s)<i.radius+i.hitRadius}class qn extends Le{constructor(n){super();F(this,"parsed");F(this,"skip");F(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,o,i){const s=this.options,{x:r,y:a}=this.getProps(["x","y"],i);return Math.pow(n-r,2)+Math.pow(o-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,o){return Tr(this,n,"x",o)}inYRange(n,o){return Tr(this,n,"y",o)}getCenterPoint(n){const{x:o,y:i}=this.getProps(["x","y"],n);return{x:o,y:i}}size(n){n=n||this.options||{};let o=n.radius||0;o=Math.max(o,o&&n.hoverRadius||0);const i=o&&n.borderWidth||0;return(o+i)*2}draw(n,o){const i=this.options;this.skip||i.radius<.1||!Ne(this,o,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Oo(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}F(qn,"id","point"),F(qn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),F(qn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function zr(t,e){const{x:n,y:o,base:i,width:s,height:r}=t.getProps(["x","y","base","width","height"],e);let a,c,d,u,f;return t.horizontal?(f=r/2,a=Math.min(n,i),c=Math.max(n,i),d=o-f,u=o+f):(f=s/2,a=n-f,c=n+f,d=Math.min(o,i),u=Math.max(o,i)),{left:a,top:d,right:c,bottom:u}}function tt(t,e,n,o){return t?0:se(e,n,o)}function th(t,e,n){const o=t.options.borderWidth,i=t.borderSkipped,s=Bs(o);return{t:tt(i.top,s.top,0,n),r:tt(i.right,s.right,0,e),b:tt(i.bottom,s.bottom,0,n),l:tt(i.left,s.left,0,e)}}function nh(t,e,n){const{enableBorderRadius:o}=t.getProps(["enableBorderRadius"]),i=t.options.borderRadius,s=ht(i),r=Math.min(e,n),a=t.borderSkipped,c=o||z(i);return{topLeft:tt(!c||a.top||a.left,s.topLeft,0,r),topRight:tt(!c||a.top||a.right,s.topRight,0,r),bottomLeft:tt(!c||a.bottom||a.left,s.bottomLeft,0,r),bottomRight:tt(!c||a.bottom||a.right,s.bottomRight,0,r)}}function oh(t){const e=zr(t),n=e.right-e.left,o=e.bottom-e.top,i=th(t,n/2,o/2),s=nh(t,n/2,o/2);return{outer:{x:e.left,y:e.top,w:n,h:o,radius:s},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:o-i.t-i.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,s.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(i.b,i.r))}}}}function ei(t,e,n,o){const i=e===null,s=n===null,a=t&&!(i&&s)&&zr(t,o);return a&&(i||Ae(e,a.left,a.right))&&(s||Ae(n,a.top,a.bottom))}function ih(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function sh(t,e){t.rect(e.x,e.y,e.w,e.h)}function ti(t,e,n={}){const o=t.x!==n.x?-e:0,i=t.y!==n.y?-e:0,s=(t.x+t.w!==n.x+n.w?e:0)-o,r=(t.y+t.h!==n.y+n.h?e:0)-i;return{x:t.x+o,y:t.y+i,w:t.w+s,h:t.h+r,radius:t.radius}}class Xn extends Le{constructor(e){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,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:o,backgroundColor:i}}=this,{inner:s,outer:r}=oh(this),a=ih(r.radius)?Ut:sh;e.save(),(r.w!==s.w||r.h!==s.h)&&(e.beginPath(),a(e,ti(r,n,s)),e.clip(),a(e,ti(s,-n,r)),e.fillStyle=o,e.fill("evenodd")),e.beginPath(),a(e,ti(s,n)),e.fillStyle=i,e.fill(),e.restore()}inRange(e,n,o){return ei(this,e,n,o)}inXRange(e,n){return ei(this,e,null,n)}inYRange(e,n){return ei(this,null,e,n)}getCenterPoint(e){const{x:n,y:o,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(n+i)/2:n,y:s?o:(o+i)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}F(Xn,"id","bar"),F(Xn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),F(Xn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var rh=Object.freeze({__proto__:null,ArcElement:sn,BarElement:Xn,LineElement:et,PointElement:qn});const ni=["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)"],Hr=ni.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function jr(t){return ni[t%ni.length]}function Wr(t){return Hr[t%Hr.length]}function lh(t,e){return t.borderColor=jr(e),t.backgroundColor=Wr(e),++e}function ah(t,e){return t.backgroundColor=t.data.map(()=>jr(e++)),e}function ch(t,e){return t.backgroundColor=t.data.map(()=>Wr(e++)),e}function dh(t){let e=0;return(n,o)=>{const i=t.getDatasetMeta(o).controller;i instanceof bt?e=ah(n,e):i instanceof Kt?e=ch(n,e):i&&(e=lh(n,e))}}function Yr(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function uh(t){return t&&(t.borderColor||t.backgroundColor)}var fh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:o},options:i}=t.config,{elements:s}=i;if(!n.forceOverride&&(Yr(o)||uh(i)||s&&Yr(s)))return;const r=dh(t);o.forEach(r)}};function hh(t,e,n,o,i){const s=i.samples||o;if(s>=n)return t.slice(e,e+n);const r=[],a=(n-2)/(s-2);let c=0;const d=e+n-1;let u=e,f,p,h,g,m;for(r[c++]=t[u],f=0;f<s-2;f++){let b=0,x=0,y;const w=Math.floor((f+1)*a)+1+e,S=Math.min(Math.floor((f+2)*a)+1,n)+e,_=S-w;for(y=w;y<S;y++)b+=t[y].x,x+=t[y].y;b/=_,x/=_;const C=Math.floor(f*a)+1+e,v=Math.min(Math.floor((f+1)*a)+1,n)+e,{x:k,y:M}=t[u];for(h=g=-1,y=C;y<v;y++)g=.5*Math.abs((k-b)*(t[y].y-M)-(k-t[y].x)*(x-M)),g>h&&(h=g,p=t[y],m=y);r[c++]=p,u=m}return r[c++]=t[d],r}function ph(t,e,n,o){let i=0,s=0,r,a,c,d,u,f,p,h,g,m;const b=[],x=e+n-1,y=t[e].x,S=t[x].x-y;for(r=e;r<e+n;++r){a=t[r],c=(a.x-y)/S*o,d=a.y;const _=c|0;if(_===u)d<g?(g=d,f=r):d>m&&(m=d,p=r),i=(s*i+a.x)/++s;else{const C=r-1;if(!H(f)&&!H(p)){const v=Math.min(f,p),k=Math.max(f,p);v!==h&&v!==C&&b.push({...t[v],x:i}),k!==h&&k!==C&&b.push({...t[k],x:i})}r>0&&C!==h&&b.push(t[C]),b.push(a),u=_,s=0,g=m=d,f=p=h=r}}return b}function Gr(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Ur(t){t.data.datasets.forEach(e=>{Gr(e)})}function gh(t,e){const n=e.length;let o=0,i;const{iScale:s}=t,{min:r,max:a,minDefined:c,maxDefined:d}=s.getUserBounds();return c&&(o=se(Oe(e,s.axis,r).lo,0,n-1)),d?i=se(Oe(e,s.axis,a).hi+1,o,n)-o:i=n-o,{start:o,count:i}}var mh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){Ur(t);return}const o=t.width;t.data.datasets.forEach((i,s)=>{const{_data:r,indexAxis:a}=i,c=t.getDatasetMeta(s),d=r||i.data;if(qt([a,t.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=t.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:f,count:p}=gh(c,d);const h=n.threshold||4*o;if(p<=h){Gr(i);return}H(r)&&(i._data=d,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(n.algorithm){case"lttb":g=hh(d,f,p,o,n);break;case"min-max":g=ph(d,f,p,o);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=g})},destroy(t){Ur(t)}};function bh(t,e,n){const o=t.segments,i=t.points,s=e.points,r=[];for(const a of o){let{start:c,end:d}=a;d=ii(c,d,i);const u=oi(n,i[c],i[d],a.loop);if(!e.segments){r.push({source:a,target:u,start:i[c],end:i[d]});continue}const f=qs(e,u);for(const p of f){const h=oi(n,s[p.start],s[p.end],p.loop),g=Us(a,i,h);for(const m of g)r.push({source:m,target:p,start:{[n]:qr(u,h,"start",Math.max)},end:{[n]:qr(u,h,"end",Math.min)}})}}return r}function oi(t,e,n,o){if(o)return;let i=e[t],s=n[t];return t==="angle"&&(i=_e(i),s=_e(s)),{property:t,start:i,end:s}}function yh(t,e){const{x:n=null,y:o=null}=t||{},i=e.points,s=[];return e.segments.forEach(({start:r,end:a})=>{a=ii(r,a,i);const c=i[r],d=i[a];o!==null?(s.push({x:c.x,y:o}),s.push({x:d.x,y:o})):n!==null&&(s.push({x:n,y:c.y}),s.push({x:n,y:d.y}))}),s}function ii(t,e,n){for(;e>t;e--){const o=n[e];if(!isNaN(o.x)&&!isNaN(o.y))break}return e}function qr(t,e,n,o){return t&&e?o(t[n],e[n]):t?t[n]:e?e[n]:0}function Xr(t,e){let n=[],o=!1;return q(t)?(o=!0,n=t):n=yh(t,e),n.length?new et({points:n,options:{tension:0},_loop:o,_fullLoop:o}):null}function Kr(t){return t&&t.fill!==!1}function _h(t,e,n){let i=t[e].fill;const s=[e];let r;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!ee(i))return i;if(r=t[i],!r)return!1;if(r.visible)return i;s.push(i),i=r.fill}return!1}function xh(t,e,n){const o=Sh(t);if(z(o))return isNaN(o.value)?!1:o;let i=parseFloat(o);return ee(i)&&Math.floor(i)===i?wh(o[0],e,i,n):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}function wh(t,e,n,o){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=o?!1:n}function Ch(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:z(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function kh(t,e,n){let o;return t==="start"?o=n:t==="end"?o=e.options.reverse?e.min:e.max:z(t)?o=t.value:o=e.getBaseValue(),o}function Sh(t){const e=t.options,n=e.fill;let o=T(n&&n.target,n);return o===void 0&&(o=!!e.backgroundColor),o===!1||o===null?!1:o===!0?"origin":o}function vh(t){const{scale:e,index:n,line:o}=t,i=[],s=o.segments,r=o.points,a=Mh(e,n);a.push(Xr({x:null,y:e.bottom},o));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)Eh(i,r[u],a)}return new et({points:i,options:{}})}function Mh(t,e){const n=[],o=t.getMatchingVisibleMetas("line");for(let i=0;i<o.length;i++){const s=o[i];if(s.index===e)break;s.hidden||n.unshift(s.dataset)}return n}function Eh(t,e,n){const o=[];for(let i=0;i<n.length;i++){const s=n[i],{first:r,last:a,point:c}=Dh(s,e,"x");if(!(!c||r&&a)){if(r)o.unshift(c);else if(t.push(c),!a)break}}t.push(...o)}function Dh(t,e,n){const o=t.interpolate(e,n);if(!o)return{};const i=o[n],s=t.segments,r=t.points;let a=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],f=r[u.start][n],p=r[u.end][n];if(Ae(i,f,p)){a=i===f,c=i===p;break}}return{first:a,last:c,point:o}}class Zr{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,o){const{x:i,y:s,radius:r}=this;return n=n||{start:0,end:K},e.arc(i,s,r,n.end,n.start,!0),!o.bounds}interpolate(e){const{x:n,y:o,radius:i}=this,s=e.angle;return{x:n+Math.cos(s)*i,y:o+Math.sin(s)*i,angle:s}}}function Vh(t){const{chart:e,fill:n,line:o}=t;if(ee(n))return Rh(e,n);if(n==="stack")return vh(t);if(n==="shape")return!0;const i=Fh(t);return i instanceof Zr?i:Xr(i,o)}function Rh(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function Fh(t){return(t.scale||{}).getPointPositionForValue?$h(t):Bh(t)}function Bh(t){const{scale:e={},fill:n}=t,o=Ch(n,e);if(ee(o)){const i=e.isHorizontal();return{x:i?o:null,y:i?null:o}}return null}function $h(t){const{scale:e,fill:n}=t,o=e.options,i=e.getLabels().length,s=o.reverse?e.max:e.min,r=kh(n,e,s),a=[];if(o.grid.circular){const c=e.getPointPositionForValue(0,s);return new Zr({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(r)})}for(let c=0;c<i;++c)a.push(e.getPointPositionForValue(c,r));return a}function si(t,e,n){const o=Vh(e),{line:i,scale:s,axis:r}=e,a=i.options,c=a.fill,d=a.backgroundColor,{above:u=d,below:f=d}=c||{};o&&i.points.length&&(Dn(t,n),Ph(t,{line:i,target:o,above:u,below:f,area:n,scale:s,axis:r}),Vn(t))}function Ph(t,e){const{line:n,target:o,above:i,below:s,area:r,scale:a}=e,c=n._loop?"angle":e.axis;t.save(),c==="x"&&s!==i&&(Jr(t,o,r.top),Qr(t,{line:n,target:o,color:i,scale:a,property:c}),t.restore(),t.save(),Jr(t,o,r.bottom)),Qr(t,{line:n,target:o,color:s,scale:a,property:c}),t.restore()}function Jr(t,e,n){const{segments:o,points:i}=e;let s=!0,r=!1;t.beginPath();for(const a of o){const{start:c,end:d}=a,u=i[c],f=i[ii(c,d,i)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(f.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Qr(t,e){const{line:n,target:o,property:i,color:s,scale:r}=e,a=bh(n,o,i);for(const{source:c,target:d,start:u,end:f}of a){const{style:{backgroundColor:p=s}={}}=c,h=o!==!0;t.save(),t.fillStyle=p,Ah(t,r,h&&oi(i,u,f)),t.beginPath();const g=!!n.pathSegment(t,c);let m;if(h){g?t.closePath():el(t,o,f,i);const b=!!o.pathSegment(t,d,{move:g,reverse:!0});m=g&&b,m||el(t,o,u,i)}t.closePath(),t.fill(m?"evenodd":"nonzero"),t.restore()}}function Ah(t,e,n){const{top:o,bottom:i}=e.chart.chartArea,{property:s,start:r,end:a}=n||{};s==="x"&&(t.beginPath(),t.rect(r,o,a-r,i-o),t.clip())}function el(t,e,n,o){const i=e.interpolate(n,o);i&&t.lineTo(i.x,i.y)}var Oh={id:"filler",afterDatasetsUpdate(t,e,n){const o=(t.data.datasets||[]).length,i=[];let s,r,a,c;for(r=0;r<o;++r)s=t.getDatasetMeta(r),a=s.dataset,c=null,a&&a.options&&a instanceof et&&(c={visible:t.isDatasetVisible(r),index:r,fill:xh(a,r,o),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=c,i.push(c);for(r=0;r<o;++r)c=i[r],!(!c||c.fill===!1)&&(c.fill=_h(i,r,n.propagate))},beforeDraw(t,e,n){const o=n.drawTime==="beforeDraw",i=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;a&&(a.line.updateControlPoints(s,a.axis),o&&a.fill&&si(t.ctx,a,s))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const o=t.getSortedVisibleDatasetMetas();for(let i=o.length-1;i>=0;--i){const s=o[i].$filler;Kr(s)&&si(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,e,n){const o=e.meta.$filler;!Kr(o)||n.drawTime!=="beforeDatasetDraw"||si(t.ctx,o,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const tl=(t,e)=>{let{boxHeight:n=e,boxWidth:o=e}=t;return t.usePointStyle&&(n=Math.min(n,e),o=t.pointStyleWidth||Math.min(o,e)),{boxWidth:o,boxHeight:n,itemHeight:Math.max(e,n)}},Nh=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class nl extends Le{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n,o){this.maxWidth=e,this.maxHeight=n,this._margins=o,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 e=this.options.labels||{};let n=G(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(o=>e.filter(o,this.chart.data))),e.sort&&(n=n.sort((o,i)=>e.sort(o,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const o=e.labels,i=oe(o.font),s=i.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=tl(o,s);let d,u;n.font=i.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(r,s,a,c)+10):(u=this.maxHeight,d=this._fitCols(r,i,a,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,o,i){const{ctx:s,maxWidth:r,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=i+a;let f=e;s.textAlign="left",s.textBaseline="middle";let p=-1,h=-u;return this.legendItems.forEach((g,m)=>{const b=o+n/2+s.measureText(g.text).width;(m===0||d[d.length-1]+b+2*a>r)&&(f+=u,d[d.length-(m>0?0:1)]=0,h+=u,p++),c[m]={left:0,top:h,row:p,width:b,height:i},d[d.length-1]+=b+a}),f}_fitCols(e,n,o,i){const{ctx:s,maxHeight:r,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=r-e;let f=a,p=0,h=0,g=0,m=0;return this.legendItems.forEach((b,x)=>{const{itemWidth:y,itemHeight:w}=Ih(o,n,s,b,i);x>0&&h+w+2*a>u&&(f+=p+a,d.push({width:p,height:h}),g+=p+a,m++,p=h=0),c[x]={left:g,top:h,col:m,width:y,height:w},p=Math.max(p,y),h+=w+a}),f+=p,d.push({width:p,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:o,labels:{padding:i},rtl:s}}=this,r=Rt(s,this.left,this.width);if(this.isHorizontal()){let a=0,c=le(o,this.left+i,this.right-this.lineWidths[a]);for(const d of n)a!==d.row&&(a=d.row,c=le(o,this.left+i,this.right-this.lineWidths[a])),d.top+=this.top+e+i,d.left=r.leftForLtr(r.x(c),d.width),c+=d.width+i}else{let a=0,c=le(o,this.top+e+i,this.bottom-this.columnSizes[a].height);for(const d of n)d.col!==a&&(a=d.col,c=le(o,this.top+e+i,this.bottom-this.columnSizes[a].height)),d.top=c,d.left+=this.left+i,d.left=r.leftForLtr(r.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 e=this.ctx;Dn(e,this),this._draw(),Vn(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:o,ctx:i}=this,{align:s,labels:r}=e,a=te.color,c=Rt(e.rtl,this.left,this.width),d=oe(r.font),{padding:u}=r,f=d.size,p=f/2;let h;this.drawTitle(),i.textAlign=c.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=d.string;const{boxWidth:g,boxHeight:m,itemHeight:b}=tl(r,f),x=function(C,v,k){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const M=T(k.lineWidth,1);if(i.fillStyle=T(k.fillStyle,a),i.lineCap=T(k.lineCap,"butt"),i.lineDashOffset=T(k.lineDashOffset,0),i.lineJoin=T(k.lineJoin,"miter"),i.lineWidth=M,i.strokeStyle=T(k.strokeStyle,a),i.setLineDash(T(k.lineDash,[])),r.usePointStyle){const V={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:M},$=c.xPlus(C,g/2),O=v+p;Fs(i,V,$,O,r.pointStyleWidth&&g)}else{const V=v+Math.max((f-m)/2,0),$=c.leftForLtr(C,g),O=ht(k.borderRadius);i.beginPath(),Object.values(O).some(U=>U!==0)?Ut(i,{x:$,y:V,w:g,h:m,radius:O}):i.rect($,V,g,m),i.fill(),M!==0&&i.stroke()}i.restore()},y=function(C,v,k){ft(i,k.text,C,v+b/2,d,{strikethrough:k.hidden,textAlign:c.textAlign(k.textAlign)})},w=this.isHorizontal(),S=this._computeTitleHeight();w?h={x:le(s,this.left+u,this.right-o[0]),y:this.top+u+S,line:0}:h={x:this.left+u,y:le(s,this.top+S+u,this.bottom-n[0].height),line:0},js(this.ctx,e.textDirection);const _=b+u;this.legendItems.forEach((C,v)=>{i.strokeStyle=C.fontColor,i.fillStyle=C.fontColor;const k=i.measureText(C.text).width,M=c.textAlign(C.textAlign||(C.textAlign=r.textAlign)),V=g+p+k;let $=h.x,O=h.y;c.setWidth(this.width),w?v>0&&$+V+u>this.right&&(O=h.y+=_,h.line++,$=h.x=le(s,this.left+u,this.right-o[h.line])):v>0&&O+_>this.bottom&&($=h.x=$+n[h.line].width+u,h.line++,O=h.y=le(s,this.top+S+u,this.bottom-n[h.line].height));const U=c.x($);if(x(U,O,C),$=id(M,$+g+p,w?$+V:this.right,e.rtl),y(c.x($),O,C),w)h.x+=V+u;else if(typeof C.text!="string"){const P=d.lineHeight;h.y+=ol(C,P)+u}else h.y+=_}),Ws(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,o=oe(n.font),i=ae(n.padding);if(!n.display)return;const s=Rt(e.rtl,this.left,this.width),r=this.ctx,a=n.position,c=o.size/2,d=i.top+c;let u,f=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+d,f=le(e.align,f,this.right-p);else{const g=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);u=d+le(e.align,this.top,this.bottom-g-e.labels.padding-this._computeTitleHeight())}const h=le(a,f,f+p);r.textAlign=s.textAlign(Fo(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=o.string,ft(r,n.text,h,u,o)}_computeTitleHeight(){const e=this.options.title,n=oe(e.font),o=ae(e.padding);return e.display?n.lineHeight+o.height:0}_getLegendItemAt(e,n){let o,i,s;if(Ae(e,this.left,this.right)&&Ae(n,this.top,this.bottom)){for(s=this.legendHitBoxes,o=0;o<s.length;++o)if(i=s[o],Ae(e,i.left,i.left+i.width)&&Ae(n,i.top,i.top+i.height))return this.legendItems[o]}return null}handleEvent(e){const n=this.options;if(!zh(e.type,n))return;const o=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const i=this._hoveredItem,s=Nh(i,o);i&&!s&&G(n.onLeave,[e,i,this],this),this._hoveredItem=o,o&&!s&&G(n.onHover,[e,o,this],this)}else o&&G(n.onClick,[e,o,this],this)}}function Ih(t,e,n,o,i){const s=Lh(o,t,e,n),r=Th(i,o,e.lineHeight);return{itemWidth:s,itemHeight:r}}function Lh(t,e,n,o){let i=t.text;return i&&typeof i!="string"&&(i=i.reduce((s,r)=>s.length>r.length?s:r)),e+n.size/2+o.measureText(i).width}function Th(t,e,n){let o=t;return typeof e.text!="string"&&(o=ol(e,n)),o}function ol(t,e){const n=t.text?t.text.length:0;return e*n}function zh(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var Hh={id:"legend",_element:nl,start(t,e,n){const o=t.legend=new nl({ctx:t.ctx,options:n,chart:t});ce.configure(t,o,n),ce.addBox(t,o)},stop(t){ce.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const o=t.legend;ce.configure(t,o,n),o.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const o=e.datasetIndex,i=n.chart;i.isDatasetVisible(o)?(i.hide(o),e.hidden=!0):(i.show(o),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:o,textAlign:i,color:s,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(n?0:void 0),u=ae(d.borderWidth);return{text:e[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:o||d.pointStyle,rotation:d.rotation,textAlign:i||d.textAlign,borderRadius:r&&(a||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class ri extends Le{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n){const o=this.options;if(this.left=0,this.top=0,!o.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const i=q(o.text)?o.text.length:1;this._padding=ae(o.padding);const s=i*oe(o.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:o,bottom:i,right:s,options:r}=this,a=r.align;let c=0,d,u,f;return this.isHorizontal()?(u=le(a,o,s),f=n+e,d=s-o):(r.position==="left"?(u=o+e,f=le(a,i,n),c=X*-.5):(u=s-e,f=le(a,n,i),c=X*.5),d=i-n),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const o=oe(n.font),s=o.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:c,rotation:d}=this._drawArgs(s);ft(e,n.text,0,0,o,{color:n.color,maxWidth:c,rotation:d,textAlign:Fo(n.align),textBaseline:"middle",translation:[r,a]})}}function jh(t,e){const n=new ri({ctx:t.ctx,options:e,chart:t});ce.configure(t,n,e),ce.addBox(t,n),t.titleBlock=n}var Wh={id:"title",_element:ri,start(t,e,n){jh(t,n)},stop(t){const e=t.titleBlock;ce.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const o=t.titleBlock;ce.configure(t,o,n),o.options=n},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 Kn=new WeakMap;var Yh={id:"subtitle",start(t,e,n){const o=new ri({ctx:t.ctx,options:n,chart:t});ce.configure(t,o,n),ce.addBox(t,o),Kn.set(t,o)},stop(t){ce.removeBox(t,Kn.get(t)),Kn.delete(t)},beforeUpdate(t,e,n){const o=Kn.get(t);ce.configure(t,o,n),o.options=n},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 rn={average(t){if(!t.length)return!1;let e,n,o=0,i=0,s=0;for(e=0,n=t.length;e<n;++e){const r=t[e].element;if(r&&r.hasValue()){const a=r.tooltipPosition();o+=a.x,i+=a.y,++s}}return{x:o/s,y:i/s}},nearest(t,e){if(!t.length)return!1;let n=e.x,o=e.y,i=Number.POSITIVE_INFINITY,s,r,a;for(s=0,r=t.length;s<r;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Vo(e,d);u<i&&(i=u,a=c)}}if(a){const c=a.tooltipPosition();n=c.x,o=c.y}return{x:n,y:o}}};function Fe(t,e){return e&&(q(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function ze(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
24
|
+
*/class pu{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,o,s){const i=n.listeners[s],r=n.duration;i.forEach(a=>a({chart:e,initial:n.initial,numSteps:r,currentStep:Math.min(o-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Bi.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((o,s)=>{if(!o.running||!o.items.length)return;const i=o.items;let r=i.length-1,a=!1,c;for(;r>=0;--r)c=i[r],c._active?(c._total>o.duration&&(o.duration=c._total),c.tick(e),a=!0):(i[r]=i[i.length-1],i.pop());a&&(s.draw(),this._notify(s,o,e,"progress")),i.length||(o.running=!1,this._notify(s,o,e,"complete"),o.initial=!1),n+=i.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let o=n.get(e);return o||(o={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,o)),o}listen(e,n,o){this._getAnims(e).listeners[n].push(o)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((o,s)=>Math.max(o,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const o=n.items;let s=o.length-1;for(;s>=0;--s)o[s].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var je=new pu;const lr="transparent",gu={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const o=Ni(t||lr),s=o.valid&&Ni(e||lr);return s&&s.valid?s.mix(o,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class mu{constructor(e,n,o,s){const i=n[o];s=Jt([e.to,s,i,e.from]);const r=Jt([e.from,i,s]);this._active=!0,this._fn=e.fn||gu[e.type||typeof r],this._easing=qt[e.easing]||qt.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=o,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,o){if(this._active){this._notify(!1);const s=this._target[this._prop],i=o-this._start,r=this._duration-i;this._start=o,this._duration=Math.floor(Math.max(r,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=Jt([e.to,n,s,e.from]),this._from=Jt([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,o=this._duration,s=this._prop,i=this._from,r=this._loop,a=this._to;let c;if(this._active=i!==a&&(r||n<o),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=i;return}c=n/o%2,c=r&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(i,a,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,o)=>{e.push({res:n,rej:o})})}_notify(e){const n=e?"res":"rej",o=this._promises||[];for(let s=0;s<o.length;s++)o[s][n]()}}class ar{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!j(e))return;const n=Object.keys(oe.animation),o=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const i=e[s];if(!j(i))return;const r={};for(const a of n)r[a]=i[a];(J(i.properties)&&i.properties||[s]).forEach(a=>{(a===s||!o.has(a))&&o.set(a,r)})})}_animateOptions(e,n){const o=n.options,s=yu(e,o);if(!s)return[];const i=this._createAnimations(s,o);return o.$shared&&bu(e.options.$animations,o).then(()=>{e.options=o},()=>{}),i}_createAnimations(e,n){const o=this._properties,s=[],i=e.$animations||(e.$animations={}),r=Object.keys(n),a=Date.now();let c;for(c=r.length-1;c>=0;--c){const d=r[c];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(e,n));continue}const u=n[d];let f=i[d];const p=o.get(d);if(f)if(p&&f.active()){f.update(p,u,a);continue}else f.cancel();if(!p||!p.duration){e[d]=u;continue}i[d]=f=new mu(p,e,d,u),s.push(f)}return s}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const o=this._createAnimations(e,n);if(o.length)return je.add(this._chart,o),!0}}function bu(t,e){const n=[],o=Object.keys(e);for(let s=0;s<o.length;s++){const i=t[o[s]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function yu(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function cr(t,e){const n=t&&t.options||{},o=n.reverse,s=n.min===void 0?e:0,i=n.max===void 0?e:0;return{start:o?i:s,end:o?s:i}}function _u(t,e,n){if(n===!1)return!1;const o=cr(t,n),s=cr(e,n);return{top:s.end,right:o.end,bottom:s.start,left:o.start}}function xu(t){let e,n,o,s;return j(t)?(e=t.top,n=t.right,o=t.bottom,s=t.left):e=n=o=s=t,{top:e,right:n,bottom:o,left:s,disabled:t===!1}}function dr(t,e){const n=[],o=t._getSortedDatasetMetas(e);let s,i;for(s=0,i=o.length;s<i;++s)n.push(o[s].index);return n}function ur(t,e,n,o={}){const s=t.keys,i=o.mode==="single";let r,a,c,d;if(e!==null){for(r=0,a=s.length;r<a;++r){if(c=+s[r],c===n){if(o.all)continue;break}d=t.values[c],ne(d)&&(i||e===0||Re(e)===Re(d))&&(e+=d)}return e}}function wu(t){const e=Object.keys(t),n=new Array(e.length);let o,s,i;for(o=0,s=e.length;o<s;++o)i=e[o],n[o]={x:i,y:t[i]};return n}function fr(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function Cu(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function ku(t){const{min:e,max:n,minDefined:o,maxDefined:s}=t.getUserBounds();return{min:o?e:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function Su(t,e,n){const o=t[e]||(t[e]={});return o[n]||(o[n]={})}function hr(t,e,n,o){for(const s of e.getMatchingVisibleMetas(o).reverse()){const i=t[s.index];if(n&&i>0||!n&&i<0)return s.index}return null}function pr(t,e){const{chart:n,_cachedMeta:o}=t,s=n._stacks||(n._stacks={}),{iScale:i,vScale:r,index:a}=o,c=i.axis,d=r.axis,u=Cu(i,r,o),f=e.length;let p;for(let h=0;h<f;++h){const g=e[h],{[c]:m,[d]:b}=g,y=g._stacks||(g._stacks={});p=y[d]=Su(s,u,m),p[a]=b,p._top=hr(p,r,!0,o.type),p._bottom=hr(p,r,!1,o.type);const _=p._visualValues||(p._visualValues={});_[a]=b}}function Xo(t,e){const n=t.scales;return Object.keys(n).filter(o=>n[o].axis===e).shift()}function vu(t,e){return it(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Mu(t,e,n){return it(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function Qt(t,e){const n=t.controller.index,o=t.vScale&&t.vScale.axis;if(o){e=e||t._parsed;for(const s of e){const i=s._stacks;if(!i||i[o]===void 0||i[o][n]===void 0)return;delete i[o][n],i[o]._visualValues!==void 0&&i[o]._visualValues[n]!==void 0&&delete i[o]._visualValues[n]}}}const Ko=t=>t==="reset"||t==="none",gr=(t,e)=>e?t:Object.assign({},t),Du=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:dr(n,!0),values:null};class De{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=fr(e.vScale,e),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(e){this.index!==e&&Qt(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,o=this.getDataset(),s=(f,p,h,g)=>f==="x"?p:f==="r"?g:h,i=n.xAxisID=T(o.xAxisID,Xo(e,"x")),r=n.yAxisID=T(o.yAxisID,Xo(e,"y")),a=n.rAxisID=T(o.rAxisID,Xo(e,"r")),c=n.indexAxis,d=n.iAxisID=s(c,i,r,a),u=n.vAxisID=s(c,r,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Vi(this._data,this),e._stacked&&Qt(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),o=this._data;if(j(n))this._data=wu(n);else if(o!==n){if(o){Vi(o,this);const s=this._cachedMeta;Qt(s),s._parsed=[]}n&&Object.isExtensible(n)&&fd(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,o=this.getDataset();let s=!1;this._dataCheck();const i=n._stacked;n._stacked=fr(n.vScale,n),n.stack!==o.stack&&(s=!0,Qt(n),n.stack=o.stack),this._resyncElements(e),(s||i!==n._stacked)&&pr(this,n._parsed)}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),o=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(o,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:o,_data:s}=this,{iScale:i,_stacked:r}=o,a=i.axis;let c=e===0&&n===s.length?!0:o._sorted,d=e>0&&o._parsed[e-1],u,f,p;if(this._parsing===!1)o._parsed=s,o._sorted=!0,p=s;else{J(s[e])?p=this.parseArrayData(o,s,e,n):j(s[e])?p=this.parseObjectData(o,s,e,n):p=this.parsePrimitiveData(o,s,e,n);const h=()=>f[a]===null||d&&f[a]<d[a];for(u=0;u<n;++u)o._parsed[u+e]=f=p[u],c&&(h()&&(c=!1),d=f);o._sorted=c}r&&pr(this,p)}parsePrimitiveData(e,n,o,s){const{iScale:i,vScale:r}=e,a=i.axis,c=r.axis,d=i.getLabels(),u=i===r,f=new Array(s);let p,h,g;for(p=0,h=s;p<h;++p)g=p+o,f[p]={[a]:u||i.parse(d[g],g),[c]:r.parse(n[g],g)};return f}parseArrayData(e,n,o,s){const{xScale:i,yScale:r}=e,a=new Array(s);let c,d,u,f;for(c=0,d=s;c<d;++c)u=c+o,f=n[u],a[c]={x:i.parse(f[0],u),y:r.parse(f[1],u)};return a}parseObjectData(e,n,o,s){const{xScale:i,yScale:r}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,d=new Array(s);let u,f,p,h;for(u=0,f=s;u<f;++u)p=u+o,h=n[p],d[u]={x:i.parse(nt(h,a),p),y:r.parse(nt(h,c),p)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,o){const s=this.chart,i=this._cachedMeta,r=n[e.axis],a={keys:dr(s,!0),values:n._stacks[e.axis]._visualValues};return ur(a,r,i.index,{mode:o})}updateRangeFromParsed(e,n,o,s){const i=o[n.axis];let r=i===null?NaN:i;const a=s&&o._stacks[n.axis];s&&a&&(s.values=a,r=ur(s,i,this._cachedMeta.index)),e.min=Math.min(e.min,r),e.max=Math.max(e.max,r)}getMinMax(e,n){const o=this._cachedMeta,s=o._parsed,i=o._sorted&&e===o.iScale,r=s.length,a=this._getOtherScale(e),c=Du(n,o,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=ku(a);let p,h;function g(){h=s[p];const m=h[a.axis];return!ne(h[e.axis])||u>m||f<m}for(p=0;p<r&&!(!g()&&(this.updateRangeFromParsed(d,e,h,c),i));++p);if(i){for(p=r-1;p>=0;--p)if(!g()){this.updateRangeFromParsed(d,e,h,c);break}}return d}getAllParsedValues(e){const n=this._cachedMeta._parsed,o=[];let s,i,r;for(s=0,i=n.length;s<i;++s)r=n[s][e.axis],ne(r)&&o.push(r);return o}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,o=n.iScale,s=n.vScale,i=this.getParsed(e);return{label:o?""+o.getLabelForValue(i[o.axis]):"",value:s?""+s.getLabelForValue(i[s.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=xu(T(this.options.clip,_u(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,o=this._cachedMeta,s=o.data||[],i=n.chartArea,r=[],a=this._drawStart||0,c=this._drawCount||s.length-a,d=this.options.drawActiveElementsOnTop;let u;for(o.dataset&&o.dataset.draw(e,i,a,c),u=a;u<a+c;++u){const f=s[u];f.hidden||(f.active&&d?r.push(f):f.draw(e,i))}for(u=0;u<r.length;++u)r[u].draw(e,i)}getStyle(e,n){const o=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(o):this.resolveDataElementOptions(e||0,o)}getContext(e,n,o){const s=this.getDataset();let i;if(e>=0&&e<this._cachedMeta.data.length){const r=this._cachedMeta.data[e];i=r.$context||(r.$context=Mu(this.getContext(),e,r)),i.parsed=this.getParsed(e),i.raw=s.data[e],i.index=i.dataIndex=e}else i=this.$context||(this.$context=vu(this.chart.getContext(),this.index)),i.dataset=s,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=o,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",o){const s=n==="active",i=this._cachedDataOpts,r=e+"-"+n,a=i[r],c=this.enableOptionSharing&&Yt(o);if(a)return gr(a,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),f=s?[`${e}Hover`,"hover",e,""]:[e,""],p=d.getOptionScopes(this.getDataset(),u),h=Object.keys(oe.elements[e]),g=()=>this.getContext(o,s,n),m=d.resolveNamedOptions(p,h,g,f);return m.$shared&&(m.$shared=c,i[r]=Object.freeze(gr(m,c))),m}_resolveAnimations(e,n,o){const s=this.chart,i=this._cachedDataOpts,r=`animation-${n}`,a=i[r];if(a)return a;let c;if(s.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),p=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(p,this.getContext(e,o,n))}const d=new ar(s,c&&c.animations);return c&&c._cacheable&&(i[r]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Ko(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const o=this.resolveDataElementOptions(e,n),s=this._sharedOptions,i=this.getSharedOptions(o),r=this.includeOptions(n,i)||i!==s;return this.updateSharedOptions(i,n,o),{sharedOptions:i,includeOptions:r}}updateElement(e,n,o,s){Ko(s)?Object.assign(e,o):this._resolveAnimations(n,s).update(e,o)}updateSharedOptions(e,n,o){e&&!Ko(n)&&this._resolveAnimations(void 0,n).update(e,o)}_setStyle(e,n,o,s){e.active=s;const i=this.getStyle(n,s);this._resolveAnimations(n,o,s).update(e,{options:!s&&this.getSharedOptions(i)||i})}removeHoverStyle(e,n,o){this._setStyle(e,o,"active",!1)}setHoverStyle(e,n,o){this._setStyle(e,o,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,o=this._cachedMeta.data;for(const[a,c,d]of this._syncList)this[a](c,d);this._syncList=[];const s=o.length,i=n.length,r=Math.min(i,s);r&&this.parse(0,r),i>s?this._insertElements(s,i-s,e):i<s&&this._removeElements(i,s-i)}_insertElements(e,n,o=!0){const s=this._cachedMeta,i=s.data,r=e+n;let a;const c=d=>{for(d.length+=n,a=d.length-1;a>=r;a--)d[a]=d[a-n]};for(c(i),a=e;a<r;++a)i[a]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(e,n),o&&this.updateElements(i,e,n,"reset")}updateElements(e,n,o,s){}_removeElements(e,n){const o=this._cachedMeta;if(this._parsing){const s=o._parsed.splice(e,n);o._stacked&&Qt(o,s)}o.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,o,s]=e;this[n](o,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const o=arguments.length-2;o&&this._sync(["_insertElements",e,o])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}$(De,"defaults",{}),$(De,"datasetElementType",null),$(De,"dataElementType",null);function Eu(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let o=[];for(let s=0,i=n.length;s<i;s++)o=o.concat(n[s].controller.getAllParsedValues(t));t._cache.$bar=Ri(o.sort((s,i)=>s-i))}return t._cache.$bar}function Vu(t){const e=t.iScale,n=Eu(e,t.type);let o=e._length,s,i,r,a;const c=()=>{r===32767||r===-32768||(Yt(a)&&(o=Math.min(o,Math.abs(r-a)||o)),a=r)};for(s=0,i=n.length;s<i;++s)r=e.getPixelForValue(n[s]),c();for(a=void 0,s=0,i=e.ticks.length;s<i;++s)r=e.getPixelForTick(s),c();return o}function Ru(t,e,n,o){const s=n.barThickness;let i,r;return Y(s)?(i=e.min*n.categoryPercentage,r=n.barPercentage):(i=s*o,r=1),{chunk:i/o,ratio:r,start:e.pixels[t]-i/2}}function Bu(t,e,n,o){const s=e.pixels,i=s[t];let r=t>0?s[t-1]:null,a=t<s.length-1?s[t+1]:null;const c=n.categoryPercentage;r===null&&(r=i-(a===null?e.end-e.start:a-i)),a===null&&(a=i+i-r);const d=i-(i-Math.min(r,a))/2*c;return{chunk:Math.abs(a-r)/2*c/o,ratio:n.barPercentage,start:d}}function Fu(t,e,n,o){const s=n.parse(t[0],o),i=n.parse(t[1],o),r=Math.min(s,i),a=Math.max(s,i);let c=r,d=a;Math.abs(r)>Math.abs(a)&&(c=a,d=r),e[n.axis]=d,e._custom={barStart:c,barEnd:d,start:s,end:i,min:r,max:a}}function mr(t,e,n,o){return J(t)?Fu(t,e,n,o):e[n.axis]=n.parse(t,o),e}function br(t,e,n,o){const s=t.iScale,i=t.vScale,r=s.getLabels(),a=s===i,c=[];let d,u,f,p;for(d=n,u=n+o;d<u;++d)p=e[d],f={},f[s.axis]=a||s.parse(r[d],d),c.push(mr(p,f,i,d));return c}function Zo(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function $u(t,e,n){return t!==0?Re(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function Pu(t){let e,n,o,s,i;return t.horizontal?(e=t.base>t.x,n="left",o="right"):(e=t.base<t.y,n="bottom",o="top"),e?(s="end",i="start"):(s="start",i="end"),{start:n,end:o,reverse:e,top:s,bottom:i}}function Au(t,e,n,o){let s=e.borderSkipped;const i={};if(!s){t.borderSkipped=i;return}if(s===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:c,top:d,bottom:u}=Pu(t);s==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===o?s=d:(n._bottom||0)===o?s=u:(i[yr(u,r,a,c)]=!0,s=d)),i[yr(s,r,a,c)]=!0,t.borderSkipped=i}function yr(t,e,n,o){return o?(t=Ou(t,e,n),t=_r(t,n,e)):t=_r(t,e,n),t}function Ou(t,e,n){return t===e?n:t===n?e:t}function _r(t,e,n){return t==="start"?e:t==="end"?n:t}function Nu(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class Ln extends De{parsePrimitiveData(e,n,o,s){return br(e,n,o,s)}parseArrayData(e,n,o,s){return br(e,n,o,s)}parseObjectData(e,n,o,s){const{iScale:i,vScale:r}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,d=i.axis==="x"?a:c,u=r.axis==="x"?a:c,f=[];let p,h,g,m;for(p=o,h=o+s;p<h;++p)m=n[p],g={},g[i.axis]=i.parse(nt(m,d),p),f.push(mr(nt(m,u),g,r,p));return f}updateRangeFromParsed(e,n,o,s){super.updateRangeFromParsed(e,n,o,s);const i=o._custom;i&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:o,vScale:s}=n,i=this.getParsed(e),r=i._custom,a=Zo(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(i[s.axis]);return{label:""+o.getLabelForValue(i[o.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,o,s){const i=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,c=a.getBasePixel(),d=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:p}=this._getSharedOptions(n,s);for(let h=n;h<n+o;h++){const g=this.getParsed(h),m=i||Y(g[a.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),b=this._calculateBarIndexPixels(h,u),y=(g._stacks||{})[a.axis],_={horizontal:d,base:m.base,enableBorderRadius:!y||Zo(g._custom)||r===y._top||r===y._bottom,x:d?m.head:b.center,y:d?b.center:m.head,height:d?b.size:Math.abs(m.size),width:d?Math.abs(m.size):b.size};p&&(_.options=f||this.resolveDataElementOptions(h,e[h].active?"active":s));const w=_.options||e[h].options;Au(_,w,y,r),Nu(_,w,u.ratio),this.updateElement(e[h],h,_,s)}}_getStacks(e,n){const{iScale:o}=this._cachedMeta,s=o.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),i=o.options.stacked,r=[],a=c=>{const d=c.controller.getParsed(n),u=d&&d[c.vScale.axis];if(Y(u)||isNaN(u))return!0};for(const c of s)if(!(n!==void 0&&a(c))&&((i===!1||r.indexOf(c.stack)===-1||i===void 0&&c.stack===void 0)&&r.push(c.stack),c.index===e))break;return r.length||r.push(void 0),r}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,n,o){const s=this._getStacks(e,o),i=n!==void 0?s.indexOf(n):-1;return i===-1?s.length-1:i}_getRuler(){const e=this.options,n=this._cachedMeta,o=n.iScale,s=[];let i,r;for(i=0,r=n.data.length;i<r;++i)s.push(o.getPixelForValue(this.getParsed(i)[o.axis],i));const a=e.barThickness;return{min:a||Vu(n),pixels:s,start:o._startPixel,end:o._endPixel,stackCount:this._getStackCount(),scale:o,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:o,index:s},options:{base:i,minBarLength:r}}=this,a=i||0,c=this.getParsed(e),d=c._custom,u=Zo(d);let f=c[n.axis],p=0,h=o?this.applyStack(n,c,o):f,g,m;h!==f&&(p=h-f,h=f),u&&(f=d.barStart,h=d.barEnd-d.barStart,f!==0&&Re(f)!==Re(d.barEnd)&&(p=0),p+=f);const b=!Y(i)&&!u?i:p;let y=n.getPixelForValue(b);if(this.chart.getDataVisibility(e)?g=n.getPixelForValue(p+h):g=y,m=g-y,Math.abs(m)<r){m=$u(m,n,a)*r,f===a&&(y-=m/2);const _=n.getPixelForDecimal(0),w=n.getPixelForDecimal(1),S=Math.min(_,w),x=Math.max(_,w);y=Math.max(Math.min(y,x),S),g=y+m,o&&!u&&(c._stacks[n.axis]._visualValues[s]=n.getValueForPixel(g)-n.getValueForPixel(y))}if(y===n.getPixelForValue(a)){const _=Re(m)*n.getLineWidthForValue(a)/2;y+=_,m-=_}return{size:m,base:y,head:g,center:g+m/2}}_calculateBarIndexPixels(e,n){const o=n.scale,s=this.options,i=s.skipNull,r=T(s.maxBarThickness,1/0);let a,c;if(n.grouped){const d=i?this._getStackCount(e):n.stackCount,u=s.barThickness==="flex"?Bu(e,n,s,d):Ru(e,n,s,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0);a=u.start+u.chunk*f+u.chunk/2,c=Math.min(r,u.chunk*u.ratio)}else a=o.getPixelForValue(this.getParsed(e)[o.axis],e),c=Math.min(r,n.min*n.ratio);return{base:a-c/2,head:a+c/2,center:a,size:c}}draw(){const e=this._cachedMeta,n=e.vScale,o=e.data,s=o.length;let i=0;for(;i<s;++i)this.getParsed(i)[n.axis]!==null&&o[i].draw(this._ctx)}}$(Ln,"id","bar"),$(Ln,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),$(Ln,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Tn extends De{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,o,s){const i=super.parsePrimitiveData(e,n,o,s);for(let r=0;r<i.length;r++)i[r]._custom=this.resolveDataElementOptions(r+o).radius;return i}parseArrayData(e,n,o,s){const i=super.parseArrayData(e,n,o,s);for(let r=0;r<i.length;r++){const a=n[o+r];i[r]._custom=T(a[2],this.resolveDataElementOptions(r+o).radius)}return i}parseObjectData(e,n,o,s){const i=super.parseObjectData(e,n,o,s);for(let r=0;r<i.length;r++){const a=n[o+r];i[r]._custom=T(a&&a.r&&+a.r,this.resolveDataElementOptions(r+o).radius)}return i}getMaxOverflow(){const e=this._cachedMeta.data;let n=0;for(let o=e.length-1;o>=0;--o)n=Math.max(n,e[o].size(this.resolveDataElementOptions(o))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart.data.labels||[],{xScale:s,yScale:i}=n,r=this.getParsed(e),a=s.getLabelForValue(r.x),c=i.getLabelForValue(r.y),d=r._custom;return{label:o[e]||"",value:"("+a+", "+c+(d?", "+d:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,o,s){const i=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(n,s),u=r.axis,f=a.axis;for(let p=n;p<n+o;p++){const h=e[p],g=!i&&this.getParsed(p),m={},b=m[u]=i?r.getPixelForDecimal(.5):r.getPixelForValue(g[u]),y=m[f]=i?a.getBasePixel():a.getPixelForValue(g[f]);m.skip=isNaN(b)||isNaN(y),d&&(m.options=c||this.resolveDataElementOptions(p,h.active?"active":s),i&&(m.options.radius=0)),this.updateElement(h,p,m,s)}}resolveDataElementOptions(e,n){const o=this.getParsed(e);let s=super.resolveDataElementOptions(e,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const i=s.radius;return n!=="active"&&(s.radius=0),s.radius+=T(o&&o._custom,i),s}}$(Tn,"id","bubble"),$(Tn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),$(Tn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Iu(t,e,n){let o=1,s=1,i=0,r=0;if(e<ee){const a=t,c=a+e,d=Math.cos(a),u=Math.sin(a),f=Math.cos(c),p=Math.sin(c),h=(w,S,x)=>Ut(w,a,c,!0)?1:Math.max(S,S*n,x,x*n),g=(w,S,x)=>Ut(w,a,c,!0)?-1:Math.min(S,S*n,x,x*n),m=h(0,d,f),b=h(se,u,p),y=g(Q,d,f),_=g(Q+se,u,p);o=(m-y)/2,s=(b-_)/2,i=-(m+y)/2,r=-(b+_)/2}return{ratioX:o,ratioY:s,offsetX:i,offsetY:r}}class Ct extends De{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const o=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=o;else{let i=c=>+o[c];if(j(o[e])){const{key:c="value"}=this._parsing;i=d=>+nt(o[d],c)}let r,a;for(r=e,a=e+n;r<a;++r)s._parsed[r]=i(r)}}_getRotation(){return Me(this.options.rotation-90)}_getCircumference(){return Me(this.options.circumference)}_getRotationExtents(){let e=ee,n=-ee;for(let o=0;o<this.chart.data.datasets.length;++o)if(this.chart.isDatasetVisible(o)&&this.chart.getDatasetMeta(o).type===this._type){const s=this.chart.getDatasetMeta(o).controller,i=s._getRotation(),r=s._getCircumference();e=Math.min(e,i),n=Math.max(n,i+r)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:o}=n,s=this._cachedMeta,i=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(o.width,o.height)-r)/2,0),c=Math.min(Jc(this.options.cutout,a),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:g,offsetY:m}=Iu(f,u,c),b=(o.width-r)/p,y=(o.height-r)/h,_=Math.max(Math.min(b,y)/2,0),w=_i(this.options.radius,_),S=Math.max(w*c,0),x=(w-S)/this._getVisibleDatasetWeightTotal();this.offsetX=g*w,this.offsetY=m*w,s.total=this.calculateTotal(),this.outerRadius=w-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*d,0),this.updateElements(i,0,i.length,e)}_circumference(e,n){const o=this.options,s=this._cachedMeta,i=this._getCircumference();return n&&o.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*i/ee)}updateElements(e,n,o,s){const i=s==="reset",r=this.chart,a=r.chartArea,d=r.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,p=i&&d.animateScale,h=p?0:this.innerRadius,g=p?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(n,s);let y=this._getRotation(),_;for(_=0;_<n;++_)y+=this._circumference(_,i);for(_=n;_<n+o;++_){const w=this._circumference(_,i),S=e[_],x={x:u+this.offsetX,y:f+this.offsetY,startAngle:y,endAngle:y+w,circumference:w,outerRadius:g,innerRadius:h};b&&(x.options=m||this.resolveDataElementOptions(_,S.active?"active":s)),y+=w,this.updateElement(S,_,x,s)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let o=0,s;for(s=0;s<n.length;s++){const i=e._parsed[s];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(o+=Math.abs(i))}return o}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?ee*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart,s=o.data.labels||[],i=Xt(n._parsed[e],o.options.locale);return{label:s[e]||"",value:i}}getMaxBorderWidth(e){let n=0;const o=this.chart;let s,i,r,a,c;if(!e){for(s=0,i=o.data.datasets.length;s<i;++s)if(o.isDatasetVisible(s)){r=o.getDatasetMeta(s),e=r.data,a=r.controller;break}}if(!e)return 0;for(s=0,i=e.length;s<i;++s)c=a.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let o=0,s=e.length;o<s;++o){const i=this.resolveDataElementOptions(o);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let o=0;o<e;++o)this.chart.isDatasetVisible(o)&&(n+=this._getRingWeight(o));return n}_getRingWeight(e){return Math.max(T(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}$(Ct,"id","doughnut"),$(Ct,"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"}),$(Ct,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),$(Ct,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:o,color:s}}=e.legend.options;return n.labels.map((i,r)=>{const c=e.getDatasetMeta(0).controller.getStyle(r);return{text:i,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,n,o){o.chart.toggleDataVisibility(n.index),o.chart.update()}}}});class zn extends De{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:o,data:s=[],_dataset:i}=n,r=this.chart._animationsDisabled;let{start:a,count:c}=$i(n,s,r);this._drawStart=a,this._drawCount=c,Pi(n)&&(a=0,c=s.length),o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!i._decimated,o.points=s;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:d},e),this.updateElements(s,a,c,e)}updateElements(e,n,o,s){const i=s==="reset",{iScale:r,vScale:a,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,s),p=r.axis,h=a.axis,{spanGaps:g,segment:m}=this.options,b=Rt(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||i||s==="none",_=n+o,w=e.length;let S=n>0&&this.getParsed(n-1);for(let x=0;x<w;++x){const E=e[x],v=y?E:{};if(x<n||x>=_){v.skip=!0;continue}const R=this.getParsed(x),P=Y(R[h]),A=v[p]=r.getPixelForValue(R[p],x),C=v[h]=i||P?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,R,c):R[h],x);v.skip=isNaN(A)||isNaN(C)||P,v.stop=x>0&&Math.abs(R[p]-S[p])>b,m&&(v.parsed=R,v.raw=d.data[x]),f&&(v.options=u||this.resolveDataElementOptions(x,E.active?"active":s)),y||this.updateElement(E,x,v,s),S=R}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,o=n.options&&n.options.borderWidth||0,s=e.data||[];if(!s.length)return o;const i=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(o,i,r)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}$(zn,"id","line"),$(zn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),$(zn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class en extends De{constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart,s=o.data.labels||[],i=Xt(n._parsed[e].r,o.options.locale);return{label:s[e]||"",value:i}}parseObjectData(e,n,o,s){return Xi.bind(this)(e,n,o,s)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((o,s)=>{const i=this.getParsed(s).r;!isNaN(i)&&this.chart.getDataVisibility(s)&&(i<n.min&&(n.min=i),i>n.max&&(n.max=i))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,o=e.options,s=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(s/2,0),r=Math.max(o.cutoutPercentage?i/100*o.cutoutPercentage:1,0),a=(i-r)/e.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,n,o,s){const i=s==="reset",r=this.chart,c=r.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,f=d.yCenter,p=d.getIndexAngle(0)-.5*Q;let h=p,g;const m=360/this.countVisibleElements();for(g=0;g<n;++g)h+=this._computeAngle(g,s,m);for(g=n;g<n+o;g++){const b=e[g];let y=h,_=h+this._computeAngle(g,s,m),w=r.getDataVisibility(g)?d.getDistanceFromCenterForValue(this.getParsed(g).r):0;h=_,i&&(c.animateScale&&(w=0),c.animateRotate&&(y=_=p));const S={x:u,y:f,innerRadius:0,outerRadius:w,startAngle:y,endAngle:_,options:this.resolveDataElementOptions(g,b.active?"active":s)};this.updateElement(b,g,S,s)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((o,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(e,n,o){return this.chart.getDataVisibility(e)?Me(this.resolveDataElementOptions(e,n).angle||o):0}}$(en,"id","polarArea"),$(en,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),$(en,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:o,color:s}}=e.legend.options;return n.labels.map((i,r)=>{const c=e.getDatasetMeta(0).controller.getStyle(r);return{text:i,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,n,o){o.chart.toggleDataVisibility(n.index),o.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Jo extends Ct{}$(Jo,"id","pie"),$(Jo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Hn extends De{getLabelAndValue(e){const n=this._cachedMeta.vScale,o=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(o[n.axis])}}parseObjectData(e,n,o,s){return Xi.bind(this)(e,n,o,s)}update(e){const n=this._cachedMeta,o=n.dataset,s=n.data||[],i=n.iScale.getLabels();if(o.points=s,e!=="resize"){const r=this.resolveDatasetElementOptions(e);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:i.length===s.length,options:r};this.updateElement(o,void 0,a,e)}this.updateElements(s,0,s.length,e)}updateElements(e,n,o,s){const i=this._cachedMeta.rScale,r=s==="reset";for(let a=n;a<n+o;a++){const c=e[a],d=this.resolveDataElementOptions(a,c.active?"active":s),u=i.getPointPositionForValue(a,this.getParsed(a).r),f=r?i.xCenter:u.x,p=r?i.yCenter:u.y,h={x:f,y:p,angle:u.angle,skip:isNaN(f)||isNaN(p),options:d};this.updateElement(c,a,h,s)}}}$(Hn,"id","radar"),$(Hn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),$(Hn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class jn extends De{getLabelAndValue(e){const n=this._cachedMeta,o=this.chart.data.labels||[],{xScale:s,yScale:i}=n,r=this.getParsed(e),a=s.getLabelForValue(r.x),c=i.getLabelForValue(r.y);return{label:o[e]||"",value:"("+a+", "+c+")"}}update(e){const n=this._cachedMeta,{data:o=[]}=n,s=this.chart._animationsDisabled;let{start:i,count:r}=$i(n,o,s);if(this._drawStart=i,this._drawCount=r,Pi(n)&&(i=0,r=o.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:c}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!c._decimated,a.points=o;const d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:d},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(o,i,r,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,n,o,s){const i=s==="reset",{iScale:r,vScale:a,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),f=this.getSharedOptions(u),p=this.includeOptions(s,f),h=r.axis,g=a.axis,{spanGaps:m,segment:b}=this.options,y=Rt(m)?m:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||i||s==="none";let w=n>0&&this.getParsed(n-1);for(let S=n;S<n+o;++S){const x=e[S],E=this.getParsed(S),v=_?x:{},R=Y(E[g]),P=v[h]=r.getPixelForValue(E[h],S),A=v[g]=i||R?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,E,c):E[g],S);v.skip=isNaN(P)||isNaN(A)||R,v.stop=S>0&&Math.abs(E[h]-w[h])>y,b&&(v.parsed=E,v.raw=d.data[S]),p&&(v.options=f||this.resolveDataElementOptions(S,x.active?"active":s)),_||this.updateElement(x,S,v,s),w=E}this.updateSharedOptions(f,s,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let a=0;for(let c=n.length-1;c>=0;--c)a=Math.max(a,n[c].size(this.resolveDataElementOptions(c))/2);return a>0&&a}const o=e.dataset,s=o.options&&o.options.borderWidth||0;if(!n.length)return s;const i=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,i,r)/2}}$(jn,"id","scatter"),$(jn,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),$(jn,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Lu=Object.freeze({__proto__:null,BarController:Ln,BubbleController:Tn,DoughnutController:Ct,LineController:zn,PieController:Jo,PolarAreaController:en,RadarController:Hn,ScatterController:jn});function kt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Qo{constructor(e){$(this,"options");this.options=e||{}}static override(e){Object.assign(Qo.prototype,e)}init(){}formats(){return kt()}parse(){return kt()}format(){return kt()}add(){return kt()}diff(){return kt()}startOf(){return kt()}endOf(){return kt()}}var Tu={_date:Qo};function zu(t,e,n,o){const{controller:s,data:i,_sorted:r}=t,a=s._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&r&&i.length){const c=a._reversePixels?dd:ze;if(o){if(s._sharedOptions){const d=i[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){const f=c(i,e,n-u),p=c(i,e,n+u);return{lo:f.lo,hi:p.hi}}}}else return c(i,e,n)}return{lo:0,hi:i.length-1}}function tn(t,e,n,o,s){const i=t.getSortedVisibleDatasetMetas(),r=n[e];for(let a=0,c=i.length;a<c;++a){const{index:d,data:u}=i[a],{lo:f,hi:p}=zu(i[a],e,r,s);for(let h=f;h<=p;++h){const g=u[h];g.skip||o(g,d,h)}}}function Hu(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(o,s){const i=e?Math.abs(o.x-s.x):0,r=n?Math.abs(o.y-s.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(r,2))}}function es(t,e,n,o,s){const i=[];return!s&&!t.isPointInArea(e)||tn(t,n,e,function(a,c,d){!s&&!He(a,t.chartArea,0)||a.inRange(e.x,e.y,o)&&i.push({element:a,datasetIndex:c,index:d})},!0),i}function ju(t,e,n,o){let s=[];function i(r,a,c){const{startAngle:d,endAngle:u}=r.getProps(["startAngle","endAngle"],o),{angle:f}=Di(r,{x:e.x,y:e.y});Ut(f,d,u)&&s.push({element:r,datasetIndex:a,index:c})}return tn(t,n,e,i),s}function Wu(t,e,n,o,s,i){let r=[];const a=Hu(n);let c=Number.POSITIVE_INFINITY;function d(u,f,p){const h=u.inRange(e.x,e.y,s);if(o&&!h)return;const g=u.getCenterPoint(s);if(!(!!i||t.isPointInArea(g))&&!h)return;const b=a(e,g);b<c?(r=[{element:u,datasetIndex:f,index:p}],c=b):b===c&&r.push({element:u,datasetIndex:f,index:p})}return tn(t,n,e,d),r}function ts(t,e,n,o,s,i){return!i&&!t.isPointInArea(e)?[]:n==="r"&&!o?ju(t,e,n,s):Wu(t,e,n,o,s,i)}function xr(t,e,n,o,s){const i=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return tn(t,n,e,(c,d,u)=>{c[r](e[n],s)&&(i.push({element:c,datasetIndex:d,index:u}),a=a||c.inRange(e.x,e.y,s))}),o&&!a?[]:i}var Yu={evaluateInteractionItems:tn,modes:{index(t,e,n,o){const s=xt(e,t),i=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?es(t,s,i,o,r):ts(t,s,i,!1,o,r),c=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=a[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,e,n,o){const s=xt(e,t),i=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?es(t,s,i,o,r):ts(t,s,i,!1,o,r);if(a.length>0){const c=a[0].datasetIndex,d=t.getDatasetMeta(c).data;a=[];for(let u=0;u<d.length;++u)a.push({element:d[u],datasetIndex:c,index:u})}return a},point(t,e,n,o){const s=xt(e,t),i=n.axis||"xy",r=n.includeInvisible||!1;return es(t,s,i,o,r)},nearest(t,e,n,o){const s=xt(e,t),i=n.axis||"xy",r=n.includeInvisible||!1;return ts(t,s,i,n.intersect,o,r)},x(t,e,n,o){const s=xt(e,t);return xr(t,s,"x",n.intersect,o)},y(t,e,n,o){const s=xt(e,t);return xr(t,s,"y",n.intersect,o)}}};const wr=["left","top","right","bottom"];function nn(t,e){return t.filter(n=>n.pos===e)}function Cr(t,e){return t.filter(n=>wr.indexOf(n.pos)===-1&&n.box.axis===e)}function on(t,e){return t.sort((n,o)=>{const s=e?o:n,i=e?n:o;return s.weight===i.weight?s.index-i.index:s.weight-i.weight})}function Gu(t){const e=[];let n,o,s,i,r,a;for(n=0,o=(t||[]).length;n<o;++n)s=t[n],{position:i,options:{stack:r,stackWeight:a=1}}=s,e.push({index:n,box:s,pos:i,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&i+r,stackWeight:a});return e}function Uu(t){const e={};for(const n of t){const{stack:o,pos:s,stackWeight:i}=n;if(!o||!wr.includes(s))continue;const r=e[o]||(e[o]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=i}return e}function qu(t,e){const n=Uu(t),{vBoxMaxWidth:o,hBoxMaxHeight:s}=e;let i,r,a;for(i=0,r=t.length;i<r;++i){a=t[i];const{fullSize:c}=a.box,d=n[a.stack],u=d&&a.stackWeight/d.weight;a.horizontal?(a.width=u?u*o:c&&e.availableWidth,a.height=s):(a.width=o,a.height=u?u*s:c&&e.availableHeight)}return n}function Xu(t){const e=Gu(t),n=on(e.filter(d=>d.box.fullSize),!0),o=on(nn(e,"left"),!0),s=on(nn(e,"right")),i=on(nn(e,"top"),!0),r=on(nn(e,"bottom")),a=Cr(e,"x"),c=Cr(e,"y");return{fullSize:n,leftAndTop:o.concat(i),rightAndBottom:s.concat(c).concat(r).concat(a),chartArea:nn(e,"chartArea"),vertical:o.concat(s).concat(c),horizontal:i.concat(r).concat(a)}}function kr(t,e,n,o){return Math.max(t[n],e[n])+Math.max(t[o],e[o])}function Sr(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Ku(t,e,n,o){const{pos:s,box:i}=n,r=t.maxPadding;if(!j(s)){n.size&&(t[s]-=n.size);const f=o[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?i.height:i.width),n.size=f.size/f.count,t[s]+=n.size}i.getPadding&&Sr(r,i.getPadding());const a=Math.max(0,e.outerWidth-kr(r,t,"left","right")),c=Math.max(0,e.outerHeight-kr(r,t,"top","bottom")),d=a!==t.w,u=c!==t.h;return t.w=a,t.h=c,n.horizontal?{same:d,other:u}:{same:u,other:d}}function Zu(t){const e=t.maxPadding;function n(o){const s=Math.max(e[o]-t[o],0);return t[o]+=s,s}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function Ju(t,e){const n=e.maxPadding;function o(s){const i={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{i[r]=Math.max(e[r],n[r])}),i}return o(t?["left","right"]:["top","bottom"])}function sn(t,e,n,o){const s=[];let i,r,a,c,d,u;for(i=0,r=t.length,d=0;i<r;++i){a=t[i],c=a.box,c.update(a.width||e.w,a.height||e.h,Ju(a.horizontal,e));const{same:f,other:p}=Ku(e,n,a,o);d|=f&&s.length,u=u||p,c.fullSize||s.push(a)}return d&&sn(s,e,n,o)||u}function Wn(t,e,n,o,s){t.top=n,t.left=e,t.right=e+o,t.bottom=n+s,t.width=o,t.height=s}function vr(t,e,n,o){const s=n.padding;let{x:i,y:r}=e;for(const a of t){const c=a.box,d=o[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/d.weight||1;if(a.horizontal){const f=e.w*u,p=d.size||c.height;Yt(d.start)&&(r=d.start),c.fullSize?Wn(c,s.left,r,n.outerWidth-s.right-s.left,p):Wn(c,e.left+d.placed,r,f,p),d.start=r,d.placed+=f,r=c.bottom}else{const f=e.h*u,p=d.size||c.width;Yt(d.start)&&(i=d.start),c.fullSize?Wn(c,i,s.top,p,n.outerHeight-s.bottom-s.top):Wn(c,i,e.top+d.placed,p,f),d.start=i,d.placed+=f,i=c.right}}e.x=i,e.y=r}var he={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,o){if(!t)return;const s=fe(t.options.layout.padding),i=Math.max(e-s.width,0),r=Math.max(n-s.height,0),a=Xu(t.boxes),c=a.vertical,d=a.horizontal;q(t.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=c.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:s,availableWidth:i,availableHeight:r,vBoxMaxWidth:i/2/u,hBoxMaxHeight:r/2}),p=Object.assign({},s);Sr(p,fe(o));const h=Object.assign({maxPadding:p,w:i,h:r,x:s.left,y:s.top},s),g=qu(c.concat(d),f);sn(a.fullSize,h,f,g),sn(c,h,f,g),sn(d,h,f,g)&&sn(c,h,f,g),Zu(h),vr(a.leftAndTop,h,f,g),h.x+=h.w,h.y+=h.h,vr(a.rightAndBottom,h,f,g),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},q(a.chartArea,m=>{const b=m.box;Object.assign(b,t.chartArea),b.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class Mr{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,o){}removeEventListener(e,n,o){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,o,s){return n=Math.max(0,n||e.width),o=o||e.height,{width:n,height:Math.max(0,s?Math.floor(n/s):o)}}isAttached(e){return!0}updateConfig(e){}}class Qu extends Mr{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Yn="$chartjs",ef={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Dr=t=>t===null||t==="";function tf(t,e){const n=t.style,o=t.getAttribute("height"),s=t.getAttribute("width");if(t[Yn]={initial:{height:o,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Dr(s)){const i=Ji(t,"width");i!==void 0&&(t.width=i)}if(Dr(o))if(t.style.height==="")t.height=t.width/(e||2);else{const i=Ji(t,"height");i!==void 0&&(t.height=i)}return t}const Er=ou?{passive:!0}:!1;function nf(t,e,n){t.addEventListener(e,n,Er)}function of(t,e,n){t.canvas.removeEventListener(e,n,Er)}function sf(t,e){const n=ef[t.type]||t.type,{x:o,y:s}=xt(t,e);return{type:n,chart:e,native:t,x:o!==void 0?o:null,y:s!==void 0?s:null}}function Gn(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function rf(t,e,n){const o=t.canvas,s=new MutationObserver(i=>{let r=!1;for(const a of i)r=r||Gn(a.addedNodes,o),r=r&&!Gn(a.removedNodes,o);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function lf(t,e,n){const o=t.canvas,s=new MutationObserver(i=>{let r=!1;for(const a of i)r=r||Gn(a.removedNodes,o),r=r&&!Gn(a.addedNodes,o);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const rn=new Map;let Vr=0;function Rr(){const t=window.devicePixelRatio;t!==Vr&&(Vr=t,rn.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function af(t,e){rn.size||window.addEventListener("resize",Rr),rn.set(t,e)}function cf(t){rn.delete(t),rn.size||window.removeEventListener("resize",Rr)}function df(t,e,n){const o=t.canvas,s=o&&qo(o);if(!s)return;const i=Fi((a,c)=>{const d=s.clientWidth;n(a,c),d<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{const c=a[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||i(d,u)});return r.observe(s),af(t,i),r}function ns(t,e,n){n&&n.disconnect(),e==="resize"&&cf(t)}function uf(t,e,n){const o=t.canvas,s=Fi(i=>{t.ctx!==null&&n(sf(i,t))},t);return nf(o,e,s),s}class ff extends Mr{acquireContext(e,n){const o=e&&e.getContext&&e.getContext("2d");return o&&o.canvas===e?(tf(e,n),o):null}releaseContext(e){const n=e.canvas;if(!n[Yn])return!1;const o=n[Yn].initial;["height","width"].forEach(i=>{const r=o[i];Y(r)?n.removeAttribute(i):n.setAttribute(i,r)});const s=o.style||{};return Object.keys(s).forEach(i=>{n.style[i]=s[i]}),n.width=n.width,delete n[Yn],!0}addEventListener(e,n,o){this.removeEventListener(e,n);const s=e.$proxies||(e.$proxies={}),r={attach:rf,detach:lf,resize:df}[n]||uf;s[n]=r(e,n,o)}removeEventListener(e,n){const o=e.$proxies||(e.$proxies={}),s=o[n];if(!s)return;({attach:ns,detach:ns,resize:ns}[n]||of)(e,n,s),o[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,o,s){return nu(e,n,o,s)}isAttached(e){const n=qo(e);return!!(n&&n.isConnected)}}function hf(t){return!Uo()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Qu:ff}let We=(ko=class{constructor(){$(this,"x");$(this,"y");$(this,"active",!1);$(this,"options");$(this,"$animations")}tooltipPosition(e){const{x:n,y:o}=this.getProps(["x","y"],e);return{x:n,y:o}}hasValue(){return Rt(this.x)&&Rt(this.y)}getProps(e,n){const o=this.$animations;if(!n||!o)return this;const s={};return e.forEach(i=>{s[i]=o[i]&&o[i].active()?o[i]._to:this[i]}),s}},$(ko,"defaults",{}),$(ko,"defaultRoutes"),ko);function pf(t,e){const n=t.options.ticks,o=gf(t),s=Math.min(n.maxTicksLimit||o,o),i=n.major.enabled?bf(e):[],r=i.length,a=i[0],c=i[r-1],d=[];if(r>s)return yf(e,d,i,r/s),d;const u=mf(i,e,s);if(r>0){let f,p;const h=r>1?Math.round((c-a)/(r-1)):null;for(Un(e,d,u,Y(h)?0:a-h,a),f=0,p=r-1;f<p;f++)Un(e,d,u,i[f],i[f+1]);return Un(e,d,u,c,Y(h)?e.length:c+h),d}return Un(e,d,u),d}function gf(t){const e=t.options.offset,n=t._tickSize(),o=t._length/n+(e?0:1),s=t._maxLength/n;return Math.floor(Math.min(o,s))}function mf(t,e,n){const o=_f(t),s=e.length/n;if(!o)return Math.max(s,1);const i=rd(o);for(let r=0,a=i.length-1;r<a;r++){const c=i[r];if(c>s)return c}return Math.max(s,1)}function bf(t){const e=[];let n,o;for(n=0,o=t.length;n<o;n++)t[n].major&&e.push(n);return e}function yf(t,e,n,o){let s=0,i=n[0],r;for(o=Math.ceil(o),r=0;r<t.length;r++)r===i&&(e.push(t[r]),s++,i=n[s*o])}function Un(t,e,n,o,s){const i=T(o,0),r=Math.min(T(s,t.length),t.length);let a=0,c,d,u;for(n=Math.ceil(n),s&&(c=s-o,n=c/Math.floor(c/n)),u=i;u<0;)a++,u=Math.round(i+a*n);for(d=Math.max(i,0);d<r;d++)d===u&&(e.push(t[d]),a++,u=Math.round(i+a*n))}function _f(t){const e=t.length;let n,o;if(e<2)return!1;for(o=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==o)return!1;return o}const xf=t=>t==="left"?"right":t==="right"?"left":t,Br=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,Fr=(t,e)=>Math.min(e||t,t);function $r(t,e){const n=[],o=t.length/e,s=t.length;let i=0;for(;i<s;i+=o)n.push(t[Math.floor(i)]);return n}function wf(t,e,n){const o=t.ticks.length,s=Math.min(e,o-1),i=t._startPixel,r=t._endPixel,a=1e-6;let c=t.getPixelForTick(s),d;if(!(n&&(o===1?d=Math.max(c-i,r-c):e===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(s-1))/2,c+=s<e?d:-d,c<i-a||c>r+a)))return c}function Cf(t,e){q(t,n=>{const o=n.gc,s=o.length/2;let i;if(s>e){for(i=0;i<s;++i)delete n.data[o[i]];o.splice(0,s)}})}function ln(t){return t.drawTicks?t.tickLength:0}function Pr(t,e){if(!t.display)return 0;const n=re(t.font,e),o=fe(t.padding);return(J(t.text)?t.text.length:1)*n.lineHeight+o.height}function kf(t,e){return it(t,{scale:e,type:"scale"})}function Sf(t,e,n){return it(t,{tick:n,index:e,type:"tick"})}function vf(t,e,n){let o=No(t);return(n&&e!=="right"||!n&&e==="right")&&(o=xf(o)),o}function Mf(t,e,n,o){const{top:s,left:i,bottom:r,right:a,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,p,h,g;const m=r-s,b=a-i;if(t.isHorizontal()){if(h=ue(o,i,a),j(n)){const y=Object.keys(n)[0],_=n[y];g=u[y].getPixelForValue(_)+m-e}else n==="center"?g=(d.bottom+d.top)/2+m-e:g=Br(t,n,e);p=a-i}else{if(j(n)){const y=Object.keys(n)[0],_=n[y];h=u[y].getPixelForValue(_)-b+e}else n==="center"?h=(d.left+d.right)/2-b+e:h=Br(t,n,e);g=ue(o,r,s),f=n==="left"?-se:se}return{titleX:h,titleY:g,maxWidth:p,rotation:f}}class St extends We{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:o,_suggestedMax:s}=this;return e=_e(e,Number.POSITIVE_INFINITY),n=_e(n,Number.NEGATIVE_INFINITY),o=_e(o,Number.POSITIVE_INFINITY),s=_e(s,Number.NEGATIVE_INFINITY),{min:_e(e,o),max:_e(n,s),minDefined:ne(e),maxDefined:ne(n)}}getMinMax(e){let{min:n,max:o,minDefined:s,maxDefined:i}=this.getUserBounds(),r;if(s&&i)return{min:n,max:o};const a=this.getMatchingVisibleMetas();for(let c=0,d=a.length;c<d;++c)r=a[c].controller.getMinMax(this,e),s||(n=Math.min(n,r.min)),i||(o=Math.max(o,r.max));return n=i&&n>o?o:n,o=s&&n>o?n:o,{min:_e(n,_e(o,n)),max:_e(o,_e(n,o))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Z(this.options.beforeUpdate,[this])}update(e,n,o){const{beginAtZero:s,grace:i,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=o=Object.assign({left:0,right:0,top:0,bottom:0},o),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+o.left+o.right:this.height+o.top+o.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Pd(this,i,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?$r(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=pf(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,o;this.isHorizontal()?(n=this.left,o=this.right):(n=this.top,o=this.bottom,e=!e),this._startPixel=n,this._endPixel=o,this._reversePixels=e,this._length=o-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Z(this.options.afterUpdate,[this])}beforeSetDimensions(){Z(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(){Z(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Z(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let o,s,i;for(o=0,s=e.length;o<s;o++)i=e[o],i.label=Z(n.callback,[i.value,o,e],this)}afterTickToLabelConversion(){Z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,o=Fr(this.ticks.length,e.ticks.maxTicksLimit),s=n.minRotation||0,i=n.maxRotation;let r=s,a,c,d;if(!this._isVisible()||!n.display||s>=i||o<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,p=u.highest.height,h=ae(this.chart.width-f,0,this.maxWidth);a=e.offset?this.maxWidth/o:h/(o-1),f+6>a&&(a=h/(o-(e.offset?.5:1)),c=this.maxHeight-ln(e.grid)-n.padding-Pr(e.title,this.chart.options.font),d=Math.sqrt(f*f+p*p),r=Po(Math.min(Math.asin(ae((u.highest.height+6)/a,-1,1)),Math.asin(ae(c/d,-1,1))-Math.asin(ae(p/d,-1,1)))),r=Math.max(s,Math.min(i,r))),this.labelRotation=r}afterCalculateLabelRotation(){Z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Z(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:o,title:s,grid:i}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const c=Pr(s,n.options.font);if(a?(e.width=this.maxWidth,e.height=ln(i)+c):(e.height=this.maxHeight,e.width=ln(i)+c),o.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:p}=this._getLabelSizes(),h=o.padding*2,g=Me(this.labelRotation),m=Math.cos(g),b=Math.sin(g);if(a){const y=o.mirror?0:b*f.width+m*p.height;e.height=Math.min(this.maxHeight,e.height+y+h)}else{const y=o.mirror?0:m*f.width+b*p.height;e.width=Math.min(this.maxWidth,e.width+y+h)}this._calculatePadding(d,u,b,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,o,s){const{ticks:{align:i,padding:r},position:a}=this.options,c=this.labelRotation!==0,d=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,h=0;c?d?(p=s*e.width,h=o*n.height):(p=o*e.height,h=s*n.width):i==="start"?h=n.width:i==="end"?p=e.width:i!=="inner"&&(p=e.width/2,h=n.width/2),this.paddingLeft=Math.max((p-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+r)*this.width/(this.width-f),0)}else{let u=n.height/2,f=e.height/2;i==="start"?(u=0,f=e.height):i==="end"&&(u=n.height,f=0),this.paddingTop=u+r,this.paddingBottom=f+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Z(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,o;for(n=0,o=e.length;n<o;n++)Y(e[n].label)&&(e.splice(n,1),o--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let o=this.ticks;n<o.length&&(o=$r(o,n)),this._labelSizes=e=this._computeLabelSizes(o,o.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,o){const{ctx:s,_longestTextCache:i}=this,r=[],a=[],c=Math.floor(n/Fr(n,o));let d=0,u=0,f,p,h,g,m,b,y,_,w,S,x;for(f=0;f<n;f+=c){if(g=e[f].label,m=this._resolveTickFontOptions(f),s.font=b=m.string,y=i[b]=i[b]||{data:{},gc:[]},_=m.lineHeight,w=S=0,!Y(g)&&!J(g))w=Fn(s,y.data,y.gc,w,g),S=_;else if(J(g))for(p=0,h=g.length;p<h;++p)x=g[p],!Y(x)&&!J(x)&&(w=Fn(s,y.data,y.gc,w,x),S+=_);r.push(w),a.push(S),d=Math.max(w,d),u=Math.max(S,u)}Cf(i,n);const E=r.indexOf(d),v=a.indexOf(u),R=P=>({width:r[P]||0,height:a[P]||0});return{first:R(0),last:R(n-1),widest:R(E),highest:R(v),widths:r,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return cd(this._alignToPixels?mt(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const o=n[e];return o.$context||(o.$context=Sf(this.getContext(),e,o))}return this.$context||(this.$context=kf(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=Me(this.labelRotation),o=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),i=this._getLabelSizes(),r=e.autoSkipPadding||0,a=i?i.widest.width+r:0,c=i?i.highest.height+r:0;return this.isHorizontal()?c*o>a*s?a/o:c/s:c*s<a*o?c/o:a/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,o=this.chart,s=this.options,{grid:i,position:r,border:a}=s,c=i.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),p=ln(i),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,b=m/2,y=function(k){return mt(o,k,m)};let _,w,S,x,E,v,R,P,A,C,V,N;if(r==="top")_=y(this.bottom),v=this.bottom-p,P=_-b,C=y(e.top)+b,N=e.bottom;else if(r==="bottom")_=y(this.top),C=e.top,N=y(e.bottom)-b,v=_+b,P=this.top+p;else if(r==="left")_=y(this.right),E=this.right-p,R=_-b,A=y(e.left)+b,V=e.right;else if(r==="right")_=y(this.left),A=e.left,V=y(e.right)-b,E=_+b,R=this.left+p;else if(n==="x"){if(r==="center")_=y((e.top+e.bottom)/2+.5);else if(j(r)){const k=Object.keys(r)[0],B=r[k];_=y(this.chart.scales[k].getPixelForValue(B))}C=e.top,N=e.bottom,v=_+b,P=v+p}else if(n==="y"){if(r==="center")_=y((e.left+e.right)/2);else if(j(r)){const k=Object.keys(r)[0],B=r[k];_=y(this.chart.scales[k].getPixelForValue(B))}E=_-b,R=E-p,A=e.left,V=e.right}const D=T(s.ticks.maxTicksLimit,f),M=Math.max(1,Math.ceil(f/D));for(w=0;w<f;w+=M){const k=this.getContext(w),B=i.setContext(k),F=a.setContext(k),O=B.lineWidth,I=B.color,W=F.dash||[],U=F.dashOffset,X=B.tickWidth,K=B.tickColor,ie=B.tickBorderDash||[],de=B.tickBorderDashOffset;S=wf(this,w,c),S!==void 0&&(x=mt(o,S,O),d?E=R=A=V=x:v=P=C=N=x,h.push({tx1:E,ty1:v,tx2:R,ty2:P,x1:A,y1:C,x2:V,y2:N,width:O,color:I,borderDash:W,borderDashOffset:U,tickWidth:X,tickColor:K,tickBorderDash:ie,tickBorderDashOffset:de}))}return this._ticksLength=f,this._borderValue=_,h}_computeLabelItems(e){const n=this.axis,o=this.options,{position:s,ticks:i}=o,r=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=i,p=ln(o.grid),h=p+u,g=f?-u:h,m=-Me(this.labelRotation),b=[];let y,_,w,S,x,E,v,R,P,A,C,V,N="middle";if(s==="top")E=this.bottom-g,v=this._getXAxisLabelAlignment();else if(s==="bottom")E=this.top+g,v=this._getXAxisLabelAlignment();else if(s==="left"){const M=this._getYAxisLabelAlignment(p);v=M.textAlign,x=M.x}else if(s==="right"){const M=this._getYAxisLabelAlignment(p);v=M.textAlign,x=M.x}else if(n==="x"){if(s==="center")E=(e.top+e.bottom)/2+h;else if(j(s)){const M=Object.keys(s)[0],k=s[M];E=this.chart.scales[M].getPixelForValue(k)+h}v=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")x=(e.left+e.right)/2-h;else if(j(s)){const M=Object.keys(s)[0],k=s[M];x=this.chart.scales[M].getPixelForValue(k)}v=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(c==="start"?N="top":c==="end"&&(N="bottom"));const D=this._getLabelSizes();for(y=0,_=a.length;y<_;++y){w=a[y],S=w.label;const M=i.setContext(this.getContext(y));R=this.getPixelForTick(y)+i.labelOffset,P=this._resolveTickFontOptions(y),A=P.lineHeight,C=J(S)?S.length:1;const k=C/2,B=M.color,F=M.textStrokeColor,O=M.textStrokeWidth;let I=v;r?(x=R,v==="inner"&&(y===_-1?I=this.options.reverse?"left":"right":y===0?I=this.options.reverse?"right":"left":I="center"),s==="top"?d==="near"||m!==0?V=-C*A+A/2:d==="center"?V=-D.highest.height/2-k*A+A:V=-D.highest.height+A/2:d==="near"||m!==0?V=A/2:d==="center"?V=D.highest.height/2-k*A:V=D.highest.height-C*A,f&&(V*=-1),m!==0&&!M.showLabelBackdrop&&(x+=A/2*Math.sin(m))):(E=R,V=(1-C)*A/2);let W;if(M.showLabelBackdrop){const U=fe(M.backdropPadding),X=D.heights[y],K=D.widths[y];let ie=V-U.top,de=0-U.left;switch(N){case"middle":ie-=X/2;break;case"bottom":ie-=X;break}switch(v){case"center":de-=K/2;break;case"right":de-=K;break;case"inner":y===_-1?de-=K:y>0&&(de-=K/2);break}W={left:de,top:ie,width:K+U.width,height:X+U.height,color:M.backdropColor}}b.push({label:S,font:P,textOffset:V,options:{rotation:m,color:B,strokeColor:F,strokeWidth:O,textAlign:I,textBaseline:N,translation:[x,E],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Me(this.labelRotation))return e==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:o,mirror:s,padding:i}}=this.options,r=this._getLabelSizes(),a=e+i,c=r.widest.width;let d,u;return n==="left"?s?(u=this.right+i,o==="near"?d="left":o==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-a,o==="near"?d="right":o==="center"?(d="center",u-=c/2):(d="left",u=this.left)):n==="right"?s?(u=this.left+i,o==="near"?d="right":o==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+a,o==="near"?d="left":o==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:o,top:s,width:i,height:r}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(o,s,i,r),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(i=>i.value===e);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const n=this.options.grid,o=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let i,r;const a=(c,d,u)=>{!u.width||!u.color||(o.save(),o.lineWidth=u.width,o.strokeStyle=u.color,o.setLineDash(u.borderDash||[]),o.lineDashOffset=u.borderDashOffset,o.beginPath(),o.moveTo(c.x,c.y),o.lineTo(d.x,d.y),o.stroke(),o.restore())};if(n.display)for(i=0,r=s.length;i<r;++i){const c=s[i];n.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&a({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:e,ctx:n,options:{border:o,grid:s}}=this,i=o.setContext(this.getContext()),r=o.display?i.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,p;this.isHorizontal()?(d=mt(e,this.left,r)-r/2,u=mt(e,this.right,a)+a/2,f=p=c):(f=mt(e,this.top,r)-r/2,p=mt(e,this.bottom,a)+a/2,d=u=c),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(d,f),n.lineTo(u,p),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const o=this.ctx,s=this._computeLabelArea();s&&$n(o,s);const i=this.getLabelItems(e);for(const r of i){const a=r.options,c=r.font,d=r.label,u=r.textOffset;bt(o,d,0,u,c,a)}s&&Pn(o)}drawTitle(){const{ctx:e,options:{position:n,title:o,reverse:s}}=this;if(!o.display)return;const i=re(o.font),r=fe(o.padding),a=o.align;let c=i.lineHeight/2;n==="bottom"||n==="center"||j(n)?(c+=r.bottom,J(o.text)&&(c+=i.lineHeight*(o.text.length-1))):c+=r.top;const{titleX:d,titleY:u,maxWidth:f,rotation:p}=Mf(this,c,n,a);bt(e,o.text,0,0,i,{color:o.color,maxWidth:f,rotation:p,textAlign:vf(a,n,s),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,o=T(e.grid&&e.grid.z,-1),s=T(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==St.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:o,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),o=this.axis+"AxisID",s=[];let i,r;for(i=0,r=n.length;i<r;++i){const a=n[i];a[o]===this.id&&(!e||a.type===e)&&s.push(a)}return s}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return re(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class qn{constructor(e,n,o){this.type=e,this.scope=n,this.override=o,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let o;Vf(n)&&(o=this.register(n));const s=this.items,i=e.id,r=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+e);return i in s||(s[i]=e,Df(e,r,o),this.override&&oe.override(e.id,e.overrides)),r}get(e){return this.items[e]}unregister(e){const n=this.items,o=e.id,s=this.scope;o in n&&delete n[o],s&&o in oe[s]&&(delete oe[s][o],this.override&&delete gt[o])}}function Df(t,e,n){const o=jt(Object.create(null),[n?oe.get(n):{},oe.get(e),t.defaults]);oe.set(e,o),t.defaultRoutes&&Ef(e,t.defaultRoutes),t.descriptors&&oe.describe(e,t.descriptors)}function Ef(t,e){Object.keys(e).forEach(n=>{const o=n.split("."),s=o.pop(),i=[t].concat(o).join("."),r=e[n].split("."),a=r.pop(),c=r.join(".");oe.route(i,s,c,a)})}function Vf(t){return"id"in t&&"defaults"in t}class Rf{constructor(){this.controllers=new qn(De,"datasets",!0),this.elements=new qn(We,"elements"),this.plugins=new qn(Object,"plugins"),this.scales=new qn(St,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,o){[...n].forEach(s=>{const i=o||this._getRegistryForType(s);o||i.isForType(s)||i===this.plugins&&s.id?this._exec(e,i,s):q(s,r=>{const a=o||this._getRegistryForType(r);this._exec(e,a,r)})})}_exec(e,n,o){const s=$o(e);Z(o["before"+s],[],o),n[e](o),Z(o["after"+s],[],o)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const o=this._typedRegistries[n];if(o.isForType(e))return o}return this.plugins}_get(e,n,o){const s=n.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+o+".");return s}}var Be=new Rf;class Bf{constructor(){this._init=[]}notify(e,n,o,s){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const i=s?this._descriptors(e).filter(s):this._descriptors(e),r=this._notify(i,e,n,o);return n==="afterDestroy"&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall")),r}_notify(e,n,o,s){s=s||{};for(const i of e){const r=i.plugin,a=r[o],c=[n,s,i.options];if(Z(a,c,r)===!1&&s.cancelable)return!1}return!0}invalidate(){Y(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const o=e&&e.config,s=T(o.options&&o.options.plugins,{}),i=Ff(o);return s===!1&&!n?[]:Pf(e,i,s,n)}_notifyStateChanges(e){const n=this._oldCache||[],o=this._cache,s=(i,r)=>i.filter(a=>!r.some(c=>a.plugin.id===c.plugin.id));this._notify(s(n,o),e,"stop"),this._notify(s(o,n),e,"start")}}function Ff(t){const e={},n=[],o=Object.keys(Be.plugins.items);for(let i=0;i<o.length;i++)n.push(Be.getPlugin(o[i]));const s=t.plugins||[];for(let i=0;i<s.length;i++){const r=s[i];n.indexOf(r)===-1&&(n.push(r),e[r.id]=!0)}return{plugins:n,localIds:e}}function $f(t,e){return!e&&t===!1?null:t===!0?{}:t}function Pf(t,{plugins:e,localIds:n},o,s){const i=[],r=t.getContext();for(const a of e){const c=a.id,d=$f(o[c],s);d!==null&&i.push({plugin:a,options:Af(t.config,{plugin:a,local:n[c]},d,r)})}return i}function Af(t,{plugin:e,local:n},o,s){const i=t.pluginScopeKeys(e),r=t.getOptionScopes(o,i);return n&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function os(t,e){const n=oe.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Of(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function Nf(t,e){return t===e?"_index_":"_value_"}function Ar(t){if(t==="x"||t==="y"||t==="r")return t}function If(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function ss(t,...e){if(Ar(t))return t;for(const n of e){const o=n.axis||If(n.position)||t.length>1&&Ar(t[0].toLowerCase());if(o)return o}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Or(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function Lf(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(o=>o.xAxisID===t||o.yAxisID===t);if(n.length)return Or(t,"x",n[0])||Or(t,"y",n[0])}return{}}function Tf(t,e){const n=gt[t.type]||{scales:{}},o=e.scales||{},s=os(t.type,e),i=Object.create(null);return Object.keys(o).forEach(r=>{const a=o[r];if(!j(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const c=ss(r,a,Lf(r,t),oe.scales[a.type]),d=Nf(c,s),u=n.scales||{};i[r]=Wt(Object.create(null),[{axis:c},a,u[c],u[d]])}),t.data.datasets.forEach(r=>{const a=r.type||t.type,c=r.indexAxis||os(a,e),u=(gt[a]||{}).scales||{};Object.keys(u).forEach(f=>{const p=Of(f,c),h=r[p+"AxisID"]||p;i[h]=i[h]||Object.create(null),Wt(i[h],[{axis:p},o[h],u[f]])})}),Object.keys(i).forEach(r=>{const a=i[r];Wt(a,[oe.scales[a.type],oe.scale])}),i}function Nr(t){const e=t.options||(t.options={});e.plugins=T(e.plugins,{}),e.scales=Tf(t,e)}function Ir(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function zf(t){return t=t||{},t.data=Ir(t.data),Nr(t),t}const Lr=new Map,Tr=new Set;function Xn(t,e){let n=Lr.get(t);return n||(n=e(),Lr.set(t,n),Tr.add(n)),n}const an=(t,e,n)=>{const o=nt(e,n);o!==void 0&&t.add(o)};class Hf{constructor(e){this._config=zf(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Ir(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Nr(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Xn(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Xn(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Xn(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,o=this.type;return Xn(`${o}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const o=this._scopeCache;let s=o.get(e);return(!s||n)&&(s=new Map,o.set(e,s)),s}getOptionScopes(e,n,o){const{options:s,type:i}=this,r=this._cachedScopes(e,o),a=r.get(n);if(a)return a;const c=new Set;n.forEach(u=>{e&&(c.add(e),u.forEach(f=>an(c,e,f))),u.forEach(f=>an(c,s,f)),u.forEach(f=>an(c,gt[i]||{},f)),u.forEach(f=>an(c,oe,f)),u.forEach(f=>an(c,To,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Tr.has(n)&&r.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,gt[n]||{},oe.datasets[n]||{},{type:n},oe,To]}resolveNamedOptions(e,n,o,s=[""]){const i={$shared:!0},{resolver:r,subPrefixes:a}=zr(this._resolverCache,e,s);let c=r;if(Wf(r,n)){i.$shared=!1,o=ot(o)?o():o;const d=this.createResolver(e,o,a);c=Bt(r,o,d)}for(const d of n)i[d]=c[d];return i}createResolver(e,n,o=[""],s){const{resolver:i}=zr(this._resolverCache,e,o);return j(n)?Bt(i,n,void 0,s):i}}function zr(t,e,n){let o=t.get(e);o||(o=new Map,t.set(e,o));const s=n.join();let i=o.get(s);return i||(i={resolver:Wo(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},o.set(s,i)),i}const jf=t=>j(t)&&Object.getOwnPropertyNames(t).some(e=>ot(t[e]));function Wf(t,e){const{isScriptable:n,isIndexable:o}=ji(t);for(const s of e){const i=n(s),r=o(s),a=(r||i)&&t[s];if(i&&(ot(a)||jf(a))||r&&J(a))return!0}return!1}var Yf="4.4.1";const Gf=["top","bottom","left","right","chartArea"];function Hr(t,e){return t==="top"||t==="bottom"||Gf.indexOf(t)===-1&&e==="x"}function jr(t,e){return function(n,o){return n[t]===o[t]?n[e]-o[e]:n[t]-o[t]}}function Wr(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Z(n&&n.onComplete,[t],e)}function Uf(t){const e=t.chart,n=e.options.animation;Z(n&&n.onProgress,[t],e)}function Yr(t){return Uo()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Kn={},Gr=t=>{const e=Yr(t);return Object.values(Kn).filter(n=>n.canvas===e).pop()};function qf(t,e,n){const o=Object.keys(t);for(const s of o){const i=+s;if(i>=e){const r=t[s];delete t[s],(n>0||i>e)&&(t[i+n]=r)}}}function Xf(t,e,n,o){return!n||t.type==="mouseout"?null:o?e:t}function Zn(t,e,n){return t.options.clip?t[n]:e[n]}function Kf(t,e){const{xScale:n,yScale:o}=t;return n&&o?{left:Zn(n,e,"left"),right:Zn(n,e,"right"),top:Zn(o,e,"top"),bottom:Zn(o,e,"bottom")}:e}class Ye{static register(...e){Be.add(...e),Ur()}static unregister(...e){Be.remove(...e),Ur()}constructor(e,n){const o=this.config=new Hf(n),s=Yr(e),i=Gr(s);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const r=o.createResolver(o.chartOptionScopes(),this.getContext());this.platform=new(o.platform||hf(s)),this.platform.updateConfig(o);const a=this.platform.acquireContext(s,r.aspectRatio),c=a&&a.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Zc(),this.ctx=a,this.canvas=c,this.width=u,this.height=d,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Bf,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=hd(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],Kn[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}je.listen(this,"complete",Wr),je.listen(this,"progress",Uf),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:o,height:s,_aspectRatio:i}=this;return Y(e)?n&&i?i:s?o/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Be}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Zi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ti(this.canvas,this.ctx),this}stop(){return je.stop(this),this}resize(e,n){je.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const o=this.options,s=this.canvas,i=o.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,e,n,i),a=o.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Zi(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),Z(o.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};q(n,(o,s)=>{o.id=s})}buildOrUpdateScales(){const e=this.options,n=e.scales,o=this.scales,s=Object.keys(o).reduce((r,a)=>(r[a]=!1,r),{});let i=[];n&&(i=i.concat(Object.keys(n).map(r=>{const a=n[r],c=ss(r,a),d=c==="r",u=c==="x";return{options:a,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),q(i,r=>{const a=r.options,c=a.id,d=ss(c,a),u=T(a.type,r.dtype);(a.position===void 0||Hr(a.position,d)!==Hr(r.dposition))&&(a.position=r.dposition),s[c]=!0;let f=null;if(c in o&&o[c].type===u)f=o[c];else{const p=Be.getScale(u);f=new p({id:c,type:u,ctx:this.ctx,chart:this}),o[f.id]=f}f.init(a,e)}),q(s,(r,a)=>{r||delete o[a]}),q(o,r=>{he.configure(this,r,r.options),he.addBox(this,r)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,o=e.length;if(e.sort((s,i)=>s.index-i.index),o>n){for(let s=n;s<o;++s)this._destroyDatasetMeta(s);e.splice(n,o-n)}this._sortedMetasets=e.slice(0).sort(jr("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((o,s)=>{n.filter(i=>i===o._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let o,s;for(this._removeUnreferencedMetasets(),o=0,s=n.length;o<s;o++){const i=n[o];let r=this.getDatasetMeta(o);const a=i.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(o),r=this.getDatasetMeta(o)),r.type=a,r.indexAxis=i.indexAxis||os(a,this.options),r.order=i.order||0,r.index=o,r.label=""+i.label,r.visible=this.isDatasetVisible(o),r.controller)r.controller.updateIndex(o),r.controller.linkScales();else{const c=Be.getController(a),{datasetElementType:d,dataElementType:u}=oe.datasets[a];Object.assign(c,{dataElementType:Be.getElement(u),datasetElementType:d&&Be.getElement(d)}),r.controller=new c(this,o),e.push(r.controller)}}return this._updateMetasets(),e}_resetElements(){q(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const o=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!o.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),p=!s&&i.indexOf(f)===-1;f.buildOrUpdateElements(p),r=Math.max(+f.getMaxOverflow(),r)}r=this._minPadding=o.layout.autoPadding?r:0,this._updateLayout(r),s||q(i,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(jr("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){q(this.scales,e=>{he.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),o=new Set(e.events);(!Ci(n,o)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:o,start:s,count:i}of n){const r=o==="_removeElements"?-i:i;qf(e,s,r)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,o=i=>new Set(e.filter(r=>r[0]===i).map((r,a)=>a+","+r.splice(1).join(","))),s=o(0);for(let i=1;i<n;i++)if(!Ci(s,o(i)))return;return Array.from(s).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;he.update(this,this.width,this.height,e);const n=this.chartArea,o=n.width<=0||n.height<=0;this._layers=[],q(this.boxes,s=>{o&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,i)=>{s._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,o=this.data.datasets.length;n<o;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,o=this.data.datasets.length;n<o;++n)this._updateDataset(n,ot(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const o=this.getDatasetMeta(e),s={meta:o,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(o.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(je.has(this)?this.attached&&!je.running(this)&&je.start(this):(this.draw(),Wr({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:o,height:s}=this._resizeBeforeDraw;this._resize(o,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,o=[];let s,i;for(s=0,i=n.length;s<i;++s){const r=n[s];(!e||r.visible)&&o.push(r)}return o}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,o=e._clip,s=!o.disabled,i=Kf(e,this.chartArea),r={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&$n(n,{left:o.left===!1?0:i.left-o.left,right:o.right===!1?this.width:i.right+o.right,top:o.top===!1?0:i.top-o.top,bottom:o.bottom===!1?this.height:i.bottom+o.bottom}),e.controller.draw(),s&&Pn(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return He(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,o,s){const i=Yu.modes[n];return typeof i=="function"?i(this,e,o,s):[]}getDatasetMeta(e){const n=this.data.datasets[e],o=this._metasets;let s=o.filter(i=>i&&i._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},o.push(s)),s}getContext(){return this.$context||(this.$context=it(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const o=this.getDatasetMeta(e);return typeof o.hidden=="boolean"?!o.hidden:!n.hidden}setDatasetVisibility(e,n){const o=this.getDatasetMeta(e);o.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,o){const s=o?"show":"hide",i=this.getDatasetMeta(e),r=i.controller._resolveAnimations(void 0,s);Yt(n)?(i.data[n].hidden=!o,this.update()):(this.setDatasetVisibility(e,o),r.update(i,{visible:o}),this.update(a=>a.datasetIndex===e?s:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),je.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Ti(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Kn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,o=(i,r)=>{n.addEventListener(this,i,r),e[i]=r},s=(i,r,a)=>{i.offsetX=r,i.offsetY=a,this._eventHandler(i)};q(this.options.events,i=>o(i,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,o=(c,d)=>{n.addEventListener(this,c,d),e[c]=d},s=(c,d)=>{e[c]&&(n.removeEventListener(this,c,d),delete e[c])},i=(c,d)=>{this.canvas&&this.resize(c,d)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),o("resize",i),o("detach",r)};r=()=>{this.attached=!1,s("resize",i),this._stop(),this._resize(0,0),o("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){q(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},q(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,o){const s=o?"set":"remove";let i,r,a,c;for(n==="dataset"&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller["_"+s+"DatasetHoverStyle"]()),a=0,c=e.length;a<c;++a){r=e[a];const d=r&&this.getDatasetMeta(r.datasetIndex).controller;d&&d[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],o=e.map(({datasetIndex:i,index:r})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[r],index:r}});!Dn(o,n)&&(this._active=o,this._lastEvent=null,this._updateHoverStyles(o,n))}notifyPlugins(e,n,o){return this._plugins.notify(this,e,n,o)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,o){const s=this.options.hover,i=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),r=i(n,e),a=o?e:i(e,n);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(e,n){const o={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},s=r=>(r.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",o,s)===!1)return;const i=this._handleEvent(e,n,o.inChartArea);return o.cancelable=!1,this.notifyPlugins("afterEvent",o,s),(i||o.changed)&&this.render(),this}_handleEvent(e,n,o){const{_active:s=[],options:i}=this,r=n,a=this._getActiveElements(e,s,o,r),c=od(e),d=Xf(e,this._lastEvent,o,c);o&&(this._lastEvent=null,Z(i.onHover,[e,a,this],this),c&&Z(i.onClick,[e,a,this],this));const u=!Dn(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=d,u}_getActiveElements(e,n,o,s){if(e.type==="mouseout")return[];if(!o)return n;const i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,s)}}$(Ye,"defaults",oe),$(Ye,"instances",Kn),$(Ye,"overrides",gt),$(Ye,"registry",Be),$(Ye,"version",Yf),$(Ye,"getChart",Gr);function Ur(){return q(Ye.instances,t=>t._plugins.invalidate())}function Zf(t,e,n){const{startAngle:o,pixelMargin:s,x:i,y:r,outerRadius:a,innerRadius:c}=e;let d=s/a;t.beginPath(),t.arc(i,r,a,o-d,n+d),c>s?(d=s/c,t.arc(i,r,c,n+d,o-d,!0)):t.arc(i,r,s,n+se,o-se),t.closePath(),t.clip()}function Jf(t){return jo(t,["outerStart","outerEnd","innerStart","innerEnd"])}function Qf(t,e,n,o){const s=Jf(t.options.borderRadius),i=(n-e)/2,r=Math.min(i,o*e/2),a=c=>{const d=(n-Math.min(i,c))*o/2;return ae(c,0,Math.min(i,d))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:ae(s.innerStart,0,r),innerEnd:ae(s.innerEnd,0,r)}}function Pt(t,e,n,o){return{x:n+t*Math.cos(e),y:o+t*Math.sin(e)}}function Jn(t,e,n,o,s,i){const{x:r,y:a,startAngle:c,pixelMargin:d,innerRadius:u}=e,f=Math.max(e.outerRadius+o+n-d,0),p=u>0?u+o+n+d:0;let h=0;const g=s-c;if(o){const M=u>0?u-o:0,k=f>0?f-o:0,B=(M+k)/2,F=B!==0?g*B/(B+o):g;h=(g-F)/2}const m=Math.max(.001,g*f-n/Q)/f,b=(g-m)/2,y=c+b+h,_=s-b-h,{outerStart:w,outerEnd:S,innerStart:x,innerEnd:E}=Qf(e,p,f,_-y),v=f-w,R=f-S,P=y+w/v,A=_-S/R,C=p+x,V=p+E,N=y+x/C,D=_-E/V;if(t.beginPath(),i){const M=(P+A)/2;if(t.arc(r,a,f,P,M),t.arc(r,a,f,M,A),S>0){const O=Pt(R,A,r,a);t.arc(O.x,O.y,S,A,_+se)}const k=Pt(V,_,r,a);if(t.lineTo(k.x,k.y),E>0){const O=Pt(V,D,r,a);t.arc(O.x,O.y,E,_+se,D+Math.PI)}const B=(_-E/p+(y+x/p))/2;if(t.arc(r,a,p,_-E/p,B,!0),t.arc(r,a,p,B,y+x/p,!0),x>0){const O=Pt(C,N,r,a);t.arc(O.x,O.y,x,N+Math.PI,y-se)}const F=Pt(v,y,r,a);if(t.lineTo(F.x,F.y),w>0){const O=Pt(v,P,r,a);t.arc(O.x,O.y,w,y-se,P)}}else{t.moveTo(r,a);const M=Math.cos(P)*f+r,k=Math.sin(P)*f+a;t.lineTo(M,k);const B=Math.cos(A)*f+r,F=Math.sin(A)*f+a;t.lineTo(B,F)}t.closePath()}function eh(t,e,n,o,s){const{fullCircles:i,startAngle:r,circumference:a}=e;let c=e.endAngle;if(i){Jn(t,e,n,o,c,s);for(let d=0;d<i;++d)t.fill();isNaN(a)||(c=r+(a%ee||ee))}return Jn(t,e,n,o,c,s),t.fill(),c}function th(t,e,n,o,s){const{fullCircles:i,startAngle:r,circumference:a,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:p}=c,h=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=p,h?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let g=e.endAngle;if(i){Jn(t,e,n,o,g,s);for(let m=0;m<i;++m)t.stroke();isNaN(a)||(g=r+(a%ee||ee))}h&&Zf(t,e,g),i||(Jn(t,e,n,o,g,s),t.stroke())}class cn extends We{constructor(n){super();$(this,"circumference");$(this,"endAngle");$(this,"fullCircles");$(this,"innerRadius");$(this,"outerRadius");$(this,"pixelMargin");$(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,n&&Object.assign(this,n)}inRange(n,o,s){const i=this.getProps(["x","y"],s),{angle:r,distance:a}=Di(i,{x:n,y:o}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),h=(this.options.spacing+this.options.borderWidth)/2,m=T(p,d-c)>=ee||Ut(r,c,d),b=Te(a,u+h,f+h);return m&&b}getCenterPoint(n){const{x:o,y:s,startAngle:i,endAngle:r,innerRadius:a,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:d,spacing:u}=this.options,f=(i+r)/2,p=(a+c+u+d)/2;return{x:o+Math.cos(f)*p,y:s+Math.sin(f)*p}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:o,circumference:s}=this,i=(o.offset||0)/4,r=(o.spacing||0)/2,a=o.circular;if(this.pixelMargin=o.borderAlign==="inner"?.33:0,this.fullCircles=s>ee?Math.floor(s/ee):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*i,Math.sin(c)*i);const d=1-Math.sin(Math.min(Q,s||0)),u=i*d;n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,eh(n,this,u,r,a),th(n,this,u,r,a),n.restore()}}$(cn,"id","arc"),$(cn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),$(cn,"defaultRoutes",{backgroundColor:"backgroundColor"}),$(cn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function qr(t,e,n=e){t.lineCap=T(n.borderCapStyle,e.borderCapStyle),t.setLineDash(T(n.borderDash,e.borderDash)),t.lineDashOffset=T(n.borderDashOffset,e.borderDashOffset),t.lineJoin=T(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=T(n.borderWidth,e.borderWidth),t.strokeStyle=T(n.borderColor,e.borderColor)}function nh(t,e,n){t.lineTo(n.x,n.y)}function oh(t){return t.stepped?vd:t.tension||t.cubicInterpolationMode==="monotone"?Md:nh}function Xr(t,e,n={}){const o=t.length,{start:s=0,end:i=o-1}=n,{start:r,end:a}=e,c=Math.max(s,r),d=Math.min(i,a),u=s<r&&i<r||s>a&&i>a;return{count:o,start:c,loop:e.loop,ilen:d<c&&!u?o+d-c:d-c}}function sh(t,e,n,o){const{points:s,options:i}=e,{count:r,start:a,loop:c,ilen:d}=Xr(s,n,o),u=oh(i);let{move:f=!0,reverse:p}=o||{},h,g,m;for(h=0;h<=d;++h)g=s[(a+(p?d-h:h))%r],!g.skip&&(f?(t.moveTo(g.x,g.y),f=!1):u(t,m,g,p,i.stepped),m=g);return c&&(g=s[(a+(p?d:0))%r],u(t,m,g,p,i.stepped)),!!c}function ih(t,e,n,o){const s=e.points,{count:i,start:r,ilen:a}=Xr(s,n,o),{move:c=!0,reverse:d}=o||{};let u=0,f=0,p,h,g,m,b,y;const _=S=>(r+(d?a-S:S))%i,w=()=>{m!==b&&(t.lineTo(u,b),t.lineTo(u,m),t.lineTo(u,y))};for(c&&(h=s[_(0)],t.moveTo(h.x,h.y)),p=0;p<=a;++p){if(h=s[_(p)],h.skip)continue;const S=h.x,x=h.y,E=S|0;E===g?(x<m?m=x:x>b&&(b=x),u=(f*u+S)/++f):(w(),t.lineTo(S,x),g=E,f=0,m=b=x),y=x}w()}function is(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?ih:sh}function rh(t){return t.stepped?su:t.tension||t.cubicInterpolationMode==="monotone"?iu:wt}function lh(t,e,n,o){let s=e._path;s||(s=e._path=new Path2D,e.path(s,n,o)&&s.closePath()),qr(t,e.options),t.stroke(s)}function ah(t,e,n,o){const{segments:s,options:i}=e,r=is(e);for(const a of s)qr(t,i,a.style),t.beginPath(),r(t,e,a,{start:n,end:n+o-1})&&t.closePath(),t.stroke()}const ch=typeof Path2D=="function";function dh(t,e,n,o){ch&&!e.options.segment?lh(t,e,n,o):ah(t,e,n,o)}class rt extends We{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,n){const o=this.options;if((o.tension||o.cubicInterpolationMode==="monotone")&&!o.stepped&&!this._pointsUpdated){const s=o.spanGaps?this._loop:this._fullLoop;Kd(this._points,o,e,s,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=uu(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,o=e.length;return o&&n[e[o-1].end]}interpolate(e,n){const o=this.options,s=e[n],i=this.points,r=sr(this,{property:n,start:s,end:s});if(!r.length)return;const a=[],c=rh(o);let d,u;for(d=0,u=r.length;d<u;++d){const{start:f,end:p}=r[d],h=i[f],g=i[p];if(h===g){a.push(h);continue}const m=Math.abs((s-h[n])/(g[n]-h[n])),b=c(h,g,m,o.stepped);b[n]=e[n],a.push(b)}return a.length===1?a[0]:a}pathSegment(e,n,o){return is(this)(e,this,n,o)}path(e,n,o){const s=this.segments,i=is(this);let r=this._loop;n=n||0,o=o||this.points.length-n;for(const a of s)r&=i(e,this,a,{start:n,end:n+o-1});return!!r}draw(e,n,o,s){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),dh(e,this,o,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}$(rt,"id","line"),$(rt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),$(rt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),$(rt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Kr(t,e,n,o){const s=t.options,{[n]:i}=t.getProps([n],o);return Math.abs(e-i)<s.radius+s.hitRadius}class Qn extends We{constructor(n){super();$(this,"parsed");$(this,"skip");$(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,o,s){const i=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(n-r,2)+Math.pow(o-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(n,o){return Kr(this,n,"x",o)}inYRange(n,o){return Kr(this,n,"y",o)}getCenterPoint(n){const{x:o,y:s}=this.getProps(["x","y"],n);return{x:o,y:s}}size(n){n=n||this.options||{};let o=n.radius||0;o=Math.max(o,o&&n.hoverRadius||0);const s=o&&n.borderWidth||0;return(o+s)*2}draw(n,o){const s=this.options;this.skip||s.radius<.1||!He(this,o,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,Ho(n,s,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}$(Qn,"id","point"),$(Qn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),$(Qn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Zr(t,e){const{x:n,y:o,base:s,width:i,height:r}=t.getProps(["x","y","base","width","height"],e);let a,c,d,u,f;return t.horizontal?(f=r/2,a=Math.min(n,s),c=Math.max(n,s),d=o-f,u=o+f):(f=i/2,a=n-f,c=n+f,d=Math.min(o,s),u=Math.max(o,s)),{left:a,top:d,right:c,bottom:u}}function lt(t,e,n,o){return t?0:ae(e,n,o)}function uh(t,e,n){const o=t.options.borderWidth,s=t.borderSkipped,i=Hi(o);return{t:lt(s.top,i.top,0,n),r:lt(s.right,i.right,0,e),b:lt(s.bottom,i.bottom,0,n),l:lt(s.left,i.left,0,e)}}function fh(t,e,n){const{enableBorderRadius:o}=t.getProps(["enableBorderRadius"]),s=t.options.borderRadius,i=yt(s),r=Math.min(e,n),a=t.borderSkipped,c=o||j(s);return{topLeft:lt(!c||a.top||a.left,i.topLeft,0,r),topRight:lt(!c||a.top||a.right,i.topRight,0,r),bottomLeft:lt(!c||a.bottom||a.left,i.bottomLeft,0,r),bottomRight:lt(!c||a.bottom||a.right,i.bottomRight,0,r)}}function hh(t){const e=Zr(t),n=e.right-e.left,o=e.bottom-e.top,s=uh(t,n/2,o/2),i=fh(t,n/2,o/2);return{outer:{x:e.left,y:e.top,w:n,h:o,radius:i},inner:{x:e.left+s.l,y:e.top+s.t,w:n-s.l-s.r,h:o-s.t-s.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,i.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(s.b,s.r))}}}}function rs(t,e,n,o){const s=e===null,i=n===null,a=t&&!(s&&i)&&Zr(t,o);return a&&(s||Te(e,a.left,a.right))&&(i||Te(n,a.top,a.bottom))}function ph(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function gh(t,e){t.rect(e.x,e.y,e.w,e.h)}function ls(t,e,n={}){const o=t.x!==n.x?-e:0,s=t.y!==n.y?-e:0,i=(t.x+t.w!==n.x+n.w?e:0)-o,r=(t.y+t.h!==n.y+n.h?e:0)-s;return{x:t.x+o,y:t.y+s,w:t.w+i,h:t.h+r,radius:t.radius}}class eo extends We{constructor(e){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,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:o,backgroundColor:s}}=this,{inner:i,outer:r}=hh(this),a=ph(r.radius)?Zt:gh;e.save(),(r.w!==i.w||r.h!==i.h)&&(e.beginPath(),a(e,ls(r,n,i)),e.clip(),a(e,ls(i,-n,r)),e.fillStyle=o,e.fill("evenodd")),e.beginPath(),a(e,ls(i,n)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,n,o){return rs(this,e,n,o)}inXRange(e,n){return rs(this,e,null,n)}inYRange(e,n){return rs(this,null,e,n)}getCenterPoint(e){const{x:n,y:o,base:s,horizontal:i}=this.getProps(["x","y","base","horizontal"],e);return{x:i?(n+s)/2:n,y:i?o:(o+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}$(eo,"id","bar"),$(eo,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),$(eo,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var mh=Object.freeze({__proto__:null,ArcElement:cn,BarElement:eo,LineElement:rt,PointElement:Qn});const as=["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)"],Jr=as.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Qr(t){return as[t%as.length]}function el(t){return Jr[t%Jr.length]}function bh(t,e){return t.borderColor=Qr(e),t.backgroundColor=el(e),++e}function yh(t,e){return t.backgroundColor=t.data.map(()=>Qr(e++)),e}function _h(t,e){return t.backgroundColor=t.data.map(()=>el(e++)),e}function xh(t){let e=0;return(n,o)=>{const s=t.getDatasetMeta(o).controller;s instanceof Ct?e=yh(n,e):s instanceof en?e=_h(n,e):s&&(e=bh(n,e))}}function tl(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function wh(t){return t&&(t.borderColor||t.backgroundColor)}var Ch={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:o},options:s}=t.config,{elements:i}=s;if(!n.forceOverride&&(tl(o)||wh(s)||i&&tl(i)))return;const r=xh(t);o.forEach(r)}};function kh(t,e,n,o,s){const i=s.samples||o;if(i>=n)return t.slice(e,e+n);const r=[],a=(n-2)/(i-2);let c=0;const d=e+n-1;let u=e,f,p,h,g,m;for(r[c++]=t[u],f=0;f<i-2;f++){let b=0,y=0,_;const w=Math.floor((f+1)*a)+1+e,S=Math.min(Math.floor((f+2)*a)+1,n)+e,x=S-w;for(_=w;_<S;_++)b+=t[_].x,y+=t[_].y;b/=x,y/=x;const E=Math.floor(f*a)+1+e,v=Math.min(Math.floor((f+1)*a)+1,n)+e,{x:R,y:P}=t[u];for(h=g=-1,_=E;_<v;_++)g=.5*Math.abs((R-b)*(t[_].y-P)-(R-t[_].x)*(y-P)),g>h&&(h=g,p=t[_],m=_);r[c++]=p,u=m}return r[c++]=t[d],r}function Sh(t,e,n,o){let s=0,i=0,r,a,c,d,u,f,p,h,g,m;const b=[],y=e+n-1,_=t[e].x,S=t[y].x-_;for(r=e;r<e+n;++r){a=t[r],c=(a.x-_)/S*o,d=a.y;const x=c|0;if(x===u)d<g?(g=d,f=r):d>m&&(m=d,p=r),s=(i*s+a.x)/++i;else{const E=r-1;if(!Y(f)&&!Y(p)){const v=Math.min(f,p),R=Math.max(f,p);v!==h&&v!==E&&b.push({...t[v],x:s}),R!==h&&R!==E&&b.push({...t[R],x:s})}r>0&&E!==h&&b.push(t[E]),b.push(a),u=x,i=0,g=m=d,f=p=h=r}}return b}function nl(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function ol(t){t.data.datasets.forEach(e=>{nl(e)})}function vh(t,e){const n=e.length;let o=0,s;const{iScale:i}=t,{min:r,max:a,minDefined:c,maxDefined:d}=i.getUserBounds();return c&&(o=ae(ze(e,i.axis,r).lo,0,n-1)),d?s=ae(ze(e,i.axis,a).hi+1,o,n)-o:s=n-o,{start:o,count:s}}var Mh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){ol(t);return}const o=t.width;t.data.datasets.forEach((s,i)=>{const{_data:r,indexAxis:a}=s,c=t.getDatasetMeta(i),d=r||s.data;if(Jt([a,t.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=t.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:f,count:p}=vh(c,d);const h=n.threshold||4*o;if(p<=h){nl(s);return}Y(r)&&(s._data=d,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(n.algorithm){case"lttb":g=kh(d,f,p,o,n);break;case"min-max":g=Sh(d,f,p,o);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=g})},destroy(t){ol(t)}};function Dh(t,e,n){const o=t.segments,s=t.points,i=e.points,r=[];for(const a of o){let{start:c,end:d}=a;d=ds(c,d,s);const u=cs(n,s[c],s[d],a.loop);if(!e.segments){r.push({source:a,target:u,start:s[c],end:s[d]});continue}const f=sr(e,u);for(const p of f){const h=cs(n,i[p.start],i[p.end],p.loop),g=or(a,s,h);for(const m of g)r.push({source:m,target:p,start:{[n]:sl(u,h,"start",Math.max)},end:{[n]:sl(u,h,"end",Math.min)}})}}return r}function cs(t,e,n,o){if(o)return;let s=e[t],i=n[t];return t==="angle"&&(s=xe(s),i=xe(i)),{property:t,start:s,end:i}}function Eh(t,e){const{x:n=null,y:o=null}=t||{},s=e.points,i=[];return e.segments.forEach(({start:r,end:a})=>{a=ds(r,a,s);const c=s[r],d=s[a];o!==null?(i.push({x:c.x,y:o}),i.push({x:d.x,y:o})):n!==null&&(i.push({x:n,y:c.y}),i.push({x:n,y:d.y}))}),i}function ds(t,e,n){for(;e>t;e--){const o=n[e];if(!isNaN(o.x)&&!isNaN(o.y))break}return e}function sl(t,e,n,o){return t&&e?o(t[n],e[n]):t?t[n]:e?e[n]:0}function il(t,e){let n=[],o=!1;return J(t)?(o=!0,n=t):n=Eh(t,e),n.length?new rt({points:n,options:{tension:0},_loop:o,_fullLoop:o}):null}function rl(t){return t&&t.fill!==!1}function Vh(t,e,n){let s=t[e].fill;const i=[e];let r;if(!n)return s;for(;s!==!1&&i.indexOf(s)===-1;){if(!ne(s))return s;if(r=t[s],!r)return!1;if(r.visible)return s;i.push(s),s=r.fill}return!1}function Rh(t,e,n){const o=Ph(t);if(j(o))return isNaN(o.value)?!1:o;let s=parseFloat(o);return ne(s)&&Math.floor(s)===s?Bh(o[0],e,s,n):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}function Bh(t,e,n,o){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=o?!1:n}function Fh(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:j(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function $h(t,e,n){let o;return t==="start"?o=n:t==="end"?o=e.options.reverse?e.min:e.max:j(t)?o=t.value:o=e.getBaseValue(),o}function Ph(t){const e=t.options,n=e.fill;let o=T(n&&n.target,n);return o===void 0&&(o=!!e.backgroundColor),o===!1||o===null?!1:o===!0?"origin":o}function Ah(t){const{scale:e,index:n,line:o}=t,s=[],i=o.segments,r=o.points,a=Oh(e,n);a.push(il({x:null,y:e.bottom},o));for(let c=0;c<i.length;c++){const d=i[c];for(let u=d.start;u<=d.end;u++)Nh(s,r[u],a)}return new rt({points:s,options:{}})}function Oh(t,e){const n=[],o=t.getMatchingVisibleMetas("line");for(let s=0;s<o.length;s++){const i=o[s];if(i.index===e)break;i.hidden||n.unshift(i.dataset)}return n}function Nh(t,e,n){const o=[];for(let s=0;s<n.length;s++){const i=n[s],{first:r,last:a,point:c}=Ih(i,e,"x");if(!(!c||r&&a)){if(r)o.unshift(c);else if(t.push(c),!a)break}}t.push(...o)}function Ih(t,e,n){const o=t.interpolate(e,n);if(!o)return{};const s=o[n],i=t.segments,r=t.points;let a=!1,c=!1;for(let d=0;d<i.length;d++){const u=i[d],f=r[u.start][n],p=r[u.end][n];if(Te(s,f,p)){a=s===f,c=s===p;break}}return{first:a,last:c,point:o}}class ll{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,o){const{x:s,y:i,radius:r}=this;return n=n||{start:0,end:ee},e.arc(s,i,r,n.end,n.start,!0),!o.bounds}interpolate(e){const{x:n,y:o,radius:s}=this,i=e.angle;return{x:n+Math.cos(i)*s,y:o+Math.sin(i)*s,angle:i}}}function Lh(t){const{chart:e,fill:n,line:o}=t;if(ne(n))return Th(e,n);if(n==="stack")return Ah(t);if(n==="shape")return!0;const s=zh(t);return s instanceof ll?s:il(s,o)}function Th(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function zh(t){return(t.scale||{}).getPointPositionForValue?jh(t):Hh(t)}function Hh(t){const{scale:e={},fill:n}=t,o=Fh(n,e);if(ne(o)){const s=e.isHorizontal();return{x:s?o:null,y:s?null:o}}return null}function jh(t){const{scale:e,fill:n}=t,o=e.options,s=e.getLabels().length,i=o.reverse?e.max:e.min,r=$h(n,e,i),a=[];if(o.grid.circular){const c=e.getPointPositionForValue(0,i);return new ll({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(r)})}for(let c=0;c<s;++c)a.push(e.getPointPositionForValue(c,r));return a}function us(t,e,n){const o=Lh(e),{line:s,scale:i,axis:r}=e,a=s.options,c=a.fill,d=a.backgroundColor,{above:u=d,below:f=d}=c||{};o&&s.points.length&&($n(t,n),Wh(t,{line:s,target:o,above:u,below:f,area:n,scale:i,axis:r}),Pn(t))}function Wh(t,e){const{line:n,target:o,above:s,below:i,area:r,scale:a}=e,c=n._loop?"angle":e.axis;t.save(),c==="x"&&i!==s&&(al(t,o,r.top),cl(t,{line:n,target:o,color:s,scale:a,property:c}),t.restore(),t.save(),al(t,o,r.bottom)),cl(t,{line:n,target:o,color:i,scale:a,property:c}),t.restore()}function al(t,e,n){const{segments:o,points:s}=e;let i=!0,r=!1;t.beginPath();for(const a of o){const{start:c,end:d}=a,u=s[c],f=s[ds(c,d,s)];i?(t.moveTo(u.x,u.y),i=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(f.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function cl(t,e){const{line:n,target:o,property:s,color:i,scale:r}=e,a=Dh(n,o,s);for(const{source:c,target:d,start:u,end:f}of a){const{style:{backgroundColor:p=i}={}}=c,h=o!==!0;t.save(),t.fillStyle=p,Yh(t,r,h&&cs(s,u,f)),t.beginPath();const g=!!n.pathSegment(t,c);let m;if(h){g?t.closePath():dl(t,o,f,s);const b=!!o.pathSegment(t,d,{move:g,reverse:!0});m=g&&b,m||dl(t,o,u,s)}t.closePath(),t.fill(m?"evenodd":"nonzero"),t.restore()}}function Yh(t,e,n){const{top:o,bottom:s}=e.chart.chartArea,{property:i,start:r,end:a}=n||{};i==="x"&&(t.beginPath(),t.rect(r,o,a-r,s-o),t.clip())}function dl(t,e,n,o){const s=e.interpolate(n,o);s&&t.lineTo(s.x,s.y)}var Gh={id:"filler",afterDatasetsUpdate(t,e,n){const o=(t.data.datasets||[]).length,s=[];let i,r,a,c;for(r=0;r<o;++r)i=t.getDatasetMeta(r),a=i.dataset,c=null,a&&a.options&&a instanceof rt&&(c={visible:t.isDatasetVisible(r),index:r,fill:Rh(a,r,o),chart:t,axis:i.controller.options.indexAxis,scale:i.vScale,line:a}),i.$filler=c,s.push(c);for(r=0;r<o;++r)c=s[r],!(!c||c.fill===!1)&&(c.fill=Vh(s,r,n.propagate))},beforeDraw(t,e,n){const o=n.drawTime==="beforeDraw",s=t.getSortedVisibleDatasetMetas(),i=t.chartArea;for(let r=s.length-1;r>=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(i,a.axis),o&&a.fill&&us(t.ctx,a,i))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const o=t.getSortedVisibleDatasetMetas();for(let s=o.length-1;s>=0;--s){const i=o[s].$filler;rl(i)&&us(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,n){const o=e.meta.$filler;!rl(o)||n.drawTime!=="beforeDatasetDraw"||us(t.ctx,o,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ul=(t,e)=>{let{boxHeight:n=e,boxWidth:o=e}=t;return t.usePointStyle&&(n=Math.min(n,e),o=t.pointStyleWidth||Math.min(o,e)),{boxWidth:o,boxHeight:n,itemHeight:Math.max(e,n)}},Uh=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class fl extends We{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n,o){this.maxWidth=e,this.maxHeight=n,this._margins=o,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 e=this.options.labels||{};let n=Z(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(o=>e.filter(o,this.chart.data))),e.sort&&(n=n.sort((o,s)=>e.sort(o,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const o=e.labels,s=re(o.font),i=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=ul(o,i);let d,u;n.font=s.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(r,i,a,c)+10):(u=this.maxHeight,d=this._fitCols(r,s,a,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,o,s){const{ctx:i,maxWidth:r,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=s+a;let f=e;i.textAlign="left",i.textBaseline="middle";let p=-1,h=-u;return this.legendItems.forEach((g,m)=>{const b=o+n/2+i.measureText(g.text).width;(m===0||d[d.length-1]+b+2*a>r)&&(f+=u,d[d.length-(m>0?0:1)]=0,h+=u,p++),c[m]={left:0,top:h,row:p,width:b,height:s},d[d.length-1]+=b+a}),f}_fitCols(e,n,o,s){const{ctx:i,maxHeight:r,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=r-e;let f=a,p=0,h=0,g=0,m=0;return this.legendItems.forEach((b,y)=>{const{itemWidth:_,itemHeight:w}=qh(o,n,i,b,s);y>0&&h+w+2*a>u&&(f+=p+a,d.push({width:p,height:h}),g+=p+a,m++,p=h=0),c[y]={left:g,top:h,col:m,width:_,height:w},p=Math.max(p,_),h+=w+a}),f+=p,d.push({width:p,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:o,labels:{padding:s},rtl:i}}=this,r=$t(i,this.left,this.width);if(this.isHorizontal()){let a=0,c=ue(o,this.left+s,this.right-this.lineWidths[a]);for(const d of n)a!==d.row&&(a=d.row,c=ue(o,this.left+s,this.right-this.lineWidths[a])),d.top+=this.top+e+s,d.left=r.leftForLtr(r.x(c),d.width),c+=d.width+s}else{let a=0,c=ue(o,this.top+e+s,this.bottom-this.columnSizes[a].height);for(const d of n)d.col!==a&&(a=d.col,c=ue(o,this.top+e+s,this.bottom-this.columnSizes[a].height)),d.top=c,d.left+=this.left+s,d.left=r.leftForLtr(r.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 e=this.ctx;$n(e,this),this._draw(),Pn(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:o,ctx:s}=this,{align:i,labels:r}=e,a=oe.color,c=$t(e.rtl,this.left,this.width),d=re(r.font),{padding:u}=r,f=d.size,p=f/2;let h;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:g,boxHeight:m,itemHeight:b}=ul(r,f),y=function(E,v,R){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;s.save();const P=T(R.lineWidth,1);if(s.fillStyle=T(R.fillStyle,a),s.lineCap=T(R.lineCap,"butt"),s.lineDashOffset=T(R.lineDashOffset,0),s.lineJoin=T(R.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=T(R.strokeStyle,a),s.setLineDash(T(R.lineDash,[])),r.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:R.pointStyle,rotation:R.rotation,borderWidth:P},C=c.xPlus(E,g/2),V=v+p;zi(s,A,C,V,r.pointStyleWidth&&g)}else{const A=v+Math.max((f-m)/2,0),C=c.leftForLtr(E,g),V=yt(R.borderRadius);s.beginPath(),Object.values(V).some(N=>N!==0)?Zt(s,{x:C,y:A,w:g,h:m,radius:V}):s.rect(C,A,g,m),s.fill(),P!==0&&s.stroke()}s.restore()},_=function(E,v,R){bt(s,R.text,E,v+b/2,d,{strikethrough:R.hidden,textAlign:c.textAlign(R.textAlign)})},w=this.isHorizontal(),S=this._computeTitleHeight();w?h={x:ue(i,this.left+u,this.right-o[0]),y:this.top+u+S,line:0}:h={x:this.left+u,y:ue(i,this.top+S+u,this.bottom-n[0].height),line:0},Qi(this.ctx,e.textDirection);const x=b+u;this.legendItems.forEach((E,v)=>{s.strokeStyle=E.fontColor,s.fillStyle=E.fontColor;const R=s.measureText(E.text).width,P=c.textAlign(E.textAlign||(E.textAlign=r.textAlign)),A=g+p+R;let C=h.x,V=h.y;c.setWidth(this.width),w?v>0&&C+A+u>this.right&&(V=h.y+=x,h.line++,C=h.x=ue(i,this.left+u,this.right-o[h.line])):v>0&&V+x>this.bottom&&(C=h.x=C+n[h.line].width+u,h.line++,V=h.y=ue(i,this.top+S+u,this.bottom-n[h.line].height));const N=c.x(C);if(y(N,V,E),C=pd(P,C+g+p,w?C+A:this.right,e.rtl),_(c.x(C),V,E),w)h.x+=A+u;else if(typeof E.text!="string"){const D=d.lineHeight;h.y+=hl(E,D)+u}else h.y+=x}),er(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,o=re(n.font),s=fe(n.padding);if(!n.display)return;const i=$t(e.rtl,this.left,this.width),r=this.ctx,a=n.position,c=o.size/2,d=s.top+c;let u,f=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+d,f=ue(e.align,f,this.right-p);else{const g=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);u=d+ue(e.align,this.top,this.bottom-g-e.labels.padding-this._computeTitleHeight())}const h=ue(a,f,f+p);r.textAlign=i.textAlign(No(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=o.string,bt(r,n.text,h,u,o)}_computeTitleHeight(){const e=this.options.title,n=re(e.font),o=fe(e.padding);return e.display?n.lineHeight+o.height:0}_getLegendItemAt(e,n){let o,s,i;if(Te(e,this.left,this.right)&&Te(n,this.top,this.bottom)){for(i=this.legendHitBoxes,o=0;o<i.length;++o)if(s=i[o],Te(e,s.left,s.left+s.width)&&Te(n,s.top,s.top+s.height))return this.legendItems[o]}return null}handleEvent(e){const n=this.options;if(!Zh(e.type,n))return;const o=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const s=this._hoveredItem,i=Uh(s,o);s&&!i&&Z(n.onLeave,[e,s,this],this),this._hoveredItem=o,o&&!i&&Z(n.onHover,[e,o,this],this)}else o&&Z(n.onClick,[e,o,this],this)}}function qh(t,e,n,o,s){const i=Xh(o,t,e,n),r=Kh(s,o,e.lineHeight);return{itemWidth:i,itemHeight:r}}function Xh(t,e,n,o){let s=t.text;return s&&typeof s!="string"&&(s=s.reduce((i,r)=>i.length>r.length?i:r)),e+n.size/2+o.measureText(s).width}function Kh(t,e,n){let o=t;return typeof e.text!="string"&&(o=hl(e,n)),o}function hl(t,e){const n=t.text?t.text.length:0;return e*n}function Zh(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var Jh={id:"legend",_element:fl,start(t,e,n){const o=t.legend=new fl({ctx:t.ctx,options:n,chart:t});he.configure(t,o,n),he.addBox(t,o)},stop(t){he.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const o=t.legend;he.configure(t,o,n),o.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const o=e.datasetIndex,s=n.chart;s.isDatasetVisible(o)?(s.hide(o),e.hidden=!0):(s.show(o),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:o,textAlign:s,color:i,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(n?0:void 0),u=fe(d.borderWidth);return{text:e[c.index].label,fillStyle:d.backgroundColor,fontColor:i,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:o||d.pointStyle,rotation:d.rotation,textAlign:s||d.textAlign,borderRadius:r&&(a||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class fs extends We{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n){const o=this.options;if(this.left=0,this.top=0,!o.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const s=J(o.text)?o.text.length:1;this._padding=fe(o.padding);const i=s*re(o.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:o,bottom:s,right:i,options:r}=this,a=r.align;let c=0,d,u,f;return this.isHorizontal()?(u=ue(a,o,i),f=n+e,d=i-o):(r.position==="left"?(u=o+e,f=ue(a,s,n),c=Q*-.5):(u=i-e,f=ue(a,n,s),c=Q*.5),d=s-n),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const o=re(n.font),i=o.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:c,rotation:d}=this._drawArgs(i);bt(e,n.text,0,0,o,{color:n.color,maxWidth:c,rotation:d,textAlign:No(n.align),textBaseline:"middle",translation:[r,a]})}}function Qh(t,e){const n=new fs({ctx:t.ctx,options:e,chart:t});he.configure(t,n,e),he.addBox(t,n),t.titleBlock=n}var ep={id:"title",_element:fs,start(t,e,n){Qh(t,n)},stop(t){const e=t.titleBlock;he.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const o=t.titleBlock;he.configure(t,o,n),o.options=n},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 to=new WeakMap;var tp={id:"subtitle",start(t,e,n){const o=new fs({ctx:t.ctx,options:n,chart:t});he.configure(t,o,n),he.addBox(t,o),to.set(t,o)},stop(t){he.removeBox(t,to.get(t)),to.delete(t)},beforeUpdate(t,e,n){const o=to.get(t);he.configure(t,o,n),o.options=n},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 dn={average(t){if(!t.length)return!1;let e,n,o=0,s=0,i=0;for(e=0,n=t.length;e<n;++e){const r=t[e].element;if(r&&r.hasValue()){const a=r.tooltipPosition();o+=a.x,s+=a.y,++i}}return{x:o/i,y:s/i}},nearest(t,e){if(!t.length)return!1;let n=e.x,o=e.y,s=Number.POSITIVE_INFINITY,i,r,a;for(i=0,r=t.length;i<r;++i){const c=t[i].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Ao(e,d);u<s&&(s=u,a=c)}}if(a){const c=a.tooltipPosition();n=c.x,o=c.y}return{x:n,y:o}}};function Fe(t,e){return e&&(J(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ge(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
25
25
|
`)>-1?t.split(`
|
|
26
|
-
`):t}function Gh(t,e){const{element:n,datasetIndex:o,index:i}=e,s=t.getDatasetMeta(o).controller,{label:r,value:a}=s.getLabelAndValue(i);return{chart:t,label:r,parsed:s.getParsed(i),raw:t.data.datasets[o].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:o,element:n}}function il(t,e){const n=t.chart.ctx,{body:o,footer:i,title:s}=t,{boxWidth:r,boxHeight:a}=e,c=oe(e.bodyFont),d=oe(e.titleFont),u=oe(e.footerFont),f=s.length,p=i.length,h=o.length,g=ae(e.padding);let m=g.height,b=0,x=o.reduce((S,_)=>S+_.before.length+_.lines.length+_.after.length,0);if(x+=t.beforeBody.length+t.afterBody.length,f&&(m+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),x){const S=e.displayColors?Math.max(a,c.lineHeight):c.lineHeight;m+=h*S+(x-h)*c.lineHeight+(x-1)*e.bodySpacing}p&&(m+=e.footerMarginTop+p*u.lineHeight+(p-1)*e.footerSpacing);let y=0;const w=function(S){b=Math.max(b,n.measureText(S).width+y)};return n.save(),n.font=d.string,W(t.title,w),n.font=c.string,W(t.beforeBody.concat(t.afterBody),w),y=e.displayColors?r+2+e.boxPadding:0,W(o,S=>{W(S.before,w),W(S.lines,w),W(S.after,w)}),y=0,n.font=u.string,W(t.footer,w),n.restore(),b+=g.width,{width:b,height:m}}function Uh(t,e){const{y:n,height:o}=e;return n<o/2?"top":n>t.height-o/2?"bottom":"center"}function qh(t,e,n,o){const{x:i,width:s}=o,r=n.caretSize+n.caretPadding;if(t==="left"&&i+s+r>e.width||t==="right"&&i-s-r<0)return!0}function Xh(t,e,n,o){const{x:i,width:s}=n,{width:r,chartArea:{left:a,right:c}}=t;let d="center";return o==="center"?d=i<=(a+c)/2?"left":"right":i<=s/2?d="left":i>=r-s/2&&(d="right"),qh(d,t,e,n)&&(d="center"),d}function sl(t,e,n){const o=n.yAlign||e.yAlign||Uh(t,n);return{xAlign:n.xAlign||e.xAlign||Xh(t,e,n,o),yAlign:o}}function Kh(t,e){let{x:n,width:o}=t;return e==="right"?n-=o:e==="center"&&(n-=o/2),n}function Zh(t,e,n){let{y:o,height:i}=t;return e==="top"?o+=n:e==="bottom"?o-=i+n:o-=i/2,o}function rl(t,e,n,o){const{caretSize:i,caretPadding:s,cornerRadius:r}=t,{xAlign:a,yAlign:c}=n,d=i+s,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:h}=ht(r);let g=Kh(e,a);const m=Zh(e,c,d);return c==="center"?a==="left"?g+=d:a==="right"&&(g-=d):a==="left"?g-=Math.max(u,p)+i:a==="right"&&(g+=Math.max(f,h)+i),{x:se(g,0,o.width-e.width),y:se(m,0,o.height-e.height)}}function Zn(t,e,n){const o=ae(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-o.right:t.x+o.left}function ll(t){return Fe([],ze(t))}function Jh(t,e,n){return Qe(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function al(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const cl={beforeTitle:Pe,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,o=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(o>0&&e.dataIndex<o)return n[e.dataIndex]}return""},afterTitle:Pe,beforeBody:Pe,beforeLabel:Pe,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return H(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Pe,afterBody:Pe,beforeFooter:Pe,footer:Pe,afterFooter:Pe};function he(t,e,n,o){const i=t[e].call(n,o);return typeof i>"u"?cl[e].call(n,o):i}class li extends Le{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,o=this.options.setContext(this.getContext()),i=o.enabled&&n.options.animation&&o.animations,s=new Js(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Jh(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:o}=n,i=he(o,"beforeTitle",this,e),s=he(o,"title",this,e),r=he(o,"afterTitle",this,e);let a=[];return a=Fe(a,ze(i)),a=Fe(a,ze(s)),a=Fe(a,ze(r)),a}getBeforeBody(e,n){return ll(he(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:o}=n,i=[];return W(e,s=>{const r={before:[],lines:[],after:[]},a=al(o,s);Fe(r.before,ze(he(a,"beforeLabel",this,s))),Fe(r.lines,he(a,"label",this,s)),Fe(r.after,ze(he(a,"afterLabel",this,s))),i.push(r)}),i}getAfterBody(e,n){return ll(he(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:o}=n,i=he(o,"beforeFooter",this,e),s=he(o,"footer",this,e),r=he(o,"afterFooter",this,e);let a=[];return a=Fe(a,ze(i)),a=Fe(a,ze(s)),a=Fe(a,ze(r)),a}_createItems(e){const n=this._active,o=this.chart.data,i=[],s=[],r=[];let a=[],c,d;for(c=0,d=n.length;c<d;++c)a.push(Gh(this.chart,n[c]));return e.filter&&(a=a.filter((u,f,p)=>e.filter(u,f,p,o))),e.itemSort&&(a=a.sort((u,f)=>e.itemSort(u,f,o))),W(a,u=>{const f=al(e.callbacks,u);i.push(he(f,"labelColor",this,u)),s.push(he(f,"labelPointStyle",this,u)),r.push(he(f,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=r,this.dataPoints=a,a}update(e,n){const o=this.options.setContext(this.getContext()),i=this._active;let s,r=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=rn[o.position].call(this,i,this._eventPosition);r=this._createItems(o),this.title=this.getTitle(r,o),this.beforeBody=this.getBeforeBody(r,o),this.body=this.getBody(r,o),this.afterBody=this.getAfterBody(r,o),this.footer=this.getFooter(r,o);const c=this._size=il(this,o),d=Object.assign({},a,c),u=sl(this.chart,o,d),f=rl(o,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&o.external&&o.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,o,i){const s=this.getCaretPosition(e,o,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(e,n,o){const{xAlign:i,yAlign:s}=this,{caretSize:r,cornerRadius:a}=o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=ht(a),{x:p,y:h}=e,{width:g,height:m}=n;let b,x,y,w,S,_;return s==="center"?(S=h+m/2,i==="left"?(b=p,x=b-r,w=S+r,_=S-r):(b=p+g,x=b+r,w=S-r,_=S+r),y=b):(i==="left"?x=p+Math.max(c,u)+r:i==="right"?x=p+g-Math.max(d,f)-r:x=this.caretX,s==="top"?(w=h,S=w-r,b=x-r,y=x+r):(w=h+m,S=w+r,b=x+r,y=x-r),_=w),{x1:b,x2:x,x3:y,y1:w,y2:S,y3:_}}drawTitle(e,n,o){const i=this.title,s=i.length;let r,a,c;if(s){const d=Rt(o.rtl,this.x,this.width);for(e.x=Zn(this,o.titleAlign,o),n.textAlign=d.textAlign(o.titleAlign),n.textBaseline="middle",r=oe(o.titleFont),a=o.titleSpacing,n.fillStyle=o.titleColor,n.font=r.string,c=0;c<s;++c)n.fillText(i[c],d.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+a,c+1===s&&(e.y+=o.titleMarginBottom-a)}}_drawColorBox(e,n,o,i,s){const r=this.labelColors[o],a=this.labelPointStyles[o],{boxHeight:c,boxWidth:d}=s,u=oe(s.bodyFont),f=Zn(this,"left",s),p=i.x(f),h=c<u.lineHeight?(u.lineHeight-c)/2:0,g=n.y+h;if(s.usePointStyle){const m={radius:Math.min(d,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=i.leftForLtr(p,d)+d/2,x=g+c/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,Oo(e,m,b,x),e.strokeStyle=r.borderColor,e.fillStyle=r.backgroundColor,Oo(e,m,b,x)}else{e.lineWidth=z(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,e.strokeStyle=r.borderColor,e.setLineDash(r.borderDash||[]),e.lineDashOffset=r.borderDashOffset||0;const m=i.leftForLtr(p,d),b=i.leftForLtr(i.xPlus(p,1),d-2),x=ht(r.borderRadius);Object.values(x).some(y=>y!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Ut(e,{x:m,y:g,w:d,h:c,radius:x}),e.fill(),e.stroke(),e.fillStyle=r.backgroundColor,e.beginPath(),Ut(e,{x:b,y:g+1,w:d-2,h:c-2,radius:x}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(m,g,d,c),e.strokeRect(m,g,d,c),e.fillStyle=r.backgroundColor,e.fillRect(b,g+1,d-2,c-2))}e.fillStyle=this.labelTextColors[o]}drawBody(e,n,o){const{body:i}=this,{bodySpacing:s,bodyAlign:r,displayColors:a,boxHeight:c,boxWidth:d,boxPadding:u}=o,f=oe(o.bodyFont);let p=f.lineHeight,h=0;const g=Rt(o.rtl,this.x,this.width),m=function(k){n.fillText(k,g.x(e.x+h),e.y+p/2),e.y+=p+s},b=g.textAlign(r);let x,y,w,S,_,C,v;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,e.x=Zn(this,b,o),n.fillStyle=o.bodyColor,W(this.beforeBody,m),h=a&&b!=="right"?r==="center"?d/2+u:d+2+u:0,S=0,C=i.length;S<C;++S){for(x=i[S],y=this.labelTextColors[S],n.fillStyle=y,W(x.before,m),w=x.lines,a&&w.length&&(this._drawColorBox(n,e,S,g,o),p=Math.max(f.lineHeight,c)),_=0,v=w.length;_<v;++_)m(w[_]),p=f.lineHeight;W(x.after,m)}h=0,p=f.lineHeight,W(this.afterBody,m),e.y-=s}drawFooter(e,n,o){const i=this.footer,s=i.length;let r,a;if(s){const c=Rt(o.rtl,this.x,this.width);for(e.x=Zn(this,o.footerAlign,o),e.y+=o.footerMarginTop,n.textAlign=c.textAlign(o.footerAlign),n.textBaseline="middle",r=oe(o.footerFont),n.fillStyle=o.footerColor,n.font=r.string,a=0;a<s;++a)n.fillText(i[a],c.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+o.footerSpacing}}drawBackground(e,n,o,i){const{xAlign:s,yAlign:r}=this,{x:a,y:c}=e,{width:d,height:u}=o,{topLeft:f,topRight:p,bottomLeft:h,bottomRight:g}=ht(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,c),r==="top"&&this.drawCaret(e,n,o,i),n.lineTo(a+d-p,c),n.quadraticCurveTo(a+d,c,a+d,c+p),r==="center"&&s==="right"&&this.drawCaret(e,n,o,i),n.lineTo(a+d,c+u-g),n.quadraticCurveTo(a+d,c+u,a+d-g,c+u),r==="bottom"&&this.drawCaret(e,n,o,i),n.lineTo(a+h,c+u),n.quadraticCurveTo(a,c+u,a,c+u-h),r==="center"&&s==="left"&&this.drawCaret(e,n,o,i),n.lineTo(a,c+f),n.quadraticCurveTo(a,c,a+f,c),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,o=this.$animations,i=o&&o.x,s=o&&o.y;if(i||s){const r=rn[e.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=il(this,e),c=Object.assign({},r,this._size),d=sl(n,e,c),u=rl(e,c,d,n);(i._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let o=this.opacity;if(!o)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};o=Math.abs(o)<.001?0:o;const r=ae(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=o,this.drawBackground(s,e,i,n),js(e,n.textDirection),s.y+=r.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),Ws(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const o=this._active,i=e.map(({datasetIndex:a,index:c})=>{const d=this.chart.getDatasetMeta(a);if(!d)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:d.data[c],index:c}}),s=!Cn(o,i),r=this._positionChanged(i,n);(s||r)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,o=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],r=this._getActiveElements(e,s,n,o),a=this._positionChanged(r,e),c=n||!Cn(r,s)||a;return c&&(this._active=r,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,o,i){const s=this.options;if(e.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(e,s.mode,s,o);return s.reverse&&r.reverse(),r}_positionChanged(e,n){const{caretX:o,caretY:i,options:s}=this,r=rn[s.position].call(this,e,n);return r!==!1&&(o!==r.x||i!==r.y)}}F(li,"positioners",rn);var Qh={id:"tooltip",_element:li,positioners:rn,afterInit(t,e,n){n&&(t.tooltip=new li({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:cl},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ep=Object.freeze({__proto__:null,Colors:fh,Decimation:mh,Filler:Oh,Legend:Hh,SubTitle:Yh,Title:Wh,Tooltip:Qh});const tp=(t,e,n,o)=>(typeof e=="string"?(n=t.push(e)-1,o.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function np(t,e,n,o){const i=t.indexOf(e);if(i===-1)return tp(t,e,n,o);const s=t.lastIndexOf(e);return i!==s?n:i}const op=(t,e)=>t===null?null:se(Math.round(t),0,e);function dl(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class ai extends _t{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const o=this.getLabels();for(const{index:i,label:s}of n)o[i]===s&&o.splice(i,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(H(e))return null;const o=this.getLabels();return n=isFinite(n)&&o[n]===e?n:np(o,e,T(n,e),this._addedLabels),op(n,o.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:o,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(o=0),n||(i=this.getLabels().length-1)),this.min=o,this.max=i}buildTicks(){const e=this.min,n=this.max,o=this.options.offset,i=[];let s=this.getLabels();s=e===0&&n===s.length-1?s:s.slice(e,n+1),this._valueRange=Math.max(s.length-(o?0:1),1),this._startValue=this.min-(o?.5:0);for(let r=e;r<=n;r++)i.push({value:r});return i}getLabelForValue(e){return dl.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}F(ai,"id","category"),F(ai,"defaults",{ticks:{callback:dl}});function ip(t,e){const n=[],{bounds:i,step:s,min:r,max:a,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:p}=t,h=s||1,g=u-1,{min:m,max:b}=e,x=!H(r),y=!H(a),w=!H(d),S=(b-m)/(f+1);let _=ps((b-m)/g/h)*h,C,v,k,M;if(_<1e-14&&!x&&!y)return[{value:m},{value:b}];M=Math.ceil(b/_)-Math.floor(m/_),M>g&&(_=ps(M*_/g/h)*h),H(c)||(C=Math.pow(10,c),_=Math.ceil(_*C)/C),i==="ticks"?(v=Math.floor(m/_)*_,k=Math.ceil(b/_)*_):(v=m,k=b),x&&y&&s&&Zc((a-r)/s,_/1e3)?(M=Math.round(Math.min((a-r)/_,u)),_=(a-r)/M,v=r,k=a):w?(v=x?r:v,k=y?a:k,M=d-1,_=(k-v)/M):(M=(k-v)/_,Ht(M,Math.round(M),_/1e3)?M=Math.round(M):M=Math.ceil(M));const V=Math.max(ms(_),ms(v));C=Math.pow(10,H(c)?V:c),v=Math.round(v*C)/C,k=Math.round(k*C)/C;let $=0;for(x&&(p&&v!==r?(n.push({value:r}),v<r&&$++,Ht(Math.round((v+$*_)*C)/C,r,ul(r,S,t))&&$++):v<r&&$++);$<M;++$){const O=Math.round((v+$*_)*C)/C;if(y&&O>a)break;n.push({value:O})}return y&&p&&k!==a?n.length&&Ht(n[n.length-1].value,a,ul(a,S,t))?n[n.length-1].value=a:n.push({value:a}):(!y||k===a)&&n.push({value:k}),n}function ul(t,e,{horizontal:n,minRotation:o}){const i=ve(o),s=(n?Math.sin(i):Math.cos(i))||.001,r=.75*e*(""+t).length;return Math.min(e/s,r)}class Jn extends _t{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return H(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:i,max:s}=this;const r=c=>i=n?i:c,a=c=>s=o?s:c;if(e){const c=Ve(i),d=Ve(s);c<0&&d<0?a(0):c>0&&d>0&&r(0)}if(i===s){let c=s===0?1:Math.abs(s*.05);a(s+c),e||r(i-c)}this.min=i,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:o}=e,i;return o?(i=Math.ceil(this.max/o)-Math.floor(this.min/o)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${o} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let o=this.getTickLimit();o=Math.max(2,o);const i={maxTicks:o,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,r=ip(i,s);return e.bounds==="ticks"&&gs(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let n=this.min,o=this.max;if(super.configure(),this.options.offset&&e.length){const i=(o-n)/Math.max(e.length-1,1)/2;n-=i,o+=i}this._startValue=n,this._endValue=o,this._valueRange=o-n}getLabelForValue(e){return Yt(e,this.chart.options.locale,this.options.ticks.format)}}class ci extends Jn{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ee(e)?e:0,this.max=ee(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,o=ve(this.options.ticks.minRotation),i=(e?Math.sin(o):Math.cos(o))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}F(ci,"id","linear"),F(ci,"defaults",{ticks:{callback:Mn.formatters.numeric}});const ln=t=>Math.floor(Je(t)),xt=(t,e)=>Math.pow(10,ln(t)+e);function fl(t){return t/Math.pow(10,ln(t))===1}function hl(t,e,n){const o=Math.pow(10,n),i=Math.floor(t/o);return Math.ceil(e/o)-i}function sp(t,e){const n=e-t;let o=ln(n);for(;hl(t,e,o)>10;)o++;for(;hl(t,e,o)<10;)o--;return Math.min(o,ln(t))}function rp(t,{min:e,max:n}){e=ye(t.min,e);const o=[],i=ln(e);let s=sp(e,n),r=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),c=i>s?Math.pow(10,i):0,d=Math.round((e-c)*r)/r,u=Math.floor((e-c)/a/10)*a*10;let f=Math.floor((d-u)/Math.pow(10,s)),p=ye(t.min,Math.round((c+u+f*Math.pow(10,s))*r)/r);for(;p<n;)o.push({value:p,major:fl(p),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,r=s>=0?1:r),p=Math.round((c+u+f*Math.pow(10,s))*r)/r;const h=ye(t.max,p);return o.push({value:h,major:fl(h),significand:f}),o}class di extends _t{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const o=Jn.prototype.parse.apply(this,[e,n]);if(o===0){this._zero=!0;return}return ee(o)&&o>0?o:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ee(e)?Math.max(0,e):null,this.max=ee(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ee(this._userMin)&&(this.min=e===xt(this.min,0)?xt(this.min,-1):xt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let o=this.min,i=this.max;const s=a=>o=e?o:a,r=a=>i=n?i:a;o===i&&(o<=0?(s(1),r(10)):(s(xt(o,-1)),r(xt(i,1)))),o<=0&&s(xt(i,-1)),i<=0&&r(xt(o,1)),this.min=o,this.max=i}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},o=rp(n,this);return e.bounds==="ticks"&&gs(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}getLabelForValue(e){return e===void 0?"0":Yt(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Je(e),this._valueRange=Je(this.max)-Je(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Je(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}F(di,"id","logarithmic"),F(di,"defaults",{ticks:{callback:Mn.formatters.logarithmic,major:{enabled:!0}}});function ui(t){const e=t.ticks;if(e.display&&t.display){const n=ae(e.backdropPadding);return T(e.font&&e.font.size,te.font.size)+n.height}return 0}function lp(t,e,n){return n=q(n)?n:[n],{w:pd(t,e.string,n),h:n.length*e.lineHeight}}function pl(t,e,n,o,i){return t===o||t===i?{start:e-n/2,end:e+n/2}:t<o||t>i?{start:e-n,end:e}:{start:e,end:e+n}}function ap(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),o=[],i=[],s=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?X/s:0;for(let c=0;c<s;c++){const d=r.setContext(t.getPointLabelContext(c));i[c]=d.padding;const u=t.getPointPosition(c,t.drawingArea+i[c],a),f=oe(d.font),p=lp(t.ctx,f,t._pointLabels[c]);o[c]=p;const h=_e(t.getIndexAngle(c)+a),g=Math.round(Do(h)),m=pl(g,u.x,p.w,0,180),b=pl(g,u.y,p.h,90,270);cp(n,e,h,m,b)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=fp(t,o,i)}function cp(t,e,n,o,i){const s=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n));let a=0,c=0;o.start<e.l?(a=(e.l-o.start)/s,t.l=Math.min(t.l,e.l-a)):o.end>e.r&&(a=(o.end-e.r)/s,t.r=Math.max(t.r,e.r+a)),i.start<e.t?(c=(e.t-i.start)/r,t.t=Math.min(t.t,e.t-c)):i.end>e.b&&(c=(i.end-e.b)/r,t.b=Math.max(t.b,e.b+c))}function dp(t,e,n){const o=t.drawingArea,{extra:i,additionalAngle:s,padding:r,size:a}=n,c=t.getPointPosition(e,o+i+r,s),d=Math.round(Do(_e(c.angle+ne))),u=gp(c.y,a.h,d),f=hp(d),p=pp(c.x,a.w,f);return{visible:!0,x:c.x,y:u,textAlign:f,left:p,top:u,right:p+a.w,bottom:u+a.h}}function up(t,e){if(!e)return!0;const{left:n,top:o,right:i,bottom:s}=t;return!(Ne({x:n,y:o},e)||Ne({x:n,y:s},e)||Ne({x:i,y:o},e)||Ne({x:i,y:s},e))}function fp(t,e,n){const o=[],i=t._pointLabels.length,s=t.options,{centerPointLabels:r,display:a}=s.pointLabels,c={extra:ui(s)/2,additionalAngle:r?X/i:0};let d;for(let u=0;u<i;u++){c.padding=n[u],c.size=e[u];const f=dp(t,u,c);o.push(f),a==="auto"&&(f.visible=up(f,d),f.visible&&(d=f))}return o}function hp(t){return t===0||t===180?"center":t<180?"left":"right"}function pp(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function gp(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function mp(t,e,n){const{left:o,top:i,right:s,bottom:r}=n,{backdropColor:a}=e;if(!H(a)){const c=ht(e.borderRadius),d=ae(e.backdropPadding);t.fillStyle=a;const u=o-d.left,f=i-d.top,p=s-o+d.width,h=r-i+d.height;Object.values(c).some(g=>g!==0)?(t.beginPath(),Ut(t,{x:u,y:f,w:p,h,radius:c}),t.fill()):t.fillRect(u,f,p,h)}}function bp(t,e){const{ctx:n,options:{pointLabels:o}}=t;for(let i=e-1;i>=0;i--){const s=t._pointLabelItems[i];if(!s.visible)continue;const r=o.setContext(t.getPointLabelContext(i));mp(n,r,s);const a=oe(r.font),{x:c,y:d,textAlign:u}=s;ft(n,t._pointLabels[i],c,d+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function gl(t,e,n,o){const{ctx:i}=t;if(n)i.arc(t.xCenter,t.yCenter,e,0,K);else{let s=t.getPointPosition(0,e);i.moveTo(s.x,s.y);for(let r=1;r<o;r++)s=t.getPointPosition(r,e),i.lineTo(s.x,s.y)}}function yp(t,e,n,o,i){const s=t.ctx,r=e.circular,{color:a,lineWidth:c}=e;!r&&!o||!a||!c||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=c,s.setLineDash(i.dash),s.lineDashOffset=i.dashOffset,s.beginPath(),gl(t,n,r,o),s.closePath(),s.stroke(),s.restore())}function _p(t,e,n){return Qe(t,{label:n,index:e,type:"pointLabel"})}class an extends Jn{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=ae(ui(this.options)/2),n=this.width=this.maxWidth-e.width,o=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+o/2+e.top),this.drawingArea=Math.floor(Math.min(n,o)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=ee(e)&&!isNaN(e)?e:0,this.max=ee(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ui(this.options))}generateTickLabels(e){Jn.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,o)=>{const i=G(this.options.pointLabels.callback,[n,o],this);return i||i===0?i:""}).filter((n,o)=>this.chart.getDataVisibility(o))}fit(){const e=this.options;e.display&&e.pointLabels.display?ap(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,o,i){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((o-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,o,i))}getIndexAngle(e){const n=K/(this._pointLabels.length||1),o=this.options.startAngle||0;return _e(e*n+ve(o))}getDistanceFromCenterForValue(e){if(H(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(H(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const o=n[e];return _p(this.getContext(),e,o)}}getPointPosition(e,n,o=0){const i=this.getIndexAngle(e)-ne+o;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:o,right:i,bottom:s}=this._pointLabelItems[e];return{left:n,top:o,right:i,bottom:s}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const o=this.ctx;o.save(),o.beginPath(),gl(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),o.closePath(),o.fillStyle=e,o.fill(),o.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:o,grid:i,border:s}=n,r=this._pointLabels.length;let a,c,d;if(n.pointLabels.display&&bp(this,r),i.display&&this.ticks.forEach((u,f)=>{if(f!==0){c=this.getDistanceFromCenterForValue(u.value);const p=this.getContext(f),h=i.setContext(p),g=s.setContext(p);yp(this,h,c,r,g)}}),o.display){for(e.save(),a=r-1;a>=0;a--){const u=o.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:p}=u;!p||!f||(e.lineWidth=p,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),d=this.getPointPosition(a,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,o=n.ticks;if(!o.display)return;const i=this.getIndexAngle(0);let s,r;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(i),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&!n.reverse)return;const d=o.setContext(this.getContext(c)),u=oe(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,r=e.measureText(a.label).width,e.fillStyle=d.backdropColor;const f=ae(d.backdropPadding);e.fillRect(-r/2-f.left,-s-u.size/2-f.top,r+f.width,u.size+f.height)}ft(e,a.label,0,-s,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}F(an,"id","radialLinear"),F(an,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),F(an,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),F(an,"descriptors",{angleLines:{_fallback:"grid"}});const Qn={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}},pe=Object.keys(Qn);function ml(t,e){return t-e}function bl(t,e){if(H(e))return null;const n=t._adapter,{parser:o,round:i,isoWeekday:s}=t._parseOpts;let r=e;return typeof o=="function"&&(r=o(r)),ee(r)||(r=typeof o=="string"?n.parse(r,o):n.parse(r)),r===null?null:(i&&(r=i==="week"&&(Et(s)||s===!0)?n.startOf(r,"isoWeek",s):n.startOf(r,i)),+r)}function yl(t,e,n,o){const i=pe.length;for(let s=pe.indexOf(t);s<i-1;++s){const r=Qn[pe[s]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-e)/(a*r.size))<=o)return pe[s]}return pe[i-1]}function xp(t,e,n,o,i){for(let s=pe.length-1;s>=pe.indexOf(n);s--){const r=pe[s];if(Qn[r].common&&t._adapter.diff(i,o,r)>=e-1)return r}return pe[n?pe.indexOf(n):0]}function wp(t){for(let e=pe.indexOf(t)+1,n=pe.length;e<n;++e)if(Qn[pe[e]].common)return pe[e]}function _l(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:o,hi:i}=Ro(n,e),s=n[o]>=e?n[o]:n[i];t[s]=!0}}function Cp(t,e,n,o){const i=t._adapter,s=+i.startOf(e[0].value,o),r=e[e.length-1].value;let a,c;for(a=s;a<=r;a=+i.add(a,1,o))c=n[a],c>=0&&(e[c].major=!0);return e}function xl(t,e,n){const o=[],i={},s=e.length;let r,a;for(r=0;r<s;++r)a=e[r],i[a]=r,o.push({value:a,major:!1});return s===0||!n?o:Cp(t,o,i,n)}class cn extends _t{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const o=e.time||(e.time={}),i=this._adapter=new Ru._date(e.adapters.date);i.init(n),Tt(o.displayFormats,i.formats()),this._parseOpts={parser:o.parser,round:o.round,isoWeekday:o.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:bl(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,o=e.time.unit||"day";let{min:i,max:s,minDefined:r,maxDefined:a}=this.getUserBounds();function c(d){!r&&!isNaN(d.min)&&(i=Math.min(i,d.min)),!a&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!r||!a)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),i=ee(i)&&!isNaN(i)?i:+n.startOf(Date.now(),o),s=ee(s)&&!isNaN(s)?s:+n.endOf(Date.now(),o)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],o=e[e.length-1]),{min:n,max:o}}buildTicks(){const e=this.options,n=e.time,o=e.ticks,i=o.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,r=this.max,a=td(i,s,r);return this._unit=n.unit||(o.autoSkip?yl(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):xp(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!o.major.enabled||this._unit==="year"?void 0:wp(this._unit),this.initOffsets(i),e.reverse&&a.reverse(),xl(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,o=0,i,s;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),e.length===1?n=1-i:n=(this.getDecimalForValue(e[1])-i)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?o=s:o=(s-this.getDecimalForValue(e[e.length-2]))/2);const r=e.length<3?.5:.25;n=se(n,0,r),o=se(o,0,r),this._offsets={start:n,end:o,factor:1/(n+1+o)}}_generate(){const e=this._adapter,n=this.min,o=this.max,i=this.options,s=i.time,r=s.unit||yl(s.minUnit,n,o,this._getLabelCapacity(n)),a=T(i.ticks.stepSize,1),c=r==="week"?s.isoWeekday:!1,d=Et(c)||c===!0,u={};let f=n,p,h;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":r),e.diff(o,n,r)>1e5*a)throw new Error(n+" and "+o+" are too far apart with stepSize of "+a+" "+r);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(p=f,h=0;p<o;p=+e.add(p,a,r),h++)_l(u,p,g);return(p===o||i.bounds==="ticks"||h===1)&&_l(u,p,g),Object.keys(u).sort(ml).map(m=>+m)}getLabelForValue(e){const n=this._adapter,o=this.options.time;return o.tooltipFormat?n.format(e,o.tooltipFormat):n.format(e,o.displayFormats.datetime)}format(e,n){const i=this.options.time.displayFormats,s=this._unit,r=n||i[s];return this._adapter.format(e,r)}_tickFormatFunction(e,n,o,i){const s=this.options,r=s.ticks.callback;if(r)return G(r,[e,n,o],this);const a=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&a[c],f=d&&a[d],p=o[n],h=d&&f&&p&&p.major;return this._adapter.format(e,i||(h?f:u))}generateTickLabels(e){let n,o,i;for(n=0,o=e.length;n<o;++n)i=e[n],i.label=this._tickFormatFunction(i.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,o=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+o)*n.factor)}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+o*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,o=this.ctx.measureText(e).width,i=ve(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),r=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:o*s+a*r,h:o*r+a*s}}_getLabelCapacity(e){const n=this.options.time,o=n.displayFormats,i=o[n.unit]||o.millisecond,s=this._tickFormatFunction(e,0,xl(this,[e],this._majorUnit),i),r=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,o;if(e.length)return e;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,o=i.length;n<o;++n)e=e.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,o;if(e.length)return e;const i=this.getLabels();for(n=0,o=i.length;n<o;++n)e.push(bl(this,i[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return xs(e.sort(ml))}}F(cn,"id","time"),F(cn,"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 eo(t,e,n){let o=0,i=t.length-1,s,r,a,c;n?(e>=t[o].pos&&e<=t[i].pos&&({lo:o,hi:i}=Oe(t,"pos",e)),{pos:s,time:a}=t[o],{pos:r,time:c}=t[i]):(e>=t[o].time&&e<=t[i].time&&({lo:o,hi:i}=Oe(t,"time",e)),{time:s,pos:a}=t[o],{time:r,pos:c}=t[i]);const d=r-s;return d?a+(c-a)*(e-s)/d:a}class fi extends cn{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=eo(n,this.min),this._tableRange=eo(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:o}=this,i=[],s=[];let r,a,c,d,u;for(r=0,a=e.length;r<a;++r)d=e[r],d>=n&&d<=o&&i.push(d);if(i.length<2)return[{time:n,pos:0},{time:o,pos:1}];for(r=0,a=i.length;r<a;++r)u=i[r+1],c=i[r-1],d=i[r],Math.round((u+c)/2)!==d&&s.push({time:d,pos:r/(a-1)});return s}_generate(){const e=this.min,n=this.max;let o=super.getDataTimestamps();return(!o.includes(e)||!o.length)&&o.splice(0,0,e),(!o.includes(n)||o.length===1)&&o.push(n),o.sort((i,s)=>i-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),o=this.getLabelTimestamps();return n.length&&o.length?e=this.normalize(n.concat(o)):e=n.length?n:o,e=this._cache.all=e,e}getDecimalForValue(e){return(eo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return eo(this._table,o*this._tableRange+this._minPos,!0)}}F(fi,"id","timeseries"),F(fi,"defaults",cn.defaults);var kp=Object.freeze({__proto__:null,CategoryScale:ai,LinearScale:ci,LogarithmicScale:di,RadialLinearScale:an,TimeScale:cn,TimeSeriesScale:fi});const Sp=[Vu,rh,ep,kp];Te.register(...Sp);const vp={class:"px-24 py-16"},Mp={class:"flex flex-col gap-8"},Ep={class:"fm-color-typo-primary fm-typo-body-lg-400"},Dp={class:"fm-color-typo-secondary fm-typo-body-md-400"},Vp=l.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{}},setup(t){const e=t,n=l.ref(null);let o=null;l.watch([()=>e.xAxis,()=>e.datasets],()=>{o&&(o.data.datasets=e.datasets,o.data.labels=e.xAxis.categories,o.update())});function i(d,u){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)},${u})`;if(d.startsWith("rgb")){const p=d.split(",");if(p.length===3)return[...p.slice(0,2),p[2].replace(")",`,${u})`)].join(",");if(p.length===4)return[...p.slice(0,3),`${u})`].join(",")}return""}function s(d){const u=getComputedStyle(document.documentElement).getPropertyValue(`--${d}`)||d;return u.startsWith("rgb")||u.startsWith("#")?u:null}function r({context:d,color:u}){const{ctx:f,chartArea:p}=d.chart;if(!p)return;const h=f==null?void 0:f.createLinearGradient(0,0,0,p.height);return h.addColorStop(0,i(u,.5)),h.addColorStop(1,i(u,0)),h}const a=l.computed(()=>({labels:e.xAxis.categories,datasets:e.datasets.map(d=>{const u=s(d.color)??"";return{...d,backgroundColor:u?f=>r({context:f,color:u}):"",borderColor:u,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));function c(){n.value&&(o=new Te(n.value,{type:"line",data:a.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,u)=>(l.openBlock(),l.createElementBlock("div",vp,[l.createElementVNode("div",Mp,[l.createElementVNode("div",Ep,l.toDisplayString(d.name),1),l.createElementVNode("div",Dp,l.toDisplayString(d.paragraph),1)]),l.createElementVNode("canvas",{ref_key:"canvas",ref:n},null,512)]))}});function Rp(){var t;return(t=l.getCurrentInstance())==null?void 0:t.emit}function de(t,e){const n=Rp(),o=l.ref(t[e]);return l.watch(()=>t[e],()=>{o.value=t[e]}),l.computed({get(){return o.value},set(s){o.value=s,n==null||n(`update:${e}`,s)}})}function ge(t,e){return t===null||e===null||typeof t!="object"&&typeof e!="object"?t===e:Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>ge(t[n],e[n]))}const Fp={class:"fm-checkbox"},Bp={class:"fm-checkbox--wrapper"},$p={class:"fm-checkbox__input--container"},Pp=["checked","disabled","indeterminate"],Ap={key:0,class:"fm-checkbox__label-container"},Op={class:"fm-typo-body-lg-400"},Np={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},wl=l.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(t){const e=t,n=de(e,"modelValue"),o=de(e,"indeterminate"),i=Array.isArray(n.value),s=l.ref(i?n.value.some(c=>ge(c,e.value)):n.value),r=l.computed(()=>{const c=i?n.value.some(d=>ge(d,e.value)):n.value;return o.value&&!c?"remove":n.value?"check_small":""});function a(){if(e.disabled)return;o.value=!1,s.value=!s.value;let c=n.value;i?c=s.value?c.concat(e.value):c.filter(d=>!ge(d,e.value)):c=s.value,n.value=c}return l.watch(()=>n.value,()=>{s.value=i?n.value.some(c=>ge(c,e.value)):n.value}),(c,d)=>(l.openBlock(),l.createElementBlock("div",Fp,[l.createElementVNode("label",Bp,[l.createElementVNode("div",$p,[l.createElementVNode("input",{class:l.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":s.value}),type:"checkbox",checked:s.value,disabled:e.disabled,indeterminate:l.unref(o),onClick:a},null,10,Pp),l.unref(o)||s.value?(l.openBlock(),l.createBlock(L,{key:0,class:"fm-checkbox__input--checkmark",name:r.value,size:"md",color:"#FFFFFF"},null,8,["name"])):l.createCommentVNode("",!0)]),e.label?(l.openBlock(),l.createElementBlock("div",Ap,[l.renderSlot(c.$slots,"label"),l.createElementVNode("div",Op,l.toDisplayString(e.label),1),e.sublabel?(l.openBlock(),l.createElementBlock("div",Np,l.toDisplayString(e.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])]))}}),e_="";var Ip=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Cl={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Ip,function(){var n=1e3,o=6e4,i=36e5,s="millisecond",r="second",a="minute",c="hour",d="day",u="week",f="month",p="quarter",h="year",g="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var D=["th","st","nd","rd"],E=P%100;return"["+P+(D[(E-20)%10]||D[E]||D[0])+"]"}},w=function(P,D,E){var R=String(P);return!R||R.length>=D?P:""+Array(D+1-R.length).join(E)+P},S={s:w,z:function(P){var D=-P.utcOffset(),E=Math.abs(D),R=Math.floor(E/60),B=E%60;return(D<=0?"+":"-")+w(R,2,"0")+":"+w(B,2,"0")},m:function P(D,E){if(D.date()<E.date())return-P(E,D);var R=12*(E.year()-D.year())+(E.month()-D.month()),B=D.clone().add(R,f),A=E-B<0,N=D.clone().add(R+(A?-1:1),f);return+(-(R+(E-B)/(A?B-N:N-B))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:f,y:h,w:u,d,D:g,h:c,m:a,s:r,ms:s,Q:p}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},_="en",C={};C[_]=y;var v="$isDayjsObject",k=function(P){return P instanceof O||!(!P||!P[v])},M=function P(D,E,R){var B;if(!D)return _;if(typeof D=="string"){var A=D.toLowerCase();C[A]&&(B=A),E&&(C[A]=E,B=A);var N=D.split("-");if(!B&&N.length>1)return P(N[0])}else{var j=D.name;C[j]=D,B=j}return!R&&B&&(_=B),B||!R&&_},V=function(P,D){if(k(P))return P.clone();var E=typeof D=="object"?D:{};return E.date=P,E.args=arguments,new O(E)},$=S;$.l=M,$.i=k,$.w=function(P,D){return V(P,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var O=function(){function P(E){this.$L=M(E.locale,null,!0),this.parse(E),this.$x=this.$x||E.x||{},this[v]=!0}var D=P.prototype;return D.parse=function(E){this.$d=function(R){var B=R.date,A=R.utc;if(B===null)return new Date(NaN);if($.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var N=B.match(b);if(N){var j=N[2]-1||0,Y=(N[7]||"0").substring(0,3);return A?new Date(Date.UTC(N[1],j,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Y)):new Date(N[1],j,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Y)}}return new Date(B)}(E),this.init()},D.init=function(){var E=this.$d;this.$y=E.getFullYear(),this.$M=E.getMonth(),this.$D=E.getDate(),this.$W=E.getDay(),this.$H=E.getHours(),this.$m=E.getMinutes(),this.$s=E.getSeconds(),this.$ms=E.getMilliseconds()},D.$utils=function(){return $},D.isValid=function(){return this.$d.toString()!==m},D.isSame=function(E,R){var B=V(E);return this.startOf(R)<=B&&B<=this.endOf(R)},D.isAfter=function(E,R){return V(E)<this.startOf(R)},D.isBefore=function(E,R){return this.endOf(R)<V(E)},D.$g=function(E,R,B){return $.u(E)?this[R]:this.set(B,E)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(E,R){var B=this,A=!!$.u(R)||R,N=$.p(E),j=function(vt,be){var at=$.w(B.$u?Date.UTC(B.$y,be,vt):new Date(B.$y,be,vt),B);return A?at:at.endOf(d)},Y=function(vt,be){return $.w(B.toDate()[vt].apply(B.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(be)),B)},Z=this.$W,J=this.$M,re=this.$D,me="set"+(this.$u?"UTC":"");switch(N){case h:return A?j(1,0):j(31,11);case f:return A?j(1,J):j(0,J+1);case u:var St=this.$locale().weekStart||0,gn=(Z<St?Z+7:Z)-St;return j(A?re-gn:re+(6-gn),J);case d:case g:return Y(me+"Hours",0);case c:return Y(me+"Minutes",1);case a:return Y(me+"Seconds",2);case r:return Y(me+"Milliseconds",3);default:return this.clone()}},D.endOf=function(E){return this.startOf(E,!1)},D.$set=function(E,R){var B,A=$.p(E),N="set"+(this.$u?"UTC":""),j=(B={},B[d]=N+"Date",B[g]=N+"Date",B[f]=N+"Month",B[h]=N+"FullYear",B[c]=N+"Hours",B[a]=N+"Minutes",B[r]=N+"Seconds",B[s]=N+"Milliseconds",B)[A],Y=A===d?this.$D+(R-this.$W):R;if(A===f||A===h){var Z=this.clone().set(g,1);Z.$d[j](Y),Z.init(),this.$d=Z.set(g,Math.min(this.$D,Z.daysInMonth())).$d}else j&&this.$d[j](Y);return this.init(),this},D.set=function(E,R){return this.clone().$set(E,R)},D.get=function(E){return this[$.p(E)]()},D.add=function(E,R){var B,A=this;E=Number(E);var N=$.p(R),j=function(J){var re=V(A);return $.w(re.date(re.date()+Math.round(J*E)),A)};if(N===f)return this.set(f,this.$M+E);if(N===h)return this.set(h,this.$y+E);if(N===d)return j(1);if(N===u)return j(7);var Y=(B={},B[a]=o,B[c]=i,B[r]=n,B)[N]||1,Z=this.$d.getTime()+E*Y;return $.w(Z,this)},D.subtract=function(E,R){return this.add(-1*E,R)},D.format=function(E){var R=this,B=this.$locale();if(!this.isValid())return B.invalidDate||m;var A=E||"YYYY-MM-DDTHH:mm:ssZ",N=$.z(this),j=this.$H,Y=this.$m,Z=this.$M,J=B.weekdays,re=B.months,me=B.meridiem,St=function(be,at,mn,bo){return be&&(be[at]||be(R,A))||mn[at].slice(0,bo)},gn=function(be){return $.s(j%12||12,be,"0")},vt=me||function(be,at,mn){var bo=be<12?"AM":"PM";return mn?bo.toLowerCase():bo};return A.replace(x,function(be,at){return at||function(mn){switch(mn){case"YY":return String(R.$y).slice(-2);case"YYYY":return $.s(R.$y,4,"0");case"M":return Z+1;case"MM":return $.s(Z+1,2,"0");case"MMM":return St(B.monthsShort,Z,re,3);case"MMMM":return St(re,Z);case"D":return R.$D;case"DD":return $.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return St(B.weekdaysMin,R.$W,J,2);case"ddd":return St(B.weekdaysShort,R.$W,J,3);case"dddd":return J[R.$W];case"H":return String(j);case"HH":return $.s(j,2,"0");case"h":return gn(1);case"hh":return gn(2);case"a":return vt(j,Y,!0);case"A":return vt(j,Y,!1);case"m":return String(Y);case"mm":return $.s(Y,2,"0");case"s":return String(R.$s);case"ss":return $.s(R.$s,2,"0");case"SSS":return $.s(R.$ms,3,"0");case"Z":return N}return null}(be)||N.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(E,R,B){var A,N=this,j=$.p(R),Y=V(E),Z=(Y.utcOffset()-this.utcOffset())*o,J=this-Y,re=function(){return $.m(N,Y)};switch(j){case h:A=re()/12;break;case f:A=re();break;case p:A=re()/3;break;case u:A=(J-Z)/6048e5;break;case d:A=(J-Z)/864e5;break;case c:A=J/i;break;case a:A=J/o;break;case r:A=J/n;break;default:A=J}return B?A:$.a(A)},D.daysInMonth=function(){return this.endOf(f).$D},D.$locale=function(){return C[this.$L]},D.locale=function(E,R){if(!E)return this.$L;var B=this.clone(),A=M(E,R,!0);return A&&(B.$L=A),B},D.clone=function(){return $.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},P}(),U=O.prototype;return V.prototype=U,[["$ms",s],["$s",r],["$m",a],["$H",c],["$W",d],["$M",f],["$y",h],["$D",g]].forEach(function(P){U[P[1]]=function(D){return this.$g(D,P[0],P[1])}}),V.extend=function(P,D){return P.$i||(P(D,O,V),P.$i=!0),V},V.locale=M,V.isDayjs=k,V.unix=function(P){return V(1e3*P)},V.en=C[_],V.Ls=C,V.p={},V})})(Cl);var Tp=Cl.exports;const ue=Lp(Tp),Bt=Math.min,wt=Math.max,to=Math.round,no=Math.floor,nt=t=>({x:t,y:t}),zp={left:"right",right:"left",bottom:"top",top:"bottom"},Hp={start:"end",end:"start"};function hi(t,e,n){return wt(t,Bt(e,n))}function dn(t,e){return typeof t=="function"?t(e):t}function Ct(t){return t.split("-")[0]}function un(t){return t.split("-")[1]}function kl(t){return t==="x"?"y":"x"}function pi(t){return t==="y"?"height":"width"}function oo(t){return["top","bottom"].includes(Ct(t))?"y":"x"}function gi(t){return kl(oo(t))}function jp(t,e,n){n===void 0&&(n=!1);const o=un(t),i=gi(t),s=pi(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=io(r)),[r,io(r)]}function Wp(t){const e=io(t);return[mi(t),e,mi(e)]}function mi(t){return t.replace(/start|end/g,e=>Hp[e])}function Yp(t,e,n){const o=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?s:r;default:return[]}}function Gp(t,e,n,o){const i=un(t);let s=Yp(Ct(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(mi)))),s}function io(t){return t.replace(/left|right|bottom|top/g,e=>zp[e])}function Up(t){return{top:0,right:0,bottom:0,left:0,...t}}function Sl(t){return typeof t!="number"?Up(t):{top:t,right:t,bottom:t,left:t}}function so(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function vl(t,e,n){let{reference:o,floating:i}=t;const s=oo(e),r=gi(e),a=pi(r),c=Ct(e),d=s==="y",u=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,p=o[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:o.y-i.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-i.width,y:f};break;default:h={x:o.x,y:o.y}}switch(un(e)){case"start":h[r]-=p*(n&&d?-1:1);break;case"end":h[r]+=p*(n&&d?-1:1);break}return h}const qp=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,a=s.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let d=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=vl(d,o,c),p=o,h={},g=0;for(let m=0;m<a.length;m++){const{name:b,fn:x}=a[m],{x:y,y:w,data:S,reset:_}=await x({x:u,y:f,initialPlacement:o,placement:p,strategy:i,middlewareData:h,rects:d,platform:r,elements:{reference:t,floating:e}});if(u=y??u,f=w??f,h={...h,[b]:{...h[b],...S}},_&&g<=50){g++,typeof _=="object"&&(_.placement&&(p=_.placement),_.rects&&(d=_.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):_.rects),{x:u,y:f}=vl(d,p,c)),m=-1;continue}}return{x:u,y:f,placement:p,strategy:i,middlewareData:h}};async function Ml(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:a,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=dn(e,t),g=Sl(h),b=a[p?f==="floating"?"reference":"floating":f],x=so(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:c})),y=f==="floating"?{...r.floating,x:o,y:i}:r.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},_=so(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:w,strategy:c}):y);return{top:(x.top-_.top+g.top)/S.y,bottom:(_.bottom-x.bottom+g.bottom)/S.y,left:(x.left-_.left+g.left)/S.x,right:(_.right-x.right+g.right)/S.x}}const Xp=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:s,platform:r,elements:a,middlewareData:c}=e,{element:d,padding:u=0}=dn(t,e)||{};if(d==null)return{};const f=Sl(u),p={x:n,y:o},h=gi(i),g=pi(h),m=await r.getDimensions(d),b=h==="y",x=b?"top":"left",y=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=s.reference[g]+s.reference[h]-p[h]-s.floating[g],_=p[h]-s.reference[h],C=await(r.getOffsetParent==null?void 0:r.getOffsetParent(d));let v=C?C[w]:0;(!v||!await(r.isElement==null?void 0:r.isElement(C)))&&(v=a.floating[w]||s.floating[g]);const k=S/2-_/2,M=v/2-m[g]/2-1,V=Bt(f[x],M),$=Bt(f[y],M),O=V,U=v-m[g]-$,P=v/2-m[g]/2+k,D=hi(O,P,U),E=!c.arrow&&un(i)!=null&&P!=D&&s.reference[g]/2-(P<O?V:$)-m[g]/2<0,R=E?P<O?P-O:P-U:0;return{[h]:p[h]+R,data:{[h]:D,centerOffset:P-D-R,...E&&{alignmentOffset:R}},reset:E}}}),bi=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:a,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=dn(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=Ct(i),y=Ct(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=p||(y||!m?[io(a)]:Wp(a));!p&&g!=="none"&&S.push(...Gp(a,m,g,w));const _=[a,...S],C=await Ml(e,b),v=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&v.push(C[x]),f){const O=jp(i,r,w);v.push(C[O[0]],C[O[1]])}if(k=[...k,{placement:i,overflows:v}],!v.every(O=>O<=0)){var M,V;const O=(((M=s.flip)==null?void 0:M.index)||0)+1,U=_[O];if(U)return{data:{index:O,overflows:k},reset:{placement:U}};let P=(V=k.filter(D=>D.overflows[0]<=0).sort((D,E)=>D.overflows[1]-E.overflows[1])[0])==null?void 0:V.placement;if(!P)switch(h){case"bestFit":{var $;const D=($=k.map(E=>[E.placement,E.overflows.filter(R=>R>0).reduce((R,B)=>R+B,0)]).sort((E,R)=>E[1]-R[1])[0])==null?void 0:$[0];D&&(P=D);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};async function Kp(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=Ct(n),a=un(n),c=oo(n)==="y",d=["left","top"].includes(r)?-1:1,u=s&&c?-1:1,f=dn(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),c?{x:h*u,y:p*d}:{x:p*d,y:h*u}}const yi=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:r,middlewareData:a}=e,c=await Kp(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:r}}}}},El=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:b=>{let{x,y}=b;return{x,y}}},...c}=dn(t,e),d={x:n,y:o},u=await Ml(e,c),f=oo(Ct(i)),p=kl(f);let h=d[p],g=d[f];if(s){const b=p==="y"?"top":"left",x=p==="y"?"bottom":"right",y=h+u[b],w=h-u[x];h=hi(y,h,w)}if(r){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=g+u[b],w=g-u[x];g=hi(y,g,w)}const m=a.fn({...e,[p]:h,[f]:g});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function ot(t){return Dl(t)?(t.nodeName||"").toLowerCase():"#document"}function xe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function He(t){var e;return(e=(Dl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Dl(t){return t instanceof Node||t instanceof xe(t).Node}function je(t){return t instanceof Element||t instanceof xe(t).Element}function Be(t){return t instanceof HTMLElement||t instanceof xe(t).HTMLElement}function Vl(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof xe(t).ShadowRoot}function fn(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=Se(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function Zp(t){return["table","td","th"].includes(ot(t))}function _i(t){const e=xi(),n=Se(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Jp(t){let e=$t(t);for(;Be(e)&&!ro(e);){if(_i(e))return e;e=$t(e)}return null}function xi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ro(t){return["html","body","#document"].includes(ot(t))}function Se(t){return xe(t).getComputedStyle(t)}function lo(t){return je(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function $t(t){if(ot(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Vl(t)&&t.host||He(t);return Vl(e)?e.host:e}function Rl(t){const e=$t(t);return ro(e)?t.ownerDocument?t.ownerDocument.body:t.body:Be(e)&&fn(e)?e:Rl(e)}function hn(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Rl(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=xe(i);return s?e.concat(r,r.visualViewport||[],fn(i)?i:[],r.frameElement&&n?hn(r.frameElement):[]):e.concat(i,hn(i,[],n))}function Fl(t){const e=Se(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Be(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,a=to(n)!==s||to(o)!==r;return a&&(n=s,o=r),{width:n,height:o,$:a}}function wi(t){return je(t)?t:t.contextElement}function Pt(t){const e=wi(t);if(!Be(e))return nt(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Fl(e);let r=(s?to(n.width):n.width)/o,a=(s?to(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Qp=nt(0);function Bl(t){const e=xe(t);return!xi()||!e.visualViewport?Qp:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function eg(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==xe(t)?!1:e}function kt(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=wi(t);let r=nt(1);e&&(o?je(o)&&(r=Pt(o)):r=Pt(t));const a=eg(s,n,o)?Bl(s):nt(0);let c=(i.left+a.x)/r.x,d=(i.top+a.y)/r.y,u=i.width/r.x,f=i.height/r.y;if(s){const p=xe(s),h=o&&je(o)?xe(o):o;let g=p.frameElement;for(;g&&o&&h!==p;){const m=Pt(g),b=g.getBoundingClientRect(),x=Se(g),y=b.left+(g.clientLeft+parseFloat(x.paddingLeft))*m.x,w=b.top+(g.clientTop+parseFloat(x.paddingTop))*m.y;c*=m.x,d*=m.y,u*=m.x,f*=m.y,c+=y,d+=w,g=xe(g).frameElement}}return so({width:u,height:f,x:c,y:d})}function tg(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=Be(n),s=He(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0},a=nt(1);const c=nt(0);if((i||!i&&o!=="fixed")&&((ot(n)!=="body"||fn(s))&&(r=lo(n)),Be(n))){const d=kt(n);a=Pt(n),c.x=d.x+n.clientLeft,c.y=d.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-r.scrollLeft*a.x+c.x,y:e.y*a.y-r.scrollTop*a.y+c.y}}function ng(t){return Array.from(t.getClientRects())}function $l(t){return kt(He(t)).left+lo(t).scrollLeft}function og(t){const e=He(t),n=lo(t),o=t.ownerDocument.body,i=wt(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=wt(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+$l(t);const a=-n.scrollTop;return Se(o).direction==="rtl"&&(r+=wt(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:a}}function ig(t,e){const n=xe(t),o=He(t),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,a=0,c=0;if(i){s=i.width,r=i.height;const d=xi();(!d||d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:r,x:a,y:c}}function sg(t,e){const n=kt(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=Be(t)?Pt(t):nt(1),r=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,d=o*s.y;return{width:r,height:a,x:c,y:d}}function Pl(t,e,n){let o;if(e==="viewport")o=ig(t,n);else if(e==="document")o=og(He(t));else if(je(e))o=sg(e,n);else{const i=Bl(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return so(o)}function Al(t,e){const n=$t(t);return n===e||!je(n)||ro(n)?!1:Se(n).position==="fixed"||Al(n,e)}function rg(t,e){const n=e.get(t);if(n)return n;let o=hn(t,[],!1).filter(a=>je(a)&&ot(a)!=="body"),i=null;const s=Se(t).position==="fixed";let r=s?$t(t):t;for(;je(r)&&!ro(r);){const a=Se(r),c=_i(r);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||fn(r)&&!c&&Al(t,r))?o=o.filter(u=>u!==r):i=a,r=$t(r)}return e.set(t,o),o}function lg(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?rg(e,this._c):[].concat(n),o],a=r[0],c=r.reduce((d,u)=>{const f=Pl(e,u,i);return d.top=wt(f.top,d.top),d.right=Bt(f.right,d.right),d.bottom=Bt(f.bottom,d.bottom),d.left=wt(f.left,d.left),d},Pl(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ag(t){return Fl(t)}function cg(t,e,n){const o=Be(e),i=He(e),s=n==="fixed",r=kt(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=nt(0);if(o||!o&&!s)if((ot(e)!=="body"||fn(i))&&(a=lo(e)),o){const d=kt(e,!0,s,e);c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}else i&&(c.x=$l(i));return{x:r.left+a.scrollLeft-c.x,y:r.top+a.scrollTop-c.y,width:r.width,height:r.height}}function Ol(t,e){return!Be(t)||Se(t).position==="fixed"?null:e?e(t):t.offsetParent}function Nl(t,e){const n=xe(t);if(!Be(t))return n;let o=Ol(t,e);for(;o&&Zp(o)&&Se(o).position==="static";)o=Ol(o,e);return o&&(ot(o)==="html"||ot(o)==="body"&&Se(o).position==="static"&&!_i(o))?n:o||Jp(t)||n}const dg=async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||Nl,s=this.getDimensions;return{reference:cg(e,await i(n),o),floating:{x:0,y:0,...await s(n)}}};function ug(t){return Se(t).direction==="rtl"}const fg={convertOffsetParentRelativeRectToViewportRelativeRect:tg,getDocumentElement:He,getClippingRect:lg,getOffsetParent:Nl,getElementRects:dg,getClientRects:ng,getDimensions:ag,getScale:Pt,isElement:je,isRTL:ug};function hg(t,e){let n=null,o;const i=He(t);function s(){clearTimeout(o),n&&n.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:d,top:u,width:f,height:p}=t.getBoundingClientRect();if(a||e(),!f||!p)return;const h=no(u),g=no(i.clientWidth-(d+f)),m=no(i.clientHeight-(u+p)),b=no(d),y={rootMargin:-h+"px "+-g+"px "+-m+"px "+-b+"px",threshold:wt(0,Bt(1,c))||1};let w=!0;function S(_){const C=_[0].intersectionRatio;if(C!==c){if(!w)return r();C?r(!1,C):o=setTimeout(()=>{r(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(S,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(t)}return r(!0),s}function Il(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=wi(t),u=i||s?[...d?hn(d):[],...hn(e)]:[];u.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=d&&a?hg(d,n):null;let p=-1,h=null;r&&(h=new ResizeObserver(x=>{let[y]=x;y&&y.target===d&&h&&(h.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{h&&h.observe(e)})),n()}),d&&!c&&h.observe(d),h.observe(e));let g,m=c?kt(t):null;c&&b();function b(){const x=kt(t);m&&(x.x!==m.x||x.y!==m.y||x.width!==m.width||x.height!==m.height)&&n(),m=x,g=requestAnimationFrame(b)}return n(),()=>{u.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f&&f(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(g)}}const Ll=(t,e,n)=>{const o=new Map,i={platform:fg,...n},s={...i.platform,_c:o};return qp(t,e,{...i,platform:s})};function Ci(t){var e;return(e=t==null?void 0:t.$el)!=null?e:t}function pg(t){return{name:"arrow",options:t,fn(e){const n=Ci(l.unref(t.element));return n==null?{}:Xp({element:n,padding:t.padding}).fn(e)}}}function Tl(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function zl(t,e){const n=Tl(t);return Math.round(e*n)/n}function Hl(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=l.computed(()=>{var v;return(v=l.unref(n.open))!=null?v:!0}),s=l.computed(()=>l.unref(n.middleware)),r=l.computed(()=>{var v;return(v=l.unref(n.placement))!=null?v:"bottom"}),a=l.computed(()=>{var v;return(v=l.unref(n.strategy))!=null?v:"absolute"}),c=l.computed(()=>{var v;return(v=l.unref(n.transform))!=null?v:!0}),d=l.computed(()=>Ci(t.value)),u=l.computed(()=>Ci(e.value)),f=l.ref(0),p=l.ref(0),h=l.ref(a.value),g=l.ref(r.value),m=l.shallowRef({}),b=l.ref(!1),x=l.computed(()=>{const v={position:h.value,left:"0",top:"0"};if(!u.value)return v;const k=zl(u.value,f.value),M=zl(u.value,p.value);return c.value?{...v,transform:"translate("+k+"px, "+M+"px)",...Tl(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:k+"px",top:M+"px"}});let y;function w(){d.value==null||u.value==null||Ll(d.value,u.value,{middleware:s.value,placement:r.value,strategy:a.value}).then(v=>{f.value=v.x,p.value=v.y,h.value=v.strategy,g.value=v.placement,m.value=v.middlewareData,b.value=!0})}function S(){typeof y=="function"&&(y(),y=void 0)}function _(){if(S(),o===void 0){w();return}if(d.value!=null&&u.value!=null){y=o(d.value,u.value,w);return}}function C(){i.value||(b.value=!1)}return l.watch([s,r,a],w,{flush:"sync"}),l.watch([d,u],_,{flush:"sync"}),l.watch(i,C,{flush:"sync"}),l.getCurrentScope()&&l.onScopeDispose(S),{x:l.shallowReadonly(f),y:l.shallowReadonly(p),strategy:l.shallowReadonly(h),placement:l.shallowReadonly(g),middlewareData:l.shallowReadonly(m),isPositioned:l.shallowReadonly(b),floatingStyles:x,update:w}}function gg(t){for(;t;){if(mg(t))return t;t=t.parentElement}return document.scrollingElement}function mg(t){if(!t||t.nodeType!==Node.ELEMENT_NODE)return!1;const e=window.getComputedStyle(t);return e.overflowY==="scroll"||e.overflowY==="auto"&&t.scrollHeight>t.clientHeight}class bg{constructor(e,n){F(this,"onScroll");F(this,"scrollParent");this.onScroll=n,this.scrollParent=gg(e)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const yg={class:"fm-menu__wrapper"},_g=l.defineComponent({__name:"FmMenuDeprecated",props:{showMenu:{type:Boolean,default:!1},placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1}},emits:["dropdown-changed"],setup(t,{expose:e,emit:n}){const o=t,i=l.ref(!1),s=l.ref(null),r=l.ref(null),{floatingStyles:a}=Hl(s,r,{middleware:[yi(4),bi()],placement:o.placement,whileElementsMounted:Il});let c;const d=n;e({show:()=>{i.value||(i.value=!0,d("dropdown-changed",i.value))},hide:()=>{i.value&&(i.value=!1,d("dropdown-changed",i.value))}});const u=h=>{h.preventDefault(),h.stopPropagation(),!o.disabled&&(i.value=!i.value,d("dropdown-changed",i.value))},f=h=>{if(!i.value)return;const g=h.path||h.composedPath();for(const m of g)if(m==s.value||m==r.value)return;i.value=!1,d("dropdown-changed",i.value)},p=()=>{d("dropdown-changed",!1)};return l.watch(()=>o.showMenu,h=>i.value=h),l.onMounted(()=>{i.value=o.showMenu,window.addEventListener("click",f),c=new bg(s.value,p),c.bindScroll()}),l.onUnmounted(()=>{window.removeEventListener("click",f),c.unbindScroll()}),(h,g)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"anchorEl",ref:s,class:"fm-menu",onClick:u},[l.renderSlot(h.$slots,"menu-button",{},void 0,!0)],512),i.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"menuEl",ref:r,class:l.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":i.value}),style:l.normalizeStyle(l.unref(a))},[l.renderSlot(h.$slots,"menu-wrapper",{},()=>[l.createElementVNode("div",yg,[l.renderSlot(h.$slots,"menu-content",{},void 0,!0)])],!0)],6)):l.createCommentVNode("",!0)]))}}),t_="",we=Q(_g,[["__scopeId","data-v-5b19ece2"]]),xg={class:"fm-menu-item--left"},wg={key:0,class:"fm-menu-item--right"},Cg=l.defineComponent({__name:"FmMenuItem",props:{modelValue:{type:Boolean,default:!1},selectable:{type:Boolean,default:!0},label:{default:""},sublabel:{default:""},icon:{default:""},expandable:{type:Boolean,default:!1},hasCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=l.ref(!1),i=e,s=c=>{c.preventDefault(),!(n.disabled||!n.selectable)&&i("update:modelValue",!n.modelValue)},r=()=>{i("update:modelValue",n.modelValue)};function a(c){o.value=c}return(c,d)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{class:l.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":c.modelValue&&!c.hasCheckbox,"fm-menu-item--disabled":c.disabled,"hover:bg-fm-color-opacity-sm cursor-pointer":!c.disabled&&!c.modelValue&&c.selectable}),onClick:s,onMousedown:d[1]||(d[1]=()=>a(!0)),onMouseup:d[2]||(d[2]=()=>a(!1)),onMouseleave:d[3]||(d[3]=()=>a(!1))},[l.createElementVNode("div",xg,[l.renderSlot(c.$slots,"prepend",{},()=>[!c.hasCheckbox&&c.icon?(l.openBlock(),l.createBlock(L,{key:0,name:c.icon,size:"md",outline:!o.value&&!c.modelValue,color:c.disabled?"#C7C7CC":c.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),c.hasCheckbox?(l.openBlock(),l.createBlock(wl,{key:1,"model-value":c.modelValue,name:"something",label:"",sublabel:"",value:"",indeterminate:!1,disabled:c.disabled,"onUpdate:modelValue":r,onClick:d[0]||(d[0]=u=>u.preventDefault())},null,8,["model-value","disabled"])):l.createCommentVNode("",!0)],!0),l.renderSlot(c.$slots,"label",{},()=>[l.createElementVNode("div",null,[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),c.sublabel?(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(c.sublabel),3)):l.createCommentVNode("",!0)])],!0)]),l.renderSlot(c.$slots,"append",{},void 0,!0),c.expandable?(l.openBlock(),l.createElementBlock("div",wg,[l.createVNode(L,{name:"chevron_right",size:"md",color:c.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):l.createCommentVNode("",!0)],34)]))}}),n_="",Ee=Q(Cg,[["__scopeId","data-v-257a1b7d"]]),kg={class:"w-full"},Sg=l.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(t){const e=t;return(n,o)=>(l.openBlock(),l.createBlock(e.tag,{class:l.normalizeClass({"fm-field":!0,"fm-field--focused":n.focused,"fm-field--invalid":n.invalid,"fm-field--valid":n.showValidBorder&&!n.invalid,"fm-field--disabled":n.disabled}),tabindex:"0"},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"prepend",{},()=>[n.prependIcon?(l.openBlock(),l.createBlock(L,{key:0,name:n.prependIcon,size:"md",color:n.disabled?"disabled":"neutral-black"},null,8,["name","color"])):l.createCommentVNode("",!0)],!0),l.createElementVNode("div",kg,[l.renderSlot(n.$slots,"default",{},void 0,!0)]),l.renderSlot(n.$slots,"append",{},()=>[n.appendIcon?(l.openBlock(),l.createBlock(L,{key:0,name:n.appendIcon,size:"md",color:n.disabled?"disabled":"neutral-black"},null,8,["name","color"])):l.createCommentVNode("",!0)],!0)]),_:3},8,["class"]))}}),o_="",it=Q(Sg,[["__scopeId","data-v-177cd78a"]]),vg={class:"flex gap-4"},jl=l.defineComponent({__name:"FmHelperText",props:{text:{default:""},disabled:{type:Boolean,default:!1},state:{default:"none"},errorMessages:{default:()=>[]}},setup(t){const e=t,n=l.computed(()=>e.state==="success"?"check_circle":e.state==="warning"?"warning":e.state==="error"?"error":""),o=l.computed(()=>e.state==="success"?"text-fm-color-system-success-300":e.state==="warning"?"text-fm-color-system-warning-300":e.state==="error"?"text-fm-color-system-error-300":"");return(i,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.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?l.renderSlot(i.$slots,"default",{key:0},()=>[l.createElementVNode("div",vg,[n.value?(l.openBlock(),l.createBlock(L,{key:0,size:"sm",name:n.value,class:l.normalizeClass(["mt-[2px]",o.value])},null,8,["name","class"])):l.createCommentVNode("",!0),l.createElementVNode("span",null,l.toDisplayString(i.text),1)])]):l.renderSlot(i.$slots,"default",{key:1},()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.errorMessages,r=>(l.openBlock(),l.createElementBlock("div",{key:r,class:"flex gap-4 text-fm-color-typo-error"},[l.createVNode(L,{size:"sm",name:"error",class:"mt-[2px] text-fm-color-system-error-300"}),l.createElementVNode("span",null,l.toDisplayString(r),1)]))),128))])],2))}}),Mg={class:"px-2 py-0"},Eg={key:0,class:"fm-typo-body-xl-700"},Dg={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},Wl=l.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(t){const e=t,n=l.ref(null),o=l.ref(null),i=l.ref(null),s=async()=>{var x,y,w,S;const{x:h,y:g,placement:m,middlewareData:b}=await Ll(n.value,o.value,{placement:e.beak,middleware:[yi(10),bi(),El({padding:5}),e.hasArrow?pg({element:i.value,padding:10}):null]});if(Object.assign(o.value.style,{left:`${h}px`,top:`${g}px`}),e.hasArrow){const _={top:"bottom",right:"left",bottom:"top",left:"right"}[m.split("-")[0]];Object.assign(i.value.style,{left:((x=b.arrow)==null?void 0:x.x)!=null?`${(y=b.arrow)==null?void 0:y.x}px`:"",top:((w=b.arrow)==null?void 0:w.y)!=null?`${(S=b.arrow)==null?void 0:S.y}px`:"",right:"",bottom:"",background:e.variant==="rich"?"#FFF":"#1C1C1E",[_]:"-4px"})}},r=l.ref(!1),a=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)"}}[e.variant],display:r.value?"block":"none"})),u=()=>{clearTimeout(c.value),a.value=window.setTimeout(()=>{r.value=!0},500)},f=()=>{clearTimeout(a.value),c.value=window.setTimeout(()=>r.value=!1,1500)},p=()=>{clearTimeout(c.value),r.value=!0};return l.watchEffect(()=>{r.value?(s(),window.addEventListener("resize",s)):window.removeEventListener("resize",s)}),(h,g)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"tooltipContainer",ref:n,class:l.normalizeClass(["cursor-pointer flex items-center justify-center relative w-max",{"cursor-not-allowed pointer-events-none":h.disabled}]),onMouseenter:u,onMouseleave:f},[l.renderSlot(h.$slots,"default")],34),l.createElementVNode("div",{ref_key:"tooltip",ref:o,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:p,onMouseleave:f},[l.createElementVNode("div",null,[l.createElementVNode("div",Mg,[h.variant=="rich"?(l.openBlock(),l.createElementBlock("div",Eg,l.toDisplayString(h.titleText),1)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(h.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},l.toDisplayString(h.contentText),3)]),h.variant=="rich"?(l.openBlock(),l.createElementBlock("div",Dg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.actionButtons,(m,b)=>(l.openBlock(),l.createElementBlock("div",{key:b},[l.createVNode(fe,{variant:"tertiary",label:m.label,onClick:m.handler},null,8,["label","onClick"])]))),128))])):l.createCommentVNode("",!0)]),l.createElementVNode("div",{ref_key:"arrowEl",ref:i,class:"-rotate-45 absolute h-3 w-3"},null,512)],36)]))}}),Yl=l.defineComponent({__name:"FmLabel",props:{label:{default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""}},setup(t){return(e,n)=>e.label?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-typo-body-lg-400 flex gap-4",e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary",{"items-center":e.info}])},[l.renderSlot(e.$slots,"default",{},()=>[l.createElementVNode("span",null,l.toDisplayString(e.label),1),e.required?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["fm-typo-body-lg-700",e.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-error"])}," * ",2)):l.createCommentVNode("",!0),e.optional?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-md-400",e.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-tertiary"])}," (optional) ",2)):l.createCommentVNode("",!0),e.info?(l.openBlock(),l.createBlock(Wl,{key:2,beak:"top","content-text":e.info,disabled:e.disabled},{default:l.withCtx(()=>[l.createVNode(L,{name:"info",size:"sm",class:l.normalizeClass(["fm-typo-body-md-400",e.disabled?"text-fm-color-typo-disabled":"text-fm-color-neutral-gray-300"])},null,8,["class"])]),_:1},8,["content-text","disabled"])):l.createCommentVNode("",!0)])],2)):l.createCommentVNode("",!0)}});function Gl(t,e){const n=l.ref([]);function o(){const s=[];if(e.value&&e.value.length>0)for(const r of e.value){const c=(typeof r=="function"?r:()=>r)(t.value);c!==!0&&s.push(c)}return n.value=s,n.value}function i(){n.value=[]}return{validate:o,resetValidation:i,errorMessages:n}}function Ul(t,e=null,n=null){let o=null;const i=de(t,"modelValue"),s=l.ref(!0),r=l.inject(Ki,null),{validate:a,resetValidation:c,errorMessages:d}=Gl(i,l.toRef(()=>t.rules)),u=(f=n)=>{s.value=!0,c(),f&&typeof f=="function"&&f(),i.value=e};return l.onMounted(()=>{r&&(o=r.register({validate:a,resetValidation:c,resetValue:u})),e=e??i.value}),l.onUnmounted(()=>{r&&r.unregister(o)}),l.watch(()=>i.value,()=>{s.value=!1,i.value!==e&&a()}),l.watch(()=>t.focused,f=>{s.value=!1,f||a()}),{validate:a,resetValidation:c,errorMessages:d,resetValue:u,isPristine:s}}function ao(){const t=l.ref(!1);function e(){t.value=!0}function n(){t.value=!1}return{focus:e,blur:n,isFocused:t}}const Vg={key:1,class:"flex items-center justify-between"},We=l.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"},tag:{default:"label"}},setup(t){const e=t,{errorMessages:n,isPristine:o}=Ul(e),{focus:i,blur:s}=ao(),r=l.computed(()=>({label:e.label,disabled:e.disabled,required:e.required,optional:e.optional,info:e.info})),a=l.computed(()=>({text:e.helperText,disabled:e.disabled,state:e.helperState,errorMessages:n.value})),c=l.computed(()=>({isPristine:o,invalid:n.value.length>0}));return(d,u)=>(l.openBlock(),l.createBlock(e.tag,{class:"flex flex-col gap-4",onClick:l.unref(i),onBlur:l.unref(s)},{default:l.withCtx(()=>[d.label?(l.openBlock(),l.createBlock(Yl,l.normalizeProps(l.mergeProps({key:0},r.value)),{default:l.withCtx(()=>[l.renderSlot(d.$slots,"label")]),_:3},16)):l.createCommentVNode("",!0),l.renderSlot(d.$slots,"default",l.normalizeProps(l.guardReactiveProps(c.value))),a.value.text||a.value.errorMessages.length>0||d.$slots["helper-append"]?(l.openBlock(),l.createElementBlock("div",Vg,[l.createVNode(jl,l.normalizeProps(l.guardReactiveProps(a.value)),{default:l.withCtx(()=>[l.renderSlot(d.$slots,"helper-text")]),_:3},16),l.renderSlot(d.$slots,"helper-append")])):l.createCommentVNode("",!0)]),_:3},8,["onClick","onBlur"]))}}),Rg={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[360px]"},Fg={class:"w-max"},Bg={class:"flex h-40 justify-between px-4 py-8"},$g={class:"flex gap-4 items-center"},Pg={class:"fm-typo-body-lg-700"},Ag={class:"h-[264px] w-[160px]"},Og={class:"fm-typo-body-lg-700"},Ng={class:"h-[264px] w-[160px]"},Ig={class:"flex gap-4 items-center justify-center"},Lg={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Tg=["onClick"],zg={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},Hg=l.defineComponent({__name:"FmDatePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue"),o=l.ref(ue(n.value,"YYYY-MM-DD")),i=l.ref(!1),s=l.ref(ue().startOf("month")),r=l.ref(!1),a=l.ref(!1),c=m=>{o.value=m},d=()=>{n.value=o.value.format("YYYY-MM-DD"),setTimeout(()=>{i.value=!1},0)},u=()=>{o.value=n.value?ue(n.value):null,i.value=!1},f=m=>{const b=[],x=m.endOf("month"),y=m.month();let w=m.startOf("week"),S=[];for(;w.isBefore(x.endOf("week"));)w.day()===0&&S.length>0&&(b.push(S),S=[]),S.push({date:w,isCurrentMonth:w.month()===y}),w=w.add(1,"day");return S.length>0&&b.push(S),b},p=m=>{r.value=!1,a.value=!1,s.value=m},h=l.computed(()=>Array.from(Array(7),(m,b)=>ue().day(b).format("ddd"))),g=l.computed(()=>{let m=-5;const b=[];for(;m!=5;)b.push(s.value.add(m,"year")),m++;return b});return(m,b)=>(l.openBlock(),l.createBlock(We,{modelValue:l.unref(n),"onUpdate:modelValue":b[5]||(b[5]=x=>l.isRef(n)?n.value=x:null),label:m.label,disabled:m.disabled,required:m.labelMark==="required",optional:m.labelMark==="optional",info:m.labelInfo,rules:m.rules,focused:i.value,"helper-text":m.helperText,"helper-state":m.helperState,tag:"div"},{label:l.withCtx(()=>[l.renderSlot(m.$slots,"label",{},void 0,!0)]),default:l.withCtx(({invalid:x})=>[l.createVNode(we,{"show-menu":i.value,disabled:m.disabled,onDropdownChanged:b[4]||(b[4]=y=>i.value=y)},{"menu-button":l.withCtx(()=>[l.createVNode(it,{class:"cursor-text",focused:i.value,invalid:x,"show-valid-border":m.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(m.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(m.$slots,"append",{},void 0,!0)]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":l.unref(n)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString(l.unref(n)?l.unref(ue)(l.unref(n)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","invalid","show-valid-border"])]),"menu-wrapper":l.withCtx(()=>[l.createElementVNode("div",Rg,[l.createElementVNode("div",Fg,[l.createElementVNode("div",Bg,[l.createElementVNode("div",$g,[l.createVNode(we,{"show-menu":r.value,onDropdownChanged:b[0]||(b[0]=y=>r.value=y)},{"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",Pg,l.toDisplayString(s.value.format("MMMM")),1),l.createVNode(L,{name:r.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",Ag,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(y,w)=>s.value.month(w)),y=>(l.openBlock(),l.createElementBlock("li",{key:y.format("MMMM")},[l.createVNode(Ee,{"model-value":s.value.format("MMMM")===y.format("MMMM"),label:y.format("MMMM"),"onUpdate:modelValue":w=>p(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(we,{"show-menu":a.value,onDropdownChanged:b[1]||(b[1]=y=>a.value=y)},{"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",Og,l.toDisplayString(s.value.format("YYYY")),1),l.createVNode(L,{name:a.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",Ng,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(g.value,y=>(l.openBlock(),l.createElementBlock("li",{key:y.format("YYYY")},[l.createVNode(Ee,{"model-value":s.value.format("YYYY")===y.format("YYYY"),label:y.format("YYYY"),"onUpdate:modelValue":w=>p(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),l.createElementVNode("div",Ig,[l.createVNode(L,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[2]||(b[2]=()=>p(s.value.subtract(1,"month")))}),l.createVNode(L,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[3]||(b[3]=()=>p(s.value.add(1,"month")))})])]),l.createElementVNode("div",null,[l.createElementVNode("div",Lg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.value,y=>(l.openBlock(),l.createElementBlock("div",{key:y,class:"fm-calendar__cell"},l.toDisplayString(y),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f(s.value),(y,w)=>(l.openBlock(),l.createElementBlock("div",{key:w,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y,S=>(l.openBlock(),l.createElementBlock("div",{key:S.date.date(),class:"fm-calendar__cell"},[S.isCurrentMonth?(l.openBlock(),l.createElementBlock("button",{key:0,class:l.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":S.date.isSame(o.value)}]),type:"button",onClick:()=>c(S.date)},l.toDisplayString(S.date.date()),11,Tg)):l.createCommentVNode("",!0)]))),128))]))),128))])])]),l.createElementVNode("div",zg,[l.createVNode(fe,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),l.createVNode(fe,{label:"Apply",size:"md",variant:"primary",disabled:!o.value,onClick:d},null,8,["disabled"])])])]),_:2},1032,["show-menu","disabled"])]),"helper-text":l.withCtx(()=>[l.renderSlot(m.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),i_="",jg=Q(Hg,[["__scopeId","data-v-baaf0541"]]),Wg=t=>(l.pushScopeId("data-v-d5c577b5"),t=t(),l.popScopeId(),t),Yg={class:"flex gap-1 items-center relative w-full"},Gg={class:"flex flex-col gap-4 w-full"},Ug=Wg(()=>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)),qg={class:"flex flex-col gap-4 w-full"},Xg={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[720px]"},Kg={class:"flex gap-24"},Zg={class:"w-max"},Jg={class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},Qg={class:"flex gap-4 items-center"},em={class:"fm-typo-body-lg-700"},tm={class:"h-[264px] w-[160px]"},nm={class:"fm-typo-body-lg-700"},om={class:"h-[264px] w-[160px]"},im={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},sm=["onClick","onMouseover"],rm={class:"w-max"},lm={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},am={class:"flex gap-4 items-center"},cm={class:"fm-typo-body-lg-700"},dm={class:"h-[264px] w-[160px]"},um={class:"fm-typo-body-lg-700"},fm={class:"h-[264px] w-[160px]"},hm={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},pm=["onClick","onMouseover"],gm={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},mm=l.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue"),o=l.ref({startDate:ue(n.value.startDate,"YYYY-MM-DD"),endDate:ue(n.value.endDate,"YYYY-MM-DD")}),i=l.ref(!1),s=l.ref(ue().startOf("month")),r=l.ref(ue().startOf("month").add(1,"month")),a=l.ref(null),c=l.ref(!1),d=l.ref(!1),u=l.ref(!1),f=l.ref(!1),p=_=>{if(o.value.startDate&&o.value.endDate){o.value={startDate:_,endDate:null};return}if(!o.value.startDate&&!o.value.endDate)o.value.startDate=_;else if(_.isBefore(o.value.startDate)){const C=o.value.startDate;o.value={startDate:_,endDate:C}}else o.value.endDate=_},h=()=>{n.value={startDate:o.value.startDate.format("YYYY-MM-DD"),endDate:o.value.endDate.format("YYYY-MM-DD")},setTimeout(()=>{i.value=!1})},g=()=>{var _,C;o.value={startDate:(_=n.value)!=null&&_.startDate?ue(n.value.startDate,"YYYY-MM-DD"):null,endDate:(C=n.value)!=null&&C.endDate?ue(n.value.endDate,"YYYY-MM-DD"):null},i.value=!1},m=_=>{const C=[],v=_.endOf("month"),k=_.month();let M=_.startOf("week"),V=[];for(;M.isBefore(v.endOf("week"));)M.day()===0&&V.length>0&&(C.push(V),V=[]),V.push({date:M,isCurrentMonth:M.month()===k}),M=M.add(1,"day");return V.length>0&&C.push(V),C},b=(_,C)=>{c.value=!1,u.value=!1,d.value=!1,f.value=!1,_==="left"?(s.value=C,r.value=C.add(1,"month")):_==="right"&&(r.value=C,s.value=C.subtract(1,"month"))},x=l.computed(()=>Array.from(Array(7),(_,C)=>ue().day(C).format("ddd"))),y=_=>{const C=o.value.startDate,v=o.value.endDate;a.value=C&&v?null:a.value;const k=a.value,M=C==null?void 0:C.isSame(_),V=v==null?void 0:v.isSame(_),$=k==null?void 0:k.isSame(_);return{"fm-calendar__cell__button--selected":M&&V||M&&!v,"fm-calendar__cell__button--selected-start":M&&v&&!(M&&V)||C&&!v&&M&&(k==null?void 0:k.isAfter(C))||C&&!v&&$&&(k==null?void 0:k.isBefore(C)),"fm-calendar__cell__button--selected-end":V&&C&&!(M&&V)||C&&!v&&M&&(k==null?void 0:k.isBefore(C))||C&&!v&&$&&(k==null?void 0:k.isAfter(C)),"fm-calendar__cell__button--selected-between":C&&(v||k)&&v?_.isAfter(C)&&_.isBefore(v):_.isAfter(k)&&_.isBefore(C)||_.isBefore(k)&&_.isAfter(C)}},w=_=>{a.value=_},S=l.computed(()=>{let _=-5;const C=[];for(;_!=5;)C.push(s.value.add(_,"year")),_++;return C});return l.watch(()=>n.value,()=>{var _,C;return o.value={startDate:(_=n.value)!=null&&_.startDate?ue(n.value.startDate,"YYYY-MM-DD"):null,endDate:(C=n.value)!=null&&C.endDate?ue(n.value.endDate,"YYYY-MM-DD"):null}}),(_,C)=>(l.openBlock(),l.createBlock(We,{modelValue:l.unref(n),"onUpdate:modelValue":C[7]||(C[7]=v=>l.isRef(n)?n.value=v:null),disabled:_.disabled,rules:_.rules,focused:i.value,"helper-text":_.helperText,"helper-state":_.helperState,tag:"div"},{default:l.withCtx(({invalid:v})=>[l.createVNode(we,{"show-menu":i.value,disabled:_.disabled,onDropdownChanged:C[6]||(C[6]=k=>i.value=k)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",Yg,[l.createElementVNode("label",Gg,[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.startLabel),3),l.createVNode(it,{class:l.normalizeClass(_.disabled?"cursor-not-allowed":"cursor-pointer"),focused:i.value,invalid:v,"show-valid-border":_.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(_.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(_.$slots,"append",{},void 0,!0)]),default:l.withCtx(()=>{var k,M;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":(k=l.unref(n))!=null&&k.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((M=l.unref(n))!=null&&M.startDate?l.unref(ue)(l.unref(n).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])]),Ug,l.createElementVNode("label",qg,[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.endLabel),3),l.createVNode(it,{class:l.normalizeClass(_.disabled?"cursor-not-allowed":"cursor-pointer"),focused:i.value,invalid:v,"show-valid-border":_.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(_.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(_.$slots,"append",{},void 0,!0)]),default:l.withCtx(()=>{var k,M;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":(k=l.unref(n))!=null&&k.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((M=l.unref(n))!=null&&M.endDate?l.unref(ue)(l.unref(n).endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])])])]),"menu-wrapper":l.withCtx(()=>[l.createElementVNode("div",Xg,[l.createElementVNode("div",Kg,[l.createElementVNode("div",Zg,[l.createElementVNode("div",Jg,[l.createElementVNode("div",Qg,[l.createVNode(L,{class:"cursor-pointer select-none",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:C[0]||(C[0]=()=>b("left",s.value.subtract(1,"month")))}),l.createVNode(we,{"show-menu":c.value,onDropdownChanged:C[1]||(C[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",em,l.toDisplayString(s.value.format("MMMM")),1),l.createVNode(L,{name:c.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",tm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(k,M)=>s.value.month(M)),k=>(l.openBlock(),l.createElementBlock("li",{key:k.format("MMMM")},[l.createVNode(Ee,{"model-value":s.value.format("MMMM")===k.format("MMMM"),label:k.format("MMMM"),"onUpdate:modelValue":M=>b("left",k)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(we,{"show-menu":u.value,onDropdownChanged:C[2]||(C[2]=k=>u.value=k)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",u.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",nm,l.toDisplayString(s.value.format("YYYY")),1),l.createVNode(L,{name:u.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",om,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(S.value,k=>(l.openBlock(),l.createElementBlock("li",{key:k.format("YYYY")},[l.createVNode(Ee,{"model-value":s.value.format("YYYY")===k.format("YYYY"),label:k.format("YYYY"),"onUpdate:modelValue":M=>b("left",k)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])])]),l.createElementVNode("div",null,[l.createElementVNode("div",im,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(x.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(m(s.value),(k,M)=>(l.openBlock(),l.createElementBlock("div",{key:M,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",y(V.date)]),type:"button",onClick:()=>p(V.date),onMouseover:$=>w(V.date)},l.toDisplayString(V.date.date()),43,sm)):l.createCommentVNode("",!0)]))),128))]))),128))])])]),l.createElementVNode("div",rm,[l.createElementVNode("div",lm,[l.createElementVNode("div",am,[l.createVNode(we,{"show-menu":d.value,onDropdownChanged:C[3]||(C[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",cm,l.toDisplayString(r.value.format("MMMM")),1),l.createVNode(L,{name:d.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",dm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(k,M)=>r.value.month(M)),k=>(l.openBlock(),l.createElementBlock("li",{key:k.format("MMMM")},[l.createVNode(Ee,{"model-value":r.value.format("MMMM")===k.format("MMMM"),label:k.format("MMMM"),"onUpdate:modelValue":M=>b("right",k)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(we,{"show-menu":f.value,onDropdownChanged:C[4]||(C[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",um,l.toDisplayString(r.value.format("YYYY")),1),l.createVNode(L,{name:f.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",fm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(S.value,k=>(l.openBlock(),l.createElementBlock("li",{key:k.format("YYYY")},[l.createVNode(Ee,{"model-value":r.value.format("YYYY")===k.format("YYYY"),label:k.format("YYYY"),"onUpdate:modelValue":M=>b("right",k)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),l.createVNode(L,{class:"cursor-pointer select-none",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:C[5]||(C[5]=()=>b("left",s.value.add(1,"month")))})]),l.createElementVNode("div",null,[l.createElementVNode("div",hm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(x.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(m(r.value),(k,M)=>(l.openBlock(),l.createElementBlock("div",{key:M,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",y(V.date)]),type:"button",onClick:()=>p(V.date),onMouseover:$=>w(V.date)},l.toDisplayString(V.date.date()),43,pm)):l.createCommentVNode("",!0)]))),128))]))),128))])])])]),l.createElementVNode("div",gm,[l.createVNode(fe,{label:"Cancel",size:"md",variant:"tertiary",onClick:g}),l.createVNode(fe,{label:"OK",size:"md",variant:"primary",disabled:!o.value.startDate||!o.value.endDate,onClick:h},null,8,["disabled"])])])]),_:2},1032,["show-menu","disabled"])]),"helper-text":l.withCtx(()=>[l.renderSlot(_.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","rules","focused","helper-text","helper-state"]))}}),s_="",bm=Q(mm,[["__scopeId","data-v-d5c577b5"]]),ym=l.defineComponent({__name:"FmForm",emits:["validation-reset","validation-success","validation-failed","reset"],setup(t,{expose:e,emit:n}){const o=l.ref([]),i=l.ref(0),s=n,r=()=>{let d=[];for(let u=0;u<o.value.length;u++){const f=o.value[u];d=[...d,...f.validate()]}d.length?s("validation-failed",d):s("validation-success")},a=()=>{for(let d=0;d<o.value.length;d++)o.value[d].resetValue();s("reset")};return e({validateInputs:r,resetInputsValidation:()=>{for(let d=0;d<o.value.length;d++)o.value[d].resetValidation();s("validation-reset")},resetInputs:a}),l.provide(Ki,{register({validate:d,resetValidation:u,resetValue:f}){return o.value.push({componentId:i.value,validate:d,resetValidation:u,resetValue:f}),i.value++},unregister(d){o.value.filter(u=>u.componentId!==d)}}),(d,u)=>(l.openBlock(),l.createElementBlock("form",{onSubmit:l.withModifiers(r,["prevent"]),onReset:l.withModifiers(a,["prevent"])},[l.renderSlot(d.$slots,"default")],32))}}),_m={class:"fm-radio-btn"},xm={class:"fm-radio-btn__input--container"},wm=["value","disabled","checked"],Cm={class:"py-8"},km={class:"fm-typo-body-lg-400"},Sm={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},vm=l.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue"),o=l.ref(),i=l.inject(Zi,null),s=()=>{r.value||(i?i.updateValue(e.value):n.value=e.value)},r=l.computed(()=>i?i.getDisabled():e.disabled),a=l.computed(()=>i?e.value===i.groupValue.value:n.value===e.value);return(c,d)=>{const u=l.resolveDirective("wave");return l.openBlock(),l.createElementBlock("div",_m,[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:s},[l.withDirectives((l.openBlock(),l.createElementBlock("div",xm,[l.createElementVNode("input",{ref_key:"inputEl",ref:o,class:"fm-radio-btn__input--btn",type:"radio",value:c.value,disabled:r.value,checked:a.value},null,8,wm)])),[[u,!r.value]]),l.createElementVNode("div",Cm,[l.renderSlot(c.$slots,"label",{},()=>[l.createElementVNode("div",km,l.toDisplayString(c.label),1),c.sublabel?(l.openBlock(),l.createElementBlock("div",Sm,l.toDisplayString(c.sublabel),1)):l.createCommentVNode("",!0)],!0)])],2)])}}}),r_="",Mm=Q(vm,[["__scopeId","data-v-24fa5bf9"]]),Em=l.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[t=>!!t||"This field is required"]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue");return l.provide(Zi,{groupValue:n,getDisabled:()=>e.disabled,updateValue(o){n.value=o}}),(o,i)=>(l.openBlock(),l.createBlock(We,{modelValue:l.unref(n),"onUpdate:modelValue":i[0]||(i[0]=s=>l.isRef(n)?n.value=s:null),label:o.label,disabled:o.disabled,required:o.labelMark==="required",optional:o.labelMark==="optional",info:o.labelInfo,rules:o.rules,"helper-text":o.helperText,"helper-state":o.helperState},{label:l.withCtx(()=>[l.renderSlot(o.$slots,"label")]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass({"flex items-center gap-16 justify-start":o.inline})},[l.renderSlot(o.$slots,"default")],2)]),"helper-text":l.withCtx(()=>[l.renderSlot(o.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","helper-text","helper-state"]))}}),Dm={class:"flex flex-col gap-4"},Vm={class:"w-[280px]"},Rm={class:"flex flex-col gap-4 justify-center"},Fm=l.defineComponent({__name:"FmSelect",props:{modelValue:{},items:{},multiselect:{type:Boolean,default:!1},placement:{default:"bottom-start"},placeholder:{default:"Select item"},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue"),o=l.ref(!1),i=(d,u)=>{if(e.multiselect){let f=[];d?f=n.value.length===0?[u]:e.items.filter(p=>n.value.some(h=>ge(p.value,h)||ge(p.value,u.value))):f=e.items.filter(p=>n.value.some(h=>ge(p.value,h)&&!ge(p.value,u.value))),n.value=f.map(p=>p.value)}else n.value=u.value,setTimeout(()=>{o.value=!1},0)},s=d=>{const u=[...n.value].filter((f,p)=>p!==d);n.value=u},r=l.computed(()=>e.multiselect?e.items.filter(d=>l.toRaw(n.value).some(u=>ge(u,d.value))):e.items.filter(d=>ge(n.value,d.value))),a=l.computed(()=>e.items.filter(d=>n.value.some(u=>ge(d.value,u))).map(d=>({label:d.label}))),c=l.computed(()=>{var d;return e.multiselect?e.placeholder:((d=e.items.find(u=>ge(u.value,n.value)))==null?void 0:d.label)??e.placeholder});return(d,u)=>(l.openBlock(),l.createElementBlock("div",Dm,[l.createVNode(We,{modelValue:l.unref(n),"onUpdate:modelValue":u[1]||(u[1]=f=>l.isRef(n)?n.value=f:null),label:d.label,disabled:d.disabled,required:d.labelMark==="required",optional:d.labelMark==="optional",info:d.labelInfo,rules:d.rules,focused:o.value,"helper-text":d.helperText,"helper-state":d.helperState},{label:l.withCtx(()=>[l.renderSlot(d.$slots,"label")]),default:l.withCtx(({invalid:f})=>[l.createVNode(we,{"show-menu":o.value,disabled:d.disabled,placement:d.placement,onDropdownChanged:u[0]||(u[0]=p=>o.value=p)},{"menu-button":l.withCtx(()=>[l.createVNode(it,{class:l.normalizeClass(d.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.value,invalid:f,"show-valid-border":d.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(d.$slots,"prepend")]),append:l.withCtx(()=>[l.createVNode(L,{name:o.value?"expand_less":"expand_more",size:"md",color:d.disabled?"#C7C7CC":"black"},null,8,["name","color"])]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":l.unref(n)!==void 0?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString(c.value),3)]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Vm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d.items,p=>(l.openBlock(),l.createBlock(Ee,{key:p.value,"has-checkbox":d.multiselect,label:p.label,value:p.value,"model-value":r.value.some(h=>l.unref(ge)(h.value,p.value)),"onUpdate:modelValue":h=>i(h,p)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))])]),_:2},1032,["show-menu","disabled","placement"])]),"helper-text":l.withCtx(()=>[l.renderSlot(d.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]),l.createElementVNode("div",Rm,[d.multiselect&&r.value.length>0?(l.openBlock(),l.createBlock(qi,{key:0,items:a.value,removable:"",disabled:d.disabled,onChipClosed:s},null,8,["items","disabled"])):l.createCommentVNode("",!0)])]))}}),Bm=["inputMode","value","placeholder","readOnly"],$m={key:0},Pm=l.defineComponent({__name:"FmStepperField",props:{modelValue:{},placeholder:{default:""},inputmode:{default:"numeric"},readonly:{type:Boolean},labelMark:{default:"none"},step:{default:1},min:{default:void 0},max:{default:void 0},prependIcon:{default:""},appendIcon:{default:""},useGrouping:{type:Boolean,default:!0},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},label:{default:""},disabled:{type:Boolean},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue"),{isFocused:o,blur:i,focus:s}=ao(),r=l.ref(null);let a;const c=y=>{if(y!==""){const w=+y.replace(/,/g,"");return isNaN(w)?null:w}return null},d=y=>a.format(y),u=y=>{if(typeof n.value!="number"){n.value=+n.value;return}if(y>0&&m.value||y<0&&b.value)return;let w=x(n.value)?n.value+y:0;w=f(w),n.value=w},f=y=>e.max!==void 0&&y>e.max?e.max:e.min!==void 0&&y<e.min?e.min:y,p=()=>{var y;n.value=c(((y=r.value)==null?void 0:y.value)??"")},h=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}},g=l.computed(()=>n.value!=null?d(n.value):""),m=l.computed(()=>{let y=!1;return e.max!==void 0&&(y=n.value>=e.max),e.min!==void 0&&(y=n.value<e.min),y}),b=l.computed(()=>{let y=!1;return e.max!==void 0&&(y=n.value>e.max),e.min!==void 0&&(y=n.value<=e.min),y});l.onBeforeMount(()=>{a=new Intl.NumberFormat("en-MY",{useGrouping:e.useGrouping})});function x(y){return typeof y=="number"&&isFinite(y)}return(y,w)=>(l.openBlock(),l.createBlock(We,{modelValue:l.unref(n),"onUpdate:modelValue":w[8]||(w[8]=S=>l.isRef(n)?n.value=S:null),label:y.label,disabled:y.disabled,required:y.labelMark==="required",optional:y.labelMark==="optional",info:y.labelInfo,rules:y.rules,focused:l.unref(o),"helper-text":y.helperText,"helper-state":y.helperState},{label:l.withCtx(()=>[l.renderSlot(y.$slots,"label",{},void 0,!0)]),default:l.withCtx(({invalid:S})=>[l.createVNode(it,{class:"cursor-text","append-icon":y.appendIcon,"prepend-icon":y.prependIcon,focused:l.unref(o),invalid:S,"show-valid-border":y.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(y.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(y.$slots,"append",{},()=>[l.createElementVNode("div",{class:l.normalizeClass(["flex items-center justify-center",{"mr-32":y.showSteppers}])},[y.appendText?(l.openBlock(),l.createElementBlock("div",$m,l.toDisplayString(y.appendText),1)):l.createCommentVNode("",!0),y.appendIcon?(l.openBlock(),l.createBlock(L,{key:1,name:y.appendIcon,size:"md",color:y.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):l.createCommentVNode("",!0)],2)],!0),y.showSteppers?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-stepper-field__stepper__container",l.unref(o)?"right-[6px]":"right-[7px]"])},[l.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"0",onMousedown:w[2]||(w[2]=()=>u(y.step)),onFocus:w[3]||(w[3]=(..._)=>l.unref(s)&&l.unref(s)(..._)),onBlur:w[4]||(w[4]=(..._)=>l.unref(i)&&l.unref(i)(..._))},[l.createVNode(L,{name:"expand_less",size:"md",color:y.disabled||m.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32),l.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"1",onMousedown:w[5]||(w[5]=()=>u(-y.step)),onFocus:w[6]||(w[6]=(..._)=>l.unref(s)&&l.unref(s)(..._)),onBlur:w[7]||(w[7]=(..._)=>l.unref(i)&&l.unref(i)(..._))},[l.createVNode(L,{name:"expand_more",size:"md",color:y.disabled||b.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32)],2)):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[l.createElementVNode("input",{ref_key:"inputEl",ref:r,class:"fm-stepper-field--input",type:"text",inputMode:y.inputmode,value:g.value,placeholder:y.placeholder,readOnly:y.readonly,onInput:p,onFocus:w[0]||(w[0]=(..._)=>l.unref(s)&&l.unref(s)(..._)),onBlur:w[1]||(w[1]=(..._)=>l.unref(i)&&l.unref(i)(..._)),onKeydown:h},null,40,Bm)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":l.withCtx(()=>[l.renderSlot(y.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),l_="",Am=Q(Pm,[["__scopeId","data-v-90140ecd"]]),Om={class:"cursor-pointer fm-switch__container"},Nm={key:0},Im={class:"fm-typo-body-lg-400"},Lm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Tm={class:"fm-switch__input--container"},zm=["checked","value","disabled"],Hm={key:1},jm={class:"fm-typo-body-lg-400"},Wm={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(t){const e=t,n=de(e,"modelValue"),o=()=>{e.disabled||(n.value=!n.value)};return(i,s)=>(l.openBlock(),l.createElementBlock("label",Om,[i.labelPlacement==="left"?(l.openBlock(),l.createElementBlock("div",Nm,[l.renderSlot(i.$slots,"label",{},void 0,!0),l.createElementVNode("div",Im,l.toDisplayString(i.label),1),i.sublabel?(l.openBlock(),l.createElementBlock("div",Lm,l.toDisplayString(i.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",Tm,[l.createElementVNode("input",{checked:l.unref(n),class:"fm-switch__input--btn",type:"checkbox",value:i.value,disabled:i.disabled,onClick:o},null,8,zm),l.createElementVNode("div",{class:l.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":i.showIcon})},[i.showIcon?(l.openBlock(),l.createBlock(L,{key:0,name:l.unref(n)?"check":"close",size:"sm",color:i.disabled?"#C7C7CC":l.unref(n)?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):l.createCommentVNode("",!0)],2)]),i.labelPlacement==="right"?(l.openBlock(),l.createElementBlock("div",Hm,[l.createElementVNode("div",jm,l.toDisplayString(i.label),1),i.sublabel?(l.openBlock(),l.createElementBlock("div",Wm,l.toDisplayString(i.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)]))}}),a_="",Gm=Q(Ym,[["__scopeId","data-v-c967bf28"]]),Um=["value","inputMode","type","placeholder","minlength","maxlength","disabled","readOnly"],qm=l.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:""},showWordCount:{type:Boolean,default:!1},modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=l.ref(null),o=de(e,"modelValue"),{isFocused:i,focus:s,blur:r}=ao(),a=c=>{o.value=c.target.value};return(c,d)=>(l.openBlock(),l.createBlock(We,{modelValue:l.unref(o),"onUpdate:modelValue":d[2]||(d[2]=u=>l.isRef(o)?o.value=u:null),label:c.label,disabled:c.disabled,required:c.labelMark==="required",optional:c.labelMark==="optional",info:c.labelInfo,rules:c.rules,focused:l.unref(i),"helper-text":c.helperText,"helper-state":c.helperState},l.createSlots({label:l.withCtx(()=>[l.renderSlot(c.$slots,"label")]),default:l.withCtx(({invalid:u})=>[l.createVNode(it,{class:"cursor-text","append-icon":c.appendIcon,"prepend-icon":c.prependIcon,focused:l.unref(i),invalid:u,"show-valid-border":c.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(c.$slots,"prepend")]),append:l.withCtx(()=>[l.renderSlot(c.$slots,"append")]),default:l.withCtx(()=>[l.createElementVNode("input",{ref_key:"inputEl",ref:n,class:l.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!c.disabled,"fm-color-typo-disabled":c.disabled}),value:l.unref(o),inputMode:c.inputmode,type:c.inputmode,placeholder:c.placeholder,minlength:c.minLength,maxlength:c.maxLength,disabled:c.disabled,readOnly:c.readonly,onInput:a,onFocus:d[0]||(d[0]=(...f)=>l.unref(s)&&l.unref(s)(...f)),onBlur:d[1]||(d[1]=(...f)=>l.unref(r)&&l.unref(r)(...f))},null,42,Um)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":l.withCtx(()=>[l.renderSlot(c.$slots,"helper-text")]),_:2},[c.showWordCount?{name:"helper-append",fn:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass([c.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},l.toDisplayString(c.maxLength?`${l.unref(o).length} / ${c.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),c_="",Xm=["value","placeholder","minlength","maxlength","readOnly","disabled"],Km=l.defineComponent({__name:"FmTextarea",props:{modelValue:{default:""},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"},showWordCount:{type:Boolean,default:!1},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]}},emits:["update:modelValue"],setup(t){const n=de(t,"modelValue"),{isFocused:o,focus:i,blur:s}=ao(),r=a=>{n.value=a.target.value};return(a,c)=>(l.openBlock(),l.createBlock(We,{modelValue:l.unref(n),"onUpdate:modelValue":c[2]||(c[2]=d=>l.isRef(n)?n.value=d:null),label:a.label,disabled:a.disabled,required:a.labelMark==="required",optional:a.labelMark==="optional",info:a.labelInfo,rules:a.rules,focused:l.unref(o),"helper-text":a.helperText,"helper-state":a.helperState},l.createSlots({label:l.withCtx(()=>[l.renderSlot(a.$slots,"label",{},void 0,!0)]),default:l.withCtx(({invalid:d})=>[l.createElementVNode("div",{class:l.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":l.unref(o),"fm-textarea__container--invalid":!!l.unref(n)&&d,"fm-textarea__container--valid":a.showValidBorder&&a.showSuccess&&!!l.unref(n)&&!d,"fm-textarea__container--disabled":a.disabled})},[l.createElementVNode("textarea",{class:l.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!a.disabled,"fm-color-typo-disabled":a.disabled}),value:l.unref(n),placeholder:a.placeholder,minlength:a.minLength,maxlength:a.maxLength,readOnly:a.readonly,disabled:a.disabled,onInput:r,onFocus:c[0]||(c[0]=(...u)=>l.unref(i)&&l.unref(i)(...u)),onBlur:c[1]||(c[1]=(...u)=>l.unref(s)&&l.unref(s)(...u))},null,42,Xm)],2)]),"helper-text":l.withCtx(()=>[l.renderSlot(a.$slots,"helper-text",{},void 0,!0)]),_:2},[a.showWordCount?{name:"helper-append",fn:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass([a.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},l.toDisplayString(a.maxLength?`${l.unref(n).length} / ${a.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),d_="",Zm=Q(Km,[["__scopeId","data-v-280a005d"]]),Jm={class:"flex flex-col fm-time-input items-center"},Qm=["value"],eb=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(t,{emit:e}){const n=t,o=e,i=l.ref();function s(u){i.value&&(i.value.value=u)}l.watch(()=>n.modelValue,s);function r(){if(!i.value)return;const u=a(i.value.value);if(u==null||u>n.max||u<n.min){s(n.modelValue);return}o("update:model-value",u)}function a(u){return u&&/^\d+$/.test(u)?Number(u):null}function c(){o("update:model-value",a(n.modelValue)+1)}function d(){o("update:model-value",a(n.modelValue)-1)}return(u,f)=>(l.openBlock(),l.createElementBlock("div",Jm,[l.createElementVNode("div",{class:"fm-time-input__scroller",onClick:c},[l.createVNode(L,{name:"expand_less",size:"lg"})]),l.createElementVNode("input",{ref_key:"inputRef",ref:i,value:n.modelValue,onInput:r},null,40,Qm),l.createElementVNode("div",{class:"fm-time-input__scroller",onClick:d},[l.createVNode(L,{name:"expand_more",size:"lg"})])]))}}),u_="",ql=Q(eb,[["__scopeId","data-v-e8ddb125"]]);var Ye=(t=>(t.AM="AM",t.PM="PM",t))(Ye||{});function st(t){return t.toString().padStart(2,"0")}const tb={class:"flex fm-time-input gap-16 items-center"},nb=l.createElementVNode("div",{class:"fm-typo-title-sm-700"}," : ",-1),ob={class:"fm-time-input-periods"},ib=["onClick"],Xl=l.defineComponent({__name:"FmTimeInput",props:{modelValue:{type:Object,required:!0}},emits:["update:model-value"],setup(t,{emit:e}){const n=t,o=e;function i(s){const r={hours:s.hours??n.modelValue.hours,minutes:s.minutes??n.modelValue.minutes,period:s.period??n.modelValue.period},a=n.modelValue.hours;(a===12&&r.hours===11||a===11&&r.hours===12)&&(r.period=n.modelValue.period===Ye.AM?Ye.PM:Ye.AM),r.hours>12?r.hours=1:r.hours<1&&(r.hours=12),r.minutes>59?r.minutes=0:r.minutes<0&&(r.minutes=59),o("update:model-value",r)}return(s,r)=>(l.openBlock(),l.createElementBlock("div",tb,[l.createVNode(ql,{"model-value":l.unref(st)(t.modelValue.hours),min:1,max:12,"onUpdate:modelValue":r[0]||(r[0]=a=>i({hours:a}))},null,8,["model-value"]),nb,l.createVNode(ql,{"model-value":l.unref(st)(t.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":r[1]||(r[1]=a=>i({minutes:a}))},null,8,["model-value"]),l.createElementVNode("div",ob,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Ye),a=>(l.openBlock(),l.createElementBlock("div",{key:a,class:l.normalizeClass([{"fm-time-input-period__selected":a===t.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>i({period:a})},l.toDisplayString(a),11,ib))),128))])]))}}),f_="",sb={class:"flex gap-8"},rb={class:"bg-fm-color-neutral-white flex flex-col p-12 rounded-lg shadow-light-300 w-[343px]"},lb=l.createElementVNode("div",{class:"fm-typo-body-xl-700"}," Enter time ",-1),ab={class:"flex justify-center w-full"},cb={class:"flex justify-end"},db=l.defineComponent({__name:"FmTimePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const n=de(t,"modelValue"),o=l.ref(null),i=l.computed(()=>{if(!n.value)return null;const{hours:h,minutes:g,period:m}=a(n.value);return`${st(h)}:${st(g)} ${m}`});function s(){if(!o.value){n.value=null;return}const{hours:h,minutes:g,period:m}=o.value,b=r(h,g,m);n.value=b,u()}function r(h,g,m){let b=h;return m===Ye.PM?b=h===12?h:h+12:h===12&&(b=0),`${st(b)}:${st(g)}`}l.onMounted(()=>{n.value&&(o.value=a(n.value))}),l.watch(()=>n.value,h=>{h&&(o.value=a(h))});function a(h){const[g,m,b]=c(h).split(":");return{hours:Number(g),minutes:Number(m),period:b}}function c(h){const[g,m]=h.split(":"),b=Number(g),x=Number(m),y=b>11?Ye.PM:Ye.AM;let w=b;return w===0?w=12:w>12&&(w-=12),`${st(w)}:${st(x)}:${y}`}const d=l.ref();function u(){var h;(h=d.value)==null||h.hide()}const f=l.ref(!1);function p(h){h?o.value=a(n.value??"00:00"):o.value=n.value?a(n.value):null,f.value=h}return(h,g)=>(l.openBlock(),l.createBlock(We,{modelValue:l.unref(n),"onUpdate:modelValue":g[1]||(g[1]=m=>l.isRef(n)?n.value=m:null),label:h.label,disabled:h.disabled,required:h.labelMark==="required",optional:h.labelMark==="optional",info:h.labelInfo,rules:h.rules,focused:f.value,"helper-text":h.helperText,"helper-state":h.helperState},{label:l.withCtx(()=>[l.renderSlot(h.$slots,"label")]),default:l.withCtx(({invalid:m})=>[l.createVNode(we,{ref_key:"dropdownRef",ref:d,onDropdownChanged:p},{"menu-button":l.withCtx(()=>[l.createVNode(it,{class:l.normalizeClass(h.disabled?"cursor-not-allowed":"cursor-pointer"),focused:f.value,invalid:m,"show-valid-border":h.showValidBorder},{default:l.withCtx(()=>[l.createElementVNode("div",sb,[l.createVNode(L,{name:"schedule",outline:!f.value},null,8,["outline"]),l.createElementVNode("div",{class:l.normalizeClass(["grow",{"text-fm-color-typo-disabled":!i.value}])},l.toDisplayString(i.value??"HH:MM"),3)])]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-wrapper":l.withCtx(()=>[l.createElementVNode("div",rb,[lb,l.createElementVNode("div",ab,[l.createVNode(Xl,{"model-value":o.value??{hours:0,minutes:0,period:l.unref(Ye).AM},class:"py-16","onUpdate:modelValue":g[0]||(g[0]=b=>o.value=b)},null,8,["model-value"])]),l.createElementVNode("div",cb,[l.createVNode(fe,{label:"Cancel",variant:"tertiary",onClick:u}),l.createVNode(fe,{label:"Confirm",variant:"tertiary",onClick:s})])])]),_:2},1536)]),"helper-text":l.withCtx(()=>[l.renderSlot(h.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),ub=l.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({"fm-list--separator":e.separator,activeClass:e.activeClass})},[l.renderSlot(e.$slots,"default",{},void 0,!0)],2))}}),h_="",fb=Q(ub,[["__scopeId","data-v-884ba127"]]),hb=l.defineComponent({__name:"FmListItem",props:{tag:{default:"div"},clickable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},activeClass:{default:""}},setup(t){const e=t;return(n,o)=>{const i=l.resolveDirective("wave");return l.withDirectives((l.openBlock(),l.createBlock(e.tag,{class:l.normalizeClass({"fm-list-item":!0,"fm-list-item--disabled":n.disabled,"cursor-pointer":n.clickable&&!n.disabled,"cursor-not-allowed":n.clickable&&n.disabled,activeClass:n.activeClass})},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},8,["class"])),[[i,n.clickable&&!n.disabled]])}}}),p_="",pb=Q(hb,[["__scopeId","data-v-f565b558"]]),gb={mounted:(t,e)=>{t.clickOutsideEvent=n=>{const o=e.arg?document.querySelectorAll(`#${e.arg}`):[];!(t==n.target||t.contains(n.target))&&!Array.from(o).some(i=>i&&(n.target==i||i.contains(n.target)))&&e.value(n,t)},document.addEventListener("click",t.clickOutsideEvent)},unmounted:t=>{document.removeEventListener("click",t.clickOutsideEvent)}},mb=l.defineComponent({__name:"FmMenu",props:{placement:{default:"bottom-start"},trigger:{default:"click"},closeOnClick:{type:Boolean,default:!0},width:{default:void 0},maxHeight:{default:408}},emits:["menu-changed"],setup(t,{emit:e}){const n=t,o=e,i=l.ref([]);let s;const r=l.ref(),a=l.ref(!1),c=l.ref(!1),d=l.inject(es,null),u=l.ref(null),f=l.ref(null),{floatingStyles:p}=Hl(u,f,{middleware:[yi({mainAxis:d?8:4,crossAxis:d?-12:0}),bi(),El()],placement:n.placement,whileElementsMounted:Il}),h=()=>{x&&clearTimeout(x)},g=()=>{k.value==="hover"&&b()},m=()=>{k.value==="click"&&b()},b=()=>{h(),c.value=!0,a.value=!0,d==null||d.setChildId(s)};let x;const y=()=>{k.value==="hover"&&(c.value=!1,h(),x=setTimeout(()=>{a.value=!1},1e3))},w=()=>{h(),c.value=!0},S=()=>{c.value=!1,x&&clearTimeout(x),x=setTimeout(()=>{c.value||(i.value.length>0&&d?a.value=i.value.some(({injectProps:M})=>M.mouseInMenu.value):(d&&d.closeParent(),k.value!=="click"&&(a.value=!1)))},1e3)},_=()=>{a.value=!1},C=()=>{n.closeOnClick&&(a.value=!1)},v=l.computed(()=>({mouseInMenu:c}));l.provide(es,{register({injectProps:M}){return i.value=[...i.value,{injectProps:M}],i.value.length},closeParent(){d?(a.value=!1,d==null||d.closeParent()):a.value=k.value!=="click"},setChildId(M){r.value=M},mouseInChildId:r,trigger:n.trigger}),l.onMounted(()=>{d&&(s=d.register({injectProps:v}))}),l.watch(()=>d==null?void 0:d.mouseInChildId.value,M=>{M!==s&&(h(),a.value=!1)});const k=l.computed(()=>d===null?n.trigger:"hover");return l.watch(()=>a.value,()=>o("menu-changed",a.value)),(M,V)=>l.withDirectives((l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"anchorEl",ref:u,class:"fm-menu",onMouseenter:g,onMouseleave:y,onClick:m},[l.renderSlot(M.$slots,"menu-button",{},void 0,!0)],544),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[a.value?(l.openBlock(),l.createElementBlock("div",{key:0,id:"fm-menu",ref_key:"menuEl",ref:f,style:l.normalizeStyle(l.unref(p)),onMouseenter:w,onMouseleave:S,onClick:C},[l.renderSlot(M.$slots,"menu-wrapper",{},()=>[l.createElementVNode("div",{class:"fm-menu__wrapper",style:l.normalizeStyle({"max-height":`${M.maxHeight}px`,width:`${M.width}px`})},[l.renderSlot(M.$slots,"default",{},void 0,!0)],4)],!0)],36)):l.createCommentVNode("",!0)]))])),[[l.unref(gb),_,"fm-menu"]])}}),g_="",Kl=Q(mb,[["__scopeId","data-v-163bd513"]]),bb=l.defineComponent({__name:"FmMenuDivider",props:{vertical:{type:Boolean,default:!1},inset:{type:Boolean,default:!1}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border-fm-color-neutral-gray-100 rounded-sm",[e.vertical?"border-l -my-4 mx-4":"border-t -mx-4 my-4",{"my-0":e.inset&&e.vertical,"mx-0":e.inset&&!e.vertical}]])},null,2))}}),yb={class:"fm-typo-body-lg-700 mx-8 p-12 text-fm-color-typo-primary"},_b=l.defineComponent({__name:"FmMenuHeader",props:{label:{}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",yb,l.toDisplayString(e.label),1))}}),xb={class:"fm-progress-indicator relative"},wb=["data-progress"],Cb={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},Zl=l.defineComponent({__name:"FmProgressIndicator",props:{modelValue:{type:Number,required:!0}},setup(t){const e=t,n=l.ref(null),o=l.computed(()=>`${e.modelValue/100*360}deg`),i=s=>{n.value&&n.value.style.setProperty("--progress",s)};return l.onMounted(()=>{i(o.value)}),l.onUpdated(()=>{i(o.value)}),l.watch(o,async s=>{i(s)}),(s,r)=>(l.openBlock(),l.createElementBlock("div",xb,[l.createElementVNode("div",{ref_key:"progress",ref:n,class:"fm-progress-circular w-full","data-progress":o.value},null,8,wb),l.createElementVNode("div",Cb,[l.renderSlot(s.$slots,"default")])]))}}),m_="",kb={class:"flex"},Sb={key:0,class:"mt-8"},vb=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(t,{emit:e}){const n=t,o=e,i=l.computed(()=>{switch(n.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 ${n.variant}`)}}),s=l.computed(()=>n.title?{text:n.title,classes:"fm-typo-body-lg-700"}:{text:n.description,classes:""}),r=l.computed(()=>n.bgColor?wo(n.bgColor)?{style:{backgroundColor:n.bgColor}}:{class:`bg-fm-color-${n.bgColor}`}:{class:`bg-fm-color-${i.value.bgColor}`}),a=l.computed(()=>n.color?wo(n.color)?{style:{color:n.color}}:{class:`text-fm-color-${n.color}`}:{class:`text-fm-color-${i.value.actionColor}`});return(c,d)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(r.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[l.createElementVNode("div",kb,[i.value.icon?(l.openBlock(),l.createBlock(L,{key:0,name:i.value.icon.name,color:n.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),n.dismissable?(l.openBlock(),l.createBlock(L,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:d[0]||(d[0]=()=>o("onDismiss"))})):l.createCommentVNode("",!0)]),n.title&&n.description?(l.openBlock(),l.createElementBlock("div",Sb,l.toDisplayString(n.description),1)):l.createCommentVNode("",!0),l.renderSlot(c.$slots,"actions",{},()=>[n.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:d[1]||(d[1]=()=>o("onAction"))},l.toDisplayString(n.action),1)],16)):l.createCommentVNode("",!0)],!0)],16))}}),b_="",Mb=Q(vb,[["__scopeId","data-v-b6db34bb"]]),Eb={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},Jl=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(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex flex-col",t.disabled?"text-fm-color-typo-disabled":""])},[l.createElementVNode("div",{class:l.normalizeClass(["fm-step-title line-clamp-2",t.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},l.toDisplayString(t.title),3),t.description?(l.openBlock(),l.createElementBlock("div",Eb,l.toDisplayString(t.description),1)):l.createCommentVNode("",!0)],2))}}),Db=["data-title","data-description","data-disabled"],Vb={class:"flex fm-step-container gap-12 grow"},Rb=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(t){const e=t,{currentStep:n,goToStep:o}=l.inject(Ji);function i(){s.value||o(e.value)}const s=l.computed(()=>e.disabled?e.disabled():!1),r=l.computed(()=>e.error?e.error():!1),a=l.computed(()=>n()===e.value),c=l.computed(()=>e.complete()),d=l.computed(()=>a.value||c.value||n()>e.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),u=l.computed(()=>a.value?{className:"bg-fm-color-primary"}:r.value?{config:{name:"warning",color:"system-error-300"}}:s.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,p)=>{const h=l.resolveDirective("wave");return l.withDirectives((l.openBlock(),l.createElementBlock("div",{"data-title":t.title,"data-description":t.description,"data-disabled":s.value,class:l.normalizeClass(`fm-step gap-4 grow ${s.value?"cursor-not-allowed":"cursor-pointer"}`),onClick:l.withModifiers(i,["stop"])},[l.createElementVNode("div",null,[l.createElementVNode("div",{class:l.normalizeClass(`fm-step-indicator ${d.value}`)},null,2)]),l.createElementVNode("div",Vb,[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]",u.value.className])},[u.value.config?(l.openBlock(),l.createBlock(L,{key:0,name:u.value.config.name,color:u.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):l.createCommentVNode("",!0)],2),l.createVNode(Jl,{title:t.title,description:t.description,disabled:s.value,class:"grow"},null,8,["title","description","disabled"])])],10,Db)),[[h,!s.value]])}}}),y_="",Fb=Q(Rb,[["__scopeId","data-v-ee172cad"]]),Bb={class:"hidden items-center xs:flex"},$b={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},Pb=l.defineComponent({__name:"FmStepper",props:{modelValue:{type:Number,required:!0},orientation:{type:String,default:"horizontal"}},emits:["update:model-value"],setup(t,{emit:e}){const n=t,o=e,i=f=>{o("update:model-value",f)};l.provide(Ji,{currentStep:()=>n.modelValue,goToStep:i});const s=l.ref(),r=l.ref([]),a=l.computed(()=>r.value[n.modelValue-1]),c=l.computed(()=>n.modelValue/r.value.length*100),d=l.computed(()=>`${n.modelValue} of ${r.value.length}`),u=()=>{var p;const f=Array.from(((p=s.value)==null?void 0:p.querySelectorAll(":scope > .fm-step"))??[]);r.value=f.map(h=>({title:h.dataset.title??"",description:h.dataset.description,disabled:h.dataset.disabled=="true"}))};return l.onMounted(()=>{u()}),(f,p)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(`fm-stepper fm-stepper__${t.orientation}`)},[l.createElementVNode("div",{ref_key:"stepperRef",ref:s,class:l.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${t.orientation==="vertical"?"flex-col":""}`)},[l.renderSlot(f.$slots,"default")],2),l.createElementVNode("div",Bb,[l.createVNode(Zl,{"model-value":c.value,class:"mr-12",style:{"min-width":"60px"}},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.value),1)]),_:1},8,["model-value"]),a.value?(l.openBlock(),l.createBlock(Jl,{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)]),f.$slots.contents?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${t.orientation==="vertical"?"w-2/3":""}`)},[l.renderSlot(f.$slots,"contents"),l.createElementVNode("div",$b,[l.renderSlot(f.$slots,"actions")])],2)):l.createCommentVNode("",!0)],2))}});let Ab=0;function Ob(){return Ab++}const Nb=t=>(l.pushScopeId("data-v-431e2921"),t=t(),l.popScopeId(),t),Ib=["disabled"],Lb=[Nb(()=>l.createElementVNode("div",{class:"fm-tab__indicator"},null,-1))],Tb={class:"max-w-[360px] min-w-[186px]"},zb=l.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:()=>Ob()},children:{default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=l.ref(!1),o=t,i=e,s=l.ref(!1);function r(f){n.value=f}const a=()=>{o.disabled||o.children.length>0||i("update:modelValue",o.value)},c=f=>{o.children.length!==0&&(s.value=f)},d=l.computed(()=>o.children.length>0?o.children.some(f=>f.value===o.modelValue):o.modelValue===o.value),u=f=>{s.value=!1,i("update:modelValue",f)};return(f,p)=>(l.openBlock(),l.createBlock(we,{"show-menu":s.value,disabled:f.children.length===0,class:l.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":f.vertical}]),placement:f.vertical?"right-start":"bottom-start",onDropdownChanged:c},{"menu-button":l.withCtx(()=>[l.createElementVNode("button",{class:l.normalizeClass(["fm-tab",`fm-tab--${f.vertical?"vertical":"horizontal"}`,f.disabled?"cursor-not-allowed":"cursor-pointer",{"fm-tab--selected":d.value}]),disabled:f.disabled,onMousedown:p[0]||(p[0]=()=>r(!0)),onMouseup:p[1]||(p[1]=()=>r(!1)),onMouseleave:p[2]||(p[2]=()=>r(!1)),onClick:a},[l.renderSlot(f.$slots,"prepend",{},void 0,!0),f.icon?(l.openBlock(),l.createBlock(L,{key:0,name:f.icon,outline:!n.value&&!d.value,color:f.disabled?"neutral-gray-200":d.value?"primary":"neutral-black",size:"md"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),f.label?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-lg-700 text-fm-color-typo-primary col-start-2 row-start-1",d.value?"visible":"invisible"])},l.toDisplayString(f.label),3)):l.createCommentVNode("",!0),f.label?(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass(["fm-typo-body-lg-400 col-start-2 row-start-1",f.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary",!d.value||f.disabled?"visible":"invisible"])},l.toDisplayString(f.label),3)):l.createCommentVNode("",!0),f.badge?(l.openBlock(),l.createBlock(yn,{key:3,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):l.createCommentVNode("",!0),f.children.length>0?(l.openBlock(),l.createBlock(L,{key:4,size:"md",name:s.value?"expand_less":"expand_more"},null,8,["name"])):l.createCommentVNode("",!0),l.renderSlot(f.$slots,"append",{},void 0,!0),d.value?(l.openBlock(),l.createElementBlock("div",{key:5,class:l.normalizeClass([`fm-tab__indicator__wrapper--${f.vertical?"vertical":"horizontal"}`])},Lb,2)):l.createCommentVNode("",!0)],42,Ib)]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Tb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.children,h=>l.renderSlot(f.$slots,"list-item",l.normalizeProps(l.guardReactiveProps(h)),()=>[l.createVNode(Ee,{"model-value":o.modelValue===h.value,label:h.label,icon:h.icon,disabled:h.disabled,onClick:g=>u(h.value)},{append:l.withCtx(()=>[h.badge?(l.openBlock(),l.createBlock(yn,{key:0,value:h.badge,inline:"",variant:"numeric"},null,8,["value"])):l.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])],!0)),256))])]),_:3},8,["show-menu","disabled","class","placement"]))}}),x_="",Ql=Q(zb,[["__scopeId","data-v-431e2921"]]);/**
|
|
26
|
+
`):t}function np(t,e){const{element:n,datasetIndex:o,index:s}=e,i=t.getDatasetMeta(o).controller,{label:r,value:a}=i.getLabelAndValue(s);return{chart:t,label:r,parsed:i.getParsed(s),raw:t.data.datasets[o].data[s],formattedValue:a,dataset:i.getDataset(),dataIndex:s,datasetIndex:o,element:n}}function pl(t,e){const n=t.chart.ctx,{body:o,footer:s,title:i}=t,{boxWidth:r,boxHeight:a}=e,c=re(e.bodyFont),d=re(e.titleFont),u=re(e.footerFont),f=i.length,p=s.length,h=o.length,g=fe(e.padding);let m=g.height,b=0,y=o.reduce((S,x)=>S+x.before.length+x.lines.length+x.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,f&&(m+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),y){const S=e.displayColors?Math.max(a,c.lineHeight):c.lineHeight;m+=h*S+(y-h)*c.lineHeight+(y-1)*e.bodySpacing}p&&(m+=e.footerMarginTop+p*u.lineHeight+(p-1)*e.footerSpacing);let _=0;const w=function(S){b=Math.max(b,n.measureText(S).width+_)};return n.save(),n.font=d.string,q(t.title,w),n.font=c.string,q(t.beforeBody.concat(t.afterBody),w),_=e.displayColors?r+2+e.boxPadding:0,q(o,S=>{q(S.before,w),q(S.lines,w),q(S.after,w)}),_=0,n.font=u.string,q(t.footer,w),n.restore(),b+=g.width,{width:b,height:m}}function op(t,e){const{y:n,height:o}=e;return n<o/2?"top":n>t.height-o/2?"bottom":"center"}function sp(t,e,n,o){const{x:s,width:i}=o,r=n.caretSize+n.caretPadding;if(t==="left"&&s+i+r>e.width||t==="right"&&s-i-r<0)return!0}function ip(t,e,n,o){const{x:s,width:i}=n,{width:r,chartArea:{left:a,right:c}}=t;let d="center";return o==="center"?d=s<=(a+c)/2?"left":"right":s<=i/2?d="left":s>=r-i/2&&(d="right"),sp(d,t,e,n)&&(d="center"),d}function gl(t,e,n){const o=n.yAlign||e.yAlign||op(t,n);return{xAlign:n.xAlign||e.xAlign||ip(t,e,n,o),yAlign:o}}function rp(t,e){let{x:n,width:o}=t;return e==="right"?n-=o:e==="center"&&(n-=o/2),n}function lp(t,e,n){let{y:o,height:s}=t;return e==="top"?o+=n:e==="bottom"?o-=s+n:o-=s/2,o}function ml(t,e,n,o){const{caretSize:s,caretPadding:i,cornerRadius:r}=t,{xAlign:a,yAlign:c}=n,d=s+i,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:h}=yt(r);let g=rp(e,a);const m=lp(e,c,d);return c==="center"?a==="left"?g+=d:a==="right"&&(g-=d):a==="left"?g-=Math.max(u,p)+s:a==="right"&&(g+=Math.max(f,h)+s),{x:ae(g,0,o.width-e.width),y:ae(m,0,o.height-e.height)}}function no(t,e,n){const o=fe(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-o.right:t.x+o.left}function bl(t){return Fe([],Ge(t))}function ap(t,e,n){return it(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function yl(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const _l={beforeTitle:Le,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,o=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(o>0&&e.dataIndex<o)return n[e.dataIndex]}return""},afterTitle:Le,beforeBody:Le,beforeLabel:Le,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Y(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Le,afterBody:Le,beforeFooter:Le,footer:Le,afterFooter:Le};function me(t,e,n,o){const s=t[e].call(n,o);return typeof s>"u"?_l[e].call(n,o):s}class hs extends We{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,o=this.options.setContext(this.getContext()),s=o.enabled&&n.options.animation&&o.animations,i=new ar(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=ap(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:o}=n,s=me(o,"beforeTitle",this,e),i=me(o,"title",this,e),r=me(o,"afterTitle",this,e);let a=[];return a=Fe(a,Ge(s)),a=Fe(a,Ge(i)),a=Fe(a,Ge(r)),a}getBeforeBody(e,n){return bl(me(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:o}=n,s=[];return q(e,i=>{const r={before:[],lines:[],after:[]},a=yl(o,i);Fe(r.before,Ge(me(a,"beforeLabel",this,i))),Fe(r.lines,me(a,"label",this,i)),Fe(r.after,Ge(me(a,"afterLabel",this,i))),s.push(r)}),s}getAfterBody(e,n){return bl(me(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:o}=n,s=me(o,"beforeFooter",this,e),i=me(o,"footer",this,e),r=me(o,"afterFooter",this,e);let a=[];return a=Fe(a,Ge(s)),a=Fe(a,Ge(i)),a=Fe(a,Ge(r)),a}_createItems(e){const n=this._active,o=this.chart.data,s=[],i=[],r=[];let a=[],c,d;for(c=0,d=n.length;c<d;++c)a.push(np(this.chart,n[c]));return e.filter&&(a=a.filter((u,f,p)=>e.filter(u,f,p,o))),e.itemSort&&(a=a.sort((u,f)=>e.itemSort(u,f,o))),q(a,u=>{const f=yl(e.callbacks,u);s.push(me(f,"labelColor",this,u)),i.push(me(f,"labelPointStyle",this,u)),r.push(me(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=i,this.labelTextColors=r,this.dataPoints=a,a}update(e,n){const o=this.options.setContext(this.getContext()),s=this._active;let i,r=[];if(!s.length)this.opacity!==0&&(i={opacity:0});else{const a=dn[o.position].call(this,s,this._eventPosition);r=this._createItems(o),this.title=this.getTitle(r,o),this.beforeBody=this.getBeforeBody(r,o),this.body=this.getBody(r,o),this.afterBody=this.getAfterBody(r,o),this.footer=this.getFooter(r,o);const c=this._size=pl(this,o),d=Object.assign({},a,c),u=gl(this.chart,o,d),f=ml(o,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&o.external&&o.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,o,s){const i=this.getCaretPosition(e,o,s);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(e,n,o){const{xAlign:s,yAlign:i}=this,{caretSize:r,cornerRadius:a}=o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=yt(a),{x:p,y:h}=e,{width:g,height:m}=n;let b,y,_,w,S,x;return i==="center"?(S=h+m/2,s==="left"?(b=p,y=b-r,w=S+r,x=S-r):(b=p+g,y=b+r,w=S-r,x=S+r),_=b):(s==="left"?y=p+Math.max(c,u)+r:s==="right"?y=p+g-Math.max(d,f)-r:y=this.caretX,i==="top"?(w=h,S=w-r,b=y-r,_=y+r):(w=h+m,S=w+r,b=y+r,_=y-r),x=w),{x1:b,x2:y,x3:_,y1:w,y2:S,y3:x}}drawTitle(e,n,o){const s=this.title,i=s.length;let r,a,c;if(i){const d=$t(o.rtl,this.x,this.width);for(e.x=no(this,o.titleAlign,o),n.textAlign=d.textAlign(o.titleAlign),n.textBaseline="middle",r=re(o.titleFont),a=o.titleSpacing,n.fillStyle=o.titleColor,n.font=r.string,c=0;c<i;++c)n.fillText(s[c],d.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+a,c+1===i&&(e.y+=o.titleMarginBottom-a)}}_drawColorBox(e,n,o,s,i){const r=this.labelColors[o],a=this.labelPointStyles[o],{boxHeight:c,boxWidth:d}=i,u=re(i.bodyFont),f=no(this,"left",i),p=s.x(f),h=c<u.lineHeight?(u.lineHeight-c)/2:0,g=n.y+h;if(i.usePointStyle){const m={radius:Math.min(d,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=s.leftForLtr(p,d)+d/2,y=g+c/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Ho(e,m,b,y),e.strokeStyle=r.borderColor,e.fillStyle=r.backgroundColor,Ho(e,m,b,y)}else{e.lineWidth=j(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,e.strokeStyle=r.borderColor,e.setLineDash(r.borderDash||[]),e.lineDashOffset=r.borderDashOffset||0;const m=s.leftForLtr(p,d),b=s.leftForLtr(s.xPlus(p,1),d-2),y=yt(r.borderRadius);Object.values(y).some(_=>_!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,Zt(e,{x:m,y:g,w:d,h:c,radius:y}),e.fill(),e.stroke(),e.fillStyle=r.backgroundColor,e.beginPath(),Zt(e,{x:b,y:g+1,w:d-2,h:c-2,radius:y}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(m,g,d,c),e.strokeRect(m,g,d,c),e.fillStyle=r.backgroundColor,e.fillRect(b,g+1,d-2,c-2))}e.fillStyle=this.labelTextColors[o]}drawBody(e,n,o){const{body:s}=this,{bodySpacing:i,bodyAlign:r,displayColors:a,boxHeight:c,boxWidth:d,boxPadding:u}=o,f=re(o.bodyFont);let p=f.lineHeight,h=0;const g=$t(o.rtl,this.x,this.width),m=function(R){n.fillText(R,g.x(e.x+h),e.y+p/2),e.y+=p+i},b=g.textAlign(r);let y,_,w,S,x,E,v;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,e.x=no(this,b,o),n.fillStyle=o.bodyColor,q(this.beforeBody,m),h=a&&b!=="right"?r==="center"?d/2+u:d+2+u:0,S=0,E=s.length;S<E;++S){for(y=s[S],_=this.labelTextColors[S],n.fillStyle=_,q(y.before,m),w=y.lines,a&&w.length&&(this._drawColorBox(n,e,S,g,o),p=Math.max(f.lineHeight,c)),x=0,v=w.length;x<v;++x)m(w[x]),p=f.lineHeight;q(y.after,m)}h=0,p=f.lineHeight,q(this.afterBody,m),e.y-=i}drawFooter(e,n,o){const s=this.footer,i=s.length;let r,a;if(i){const c=$t(o.rtl,this.x,this.width);for(e.x=no(this,o.footerAlign,o),e.y+=o.footerMarginTop,n.textAlign=c.textAlign(o.footerAlign),n.textBaseline="middle",r=re(o.footerFont),n.fillStyle=o.footerColor,n.font=r.string,a=0;a<i;++a)n.fillText(s[a],c.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+o.footerSpacing}}drawBackground(e,n,o,s){const{xAlign:i,yAlign:r}=this,{x:a,y:c}=e,{width:d,height:u}=o,{topLeft:f,topRight:p,bottomLeft:h,bottomRight:g}=yt(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+f,c),r==="top"&&this.drawCaret(e,n,o,s),n.lineTo(a+d-p,c),n.quadraticCurveTo(a+d,c,a+d,c+p),r==="center"&&i==="right"&&this.drawCaret(e,n,o,s),n.lineTo(a+d,c+u-g),n.quadraticCurveTo(a+d,c+u,a+d-g,c+u),r==="bottom"&&this.drawCaret(e,n,o,s),n.lineTo(a+h,c+u),n.quadraticCurveTo(a,c+u,a,c+u-h),r==="center"&&i==="left"&&this.drawCaret(e,n,o,s),n.lineTo(a,c+f),n.quadraticCurveTo(a,c,a+f,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,o=this.$animations,s=o&&o.x,i=o&&o.y;if(s||i){const r=dn[e.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=pl(this,e),c=Object.assign({},r,this._size),d=gl(n,e,c),u=ml(e,c,d,n);(s._to!==u.x||i._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let o=this.opacity;if(!o)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},i={x:this.x,y:this.y};o=Math.abs(o)<.001?0:o;const r=fe(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=o,this.drawBackground(i,e,s,n),Qi(e,n.textDirection),i.y+=r.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),er(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const o=this._active,s=e.map(({datasetIndex:a,index:c})=>{const d=this.chart.getDatasetMeta(a);if(!d)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:d.data[c],index:c}}),i=!Dn(o,s),r=this._positionChanged(s,n);(i||r)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,o=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,i=this._active||[],r=this._getActiveElements(e,i,n,o),a=this._positionChanged(r,e),c=n||!Dn(r,i)||a;return c&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,o,s){const i=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(e,i.mode,i,o);return i.reverse&&r.reverse(),r}_positionChanged(e,n){const{caretX:o,caretY:s,options:i}=this,r=dn[i.position].call(this,e,n);return r!==!1&&(o!==r.x||s!==r.y)}}$(hs,"positioners",dn);var cp={id:"tooltip",_element:hs,positioners:dn,afterInit(t,e,n){n&&(t.tooltip=new hs({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:_l},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},dp=Object.freeze({__proto__:null,Colors:Ch,Decimation:Mh,Filler:Gh,Legend:Jh,SubTitle:tp,Title:ep,Tooltip:cp});const up=(t,e,n,o)=>(typeof e=="string"?(n=t.push(e)-1,o.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function fp(t,e,n,o){const s=t.indexOf(e);if(s===-1)return up(t,e,n,o);const i=t.lastIndexOf(e);return s!==i?n:s}const hp=(t,e)=>t===null?null:ae(Math.round(t),0,e);function xl(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class ps extends St{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const o=this.getLabels();for(const{index:s,label:i}of n)o[s]===i&&o.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Y(e))return null;const o=this.getLabels();return n=isFinite(n)&&o[n]===e?n:fp(o,e,T(n,e),this._addedLabels),hp(n,o.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:o,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(o=0),n||(s=this.getLabels().length-1)),this.min=o,this.max=s}buildTicks(){const e=this.min,n=this.max,o=this.options.offset,s=[];let i=this.getLabels();i=e===0&&n===i.length-1?i:i.slice(e,n+1),this._valueRange=Math.max(i.length-(o?0:1),1),this._startValue=this.min-(o?.5:0);for(let r=e;r<=n;r++)s.push({value:r});return s}getLabelForValue(e){return xl.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}$(ps,"id","category"),$(ps,"defaults",{ticks:{callback:xl}});function pp(t,e){const n=[],{bounds:s,step:i,min:r,max:a,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:p}=t,h=i||1,g=u-1,{min:m,max:b}=e,y=!Y(r),_=!Y(a),w=!Y(d),S=(b-m)/(f+1);let x=Si((b-m)/g/h)*h,E,v,R,P;if(x<1e-14&&!y&&!_)return[{value:m},{value:b}];P=Math.ceil(b/x)-Math.floor(m/x),P>g&&(x=Si(P*x/g/h)*h),Y(c)||(E=Math.pow(10,c),x=Math.ceil(x*E)/E),s==="ticks"?(v=Math.floor(m/x)*x,R=Math.ceil(b/x)*x):(v=m,R=b),y&&_&&i&&ld((a-r)/i,x/1e3)?(P=Math.round(Math.min((a-r)/x,u)),x=(a-r)/P,v=r,R=a):w?(v=y?r:v,R=_?a:R,P=d-1,x=(R-v)/P):(P=(R-v)/x,Gt(P,Math.round(P),x/1e3)?P=Math.round(P):P=Math.ceil(P));const A=Math.max(Mi(x),Mi(v));E=Math.pow(10,Y(c)?A:c),v=Math.round(v*E)/E,R=Math.round(R*E)/E;let C=0;for(y&&(p&&v!==r?(n.push({value:r}),v<r&&C++,Gt(Math.round((v+C*x)*E)/E,r,wl(r,S,t))&&C++):v<r&&C++);C<P;++C){const V=Math.round((v+C*x)*E)/E;if(_&&V>a)break;n.push({value:V})}return _&&p&&R!==a?n.length&&Gt(n[n.length-1].value,a,wl(a,S,t))?n[n.length-1].value=a:n.push({value:a}):(!_||R===a)&&n.push({value:R}),n}function wl(t,e,{horizontal:n,minRotation:o}){const s=Me(o),i=(n?Math.sin(s):Math.cos(s))||.001,r=.75*e*(""+t).length;return Math.min(e/i,r)}class oo extends St{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return Y(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:s,max:i}=this;const r=c=>s=n?s:c,a=c=>i=o?i:c;if(e){const c=Re(s),d=Re(i);c<0&&d<0?a(0):c>0&&d>0&&r(0)}if(s===i){let c=i===0?1:Math.abs(i*.05);a(i+c),e||r(s-c)}this.min=s,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:o}=e,s;return o?(s=Math.ceil(this.max/o)-Math.floor(this.min/o)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${o} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let o=this.getTickLimit();o=Math.max(2,o);const s={maxTicks:o,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,r=pp(s,i);return e.bounds==="ticks"&&vi(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let n=this.min,o=this.max;if(super.configure(),this.options.offset&&e.length){const s=(o-n)/Math.max(e.length-1,1)/2;n-=s,o+=s}this._startValue=n,this._endValue=o,this._valueRange=o-n}getLabelForValue(e){return Xt(e,this.chart.options.locale,this.options.ticks.format)}}class gs extends oo{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ne(e)?e:0,this.max=ne(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,o=Me(this.options.ticks.minRotation),s=(e?Math.sin(o):Math.cos(o))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}$(gs,"id","linear"),$(gs,"defaults",{ticks:{callback:Bn.formatters.numeric}});const un=t=>Math.floor(st(t)),vt=(t,e)=>Math.pow(10,un(t)+e);function Cl(t){return t/Math.pow(10,un(t))===1}function kl(t,e,n){const o=Math.pow(10,n),s=Math.floor(t/o);return Math.ceil(e/o)-s}function gp(t,e){const n=e-t;let o=un(n);for(;kl(t,e,o)>10;)o++;for(;kl(t,e,o)<10;)o--;return Math.min(o,un(t))}function mp(t,{min:e,max:n}){e=_e(t.min,e);const o=[],s=un(e);let i=gp(e,n),r=i<0?Math.pow(10,Math.abs(i)):1;const a=Math.pow(10,i),c=s>i?Math.pow(10,s):0,d=Math.round((e-c)*r)/r,u=Math.floor((e-c)/a/10)*a*10;let f=Math.floor((d-u)/Math.pow(10,i)),p=_e(t.min,Math.round((c+u+f*Math.pow(10,i))*r)/r);for(;p<n;)o.push({value:p,major:Cl(p),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(i++,f=2,r=i>=0?1:r),p=Math.round((c+u+f*Math.pow(10,i))*r)/r;const h=_e(t.max,p);return o.push({value:h,major:Cl(h),significand:f}),o}class ms extends St{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const o=oo.prototype.parse.apply(this,[e,n]);if(o===0){this._zero=!0;return}return ne(o)&&o>0?o:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ne(e)?Math.max(0,e):null,this.max=ne(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ne(this._userMin)&&(this.min=e===vt(this.min,0)?vt(this.min,-1):vt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let o=this.min,s=this.max;const i=a=>o=e?o:a,r=a=>s=n?s:a;o===s&&(o<=0?(i(1),r(10)):(i(vt(o,-1)),r(vt(s,1)))),o<=0&&i(vt(s,-1)),s<=0&&r(vt(o,1)),this.min=o,this.max=s}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},o=mp(n,this);return e.bounds==="ticks"&&vi(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}getLabelForValue(e){return e===void 0?"0":Xt(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=st(e),this._valueRange=st(this.max)-st(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(st(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}$(ms,"id","logarithmic"),$(ms,"defaults",{ticks:{callback:Bn.formatters.logarithmic,major:{enabled:!0}}});function bs(t){const e=t.ticks;if(e.display&&t.display){const n=fe(e.backdropPadding);return T(e.font&&e.font.size,oe.font.size)+n.height}return 0}function bp(t,e,n){return n=J(n)?n:[n],{w:Sd(t,e.string,n),h:n.length*e.lineHeight}}function Sl(t,e,n,o,s){return t===o||t===s?{start:e-n/2,end:e+n/2}:t<o||t>s?{start:e-n,end:e}:{start:e,end:e+n}}function yp(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),o=[],s=[],i=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?Q/i:0;for(let c=0;c<i;c++){const d=r.setContext(t.getPointLabelContext(c));s[c]=d.padding;const u=t.getPointPosition(c,t.drawingArea+s[c],a),f=re(d.font),p=bp(t.ctx,f,t._pointLabels[c]);o[c]=p;const h=xe(t.getIndexAngle(c)+a),g=Math.round(Po(h)),m=Sl(g,u.x,p.w,0,180),b=Sl(g,u.y,p.h,90,270);_p(n,e,h,m,b)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=Cp(t,o,s)}function _p(t,e,n,o,s){const i=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n));let a=0,c=0;o.start<e.l?(a=(e.l-o.start)/i,t.l=Math.min(t.l,e.l-a)):o.end>e.r&&(a=(o.end-e.r)/i,t.r=Math.max(t.r,e.r+a)),s.start<e.t?(c=(e.t-s.start)/r,t.t=Math.min(t.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+c))}function xp(t,e,n){const o=t.drawingArea,{extra:s,additionalAngle:i,padding:r,size:a}=n,c=t.getPointPosition(e,o+s+r,i),d=Math.round(Po(xe(c.angle+se))),u=vp(c.y,a.h,d),f=kp(d),p=Sp(c.x,a.w,f);return{visible:!0,x:c.x,y:u,textAlign:f,left:p,top:u,right:p+a.w,bottom:u+a.h}}function wp(t,e){if(!e)return!0;const{left:n,top:o,right:s,bottom:i}=t;return!(He({x:n,y:o},e)||He({x:n,y:i},e)||He({x:s,y:o},e)||He({x:s,y:i},e))}function Cp(t,e,n){const o=[],s=t._pointLabels.length,i=t.options,{centerPointLabels:r,display:a}=i.pointLabels,c={extra:bs(i)/2,additionalAngle:r?Q/s:0};let d;for(let u=0;u<s;u++){c.padding=n[u],c.size=e[u];const f=xp(t,u,c);o.push(f),a==="auto"&&(f.visible=wp(f,d),f.visible&&(d=f))}return o}function kp(t){return t===0||t===180?"center":t<180?"left":"right"}function Sp(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function vp(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function Mp(t,e,n){const{left:o,top:s,right:i,bottom:r}=n,{backdropColor:a}=e;if(!Y(a)){const c=yt(e.borderRadius),d=fe(e.backdropPadding);t.fillStyle=a;const u=o-d.left,f=s-d.top,p=i-o+d.width,h=r-s+d.height;Object.values(c).some(g=>g!==0)?(t.beginPath(),Zt(t,{x:u,y:f,w:p,h,radius:c}),t.fill()):t.fillRect(u,f,p,h)}}function Dp(t,e){const{ctx:n,options:{pointLabels:o}}=t;for(let s=e-1;s>=0;s--){const i=t._pointLabelItems[s];if(!i.visible)continue;const r=o.setContext(t.getPointLabelContext(s));Mp(n,r,i);const a=re(r.font),{x:c,y:d,textAlign:u}=i;bt(n,t._pointLabels[s],c,d+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function vl(t,e,n,o){const{ctx:s}=t;if(n)s.arc(t.xCenter,t.yCenter,e,0,ee);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let r=1;r<o;r++)i=t.getPointPosition(r,e),s.lineTo(i.x,i.y)}}function Ep(t,e,n,o,s){const i=t.ctx,r=e.circular,{color:a,lineWidth:c}=e;!r&&!o||!a||!c||n<0||(i.save(),i.strokeStyle=a,i.lineWidth=c,i.setLineDash(s.dash),i.lineDashOffset=s.dashOffset,i.beginPath(),vl(t,n,r,o),i.closePath(),i.stroke(),i.restore())}function Vp(t,e,n){return it(t,{label:n,index:e,type:"pointLabel"})}class fn extends oo{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=fe(bs(this.options)/2),n=this.width=this.maxWidth-e.width,o=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+o/2+e.top),this.drawingArea=Math.floor(Math.min(n,o)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=ne(e)&&!isNaN(e)?e:0,this.max=ne(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/bs(this.options))}generateTickLabels(e){oo.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,o)=>{const s=Z(this.options.pointLabels.callback,[n,o],this);return s||s===0?s:""}).filter((n,o)=>this.chart.getDataVisibility(o))}fit(){const e=this.options;e.display&&e.pointLabels.display?yp(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,o,s){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((o-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,o,s))}getIndexAngle(e){const n=ee/(this._pointLabels.length||1),o=this.options.startAngle||0;return xe(e*n+Me(o))}getDistanceFromCenterForValue(e){if(Y(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(Y(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const o=n[e];return Vp(this.getContext(),e,o)}}getPointPosition(e,n,o=0){const s=this.getIndexAngle(e)-se+o;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:o,right:s,bottom:i}=this._pointLabelItems[e];return{left:n,top:o,right:s,bottom:i}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const o=this.ctx;o.save(),o.beginPath(),vl(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),o.closePath(),o.fillStyle=e,o.fill(),o.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:o,grid:s,border:i}=n,r=this._pointLabels.length;let a,c,d;if(n.pointLabels.display&&Dp(this,r),s.display&&this.ticks.forEach((u,f)=>{if(f!==0){c=this.getDistanceFromCenterForValue(u.value);const p=this.getContext(f),h=s.setContext(p),g=i.setContext(p);Ep(this,h,c,r,g)}}),o.display){for(e.save(),a=r-1;a>=0;a--){const u=o.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:p}=u;!p||!f||(e.lineWidth=p,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),d=this.getPointPosition(a,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,o=n.ticks;if(!o.display)return;const s=this.getIndexAngle(0);let i,r;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&!n.reverse)return;const d=o.setContext(this.getContext(c)),u=re(d.font);if(i=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,r=e.measureText(a.label).width,e.fillStyle=d.backdropColor;const f=fe(d.backdropPadding);e.fillRect(-r/2-f.left,-i-u.size/2-f.top,r+f.width,u.size+f.height)}bt(e,a.label,0,-i,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}$(fn,"id","radialLinear"),$(fn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Bn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),$(fn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),$(fn,"descriptors",{angleLines:{_fallback:"grid"}});const so={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}},be=Object.keys(so);function Ml(t,e){return t-e}function Dl(t,e){if(Y(e))return null;const n=t._adapter,{parser:o,round:s,isoWeekday:i}=t._parseOpts;let r=e;return typeof o=="function"&&(r=o(r)),ne(r)||(r=typeof o=="string"?n.parse(r,o):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(Rt(i)||i===!0)?n.startOf(r,"isoWeek",i):n.startOf(r,s)),+r)}function El(t,e,n,o){const s=be.length;for(let i=be.indexOf(t);i<s-1;++i){const r=so[be[i]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-e)/(a*r.size))<=o)return be[i]}return be[s-1]}function Rp(t,e,n,o,s){for(let i=be.length-1;i>=be.indexOf(n);i--){const r=be[i];if(so[r].common&&t._adapter.diff(s,o,r)>=e-1)return r}return be[n?be.indexOf(n):0]}function Bp(t){for(let e=be.indexOf(t)+1,n=be.length;e<n;++e)if(so[be[e]].common)return be[e]}function Vl(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:o,hi:s}=Oo(n,e),i=n[o]>=e?n[o]:n[s];t[i]=!0}}function Fp(t,e,n,o){const s=t._adapter,i=+s.startOf(e[0].value,o),r=e[e.length-1].value;let a,c;for(a=i;a<=r;a=+s.add(a,1,o))c=n[a],c>=0&&(e[c].major=!0);return e}function Rl(t,e,n){const o=[],s={},i=e.length;let r,a;for(r=0;r<i;++r)a=e[r],s[a]=r,o.push({value:a,major:!1});return i===0||!n?o:Fp(t,o,s,n)}class hn extends St{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const o=e.time||(e.time={}),s=this._adapter=new Tu._date(e.adapters.date);s.init(n),Wt(o.displayFormats,s.formats()),this._parseOpts={parser:o.parser,round:o.round,isoWeekday:o.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Dl(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,o=e.time.unit||"day";let{min:s,max:i,minDefined:r,maxDefined:a}=this.getUserBounds();function c(d){!r&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!a&&!isNaN(d.max)&&(i=Math.max(i,d.max))}(!r||!a)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=ne(s)&&!isNaN(s)?s:+n.startOf(Date.now(),o),i=ne(i)&&!isNaN(i)?i:+n.endOf(Date.now(),o)+1,this.min=Math.min(s,i-1),this.max=Math.max(s+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],o=e[e.length-1]),{min:n,max:o}}buildTicks(){const e=this.options,n=e.time,o=e.ticks,s=o.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const i=this.min,r=this.max,a=ud(s,i,r);return this._unit=n.unit||(o.autoSkip?El(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):Rp(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!o.major.enabled||this._unit==="year"?void 0:Bp(this._unit),this.initOffsets(s),e.reverse&&a.reverse(),Rl(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,o=0,s,i;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?o=i:o=(i-this.getDecimalForValue(e[e.length-2]))/2);const r=e.length<3?.5:.25;n=ae(n,0,r),o=ae(o,0,r),this._offsets={start:n,end:o,factor:1/(n+1+o)}}_generate(){const e=this._adapter,n=this.min,o=this.max,s=this.options,i=s.time,r=i.unit||El(i.minUnit,n,o,this._getLabelCapacity(n)),a=T(s.ticks.stepSize,1),c=r==="week"?i.isoWeekday:!1,d=Rt(c)||c===!0,u={};let f=n,p,h;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":r),e.diff(o,n,r)>1e5*a)throw new Error(n+" and "+o+" are too far apart with stepSize of "+a+" "+r);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(p=f,h=0;p<o;p=+e.add(p,a,r),h++)Vl(u,p,g);return(p===o||s.bounds==="ticks"||h===1)&&Vl(u,p,g),Object.keys(u).sort(Ml).map(m=>+m)}getLabelForValue(e){const n=this._adapter,o=this.options.time;return o.tooltipFormat?n.format(e,o.tooltipFormat):n.format(e,o.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,i=this._unit,r=n||s[i];return this._adapter.format(e,r)}_tickFormatFunction(e,n,o,s){const i=this.options,r=i.ticks.callback;if(r)return Z(r,[e,n,o],this);const a=i.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&a[c],f=d&&a[d],p=o[n],h=d&&f&&p&&p.major;return this._adapter.format(e,s||(h?f:u))}generateTickLabels(e){let n,o,s;for(n=0,o=e.length;n<o;++n)s=e[n],s.label=this._tickFormatFunction(s.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,o=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+o)*n.factor)}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+o*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,o=this.ctx.measureText(e).width,s=Me(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:o*i+a*r,h:o*r+a*i}}_getLabelCapacity(e){const n=this.options.time,o=n.displayFormats,s=o[n.unit]||o.millisecond,i=this._tickFormatFunction(e,0,Rl(this,[e],this._majorUnit),s),r=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,o;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,o=s.length;n<o;++n)e=e.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,o;if(e.length)return e;const s=this.getLabels();for(n=0,o=s.length;n<o;++n)e.push(Dl(this,s[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Ri(e.sort(Ml))}}$(hn,"id","time"),$(hn,"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 io(t,e,n){let o=0,s=t.length-1,i,r,a,c;n?(e>=t[o].pos&&e<=t[s].pos&&({lo:o,hi:s}=ze(t,"pos",e)),{pos:i,time:a}=t[o],{pos:r,time:c}=t[s]):(e>=t[o].time&&e<=t[s].time&&({lo:o,hi:s}=ze(t,"time",e)),{time:i,pos:a}=t[o],{time:r,pos:c}=t[s]);const d=r-i;return d?a+(c-a)*(e-i)/d:a}class ys extends hn{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=io(n,this.min),this._tableRange=io(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:o}=this,s=[],i=[];let r,a,c,d,u;for(r=0,a=e.length;r<a;++r)d=e[r],d>=n&&d<=o&&s.push(d);if(s.length<2)return[{time:n,pos:0},{time:o,pos:1}];for(r=0,a=s.length;r<a;++r)u=s[r+1],c=s[r-1],d=s[r],Math.round((u+c)/2)!==d&&i.push({time:d,pos:r/(a-1)});return i}_generate(){const e=this.min,n=this.max;let o=super.getDataTimestamps();return(!o.includes(e)||!o.length)&&o.splice(0,0,e),(!o.includes(n)||o.length===1)&&o.push(n),o.sort((s,i)=>s-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),o=this.getLabelTimestamps();return n.length&&o.length?e=this.normalize(n.concat(o)):e=n.length?n:o,e=this._cache.all=e,e}getDecimalForValue(e){return(io(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return io(this._table,o*this._tableRange+this._minPos,!0)}}$(ys,"id","timeseries"),$(ys,"defaults",hn.defaults);var $p=Object.freeze({__proto__:null,CategoryScale:ps,LinearScale:gs,LogarithmicScale:ms,RadialLinearScale:fn,TimeScale:hn,TimeSeriesScale:ys});const Pp=[Lu,mh,dp,$p];Ye.register(...Pp);const Ap={class:"px-24 py-16"},Op={class:"flex flex-col gap-8"},Np={class:"fm-color-typo-primary fm-typo-body-lg-400"},Ip={class:"fm-color-typo-secondary fm-typo-body-md-400"},Lp=l.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{}},setup(t){const e=t,n=l.ref(null);let o=null;l.watch([()=>e.xAxis,()=>e.datasets],()=>{o&&(o.data.datasets=e.datasets,o.data.labels=e.xAxis.categories,o.update())});function s(d,u){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)},${u})`;if(d.startsWith("rgb")){const p=d.split(",");if(p.length===3)return[...p.slice(0,2),p[2].replace(")",`,${u})`)].join(",");if(p.length===4)return[...p.slice(0,3),`${u})`].join(",")}return""}function i(d){const u=getComputedStyle(document.documentElement).getPropertyValue(`--${d}`)||d;return u.startsWith("rgb")||u.startsWith("#")?u:null}function r({context:d,color:u}){const{ctx:f,chartArea:p}=d.chart;if(!p)return;const h=f==null?void 0:f.createLinearGradient(0,0,0,p.height);return h.addColorStop(0,s(u,.5)),h.addColorStop(1,s(u,0)),h}const a=l.computed(()=>({labels:e.xAxis.categories,datasets:e.datasets.map(d=>{const u=i(d.color)??"";return{...d,backgroundColor:u?f=>r({context:f,color:u}):"",borderColor:u,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));function c(){n.value&&(o=new Ye(n.value,{type:"line",data:a.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,u)=>(l.openBlock(),l.createElementBlock("div",Ap,[l.createElementVNode("div",Op,[l.createElementVNode("div",Np,l.toDisplayString(d.name),1),l.createElementVNode("div",Ip,l.toDisplayString(d.paragraph),1)]),l.createElementVNode("canvas",{ref_key:"canvas",ref:n},null,512)]))}});function Tp(){var t;return(t=l.getCurrentInstance())==null?void 0:t.emit}function pe(t,e){const n=Tp(),o=l.ref(t[e]);return l.watch(()=>t[e],()=>{o.value=t[e]}),l.computed({get(){return o.value},set(i){o.value=i,n==null||n(`update:${e}`,i)}})}function ye(t,e){return t===null||e===null||typeof t!="object"&&typeof e!="object"?t===e:Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>ye(t[n],e[n]))}const zp={class:"fm-checkbox"},Hp={class:"fm-checkbox--wrapper"},jp={class:"fm-checkbox__input--container"},Wp=["checked","disabled","indeterminate"],Yp={key:0,class:"fm-checkbox__label-container"},Gp={class:"fm-typo-body-lg-400"},Up={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Bl=l.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(t){const e=t,n=pe(e,"modelValue"),o=pe(e,"indeterminate"),s=Array.isArray(n.value),i=l.ref(s?n.value.some(c=>ye(c,e.value)):n.value),r=l.computed(()=>{const c=s?n.value.some(d=>ye(d,e.value)):n.value;return o.value&&!c?"remove":n.value?"check_small":""});function a(){if(e.disabled)return;o.value=!1,i.value=!i.value;let c=n.value;s?c=i.value?c.concat(e.value):c.filter(d=>!ye(d,e.value)):c=i.value,n.value=c}return l.watch(()=>n.value,()=>{i.value=s?n.value.some(c=>ye(c,e.value)):n.value}),(c,d)=>(l.openBlock(),l.createElementBlock("div",zp,[l.createElementVNode("label",Hp,[l.createElementVNode("div",jp,[l.createElementVNode("input",{class:l.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":i.value}),type:"checkbox",checked:i.value,disabled:e.disabled,indeterminate:l.unref(o),onClick:a},null,10,Wp),l.unref(o)||i.value?(l.openBlock(),l.createBlock(H,{key:0,class:"fm-checkbox__input--checkmark",name:r.value,size:"md",color:"#FFFFFF"},null,8,["name"])):l.createCommentVNode("",!0)]),e.label?(l.openBlock(),l.createElementBlock("div",Yp,[l.renderSlot(c.$slots,"label"),l.createElementVNode("div",Gp,l.toDisplayString(e.label),1),e.sublabel?(l.openBlock(),l.createElementBlock("div",Up,l.toDisplayString(e.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])]))}}),c_="";var qp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fl={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(qp,function(){var n=1e3,o=6e4,s=36e5,i="millisecond",r="second",a="minute",c="hour",d="day",u="week",f="month",p="quarter",h="year",g="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var M=["th","st","nd","rd"],k=D%100;return"["+D+(M[(k-20)%10]||M[k]||M[0])+"]"}},w=function(D,M,k){var B=String(D);return!B||B.length>=M?D:""+Array(M+1-B.length).join(k)+D},S={s:w,z:function(D){var M=-D.utcOffset(),k=Math.abs(M),B=Math.floor(k/60),F=k%60;return(M<=0?"+":"-")+w(B,2,"0")+":"+w(F,2,"0")},m:function D(M,k){if(M.date()<k.date())return-D(k,M);var B=12*(k.year()-M.year())+(k.month()-M.month()),F=M.clone().add(B,f),O=k-F<0,I=M.clone().add(B+(O?-1:1),f);return+(-(B+(k-F)/(O?F-I:I-F))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:f,y:h,w:u,d,D:g,h:c,m:a,s:r,ms:i,Q:p}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},x="en",E={};E[x]=_;var v="$isDayjsObject",R=function(D){return D instanceof V||!(!D||!D[v])},P=function D(M,k,B){var F;if(!M)return x;if(typeof M=="string"){var O=M.toLowerCase();E[O]&&(F=O),k&&(E[O]=k,F=O);var I=M.split("-");if(!F&&I.length>1)return D(I[0])}else{var W=M.name;E[W]=M,F=W}return!B&&F&&(x=F),F||!B&&x},A=function(D,M){if(R(D))return D.clone();var k=typeof M=="object"?M:{};return k.date=D,k.args=arguments,new V(k)},C=S;C.l=P,C.i=R,C.w=function(D,M){return A(D,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var V=function(){function D(k){this.$L=P(k.locale,null,!0),this.parse(k),this.$x=this.$x||k.x||{},this[v]=!0}var M=D.prototype;return M.parse=function(k){this.$d=function(B){var F=B.date,O=B.utc;if(F===null)return new Date(NaN);if(C.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var I=F.match(b);if(I){var W=I[2]-1||0,U=(I[7]||"0").substring(0,3);return O?new Date(Date.UTC(I[1],W,I[3]||1,I[4]||0,I[5]||0,I[6]||0,U)):new Date(I[1],W,I[3]||1,I[4]||0,I[5]||0,I[6]||0,U)}}return new Date(F)}(k),this.init()},M.init=function(){var k=this.$d;this.$y=k.getFullYear(),this.$M=k.getMonth(),this.$D=k.getDate(),this.$W=k.getDay(),this.$H=k.getHours(),this.$m=k.getMinutes(),this.$s=k.getSeconds(),this.$ms=k.getMilliseconds()},M.$utils=function(){return C},M.isValid=function(){return this.$d.toString()!==m},M.isSame=function(k,B){var F=A(k);return this.startOf(B)<=F&&F<=this.endOf(B)},M.isAfter=function(k,B){return A(k)<this.startOf(B)},M.isBefore=function(k,B){return this.endOf(B)<A(k)},M.$g=function(k,B,F){return C.u(k)?this[B]:this.set(F,k)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(k,B){var F=this,O=!!C.u(B)||B,I=C.p(k),W=function(Ae,ce){var ke=C.w(F.$u?Date.UTC(F.$y,ce,Ae):new Date(F.$y,ce,Ae),F);return O?ke:ke.endOf(d)},U=function(Ae,ce){return C.w(F.toDate()[Ae].apply(F.toDate("s"),(O?[0,0,0,0]:[23,59,59,999]).slice(ce)),F)},X=this.$W,K=this.$M,ie=this.$D,de="set"+(this.$u?"UTC":"");switch(I){case h:return O?W(1,0):W(31,11);case f:return O?W(1,K):W(0,K+1);case u:var Pe=this.$locale().weekStart||0,ht=(X<Pe?X+7:X)-Pe;return W(O?ie-ht:ie+(6-ht),K);case d:case g:return U(de+"Hours",0);case c:return U(de+"Minutes",1);case a:return U(de+"Seconds",2);case r:return U(de+"Milliseconds",3);default:return this.clone()}},M.endOf=function(k){return this.startOf(k,!1)},M.$set=function(k,B){var F,O=C.p(k),I="set"+(this.$u?"UTC":""),W=(F={},F[d]=I+"Date",F[g]=I+"Date",F[f]=I+"Month",F[h]=I+"FullYear",F[c]=I+"Hours",F[a]=I+"Minutes",F[r]=I+"Seconds",F[i]=I+"Milliseconds",F)[O],U=O===d?this.$D+(B-this.$W):B;if(O===f||O===h){var X=this.clone().set(g,1);X.$d[W](U),X.init(),this.$d=X.set(g,Math.min(this.$D,X.daysInMonth())).$d}else W&&this.$d[W](U);return this.init(),this},M.set=function(k,B){return this.clone().$set(k,B)},M.get=function(k){return this[C.p(k)]()},M.add=function(k,B){var F,O=this;k=Number(k);var I=C.p(B),W=function(K){var ie=A(O);return C.w(ie.date(ie.date()+Math.round(K*k)),O)};if(I===f)return this.set(f,this.$M+k);if(I===h)return this.set(h,this.$y+k);if(I===d)return W(1);if(I===u)return W(7);var U=(F={},F[a]=o,F[c]=s,F[r]=n,F)[I]||1,X=this.$d.getTime()+k*U;return C.w(X,this)},M.subtract=function(k,B){return this.add(-1*k,B)},M.format=function(k){var B=this,F=this.$locale();if(!this.isValid())return F.invalidDate||m;var O=k||"YYYY-MM-DDTHH:mm:ssZ",I=C.z(this),W=this.$H,U=this.$m,X=this.$M,K=F.weekdays,ie=F.months,de=F.meridiem,Pe=function(ce,ke,Oe,Ne){return ce&&(ce[ke]||ce(B,O))||Oe[ke].slice(0,Ne)},ht=function(ce){return C.s(W%12||12,ce,"0")},Ae=de||function(ce,ke,Oe){var Ne=ce<12?"AM":"PM";return Oe?Ne.toLowerCase():Ne};return O.replace(y,function(ce,ke){return ke||function(Oe){switch(Oe){case"YY":return String(B.$y).slice(-2);case"YYYY":return C.s(B.$y,4,"0");case"M":return X+1;case"MM":return C.s(X+1,2,"0");case"MMM":return Pe(F.monthsShort,X,ie,3);case"MMMM":return Pe(ie,X);case"D":return B.$D;case"DD":return C.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return Pe(F.weekdaysMin,B.$W,K,2);case"ddd":return Pe(F.weekdaysShort,B.$W,K,3);case"dddd":return K[B.$W];case"H":return String(W);case"HH":return C.s(W,2,"0");case"h":return ht(1);case"hh":return ht(2);case"a":return Ae(W,U,!0);case"A":return Ae(W,U,!1);case"m":return String(U);case"mm":return C.s(U,2,"0");case"s":return String(B.$s);case"ss":return C.s(B.$s,2,"0");case"SSS":return C.s(B.$ms,3,"0");case"Z":return I}return null}(ce)||I.replace(":","")})},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(k,B,F){var O,I=this,W=C.p(B),U=A(k),X=(U.utcOffset()-this.utcOffset())*o,K=this-U,ie=function(){return C.m(I,U)};switch(W){case h:O=ie()/12;break;case f:O=ie();break;case p:O=ie()/3;break;case u:O=(K-X)/6048e5;break;case d:O=(K-X)/864e5;break;case c:O=K/s;break;case a:O=K/o;break;case r:O=K/n;break;default:O=K}return F?O:C.a(O)},M.daysInMonth=function(){return this.endOf(f).$D},M.$locale=function(){return E[this.$L]},M.locale=function(k,B){if(!k)return this.$L;var F=this.clone(),O=P(k,B,!0);return O&&(F.$L=O),F},M.clone=function(){return C.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},D}(),N=V.prototype;return A.prototype=N,[["$ms",i],["$s",r],["$m",a],["$H",c],["$W",d],["$M",f],["$y",h],["$D",g]].forEach(function(D){N[D[1]]=function(M){return this.$g(M,D[0],D[1])}}),A.extend=function(D,M){return D.$i||(D(M,V,A),D.$i=!0),A},A.locale=P,A.isDayjs=R,A.unix=function(D){return A(1e3*D)},A.en=E[x],A.Ls=E,A.p={},A})})(Fl);var Kp=Fl.exports;const z=Xp(Kp),Zp={class:"w-full"},Jp=l.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(t){const e=t;return(n,o)=>(l.openBlock(),l.createBlock(e.tag,{class:l.normalizeClass({"fm-field":!0,"fm-field--focused":n.focused,"fm-field--invalid":n.invalid,"fm-field--valid":n.showValidBorder&&!n.invalid,"fm-field--disabled":n.disabled}),tabindex:"0"},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"prepend",{},()=>[n.prependIcon?(l.openBlock(),l.createBlock(H,{key:0,name:n.prependIcon,size:"md",color:n.disabled?"disabled":"neutral-black"},null,8,["name","color"])):l.createCommentVNode("",!0)],!0),l.createElementVNode("div",Zp,[l.renderSlot(n.$slots,"default",{},void 0,!0)]),l.renderSlot(n.$slots,"append",{},()=>[n.appendIcon?(l.openBlock(),l.createBlock(H,{key:0,name:n.appendIcon,size:"md",color:n.disabled?"disabled":"neutral-black"},null,8,["name","color"])):l.createCommentVNode("",!0)],!0)]),_:3},8,["class"]))}}),d_="",Ee=te(Jp,[["__scopeId","data-v-177cd78a"]]),Qp={class:"flex gap-4"},$l=l.defineComponent({__name:"FmHelperText",props:{text:{default:""},disabled:{type:Boolean,default:!1},state:{default:"none"},errorMessages:{default:()=>[]}},setup(t){const e=t,n=l.computed(()=>e.state==="success"?"check_circle":e.state==="warning"?"warning":e.state==="error"?"error":""),o=l.computed(()=>e.state==="success"?"text-fm-color-system-success-300":e.state==="warning"?"text-fm-color-system-warning-300":e.state==="error"?"text-fm-color-system-error-300":"");return(s,i)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-typo-body-sm-400",{"text-fm-color-typo-disabled":s.disabled,"text-fm-color-typo-secondary":s.state==="none"&&!s.disabled,"text-fm-color-typo-success":s.state==="success"&&!s.disabled,"text-fm-color-typo-warning":s.state==="warning"&&!s.disabled,"text-fm-color-typo-error":s.state==="error"&&!s.disabled}])},[s.errorMessages.length===0?l.renderSlot(s.$slots,"default",{key:0},()=>[l.createElementVNode("div",Qp,[n.value?(l.openBlock(),l.createBlock(H,{key:0,size:"sm",name:n.value,class:l.normalizeClass(["mt-[2px]",o.value])},null,8,["name","class"])):l.createCommentVNode("",!0),l.createElementVNode("span",null,l.toDisplayString(s.text),1)])]):l.renderSlot(s.$slots,"default",{key:1},()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.errorMessages,r=>(l.openBlock(),l.createElementBlock("div",{key:r,class:"flex gap-4 text-fm-color-typo-error"},[l.createVNode(H,{size:"sm",name:"error",class:"mt-[2px] text-fm-color-system-error-300"}),l.createElementVNode("span",null,l.toDisplayString(r),1)]))),128))])],2))}}),At=Math.min,Mt=Math.max,ro=Math.round,lo=Math.floor,at=t=>({x:t,y:t}),eg={left:"right",right:"left",bottom:"top",top:"bottom"},tg={start:"end",end:"start"};function _s(t,e,n){return Mt(t,At(e,n))}function pn(t,e){return typeof t=="function"?t(e):t}function Dt(t){return t.split("-")[0]}function gn(t){return t.split("-")[1]}function Pl(t){return t==="x"?"y":"x"}function xs(t){return t==="y"?"height":"width"}function ao(t){return["top","bottom"].includes(Dt(t))?"y":"x"}function ws(t){return Pl(ao(t))}function ng(t,e,n){n===void 0&&(n=!1);const o=gn(t),s=ws(t),i=xs(s);let r=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(r=co(r)),[r,co(r)]}function og(t){const e=co(t);return[Cs(t),e,Cs(e)]}function Cs(t){return t.replace(/start|end/g,e=>tg[e])}function sg(t,e,n){const o=["left","right"],s=["right","left"],i=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:o:e?o:s;case"left":case"right":return e?i:r;default:return[]}}function ig(t,e,n,o){const s=gn(t);let i=sg(Dt(t),n==="start",o);return s&&(i=i.map(r=>r+"-"+s),e&&(i=i.concat(i.map(Cs)))),i}function co(t){return t.replace(/left|right|bottom|top/g,e=>eg[e])}function rg(t){return{top:0,right:0,bottom:0,left:0,...t}}function Al(t){return typeof t!="number"?rg(t):{top:t,right:t,bottom:t,left:t}}function uo(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Ol(t,e,n){let{reference:o,floating:s}=t;const i=ao(e),r=ws(e),a=xs(r),c=Dt(e),d=i==="y",u=o.x+o.width/2-s.width/2,f=o.y+o.height/2-s.height/2,p=o[a]/2-s[a]/2;let h;switch(c){case"top":h={x:u,y:o.y-s.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-s.width,y:f};break;default:h={x:o.x,y:o.y}}switch(gn(e)){case"start":h[r]-=p*(n&&d?-1:1);break;case"end":h[r]+=p*(n&&d?-1:1);break}return h}const lg=async(t,e,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:r}=n,a=i.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let d=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:u,y:f}=Ol(d,o,c),p=o,h={},g=0;for(let m=0;m<a.length;m++){const{name:b,fn:y}=a[m],{x:_,y:w,data:S,reset:x}=await y({x:u,y:f,initialPlacement:o,placement:p,strategy:s,middlewareData:h,rects:d,platform:r,elements:{reference:t,floating:e}});if(u=_??u,f=w??f,h={...h,[b]:{...h[b],...S}},x&&g<=50){g++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(d=x.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):x.rects),{x:u,y:f}=Ol(d,p,c)),m=-1;continue}}return{x:u,y:f,placement:p,strategy:s,middlewareData:h}};async function Nl(t,e){var n;e===void 0&&(e={});const{x:o,y:s,platform:i,rects:r,elements:a,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=pn(e,t),g=Al(h),b=a[p?f==="floating"?"reference":"floating":f],y=uo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:c})),_=f==="floating"?{...r.floating,x:o,y:s}:r.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},x=uo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:w,strategy:c}):_);return{top:(y.top-x.top+g.top)/S.y,bottom:(x.bottom-y.bottom+g.bottom)/S.y,left:(y.left-x.left+g.left)/S.x,right:(x.right-y.right+g.right)/S.x}}const ag=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:s,rects:i,platform:r,elements:a,middlewareData:c}=e,{element:d,padding:u=0}=pn(t,e)||{};if(d==null)return{};const f=Al(u),p={x:n,y:o},h=ws(s),g=xs(h),m=await r.getDimensions(d),b=h==="y",y=b?"top":"left",_=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=i.reference[g]+i.reference[h]-p[h]-i.floating[g],x=p[h]-i.reference[h],E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(d));let v=E?E[w]:0;(!v||!await(r.isElement==null?void 0:r.isElement(E)))&&(v=a.floating[w]||i.floating[g]);const R=S/2-x/2,P=v/2-m[g]/2-1,A=At(f[y],P),C=At(f[_],P),V=A,N=v-m[g]-C,D=v/2-m[g]/2+R,M=_s(V,D,N),k=!c.arrow&&gn(s)!=null&&D!=M&&i.reference[g]/2-(D<V?A:C)-m[g]/2<0,B=k?D<V?D-V:D-N:0;return{[h]:p[h]+B,data:{[h]:M,centerOffset:D-M-B,...k&&{alignmentOffset:B}},reset:k}}}),fo=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:s,middlewareData:i,rects:r,initialPlacement:a,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=pn(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Dt(s),_=Dt(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=p||(_||!m?[co(a)]:og(a));!p&&g!=="none"&&S.push(...ig(a,m,g,w));const x=[a,...S],E=await Nl(e,b),v=[];let R=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&v.push(E[y]),f){const V=ng(s,r,w);v.push(E[V[0]],E[V[1]])}if(R=[...R,{placement:s,overflows:v}],!v.every(V=>V<=0)){var P,A;const V=(((P=i.flip)==null?void 0:P.index)||0)+1,N=x[V];if(N)return{data:{index:V,overflows:R},reset:{placement:N}};let D=(A=R.filter(M=>M.overflows[0]<=0).sort((M,k)=>M.overflows[1]-k.overflows[1])[0])==null?void 0:A.placement;if(!D)switch(h){case"bestFit":{var C;const M=(C=R.map(k=>[k.placement,k.overflows.filter(B=>B>0).reduce((B,F)=>B+F,0)]).sort((k,B)=>k[1]-B[1])[0])==null?void 0:C[0];M&&(D=M);break}case"initialPlacement":D=a;break}if(s!==D)return{reset:{placement:D}}}return{}}}};async function cg(t,e){const{placement:n,platform:o,elements:s}=t,i=await(o.isRTL==null?void 0:o.isRTL(s.floating)),r=Dt(n),a=gn(n),c=ao(n)==="y",d=["left","top"].includes(r)?-1:1,u=i&&c?-1:1,f=pn(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),c?{x:h*u,y:p*d}:{x:p*d,y:h*u}}const ho=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:s,y:i,placement:r,middlewareData:a}=e,c=await cg(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:r}}}}},Il=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:s}=e,{mainAxis:i=!0,crossAxis:r=!1,limiter:a={fn:b=>{let{x:y,y:_}=b;return{x:y,y:_}}},...c}=pn(t,e),d={x:n,y:o},u=await Nl(e,c),f=ao(Dt(s)),p=Pl(f);let h=d[p],g=d[f];if(i){const b=p==="y"?"top":"left",y=p==="y"?"bottom":"right",_=h+u[b],w=h-u[y];h=_s(_,h,w)}if(r){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",_=g+u[b],w=g-u[y];g=_s(_,g,w)}const m=a.fn({...e,[p]:h,[f]:g});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function ct(t){return Ll(t)?(t.nodeName||"").toLowerCase():"#document"}function we(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ue(t){var e;return(e=(Ll(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ll(t){return t instanceof Node||t instanceof we(t).Node}function qe(t){return t instanceof Element||t instanceof we(t).Element}function $e(t){return t instanceof HTMLElement||t instanceof we(t).HTMLElement}function Tl(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof we(t).ShadowRoot}function mn(t){const{overflow:e,overflowX:n,overflowY:o,display:s}=ve(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(s)}function dg(t){return["table","td","th"].includes(ct(t))}function ks(t){const e=Ss(),n=ve(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function ug(t){let e=Ot(t);for(;$e(e)&&!po(e);){if(ks(e))return e;e=Ot(e)}return null}function Ss(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function po(t){return["html","body","#document"].includes(ct(t))}function ve(t){return we(t).getComputedStyle(t)}function go(t){return qe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ot(t){if(ct(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Tl(t)&&t.host||Ue(t);return Tl(e)?e.host:e}function zl(t){const e=Ot(t);return po(e)?t.ownerDocument?t.ownerDocument.body:t.body:$e(e)&&mn(e)?e:zl(e)}function bn(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=zl(t),i=s===((o=t.ownerDocument)==null?void 0:o.body),r=we(s);return i?e.concat(r,r.visualViewport||[],mn(s)?s:[],r.frameElement&&n?bn(r.frameElement):[]):e.concat(s,bn(s,[],n))}function Hl(t){const e=ve(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const s=$e(t),i=s?t.offsetWidth:n,r=s?t.offsetHeight:o,a=ro(n)!==i||ro(o)!==r;return a&&(n=i,o=r),{width:n,height:o,$:a}}function vs(t){return qe(t)?t:t.contextElement}function Nt(t){const e=vs(t);if(!$e(e))return at(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:i}=Hl(e);let r=(i?ro(n.width):n.width)/o,a=(i?ro(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const fg=at(0);function jl(t){const e=we(t);return!Ss()||!e.visualViewport?fg:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function hg(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==we(t)?!1:e}function Et(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=vs(t);let r=at(1);e&&(o?qe(o)&&(r=Nt(o)):r=Nt(t));const a=hg(i,n,o)?jl(i):at(0);let c=(s.left+a.x)/r.x,d=(s.top+a.y)/r.y,u=s.width/r.x,f=s.height/r.y;if(i){const p=we(i),h=o&&qe(o)?we(o):o;let g=p.frameElement;for(;g&&o&&h!==p;){const m=Nt(g),b=g.getBoundingClientRect(),y=ve(g),_=b.left+(g.clientLeft+parseFloat(y.paddingLeft))*m.x,w=b.top+(g.clientTop+parseFloat(y.paddingTop))*m.y;c*=m.x,d*=m.y,u*=m.x,f*=m.y,c+=_,d+=w,g=we(g).frameElement}}return uo({width:u,height:f,x:c,y:d})}function pg(t){let{rect:e,offsetParent:n,strategy:o}=t;const s=$e(n),i=Ue(n);if(n===i)return e;let r={scrollLeft:0,scrollTop:0},a=at(1);const c=at(0);if((s||!s&&o!=="fixed")&&((ct(n)!=="body"||mn(i))&&(r=go(n)),$e(n))){const d=Et(n);a=Nt(n),c.x=d.x+n.clientLeft,c.y=d.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-r.scrollLeft*a.x+c.x,y:e.y*a.y-r.scrollTop*a.y+c.y}}function gg(t){return Array.from(t.getClientRects())}function Wl(t){return Et(Ue(t)).left+go(t).scrollLeft}function mg(t){const e=Ue(t),n=go(t),o=t.ownerDocument.body,s=Mt(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=Mt(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Wl(t);const a=-n.scrollTop;return ve(o).direction==="rtl"&&(r+=Mt(e.clientWidth,o.clientWidth)-s),{width:s,height:i,x:r,y:a}}function bg(t,e){const n=we(t),o=Ue(t),s=n.visualViewport;let i=o.clientWidth,r=o.clientHeight,a=0,c=0;if(s){i=s.width,r=s.height;const d=Ss();(!d||d&&e==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:r,x:a,y:c}}function yg(t,e){const n=Et(t,!0,e==="fixed"),o=n.top+t.clientTop,s=n.left+t.clientLeft,i=$e(t)?Nt(t):at(1),r=t.clientWidth*i.x,a=t.clientHeight*i.y,c=s*i.x,d=o*i.y;return{width:r,height:a,x:c,y:d}}function Yl(t,e,n){let o;if(e==="viewport")o=bg(t,n);else if(e==="document")o=mg(Ue(t));else if(qe(e))o=yg(e,n);else{const s=jl(t);o={...e,x:e.x-s.x,y:e.y-s.y}}return uo(o)}function Gl(t,e){const n=Ot(t);return n===e||!qe(n)||po(n)?!1:ve(n).position==="fixed"||Gl(n,e)}function _g(t,e){const n=e.get(t);if(n)return n;let o=bn(t,[],!1).filter(a=>qe(a)&&ct(a)!=="body"),s=null;const i=ve(t).position==="fixed";let r=i?Ot(t):t;for(;qe(r)&&!po(r);){const a=ve(r),c=ks(r);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||mn(r)&&!c&&Gl(t,r))?o=o.filter(u=>u!==r):s=a,r=Ot(r)}return e.set(t,o),o}function xg(t){let{element:e,boundary:n,rootBoundary:o,strategy:s}=t;const r=[...n==="clippingAncestors"?_g(e,this._c):[].concat(n),o],a=r[0],c=r.reduce((d,u)=>{const f=Yl(e,u,s);return d.top=Mt(f.top,d.top),d.right=At(f.right,d.right),d.bottom=At(f.bottom,d.bottom),d.left=Mt(f.left,d.left),d},Yl(e,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function wg(t){return Hl(t)}function Cg(t,e,n){const o=$e(e),s=Ue(e),i=n==="fixed",r=Et(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const c=at(0);if(o||!o&&!i)if((ct(e)!=="body"||mn(s))&&(a=go(e)),o){const d=Et(e,!0,i,e);c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}else s&&(c.x=Wl(s));return{x:r.left+a.scrollLeft-c.x,y:r.top+a.scrollTop-c.y,width:r.width,height:r.height}}function Ul(t,e){return!$e(t)||ve(t).position==="fixed"?null:e?e(t):t.offsetParent}function ql(t,e){const n=we(t);if(!$e(t))return n;let o=Ul(t,e);for(;o&&dg(o)&&ve(o).position==="static";)o=Ul(o,e);return o&&(ct(o)==="html"||ct(o)==="body"&&ve(o).position==="static"&&!ks(o))?n:o||ug(t)||n}const kg=async function(t){let{reference:e,floating:n,strategy:o}=t;const s=this.getOffsetParent||ql,i=this.getDimensions;return{reference:Cg(e,await s(n),o),floating:{x:0,y:0,...await i(n)}}};function Sg(t){return ve(t).direction==="rtl"}const vg={convertOffsetParentRelativeRectToViewportRelativeRect:pg,getDocumentElement:Ue,getClippingRect:xg,getOffsetParent:ql,getElementRects:kg,getClientRects:gg,getDimensions:wg,getScale:Nt,isElement:qe,isRTL:Sg};function Mg(t,e){let n=null,o;const s=Ue(t);function i(){clearTimeout(o),n&&n.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:d,top:u,width:f,height:p}=t.getBoundingClientRect();if(a||e(),!f||!p)return;const h=lo(u),g=lo(s.clientWidth-(d+f)),m=lo(s.clientHeight-(u+p)),b=lo(d),_={rootMargin:-h+"px "+-g+"px "+-m+"px "+-b+"px",threshold:Mt(0,At(1,c))||1};let w=!0;function S(x){const E=x[0].intersectionRatio;if(E!==c){if(!w)return r();E?r(!1,E):o=setTimeout(()=>{r(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(S,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,_)}n.observe(t)}return r(!0),i}function Ms(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=vs(t),u=s||i?[...d?bn(d):[],...bn(e)]:[];u.forEach(y=>{s&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=d&&a?Mg(d,n):null;let p=-1,h=null;r&&(h=new ResizeObserver(y=>{let[_]=y;_&&_.target===d&&h&&(h.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{h&&h.observe(e)})),n()}),d&&!c&&h.observe(d),h.observe(e));let g,m=c?Et(t):null;c&&b();function b(){const y=Et(t);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&n(),m=y,g=requestAnimationFrame(b)}return n(),()=>{u.forEach(y=>{s&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f&&f(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(g)}}const Xl=(t,e,n)=>{const o=new Map,s={platform:vg,...n},i={...s.platform,_c:o};return lg(t,e,{...s,platform:i})};function Ds(t){var e;return(e=t==null?void 0:t.$el)!=null?e:t}function Dg(t){return{name:"arrow",options:t,fn(e){const n=Ds(l.unref(t.element));return n==null?{}:ag({element:n,padding:t.padding}).fn(e)}}}function Kl(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Zl(t,e){const n=Kl(t);return Math.round(e*n)/n}function Es(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,s=l.computed(()=>{var v;return(v=l.unref(n.open))!=null?v:!0}),i=l.computed(()=>l.unref(n.middleware)),r=l.computed(()=>{var v;return(v=l.unref(n.placement))!=null?v:"bottom"}),a=l.computed(()=>{var v;return(v=l.unref(n.strategy))!=null?v:"absolute"}),c=l.computed(()=>{var v;return(v=l.unref(n.transform))!=null?v:!0}),d=l.computed(()=>Ds(t.value)),u=l.computed(()=>Ds(e.value)),f=l.ref(0),p=l.ref(0),h=l.ref(a.value),g=l.ref(r.value),m=l.shallowRef({}),b=l.ref(!1),y=l.computed(()=>{const v={position:h.value,left:"0",top:"0"};if(!u.value)return v;const R=Zl(u.value,f.value),P=Zl(u.value,p.value);return c.value?{...v,transform:"translate("+R+"px, "+P+"px)",...Kl(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:R+"px",top:P+"px"}});let _;function w(){d.value==null||u.value==null||Xl(d.value,u.value,{middleware:i.value,placement:r.value,strategy:a.value}).then(v=>{f.value=v.x,p.value=v.y,h.value=v.strategy,g.value=v.placement,m.value=v.middlewareData,b.value=!0})}function S(){typeof _=="function"&&(_(),_=void 0)}function x(){if(S(),o===void 0){w();return}if(d.value!=null&&u.value!=null){_=o(d.value,u.value,w);return}}function E(){s.value||(b.value=!1)}return l.watch([i,r,a],w,{flush:"sync"}),l.watch([d,u],x,{flush:"sync"}),l.watch(s,E,{flush:"sync"}),l.getCurrentScope()&&l.onScopeDispose(S),{x:l.shallowReadonly(f),y:l.shallowReadonly(p),strategy:l.shallowReadonly(h),placement:l.shallowReadonly(g),middlewareData:l.shallowReadonly(m),isPositioned:l.shallowReadonly(b),floatingStyles:y,update:w}}const Eg={class:"px-2 py-0"},Vg={key:0,class:"fm-typo-body-xl-700"},Rg={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},Jl=l.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(t){const e=t,n=l.ref(null),o=l.ref(null),s=l.ref(null),i=async()=>{var y,_,w,S;const{x:h,y:g,placement:m,middlewareData:b}=await Xl(n.value,o.value,{placement:e.beak,middleware:[ho(10),fo(),Il({padding:5}),e.hasArrow?Dg({element:s.value,padding:10}):null]});if(Object.assign(o.value.style,{left:`${h}px`,top:`${g}px`}),e.hasArrow){const x={top:"bottom",right:"left",bottom:"top",left:"right"}[m.split("-")[0]];Object.assign(s.value.style,{left:((y=b.arrow)==null?void 0:y.x)!=null?`${(_=b.arrow)==null?void 0:_.x}px`:"",top:((w=b.arrow)==null?void 0:w.y)!=null?`${(S=b.arrow)==null?void 0:S.y}px`:"",right:"",bottom:"",background:e.variant==="rich"?"#FFF":"#1C1C1E",[x]:"-4px"})}},r=l.ref(!1),a=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)"}}[e.variant],display:r.value?"block":"none"})),u=()=>{clearTimeout(c.value),a.value=window.setTimeout(()=>{r.value=!0},500)},f=()=>{clearTimeout(a.value),c.value=window.setTimeout(()=>r.value=!1,1500)},p=()=>{clearTimeout(c.value),r.value=!0};return l.watchEffect(()=>{r.value?(i(),window.addEventListener("resize",i)):window.removeEventListener("resize",i)}),(h,g)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"tooltipContainer",ref:n,class:l.normalizeClass(["cursor-pointer flex items-center justify-center relative w-max",{"cursor-not-allowed pointer-events-none":h.disabled}]),onMouseenter:u,onMouseleave:f},[l.renderSlot(h.$slots,"default")],34),l.createElementVNode("div",{ref_key:"tooltip",ref:o,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:p,onMouseleave:f},[l.createElementVNode("div",null,[l.createElementVNode("div",Eg,[h.variant=="rich"?(l.openBlock(),l.createElementBlock("div",Vg,l.toDisplayString(h.titleText),1)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(h.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},l.toDisplayString(h.contentText),3)]),h.variant=="rich"?(l.openBlock(),l.createElementBlock("div",Rg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.actionButtons,(m,b)=>(l.openBlock(),l.createElementBlock("div",{key:b},[l.createVNode(ge,{variant:"tertiary",label:m.label,onClick:m.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)]))}}),yn=l.defineComponent({__name:"FmLabel",props:{label:{default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""}},setup(t){return(e,n)=>e.label?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-typo-body-lg-400 flex gap-4",e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary",{"items-center":e.info}])},[l.renderSlot(e.$slots,"default",{},()=>[l.createElementVNode("span",null,l.toDisplayString(e.label),1),e.required?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["fm-typo-body-lg-700",e.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-error"])}," * ",2)):l.createCommentVNode("",!0),e.optional?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-md-400",e.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-tertiary"])}," (optional) ",2)):l.createCommentVNode("",!0),e.info?(l.openBlock(),l.createBlock(Jl,{key:2,beak:"top","content-text":e.info,disabled:e.disabled},{default:l.withCtx(()=>[l.createVNode(H,{name:"info",size:"sm",class:l.normalizeClass(["fm-typo-body-md-400",e.disabled?"text-fm-color-typo-disabled":"text-fm-color-neutral-gray-300"])},null,8,["class"])]),_:1},8,["content-text","disabled"])):l.createCommentVNode("",!0)])],2)):l.createCommentVNode("",!0)}});function Ql(t,e){const n=l.ref([]);function o(){const i=[];if(e.value&&e.value.length>0)for(const r of e.value){const c=(typeof r=="function"?r:()=>r)(t.value);c!==!0&&i.push(c)}return n.value=i,n.value}function s(){n.value=[]}return{validate:o,resetValidation:s,errorMessages:n}}function ea(t,e=null,n=null){let o=null;const s=pe(t,"modelValue"),i=l.ref(!0),r=l.inject(ii,null),{validate:a,resetValidation:c,errorMessages:d}=Ql(s,l.toRef(()=>t.rules)),u=(f=n)=>{i.value=!0,c(),f&&typeof f=="function"&&f(),s.value=e};return l.onMounted(()=>{r&&(o=r.register({validate:a,resetValidation:c,resetValue:u})),e=e??s.value}),l.onUnmounted(()=>{r&&r.unregister(o)}),l.watch(()=>s.value,()=>{i.value=!1,s.value!==e&&a()}),l.watch(()=>t.focused,f=>{i.value=!1,f||a()}),{validate:a,resetValidation:c,errorMessages:d,resetValue:u,isPristine:i}}function mo(){const t=l.ref(!1);function e(){t.value=!0}function n(){t.value=!1}return{focus:e,blur:n,isFocused:t}}const Bg={key:1,class:"flex items-center justify-between"},Xe=l.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"},tag:{default:"label"}},setup(t){const e=t,{errorMessages:n,isPristine:o}=ea(e),{focus:s,blur:i}=mo(),r=l.computed(()=>({label:e.label,disabled:e.disabled,required:e.required,optional:e.optional,info:e.info})),a=l.computed(()=>({text:e.helperText,disabled:e.disabled,state:e.helperState,errorMessages:n.value})),c=l.computed(()=>({isPristine:o,invalid:n.value.length>0}));return(d,u)=>(l.openBlock(),l.createBlock(e.tag,{class:"flex flex-col gap-4",onClick:l.unref(s),onBlur:l.unref(i)},{default:l.withCtx(()=>[d.label?(l.openBlock(),l.createBlock(yn,l.normalizeProps(l.mergeProps({key:0},r.value)),{default:l.withCtx(()=>[l.renderSlot(d.$slots,"label")]),_:3},16)):l.createCommentVNode("",!0),l.renderSlot(d.$slots,"default",l.normalizeProps(l.guardReactiveProps(c.value))),a.value.text||a.value.errorMessages.length>0||d.$slots["helper-append"]?(l.openBlock(),l.createElementBlock("div",Bg,[l.createVNode($l,l.normalizeProps(l.guardReactiveProps(a.value)),{default:l.withCtx(()=>[l.renderSlot(d.$slots,"helper-text")]),_:3},16),l.renderSlot(d.$slots,"helper-append")])):l.createCommentVNode("",!0)]),_:3},8,["onClick","onBlur"]))}}),Fg=l.defineComponent({__name:"FmMenu",props:{placement:{default:"bottom-start"},trigger:{default:"click"},closeOnClick:{type:Boolean,default:!0},width:{default:void 0},maxHeight:{default:408}},emits:["menu-changed"],setup(t,{emit:e}){const n=t,o=e,s=l.ref([]);let i;const r=l.ref(),a=l.ref(!1),c=l.ref(!1),d=l.inject(ci,null),u=l.ref(null),f=l.ref(null),{floatingStyles:p}=Es(u,f,{middleware:[ho({mainAxis:d?8:4,crossAxis:d?-12:0}),fo(),Il()],placement:n.placement,whileElementsMounted:Ms}),h=()=>{x.value==="hover"&&m()},g=()=>{if(a.value){a.value=!1;return}x.value==="click"&&m()},m=()=>{c.value=!0,a.value=!0,d==null||d.setChildId(i)},b=()=>{x.value==="hover"&&(c.value=!1)},y=()=>{c.value=!0},_=()=>{c.value=!1},w=()=>{n.closeOnClick&&setTimeout(()=>{a.value=!1,d==null||d.closeParent()},10)},S=l.computed(()=>({mouseInMenu:c}));l.provide(ci,{register({injectProps:v}){return s.value=[...s.value,{injectProps:v}],s.value.length},closeParent(){d?(a.value=!1,d==null||d.closeParent()):a.value=x.value!=="click"},setChildId(v){r.value=v},mouseInChildId:r,trigger:n.trigger}),l.provide(di,{handleContentClick:w}),l.onMounted(()=>{window.addEventListener("click",E),d&&(i=d.register({injectProps:S}))}),l.onUnmounted(()=>{window.removeEventListener("click",E)}),l.watch(()=>d==null?void 0:d.mouseInChildId.value,v=>{v!==i&&(a.value=!1)});const x=l.computed(()=>d===null?n.trigger:"hover");l.watch(()=>a.value,()=>o("menu-changed",a.value));const E=v=>{if(!a.value)return;const R=v.path||v.composedPath();for(const P of R)if(P==u.value||P==f.value)return;a.value=!1};return(v,R)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"anchorEl",ref:u,class:"fm-menu",onMouseenter:h,onMouseleave:b,onClick:g},[l.renderSlot(v.$slots,"menu-button",{},void 0,!0)],544),(l.openBlock(),l.createBlock(l.Teleport,{to:"body",disabled:!!l.unref(d)},[a.value?(l.openBlock(),l.createElementBlock("div",{key:0,id:"fm-menu",ref_key:"menuEl",ref:f,class:"block z-[99]",style:l.normalizeStyle(l.unref(p)),onMouseenter:y,onMouseleave:_},[l.renderSlot(v.$slots,"menu-wrapper",{},()=>[l.createElementVNode("div",{class:"fm-menu__wrapper",style:l.normalizeStyle({"max-height":`${v.maxHeight}px`,width:`${v.width}px`})},[l.renderSlot(v.$slots,"default",{},void 0,!0)],4)],!0)],36)):l.createCommentVNode("",!0)],8,["disabled"]))]))}}),u_="",Vs=te(Fg,[["__scopeId","data-v-52b3923a"]]),$g={class:"fm-menu-item--left"},Pg={key:0,class:"fm-menu-item--right"},Ag=l.defineComponent({__name:"FmMenuItem",props:{modelValue:{type:Boolean,default:!1},selectable:{type:Boolean,default:!0},label:{default:""},sublabel:{default:""},icon:{default:""},expandable:{type:Boolean,default:!1},hasCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=l.ref(!1),s=l.inject(di,null),i=e,r=d=>{d.preventDefault(),s==null||s.handleContentClick(),!(n.disabled||!n.selectable)&&i("update:modelValue",!n.modelValue)},a=()=>{i("update:modelValue",n.modelValue)};function c(d){o.value=d}return(d,u)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{class:l.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":d.modelValue&&!d.hasCheckbox,"fm-menu-item--disabled":d.disabled,"hover:bg-fm-color-opacity-sm cursor-pointer":!d.disabled&&!d.modelValue&&d.selectable}),onClick:r,onMousedown:u[1]||(u[1]=()=>c(!0)),onMouseup:u[2]||(u[2]=()=>c(!1)),onMouseleave:u[3]||(u[3]=()=>c(!1))},[l.createElementVNode("div",$g,[l.renderSlot(d.$slots,"prepend",{},()=>[!d.hasCheckbox&&d.icon?(l.openBlock(),l.createBlock(H,{key:0,name:d.icon,size:"md",outline:!o.value&&!d.modelValue,color:d.disabled?"#C7C7CC":d.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),d.hasCheckbox?(l.openBlock(),l.createBlock(Bl,{key:1,"model-value":d.modelValue,name:"something",label:"",sublabel:"",value:"",indeterminate:!1,disabled:d.disabled,"onUpdate:modelValue":a,onClick:u[0]||(u[0]=f=>f.preventDefault())},null,8,["model-value","disabled"])):l.createCommentVNode("",!0)],!0),l.renderSlot(d.$slots,"label",{},()=>[l.createElementVNode("div",null,[l.createElementVNode("div",{class:l.normalizeClass(`fm-typo-body-lg-400 ${d.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"}`)},l.toDisplayString(d.label),3),d.sublabel?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(`fm-typo-body-md-400 ${d.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"}`)},l.toDisplayString(d.sublabel),3)):l.createCommentVNode("",!0)])],!0)]),l.renderSlot(d.$slots,"append",{},void 0,!0),d.expandable?(l.openBlock(),l.createElementBlock("div",Pg,[l.createVNode(H,{name:"chevron_right",size:"md",color:d.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):l.createCommentVNode("",!0)],34)]))}}),f_="",Ke=te(Ag,[["__scopeId","data-v-d35d7939"]]),Og={class:"fm-typo-body-lg-700"},Ng={class:"h-[264px] overflow-y-auto w-[160px]"},It=l.defineComponent({__name:"FmDateRangeYearMonthPicker",props:{modelValue:{},picker:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,s=l.ref(!1),i=l.computed(()=>{let r=-5;const a=[];for(;r!=5;)a.push(n.modelValue.add(r,"year")),r++;return a});return(r,a)=>(l.openBlock(),l.createBlock(Vs,{trigger:"click",onMenuChanged:a[0]||(a[0]=c=>s.value=c)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["flex gap-4 h-24 items-center px-8 rounded-sm",s.value?"text-fm-color-primary":"hover:bg-fm-color-neutral-gray-100"])},[l.createElementVNode("div",Og,[r.picker==="month"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(r.modelValue.format("MMMM")),1)],64)):l.createCommentVNode("",!0),r.picker==="year"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(r.modelValue.format("YYYY")),1)],64)):l.createCommentVNode("",!0)]),l.createVNode(H,{name:s.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),default:l.withCtx(()=>[l.createElementVNode("ul",Ng,[r.picker==="month"?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(Array.from(Array(12),(c,d)=>r.modelValue.month(d)),c=>(l.openBlock(),l.createElementBlock("li",{key:c.format("MMMM")},[l.createVNode(Ke,{"model-value":r.modelValue.format("MMMM")===c.format("MMMM"),label:c.format("MMMM"),"onUpdate:modelValue":d=>o("update:modelValue",c)},null,8,["model-value","label","onUpdate:modelValue"])]))),128)):l.createCommentVNode("",!0),r.picker==="year"?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(i.value,c=>(l.openBlock(),l.createElementBlock("li",{key:c.format("YYYY")},[l.createVNode(Ke,{"model-value":r.modelValue.format("YYYY")===c.format("YYYY"),label:c.format("YYYY"),"onUpdate:modelValue":d=>o("update:modelValue",c)},null,8,["model-value","label","onUpdate:modelValue"])]))),128)):l.createCommentVNode("",!0)])]),_:1}))}}),Ig={mounted:(t,e)=>{t.clickOutsideEvent=n=>{const o=e.arg?document.querySelectorAll(`#${e.arg}`):[];!(t==n.target||t.contains(n.target))&&!Array.from(o).some(s=>s&&(n.target==s||s.contains(n.target)))&&e.value(n,t)},document.addEventListener("click",t.clickOutsideEvent)},unmounted:t=>{document.removeEventListener("click",t.clickOutsideEvent)}},Lg=l.defineComponent({__name:"FmPopover",props:{showPopover:{type:Boolean,default:!1},placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1}},emits:["popover-changed"],setup(t,{expose:e,emit:n}){const o=t,s=l.ref(o.showPopover),i=l.ref(null),r=l.ref(null),{floatingStyles:a}=Es(i,r,{middleware:[ho(4),fo()],placement:o.placement,whileElementsMounted:Ms}),c=n,d=()=>{s.value||(s.value=!0,c("popover-changed",s.value))},u=()=>{s.value&&(s.value=!1,c("popover-changed",s.value))};e({show:d,hide:u});const f=h=>{h.preventDefault(),h.stopPropagation(),!o.disabled&&(s.value=!s.value,c("popover-changed",s.value))};l.watch(()=>o.showPopover,h=>s.value=h);const p=()=>{s.value=!1,c("popover-changed",s.value)};return(h,g)=>l.withDirectives((l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"anchorEl",ref:i,class:"fm-popover",onClick:f},[l.renderSlot(h.$slots,"popover-button",{},void 0,!0)],512),s.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"popoverEl",ref:r,class:"fm-popover__content",style:l.normalizeStyle(l.unref(a))},[l.renderSlot(h.$slots,"default",{show:d,hide:u},void 0,!0)],4)):l.createCommentVNode("",!0)])),[[l.unref(Ig),p]])}}),h_="",ta=te(Lg,[["__scopeId","data-v-0f0a6704"]]),G="YYYY-MM-DD",Rs=t=>{const e=[],n=t.endOf("month"),o=t.month();let s=t.startOf("week"),i=[];for(;s.isBefore(n.endOf("week"));)s.day()===0&&i.length>0&&(e.push(i),i=[]),i.push({date:s,isCurrentMonth:s.month()===o}),s=s.add(1,"day");return i.length>0&&e.push(i),e},Bs=Array.from(Array(7),(t,e)=>z().day(e).format("ddd")),Tg={class:"p-12 w-[360px]"},zg={class:"w-max"},Hg={class:"flex h-40 justify-between px-4 py-8"},jg={class:"flex gap-4 items-center"},Wg={class:"flex gap-4 items-center justify-center"},Yg={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Gg=["onClick"],Ug={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},qg=l.defineComponent({__name:"FmDatePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=pe(e,"modelValue"),o=l.ref(z(n.value,G)),s=l.ref(!1),i=l.ref(z().startOf("month")),r=l.ref(!1),a=l.ref(!1),c=p=>{o.value=p},d=()=>{n.value=o.value.format(G),setTimeout(()=>{s.value=!1},0)},u=()=>{o.value=n.value?z(n.value):null,s.value=!1},f=p=>{r.value=!1,a.value=!1,i.value=p};return(p,h)=>(l.openBlock(),l.createBlock(Xe,{modelValue:l.unref(n),"onUpdate:modelValue":h[5]||(h[5]=g=>l.isRef(n)?n.value=g:null),label:p.label,disabled:p.disabled,required:p.labelMark==="required",optional:p.labelMark==="optional",info:p.labelInfo,rules:p.rules,focused:s.value,"helper-text":p.helperText,"helper-state":p.helperState,tag:"div"},{label:l.withCtx(()=>[l.renderSlot(p.$slots,"label",{},void 0,!0)]),default:l.withCtx(({invalid:g})=>[l.createVNode(ta,{"show-popover":s.value,disabled:p.disabled,onPopoverChanged:h[4]||(h[4]=m=>s.value=m)},{"popover-button":l.withCtx(()=>[l.createVNode(Ee,{class:"cursor-text",focused:s.value,invalid:g,"show-valid-border":p.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(p.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(p.$slots,"append",{},void 0,!0)]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":l.unref(n)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString(l.unref(n)?l.unref(z)(l.unref(n)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","invalid","show-valid-border"])]),default:l.withCtx(()=>[l.createElementVNode("div",Tg,[l.createElementVNode("div",zg,[l.createElementVNode("div",Hg,[l.createElementVNode("div",jg,[l.createVNode(It,{picker:"month","model-value":i.value,"onUpdate:modelValue":h[0]||(h[0]=m=>f(m))},null,8,["model-value"]),l.createVNode(It,{picker:"year","model-value":i.value,"onUpdate:modelValue":h[1]||(h[1]=m=>f(m))},null,8,["model-value"])]),l.createElementVNode("div",Wg,[l.createVNode(H,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:h[2]||(h[2]=()=>f(i.value.subtract(1,"month")))}),l.createVNode(H,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:h[3]||(h[3]=()=>f(i.value.add(1,"month")))})])]),l.createElementVNode("div",null,[l.createElementVNode("div",Yg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Bs),m=>(l.openBlock(),l.createElementBlock("div",{key:m,class:"fm-calendar__cell"},l.toDisplayString(m),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Rs)(i.value),(m,b)=>(l.openBlock(),l.createElementBlock("div",{key:b,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m,y=>(l.openBlock(),l.createElementBlock("div",{key:y.date.date(),class:"fm-calendar__cell"},[y.isCurrentMonth?(l.openBlock(),l.createElementBlock("button",{key:0,class:l.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":y.date.isSame(o.value)}]),type:"button",onClick:()=>c(y.date)},l.toDisplayString(y.date.date()),11,Gg)):l.createCommentVNode("",!0)]))),128))]))),128))])])]),l.createElementVNode("div",Ug,[l.createVNode(ge,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),l.createVNode(ge,{label:"Apply",size:"md",variant:"primary",disabled:!o.value,onClick:d},null,8,["disabled"])])])]),_:2},1032,["show-popover","disabled"])]),"helper-text":l.withCtx(()=>[l.renderSlot(p.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),p_="",Xg=te(qg,[["__scopeId","data-v-8d0cb5aa"]]),na=l.defineComponent({__name:"FmMenuDivider",props:{vertical:{type:Boolean,default:!1},inset:{type:Boolean,default:!1}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border-fm-color-neutral-gray-100 rounded-sm",[e.vertical?"border-l -my-4 mx-4":"border-t -mx-4 my-4",{"my-0":e.inset&&e.vertical,"mx-0":e.inset&&!e.vertical}]])},null,2))}}),Kg={class:"cursor-pointer fm-switch__container"},Zg={key:0},Jg={class:"fm-typo-body-lg-400"},Qg={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},em={class:"fm-switch__input--container"},tm=["checked","value","disabled"],nm={key:1},om={class:"fm-typo-body-lg-400"},sm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},im=l.defineComponent({__name:"FmSwitch",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},labelPlacement:{default:"left"},value:{default:null},disabled:{type:Boolean,default:!1},showIcon:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){const e=t,n=pe(e,"modelValue"),o=()=>{e.disabled||(n.value=!n.value)};return(s,i)=>(l.openBlock(),l.createElementBlock("label",Kg,[s.labelPlacement==="left"?(l.openBlock(),l.createElementBlock("div",Zg,[l.renderSlot(s.$slots,"label",{},void 0,!0),l.createElementVNode("div",Jg,l.toDisplayString(s.label),1),s.sublabel?(l.openBlock(),l.createElementBlock("div",Qg,l.toDisplayString(s.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",em,[l.createElementVNode("input",{checked:l.unref(n),class:"fm-switch__input--btn",type:"checkbox",value:s.value,disabled:s.disabled,onClick:o},null,8,tm),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(H,{key:0,name:l.unref(n)?"check":"close",size:"sm",color:s.disabled?"#C7C7CC":l.unref(n)?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):l.createCommentVNode("",!0)],2)]),s.labelPlacement==="right"?(l.openBlock(),l.createElementBlock("div",nm,[l.createElementVNode("div",om,l.toDisplayString(s.label),1),s.sublabel?(l.openBlock(),l.createElementBlock("div",sm,l.toDisplayString(s.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)]))}}),g_="",oa=te(im,[["__scopeId","data-v-0fcef85e"]]),sa=t=>(l.pushScopeId("data-v-06d70210"),t=t(),l.popScopeId(),t),rm={key:0,class:"flex gap-4 items-center relative w-full"},lm={class:"flex flex-col gap-4 w-full"},am=sa(()=>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)),cm={class:"flex flex-col gap-4 w-full"},dm={key:1,class:"flex flex-col gap-4 w-full"},um={class:"flex gap-4 p-12"},fm={key:0,class:"max-h-[549px] overflow-y-auto w-[171px]"},hm={key:0,class:"px-8"},pm={key:1,class:"-my-12 border-fm-color-neutral-gray-100 border-l shrink-0"},gm={class:"flex flex-col gap-24"},mm={key:0,class:"flex gap-4 items-center px-12 w-full"},bm={class:"flex flex-col gap-4 w-full"},ym=sa(()=>l.createElementVNode("div",{class:"fm-typo-body-lg-400 h-6 mt-7 shrink-0 text-center text-fm-color-typo-primary w-6"}," - ",-1)),_m={class:"flex flex-col gap-4 w-full"},xm={class:"flex gap-24"},wm={class:"w-max"},Cm={class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},km={class:"flex gap-4 items-center"},Sm={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},vm={class:"h-[288px]"},Mm=["onClick","onMouseover"],Dm={class:"w-max"},Em={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},Vm={class:"flex gap-4 items-center"},Rm={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Bm=["onClick","onMouseover"],Fm={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},$m=l.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:z().format(G),endDate:z().format(G)}},{label:"Yesterday",value:{startDate:z().subtract(1,"day").format(G),endDate:z().subtract(1,"day").format(G)}},{label:"This week",value:{startDate:z().startOf("week").format(G),endDate:z().endOf("week").format(G)}},{label:"Last week",value:{startDate:z().subtract(1,"week").startOf("week").format(G),endDate:z().subtract(1,"week").endOf("week").format(G)}},{label:"Last 7 days",value:{startDate:z().subtract(7,"day").format(G),endDate:z().subtract(1,"day").format(G)}},{label:"This month",value:{startDate:z().startOf("month").format(G),endDate:z().endOf("month").format(G)}},{label:"Last month",value:{startDate:z().subtract(1,"month").startOf("month").format(G),endDate:z().subtract(1,"month").endOf("month").format(G)}},{label:"This year",value:{startDate:z().startOf("year").format(G),endDate:z().endOf("year").format(G)}}]},compare:{type:Boolean,default:!1},compareLabel:{default:"Date"},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){var P,A;const e=[{id:"preceding_week",label:"Preceding period",sublabel:"Match day of week",action:()=>{c.value="preceding_week";const C=i.value;if(C[0].startDate&&C[0].endDate){const V=C[0].startDate.diff(C[0].endDate,"day");C[1]={startDate:C[0].startDate.subtract(+(1-V),"day"),endDate:C[0].startDate.subtract(1,"day")}}}},{id:"custom",label:"Custom",sublabel:"",action:()=>{console.log("3")}}],n=t,o=z(),s=pe(n,"modelValue"),i=l.ref([{startDate:(P=s.value)!=null&&P.startDate?z(s.value.startDate,G):null,endDate:(A=s.value)!=null&&A.endDate?z(s.value.endDate,G):null},{startDate:null,endDate:null}]),r=l.ref(!1),a=l.ref(!1),c=l.ref(""),d=l.ref(z().startOf("month")),u=l.ref(z().startOf("month").add(1,"month")),f=l.ref(""),p=l.ref(null);let h=0;const g=C=>{if(c.value="",f.value="",i.value[h].startDate&&i.value[h].endDate){h===1&&(i.value=i.value.map(()=>({startDate:null,endDate:null})),h=0),i.value[0]={startDate:C,endDate:null};return}else if(!i.value[h].startDate&&!i.value[h].endDate)i.value[h].startDate=C;else{if(C.isBefore(i.value[h].startDate)){const V=i.value[h].startDate;i.value[h]={startDate:C,endDate:V}}else i.value[h].endDate=C;a.value&&(h=1)}},m=()=>{a.value?s.value=i.value.map(C=>({startDate:C.startDate.format(G),endDate:C.endDate.format(G)})):s.value={startDate:i.value[0].startDate.format(G),endDate:i.value[0].endDate.format(G)},setTimeout(()=>{r.value=!1})},b=()=>{var C,V;Array.isArray(s.value)?i.value=s.value:i.value[0]={startDate:(C=s.value)!=null&&C.startDate?z(s.value.startDate,G):null,endDate:(V=s.value)!=null&&V.endDate?z(s.value.endDate,G):null},r.value=!1},y=(C,V)=>{C==="left"?(d.value=V,u.value=V.add(1,"month")):C==="right"&&(u.value=V,d.value=V.subtract(1,"month"))},_=C=>{const V=i.value[0].startDate,N=i.value[0].endDate,D=i.value[1].startDate,M=i.value[1].endDate,k=p.value,B=V==null?void 0:V.isSame(C),F=N==null?void 0:N.isSame(C),O=D==null?void 0:D.isSame(C),I=M==null?void 0:M.isSame(C),W=k==null?void 0:k.isSame(C),U=B&&N&&!(B&&F)||V&&!N&&B&&(k==null?void 0:k.isAfter(V))||V&&!N&&W&&(k==null?void 0:k.isBefore(V)),X=O&&M&&!(O&&I)||D&&!M&&O&&(k==null?void 0:k.isAfter(D))||D&&!M&&W&&(k==null?void 0:k.isBefore(D)),K=F&&V&&!(B&&F)||V&&!N&&B&&(k==null?void 0:k.isBefore(V))||V&&!N&&W&&(k==null?void 0:k.isAfter(V)),ie=I&&D&&!(O&&I)||D&&!M&&O&&(k==null?void 0:k.isBefore(D))||D&&!M&&W&&(k==null?void 0:k.isAfter(D)),de=B&&F||B&&!N,Pe=O&&I||O&&!M,ht=V&&(N||k)&&N?C.isAfter(V)&&C.isBefore(N):C.isAfter(k)&&C.isBefore(V)||C.isBefore(k)&&C.isAfter(V),Ae=D&&(M||k)&&M?C.isAfter(D)&&C.isBefore(M):C.isAfter(k)&&C.isBefore(D)||C.isBefore(k)&&C.isAfter(D),ce=(Oe,Ne,wn)=>Oe&&Ne&&wn?Oe.isAfter(Ne,"day")&&Oe.isBefore(wn,"day"):!1,ke=()=>{if(i.value.filter(Ne=>{var wn;for(const Ky in Ne)if((wn=Ne[Ky])!=null&&wn.isSame(C,"day"))return!0;return!1}).length===2)return"bg-fm-color-system-success-400";if(U||K||de)return"bg-fm-color-primary";if(X||ie||Pe)return"bg-fm-color-system-info-300";if(ce(C,V,N)&&(ce(C,D,M)||ce(C,D,k)))return"bg-fm-color-system-success-100";if(ht)return"bg-fm-color-system-warning-100";if(Ae)return"bg-fm-color-system-info-100"};return{[`fm-calendar__cell__button--selected-start ${ke()}`]:U||X,[`fm-calendar__cell__button--selected-end ${ke()}`]:K||ie,[`fm-calendar__cell__button--selected-between ${ke()}`]:ht||Ae,[`fm-calendar__cell__button--selected ${ke()}`]:de||Pe}},w=C=>{const V=i.value;if(V[0].startDate&&!V[0].endDate||V[1].startDate&&!V[1].endDate){p.value=C;return}p.value=null},S=C=>{f.value=C.label,i.value[0]={startDate:z(C.value.startDate,G),endDate:z(C.value.endDate,G)}},x=l.computed(()=>a.value?!i.value.every(C=>C.startDate&&C.endDate):!(i.value[0].startDate&&i.value[0].endDate)),E=C=>{a.value=C,i.value=Array.from(Array(2),()=>({startDate:null,endDate:null})),h=0},v=l.computed(()=>{if(!s.value)return{startDate:"DD MM YYYY",endDate:"DD MM YYYY"};const C=a.value&&Array.isArray(s.value)?s.value[0].startDate:s.value.startDate,V=a.value&&Array.isArray(s.value)?s.value[0].endDate:s.value.endDate;return{startDate:C?z(C).format("D MMM YYYY"):"DD MM YYYY",endDate:V?z(V).format("D MMM YYYY"):"DD MM YYYY"}}),R=l.computed(()=>{const C=a.value&&Array.isArray(s.value)?s.value[1].startDate:null,V=a.value&&Array.isArray(s.value)?s.value[1].endDate:null;return C&&V?`Compared: ${z(C).format("D MMM YYYY")} - ${z(V).format("D MMM YYYY")}`:""});return l.watch(()=>s.value,()=>{var C,V;a.value?i.value=s.value.map(N=>({startDate:N!=null&&N.startDate?z(N.startDate,G):null,endDate:N!=null&&N.endDate?z(N.endDate,G):null})):i.value[0]={startDate:(C=s.value)!=null&&C.startDate?z(s.value.startDate,G):null,endDate:(V=s.value)!=null&&V.endDate?z(s.value.endDate,G):null}}),(C,V)=>(l.openBlock(),l.createBlock(Xe,{modelValue:l.unref(s),"onUpdate:modelValue":V[8]||(V[8]=N=>l.isRef(s)?s.value=N:null),disabled:C.disabled,rules:C.rules,focused:r.value,"helper-text":a.value?R.value:C.helperText,"helper-state":C.helperState,tag:"div"},{default:l.withCtx(({invalid:N})=>[l.createVNode(ta,{"show-popover":r.value,disabled:C.disabled,onPopoverChanged:V[7]||(V[7]=D=>r.value=D)},{"popover-button":l.withCtx(()=>[C.compare?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",rm,[l.createElementVNode("label",lm,[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[n.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},l.toDisplayString(n.startLabel),3),l.createVNode(Ee,{class:l.normalizeClass(C.disabled?"cursor-not-allowed":"cursor-pointer"),focused:r.value,invalid:N,"show-valid-border":C.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(C.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(C.$slots,"append",{},void 0,!0)]),default:l.withCtx(()=>{var D,M;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[n.disabled?"text-fm-color-typo-disabled":(D=l.unref(s))!=null&&D.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((M=l.unref(s))!=null&&M.startDate?l.unref(z)(l.unref(s).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])]),am,l.createElementVNode("label",cm,[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[n.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},l.toDisplayString(n.endLabel),3),l.createVNode(Ee,{class:l.normalizeClass(C.disabled?"cursor-not-allowed":"cursor-pointer"),focused:r.value,invalid:N,"show-valid-border":C.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(C.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(C.$slots,"append",{},void 0,!0)]),default:l.withCtx(()=>{var D,M;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[n.disabled?"text-fm-color-typo-disabled":(D=l.unref(s))!=null&&D.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((M=l.unref(s))!=null&&M.endDate?l.unref(z)(l.unref(s).endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])])])),C.compare?(l.openBlock(),l.createElementBlock("label",dm,[l.createVNode(yn,{label:C.compareLabel},null,8,["label"]),l.createVNode(Ee,{class:l.normalizeClass(C.disabled?"cursor-not-allowed":"cursor-pointer"),focused:r.value,invalid:N,"show-valid-border":C.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(C.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(C.$slots,"append",{},void 0,!0)]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[n.disabled?"text-fm-color-typo-disabled":v.value.startDate!=="DD MM YYYY"?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString(v.value.startDate)+" - "+l.toDisplayString(v.value.endDate),3)]),_:2},1032,["class","focused","invalid","show-valid-border"])])):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[l.createElementVNode("div",um,[C.showPredefinedRange?(l.openBlock(),l.createElementBlock("div",fm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(C.predefinedRange,(D,M)=>(l.openBlock(),l.createBlock(Ke,{key:M,label:D.label,"model-value":f.value===D.label,selectable:"",onClick:k=>S(D)},null,8,["label","model-value","onClick"]))),128)),C.compare&&C.predefinedRange?(l.openBlock(),l.createElementBlock("div",hm,[l.createVNode(na,{inset:""})])):l.createCommentVNode("",!0),C.compare?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createVNode(oa,{"model-value":a.value,class:"justify-between px-12",label:"Compare","onUpdate:modelValue":V[0]||(V[0]=D=>E(D))},null,8,["model-value"]),a.value?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},l.renderList(e,(D,M)=>l.createVNode(Ke,{key:M,label:D.label,sublabel:D.sublabel,"model-value":c.value===D.id,selectable:"",onClick:k=>D.action()},null,8,["label","sublabel","model-value","onClick"])),64)):l.createCommentVNode("",!0)],64)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),C.showPredefinedRange?(l.openBlock(),l.createElementBlock("div",pm)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass({"pl-4":C.showPredefinedRange})},[l.createElementVNode("div",gm,[a.value?(l.openBlock(),l.createElementBlock("div",mm,[l.createElementVNode("label",bm,[l.createVNode(yn,{label:"Custom"}),l.createVNode(Ee,{focused:!1},{default:l.withCtx(()=>{var D,M;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[(D=i.value[0])!=null&&D.startDate&&((M=i.value[0])!=null&&M.endDate)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString(i.value[0].startDate!==null?i.value[0].startDate.format("D MMM YYYY"):"DD MM YYYY")+" - "+l.toDisplayString(i.value[0].endDate!==null?i.value[0].endDate.format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:1})]),ym,l.createElementVNode("label",_m,[l.createVNode(yn,{label:"Compare"}),l.createVNode(Ee,{focused:!1},{default:l.withCtx(()=>{var D,M;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[(D=i.value[1])!=null&&D.startDate&&((M=i.value[1])!=null&&M.endDate)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString(i.value[1].startDate!==null?i.value[1].startDate.format("D MMM YYYY"):"DD MM YYYY")+" - "+l.toDisplayString(i.value[1].endDate!==null?i.value[1].endDate.format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:1})])])):l.createCommentVNode("",!0),l.createElementVNode("div",xm,[l.createElementVNode("div",wm,[l.createElementVNode("div",Cm,[l.createElementVNode("div",km,[l.createVNode(H,{class:"cursor-pointer select-none",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:V[1]||(V[1]=()=>y("left",d.value.subtract(1,"month")))}),l.createVNode(It,{picker:"month","model-value":d.value,"onUpdate:modelValue":V[2]||(V[2]=D=>y("left",D))},null,8,["model-value"]),l.createVNode(It,{picker:"year","model-value":d.value,"onUpdate:modelValue":V[3]||(V[3]=D=>y("left",D))},null,8,["model-value"])])]),l.createElementVNode("div",null,[l.createElementVNode("div",Sm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Bs),D=>(l.openBlock(),l.createElementBlock("div",{key:D,class:"fm-calendar__cell"},l.toDisplayString(D),1))),128))]),l.createElementVNode("div",vm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Rs)(d.value),(D,M)=>(l.openBlock(),l.createElementBlock("div",{key:M,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(D,k=>(l.openBlock(),l.createElementBlock("div",{key:k.date.date(),class:"fm-calendar__cell"},[k.isCurrentMonth?(l.openBlock(),l.createElementBlock("button",{key:0,class:l.normalizeClass(["fm-calendar__cell__button",[_(k.date),{"fm-calendar__cell__button--today":k.date.isSame(l.unref(o),"day")}]]),type:"button",onClick:()=>g(k.date),onMouseover:B=>w(k.date)},l.toDisplayString(k.date.date()),43,Mm)):l.createCommentVNode("",!0)]))),128))]))),128))])])]),l.createElementVNode("div",Dm,[l.createElementVNode("div",Em,[l.createElementVNode("div",Vm,[l.createVNode(It,{picker:"month","model-value":u.value,"onUpdate:modelValue":V[4]||(V[4]=D=>y("right",D))},null,8,["model-value"]),l.createVNode(It,{picker:"year","model-value":u.value,"onUpdate:modelValue":V[5]||(V[5]=D=>y("right",D))},null,8,["model-value"])]),l.createVNode(H,{class:"cursor-pointer select-none",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:V[6]||(V[6]=()=>y("left",d.value.add(1,"month")))})]),l.createElementVNode("div",null,[l.createElementVNode("div",Rm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Bs),D=>(l.openBlock(),l.createElementBlock("div",{key:D,class:"fm-calendar__cell"},l.toDisplayString(D),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Rs)(u.value),(D,M)=>(l.openBlock(),l.createElementBlock("div",{key:M,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(D,k=>(l.openBlock(),l.createElementBlock("div",{key:k.date.date(),class:"fm-calendar__cell"},[k.isCurrentMonth?(l.openBlock(),l.createElementBlock("button",{key:0,class:l.normalizeClass(["fm-calendar__cell__button",_(k.date)]),type:"button",onClick:()=>g(k.date),onMouseover:B=>w(k.date)},l.toDisplayString(k.date.date()),43,Bm)):l.createCommentVNode("",!0)]))),128))]))),128))])])])])]),l.createElementVNode("div",Fm,[l.createVNode(ge,{label:"Cancel",size:"md",variant:"tertiary",onClick:b}),l.createVNode(ge,{label:"Apply",size:"md",variant:"primary",disabled:x.value,onClick:m},null,8,["disabled"])])],2)])]),_:2},1032,["show-popover","disabled"])]),"helper-text":l.withCtx(()=>[l.renderSlot(C.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","rules","focused","helper-text","helper-state"]))}}),m_="",Pm=te($m,[["__scopeId","data-v-06d70210"]]),Am=l.defineComponent({__name:"FmForm",emits:["validation-reset","validation-success","validation-failed","reset"],setup(t,{expose:e,emit:n}){const o=l.ref([]),s=l.ref(0),i=n,r=()=>{let d=[];for(let u=0;u<o.value.length;u++){const f=o.value[u];d=[...d,...f.validate()]}d.length?i("validation-failed",d):i("validation-success")},a=()=>{for(let d=0;d<o.value.length;d++)o.value[d].resetValue();i("reset")};return e({validateInputs:r,resetInputsValidation:()=>{for(let d=0;d<o.value.length;d++)o.value[d].resetValidation();i("validation-reset")},resetInputs:a}),l.provide(ii,{register({validate:d,resetValidation:u,resetValue:f}){return o.value.push({componentId:s.value,validate:d,resetValidation:u,resetValue:f}),s.value++},unregister(d){o.value.filter(u=>u.componentId!==d)}}),(d,u)=>(l.openBlock(),l.createElementBlock("form",{onSubmit:l.withModifiers(r,["prevent"]),onReset:l.withModifiers(a,["prevent"])},[l.renderSlot(d.$slots,"default")],32))}}),Om={class:"fm-radio-btn"},Nm={class:"fm-radio-btn__input--container"},Im=["value","disabled","checked"],Lm={class:"py-8"},Tm={class:"fm-typo-body-lg-400"},zm={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},Hm=l.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){const e=t,n=pe(e,"modelValue"),o=l.ref(),s=l.inject(ri,null),i=()=>{r.value||(s?s.updateValue(e.value):n.value=e.value)},r=l.computed(()=>s?s.getDisabled():e.disabled),a=l.computed(()=>s?e.value===s.groupValue.value:n.value===e.value);return(c,d)=>{const u=l.resolveDirective("wave");return l.openBlock(),l.createElementBlock("div",Om,[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:i},[l.withDirectives((l.openBlock(),l.createElementBlock("div",Nm,[l.createElementVNode("input",{ref_key:"inputEl",ref:o,class:"fm-radio-btn__input--btn",type:"radio",value:c.value,disabled:r.value,checked:a.value},null,8,Im)])),[[u,!r.value]]),l.createElementVNode("div",Lm,[l.renderSlot(c.$slots,"label",{},()=>[l.createElementVNode("div",Tm,l.toDisplayString(c.label),1),c.sublabel?(l.openBlock(),l.createElementBlock("div",zm,l.toDisplayString(c.sublabel),1)):l.createCommentVNode("",!0)],!0)])],2)])}}}),b_="",jm=te(Hm,[["__scopeId","data-v-24fa5bf9"]]),Wm=l.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[t=>!!t||"This field is required"]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=pe(e,"modelValue");return l.provide(ri,{groupValue:n,getDisabled:()=>e.disabled,updateValue(o){n.value=o}}),(o,s)=>(l.openBlock(),l.createBlock(Xe,{modelValue:l.unref(n),"onUpdate:modelValue":s[0]||(s[0]=i=>l.isRef(n)?n.value=i:null),label:o.label,disabled:o.disabled,required:o.labelMark==="required",optional:o.labelMark==="optional",info:o.labelInfo,rules:o.rules,"helper-text":o.helperText,"helper-state":o.helperState},{label:l.withCtx(()=>[l.renderSlot(o.$slots,"label")]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass({"flex items-center gap-16 justify-start":o.inline})},[l.renderSlot(o.$slots,"default")],2)]),"helper-text":l.withCtx(()=>[l.renderSlot(o.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","helper-text","helper-state"]))}});function Ym(t){for(;t;){if(Gm(t))return t;t=t.parentElement}return document.scrollingElement}function Gm(t){if(!t||t.nodeType!==Node.ELEMENT_NODE)return!1;const e=window.getComputedStyle(t);return e.overflowY==="scroll"||e.overflowY==="auto"&&t.scrollHeight>t.clientHeight}class Um{constructor(e,n){$(this,"onScroll");$(this,"scrollParent");this.onScroll=n,this.scrollParent=Ym(e)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const qm={class:"fm-menu__wrapper"},Xm=l.defineComponent({__name:"FmMenuDeprecated",props:{showMenu:{type:Boolean,default:!1},placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1}},emits:["dropdown-changed"],setup(t,{expose:e,emit:n}){const o=t,s=l.ref(!1),i=l.ref(null),r=l.ref(null),{floatingStyles:a}=Es(i,r,{middleware:[ho(4),fo()],placement:o.placement,whileElementsMounted:Ms});let c;const d=n;e({show:()=>{s.value||(s.value=!0,d("dropdown-changed",s.value))},hide:()=>{s.value&&(s.value=!1,d("dropdown-changed",s.value))}});const u=h=>{h.preventDefault(),h.stopPropagation(),!o.disabled&&(s.value=!s.value,d("dropdown-changed",s.value))},f=h=>{if(!s.value)return;const g=h.path||h.composedPath();for(const m of g)if(m==i.value||m==r.value)return;s.value=!1,d("dropdown-changed",s.value)},p=()=>{d("dropdown-changed",!1)};return l.watch(()=>o.showMenu,h=>s.value=h),l.onMounted(()=>{s.value=o.showMenu,window.addEventListener("click",f),c=new Um(i.value,p),c.bindScroll()}),l.onUnmounted(()=>{window.removeEventListener("click",f),c.unbindScroll()}),(h,g)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"anchorEl",ref:i,class:"fm-menu",onClick:u},[l.renderSlot(h.$slots,"menu-button",{},void 0,!0)],512),s.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"menuEl",ref:r,class:l.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":s.value}),style:l.normalizeStyle(l.unref(a))},[l.renderSlot(h.$slots,"menu-wrapper",{},()=>[l.createElementVNode("div",qm,[l.renderSlot(h.$slots,"menu-content",{},void 0,!0)])],!0)],6)):l.createCommentVNode("",!0)]))}}),y_="",_n=te(Xm,[["__scopeId","data-v-5b19ece2"]]),Km={class:"flex flex-col gap-4"},Zm={class:"w-[280px]"},Jm={class:"flex flex-col gap-4 justify-center"},Qm=l.defineComponent({__name:"FmSelect",props:{modelValue:{},items:{},multiselect:{type:Boolean,default:!1},placement:{default:"bottom-start"},placeholder:{default:"Select item"},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=pe(e,"modelValue"),o=l.ref(!1),s=(d,u)=>{if(e.multiselect){let f=[];d?f=n.value.length===0?[u]:e.items.filter(p=>n.value.some(h=>ye(p.value,h)||ye(p.value,u.value))):f=e.items.filter(p=>n.value.some(h=>ye(p.value,h)&&!ye(p.value,u.value))),n.value=f.map(p=>p.value)}else n.value=u.value,setTimeout(()=>{o.value=!1},0)},i=d=>{const u=[...n.value].filter((f,p)=>p!==d);n.value=u},r=l.computed(()=>e.multiselect?e.items.filter(d=>l.toRaw(n.value).some(u=>ye(u,d.value))):e.items.filter(d=>ye(n.value,d.value))),a=l.computed(()=>e.items.filter(d=>n.value.some(u=>ye(d.value,u))).map(d=>({label:d.label}))),c=l.computed(()=>{var d;return e.multiselect?e.placeholder:((d=e.items.find(u=>ye(u.value,n.value)))==null?void 0:d.label)??e.placeholder});return(d,u)=>(l.openBlock(),l.createElementBlock("div",Km,[l.createVNode(Xe,{modelValue:l.unref(n),"onUpdate:modelValue":u[1]||(u[1]=f=>l.isRef(n)?n.value=f:null),label:d.label,disabled:d.disabled,required:d.labelMark==="required",optional:d.labelMark==="optional",info:d.labelInfo,rules:d.rules,focused:o.value,"helper-text":d.helperText,"helper-state":d.helperState},{label:l.withCtx(()=>[l.renderSlot(d.$slots,"label")]),default:l.withCtx(({invalid:f})=>[l.createVNode(_n,{"show-menu":o.value,disabled:d.disabled,placement:d.placement,onDropdownChanged:u[0]||(u[0]=p=>o.value=p)},{"menu-button":l.withCtx(()=>[l.createVNode(Ee,{class:l.normalizeClass(d.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.value,invalid:f,"show-valid-border":d.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(d.$slots,"prepend")]),append:l.withCtx(()=>[l.createVNode(H,{name:o.value?"expand_less":"expand_more",size:"md",color:d.disabled?"#C7C7CC":"black"},null,8,["name","color"])]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":l.unref(n)!==void 0?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString(c.value),3)]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Zm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d.items,p=>(l.openBlock(),l.createBlock(Ke,{key:p.value,"has-checkbox":d.multiselect,label:p.label,value:p.value,"model-value":r.value.some(h=>l.unref(ye)(h.value,p.value)),"onUpdate:modelValue":h=>s(h,p)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))])]),_:2},1032,["show-menu","disabled","placement"])]),"helper-text":l.withCtx(()=>[l.renderSlot(d.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]),l.createElementVNode("div",Jm,[d.multiselect&&r.value.length>0?(l.openBlock(),l.createBlock(oi,{key:0,items:a.value,removable:"",disabled:d.disabled,onChipClosed:i},null,8,["items","disabled"])):l.createCommentVNode("",!0)])]))}}),eb=["inputMode","value","placeholder","readOnly"],tb={key:0},nb=l.defineComponent({__name:"FmStepperField",props:{modelValue:{},placeholder:{default:""},inputmode:{default:"numeric"},readonly:{type:Boolean},labelMark:{default:"none"},step:{default:1},min:{default:void 0},max:{default:void 0},prependIcon:{default:""},appendIcon:{default:""},useGrouping:{type:Boolean,default:!0},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},label:{default:""},disabled:{type:Boolean},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=pe(e,"modelValue"),{isFocused:o,blur:s,focus:i}=mo(),r=l.ref(null);let a;const c=_=>{if(_!==""){const w=+_.replace(/,/g,"");return isNaN(w)?null:w}return null},d=_=>a.format(_),u=_=>{if(typeof n.value!="number"){n.value=+n.value;return}if(_>0&&m.value||_<0&&b.value)return;let w=y(n.value)?n.value+_:0;w=f(w),n.value=w},f=_=>e.max!==void 0&&_>e.max?e.max:e.min!==void 0&&_<e.min?e.min:_,p=()=>{var _;n.value=c(((_=r.value)==null?void 0:_.value)??"")},h=_=>{if(![...Array(10).keys()].map(w=>w.toString()).includes(_.key)&&!["Backspace","Tab","Enter",".","-","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(_.key)){_.preventDefault();return}},g=l.computed(()=>n.value!=null?d(n.value):""),m=l.computed(()=>{let _=!1;return e.max!==void 0&&(_=n.value>=e.max),e.min!==void 0&&(_=n.value<e.min),_}),b=l.computed(()=>{let _=!1;return e.max!==void 0&&(_=n.value>e.max),e.min!==void 0&&(_=n.value<=e.min),_});l.onBeforeMount(()=>{a=new Intl.NumberFormat("en-MY",{useGrouping:e.useGrouping})});function y(_){return typeof _=="number"&&isFinite(_)}return(_,w)=>(l.openBlock(),l.createBlock(Xe,{modelValue:l.unref(n),"onUpdate:modelValue":w[8]||(w[8]=S=>l.isRef(n)?n.value=S:null),label:_.label,disabled:_.disabled,required:_.labelMark==="required",optional:_.labelMark==="optional",info:_.labelInfo,rules:_.rules,focused:l.unref(o),"helper-text":_.helperText,"helper-state":_.helperState},{label:l.withCtx(()=>[l.renderSlot(_.$slots,"label",{},void 0,!0)]),default:l.withCtx(({invalid:S})=>[l.createVNode(Ee,{class:"cursor-text","append-icon":_.appendIcon,"prepend-icon":_.prependIcon,focused:l.unref(o),invalid:S,"show-valid-border":_.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(_.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(_.$slots,"append",{},()=>[l.createElementVNode("div",{class:l.normalizeClass(["flex items-center justify-center",{"mr-32":_.showSteppers}])},[_.appendText?(l.openBlock(),l.createElementBlock("div",tb,l.toDisplayString(_.appendText),1)):l.createCommentVNode("",!0),_.appendIcon?(l.openBlock(),l.createBlock(H,{key:1,name:_.appendIcon,size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):l.createCommentVNode("",!0)],2)],!0),_.showSteppers?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-stepper-field__stepper__container",l.unref(o)?"right-[6px]":"right-[7px]"])},[l.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"0",onMousedown:w[2]||(w[2]=()=>u(_.step)),onFocus:w[3]||(w[3]=(...x)=>l.unref(i)&&l.unref(i)(...x)),onBlur:w[4]||(w[4]=(...x)=>l.unref(s)&&l.unref(s)(...x))},[l.createVNode(H,{name:"expand_less",size:"md",color:_.disabled||m.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32),l.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"1",onMousedown:w[5]||(w[5]=()=>u(-_.step)),onFocus:w[6]||(w[6]=(...x)=>l.unref(i)&&l.unref(i)(...x)),onBlur:w[7]||(w[7]=(...x)=>l.unref(s)&&l.unref(s)(...x))},[l.createVNode(H,{name:"expand_more",size:"md",color:_.disabled||b.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32)],2)):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[l.createElementVNode("input",{ref_key:"inputEl",ref:r,class:"fm-stepper-field--input",type:"text",inputMode:_.inputmode,value:g.value,placeholder:_.placeholder,readOnly:_.readonly,onInput:p,onFocus:w[0]||(w[0]=(...x)=>l.unref(i)&&l.unref(i)(...x)),onBlur:w[1]||(w[1]=(...x)=>l.unref(s)&&l.unref(s)(...x)),onKeydown:h},null,40,eb)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":l.withCtx(()=>[l.renderSlot(_.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),__="",ob=te(nb,[["__scopeId","data-v-90140ecd"]]),sb=["value","inputMode","type","placeholder","minlength","maxlength","disabled","readOnly"],ib=l.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:""},showWordCount:{type:Boolean,default:!1},modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=l.ref(null),o=pe(e,"modelValue"),{isFocused:s,focus:i,blur:r}=mo(),a=c=>{o.value=c.target.value};return(c,d)=>(l.openBlock(),l.createBlock(Xe,{modelValue:l.unref(o),"onUpdate:modelValue":d[2]||(d[2]=u=>l.isRef(o)?o.value=u:null),label:c.label,disabled:c.disabled,required:c.labelMark==="required",optional:c.labelMark==="optional",info:c.labelInfo,rules:c.rules,focused:l.unref(s),"helper-text":c.helperText,"helper-state":c.helperState},l.createSlots({label:l.withCtx(()=>[l.renderSlot(c.$slots,"label")]),default:l.withCtx(({invalid:u})=>[l.createVNode(Ee,{class:"cursor-text","append-icon":c.appendIcon,"prepend-icon":c.prependIcon,focused:l.unref(s),invalid:u,"show-valid-border":c.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(c.$slots,"prepend")]),append:l.withCtx(()=>[l.renderSlot(c.$slots,"append")]),default:l.withCtx(()=>[l.createElementVNode("input",{ref_key:"inputEl",ref:n,class:l.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!c.disabled,"fm-color-typo-disabled":c.disabled}),value:l.unref(o),inputMode:c.inputmode,type:c.inputmode,placeholder:c.placeholder,minlength:c.minLength,maxlength:c.maxLength,disabled:c.disabled,readOnly:c.readonly,onInput:a,onFocus:d[0]||(d[0]=(...f)=>l.unref(i)&&l.unref(i)(...f)),onBlur:d[1]||(d[1]=(...f)=>l.unref(r)&&l.unref(r)(...f))},null,42,sb)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":l.withCtx(()=>[l.renderSlot(c.$slots,"helper-text")]),_:2},[c.showWordCount?{name:"helper-append",fn:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass([c.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},l.toDisplayString(c.maxLength?`${l.unref(o).length} / ${c.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),x_="",rb=["value","placeholder","minlength","maxlength","readOnly","disabled"],lb=l.defineComponent({__name:"FmTextarea",props:{modelValue:{default:""},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"},showWordCount:{type:Boolean,default:!1},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]}},emits:["update:modelValue"],setup(t){const n=pe(t,"modelValue"),{isFocused:o,focus:s,blur:i}=mo(),r=a=>{n.value=a.target.value};return(a,c)=>(l.openBlock(),l.createBlock(Xe,{modelValue:l.unref(n),"onUpdate:modelValue":c[2]||(c[2]=d=>l.isRef(n)?n.value=d:null),label:a.label,disabled:a.disabled,required:a.labelMark==="required",optional:a.labelMark==="optional",info:a.labelInfo,rules:a.rules,focused:l.unref(o),"helper-text":a.helperText,"helper-state":a.helperState},l.createSlots({label:l.withCtx(()=>[l.renderSlot(a.$slots,"label",{},void 0,!0)]),default:l.withCtx(({invalid:d})=>[l.createElementVNode("div",{class:l.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":l.unref(o),"fm-textarea__container--invalid":!!l.unref(n)&&d,"fm-textarea__container--valid":a.showValidBorder&&a.showSuccess&&!!l.unref(n)&&!d,"fm-textarea__container--disabled":a.disabled})},[l.createElementVNode("textarea",{class:l.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!a.disabled,"fm-color-typo-disabled":a.disabled}),value:l.unref(n),placeholder:a.placeholder,minlength:a.minLength,maxlength:a.maxLength,readOnly:a.readonly,disabled:a.disabled,onInput:r,onFocus:c[0]||(c[0]=(...u)=>l.unref(s)&&l.unref(s)(...u)),onBlur:c[1]||(c[1]=(...u)=>l.unref(i)&&l.unref(i)(...u))},null,42,rb)],2)]),"helper-text":l.withCtx(()=>[l.renderSlot(a.$slots,"helper-text",{},void 0,!0)]),_:2},[a.showWordCount?{name:"helper-append",fn:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass([a.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},l.toDisplayString(a.maxLength?`${l.unref(n).length} / ${a.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),w_="",ab=te(lb,[["__scopeId","data-v-280a005d"]]),cb={class:"flex flex-col fm-time-input items-center"},db=["value"],ub=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(t,{emit:e}){const n=t,o=e,s=l.ref();function i(u){s.value&&(s.value.value=u)}l.watch(()=>n.modelValue,i);function r(){if(!s.value)return;const u=a(s.value.value);if(u==null||u>n.max||u<n.min){i(n.modelValue);return}o("update:model-value",u)}function a(u){return u&&/^\d+$/.test(u)?Number(u):null}function c(){o("update:model-value",a(n.modelValue)+1)}function d(){o("update:model-value",a(n.modelValue)-1)}return(u,f)=>(l.openBlock(),l.createElementBlock("div",cb,[l.createElementVNode("div",{class:"fm-time-input__scroller",onClick:c},[l.createVNode(H,{name:"expand_less",size:"lg"})]),l.createElementVNode("input",{ref_key:"inputRef",ref:s,value:n.modelValue,onInput:r},null,40,db),l.createElementVNode("div",{class:"fm-time-input__scroller",onClick:d},[l.createVNode(H,{name:"expand_more",size:"lg"})])]))}}),C_="",ia=te(ub,[["__scopeId","data-v-e8ddb125"]]);var Ze=(t=>(t.AM="AM",t.PM="PM",t))(Ze||{});function dt(t){return t.toString().padStart(2,"0")}const fb={class:"flex fm-time-input gap-16 items-center"},hb=l.createElementVNode("div",{class:"fm-typo-title-sm-700"}," : ",-1),pb={class:"fm-time-input-periods"},gb=["onClick"],ra=l.defineComponent({__name:"FmTimeInput",props:{modelValue:{type:Object,required:!0}},emits:["update:model-value"],setup(t,{emit:e}){const n=t,o=e;function s(i){const r={hours:i.hours??n.modelValue.hours,minutes:i.minutes??n.modelValue.minutes,period:i.period??n.modelValue.period},a=n.modelValue.hours;(a===12&&r.hours===11||a===11&&r.hours===12)&&(r.period=n.modelValue.period===Ze.AM?Ze.PM:Ze.AM),r.hours>12?r.hours=1:r.hours<1&&(r.hours=12),r.minutes>59?r.minutes=0:r.minutes<0&&(r.minutes=59),o("update:model-value",r)}return(i,r)=>(l.openBlock(),l.createElementBlock("div",fb,[l.createVNode(ia,{"model-value":l.unref(dt)(t.modelValue.hours),min:1,max:12,"onUpdate:modelValue":r[0]||(r[0]=a=>s({hours:a}))},null,8,["model-value"]),hb,l.createVNode(ia,{"model-value":l.unref(dt)(t.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":r[1]||(r[1]=a=>s({minutes:a}))},null,8,["model-value"]),l.createElementVNode("div",pb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Ze),a=>(l.openBlock(),l.createElementBlock("div",{key:a,class:l.normalizeClass([{"fm-time-input-period__selected":a===t.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>s({period:a})},l.toDisplayString(a),11,gb))),128))])]))}}),k_="",mb={class:"flex gap-8"},bb={class:"bg-fm-color-neutral-white flex flex-col p-12 rounded-lg shadow-light-300 w-[343px]"},yb=l.createElementVNode("div",{class:"fm-typo-body-xl-700"}," Enter time ",-1),_b={class:"flex justify-center w-full"},xb={class:"flex justify-end"},wb=l.defineComponent({__name:"FmTimePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const n=pe(t,"modelValue"),o=l.ref(null),s=l.computed(()=>{if(!n.value)return null;const{hours:h,minutes:g,period:m}=a(n.value);return`${dt(h)}:${dt(g)} ${m}`});function i(){if(!o.value){n.value=null;return}const{hours:h,minutes:g,period:m}=o.value,b=r(h,g,m);n.value=b,u()}function r(h,g,m){let b=h;return m===Ze.PM?b=h===12?h:h+12:h===12&&(b=0),`${dt(b)}:${dt(g)}`}l.onMounted(()=>{n.value&&(o.value=a(n.value))}),l.watch(()=>n.value,h=>{h&&(o.value=a(h))});function a(h){const[g,m,b]=c(h).split(":");return{hours:Number(g),minutes:Number(m),period:b}}function c(h){const[g,m]=h.split(":"),b=Number(g),y=Number(m),_=b>11?Ze.PM:Ze.AM;let w=b;return w===0?w=12:w>12&&(w-=12),`${dt(w)}:${dt(y)}:${_}`}const d=l.ref();function u(){var h;(h=d.value)==null||h.hide()}const f=l.ref(!1);function p(h){h?o.value=a(n.value??"00:00"):o.value=n.value?a(n.value):null,f.value=h}return(h,g)=>(l.openBlock(),l.createBlock(Xe,{modelValue:l.unref(n),"onUpdate:modelValue":g[1]||(g[1]=m=>l.isRef(n)?n.value=m:null),label:h.label,disabled:h.disabled,required:h.labelMark==="required",optional:h.labelMark==="optional",info:h.labelInfo,rules:h.rules,focused:f.value,"helper-text":h.helperText,"helper-state":h.helperState},{label:l.withCtx(()=>[l.renderSlot(h.$slots,"label")]),default:l.withCtx(({invalid:m})=>[l.createVNode(_n,{ref_key:"dropdownRef",ref:d,onDropdownChanged:p},{"menu-button":l.withCtx(()=>[l.createVNode(Ee,{class:l.normalizeClass(h.disabled?"cursor-not-allowed":"cursor-pointer"),focused:f.value,invalid:m,"show-valid-border":h.showValidBorder},{default:l.withCtx(()=>[l.createElementVNode("div",mb,[l.createVNode(H,{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)])]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-wrapper":l.withCtx(()=>[l.createElementVNode("div",bb,[yb,l.createElementVNode("div",_b,[l.createVNode(ra,{"model-value":o.value??{hours:0,minutes:0,period:l.unref(Ze).AM},class:"py-16","onUpdate:modelValue":g[0]||(g[0]=b=>o.value=b)},null,8,["model-value"])]),l.createElementVNode("div",xb,[l.createVNode(ge,{label:"Cancel",variant:"tertiary",onClick:u}),l.createVNode(ge,{label:"Confirm",variant:"tertiary",onClick:i})])])]),_:2},1536)]),"helper-text":l.withCtx(()=>[l.renderSlot(h.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Cb=l.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({"fm-list--separator":e.separator,activeClass:e.activeClass})},[l.renderSlot(e.$slots,"default",{},void 0,!0)],2))}}),S_="",kb=te(Cb,[["__scopeId","data-v-884ba127"]]),Sb=l.defineComponent({__name:"FmListItem",props:{tag:{default:"div"},clickable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},activeClass:{default:""}},setup(t){const e=t;return(n,o)=>{const s=l.resolveDirective("wave");return l.withDirectives((l.openBlock(),l.createBlock(e.tag,{class:l.normalizeClass({"fm-list-item":!0,"fm-list-item--disabled":n.disabled,"cursor-pointer":n.clickable&&!n.disabled,"cursor-not-allowed":n.clickable&&n.disabled,activeClass:n.activeClass})},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},8,["class"])),[[s,n.clickable&&!n.disabled]])}}}),v_="",vb=te(Sb,[["__scopeId","data-v-f565b558"]]),Mb={class:"fm-typo-body-lg-700 mx-8 p-12 text-fm-color-typo-primary"},Db=l.defineComponent({__name:"FmMenuHeader",props:{label:{}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",Mb,l.toDisplayString(e.label),1))}}),Eb={class:"fm-progress-indicator relative"},Vb=["data-progress"],Rb={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},la=l.defineComponent({__name:"FmProgressIndicator",props:{modelValue:{type:Number,required:!0}},setup(t){const e=t,n=l.ref(null),o=l.computed(()=>`${e.modelValue/100*360}deg`),s=i=>{n.value&&n.value.style.setProperty("--progress",i)};return l.onMounted(()=>{s(o.value)}),l.onUpdated(()=>{s(o.value)}),l.watch(o,async i=>{s(i)}),(i,r)=>(l.openBlock(),l.createElementBlock("div",Eb,[l.createElementVNode("div",{ref_key:"progress",ref:n,class:"fm-progress-circular w-full","data-progress":o.value},null,8,Vb),l.createElementVNode("div",Rb,[l.renderSlot(i.$slots,"default")])]))}}),M_="",Bb={class:"flex"},Fb={key:0,class:"mt-8"},$b=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(t,{emit:e}){const n=t,o=e,s=l.computed(()=>{switch(n.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 ${n.variant}`)}}),i=l.computed(()=>n.title?{text:n.title,classes:"fm-typo-body-lg-700"}:{text:n.description,classes:""}),r=l.computed(()=>n.bgColor?Do(n.bgColor)?{style:{backgroundColor:n.bgColor}}:{class:`bg-fm-color-${n.bgColor}`}:{class:`bg-fm-color-${s.value.bgColor}`}),a=l.computed(()=>n.color?Do(n.color)?{style:{color:n.color}}:{class:`text-fm-color-${n.color}`}:{class:`text-fm-color-${s.value.actionColor}`});return(c,d)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(r.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[l.createElementVNode("div",Bb,[s.value.icon?(l.openBlock(),l.createBlock(H,{key:0,name:s.value.icon.name,color:n.color??s.value.icon.color,class:"mr-12"},null,8,["name","color"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(`${i.value.classes} grow ellipsis`)},l.toDisplayString(i.value.text),3),n.dismissable?(l.openBlock(),l.createBlock(H,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:d[0]||(d[0]=()=>o("onDismiss"))})):l.createCommentVNode("",!0)]),n.title&&n.description?(l.openBlock(),l.createElementBlock("div",Fb,l.toDisplayString(n.description),1)):l.createCommentVNode("",!0),l.renderSlot(c.$slots,"actions",{},()=>[n.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:d[1]||(d[1]=()=>o("onAction"))},l.toDisplayString(n.action),1)],16)):l.createCommentVNode("",!0)],!0)],16))}}),D_="",Pb=te($b,[["__scopeId","data-v-b6db34bb"]]),Ab={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},aa=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(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex flex-col",t.disabled?"text-fm-color-typo-disabled":""])},[l.createElementVNode("div",{class:l.normalizeClass(["fm-step-title line-clamp-2",t.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},l.toDisplayString(t.title),3),t.description?(l.openBlock(),l.createElementBlock("div",Ab,l.toDisplayString(t.description),1)):l.createCommentVNode("",!0)],2))}}),Ob=["data-title","data-description","data-disabled"],Nb={class:"flex fm-step-container gap-12 grow"},Ib=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(t){const e=t,{currentStep:n,goToStep:o}=l.inject(li);function s(){i.value||o(e.value)}const i=l.computed(()=>e.disabled?e.disabled():!1),r=l.computed(()=>e.error?e.error():!1),a=l.computed(()=>n()===e.value),c=l.computed(()=>e.complete()),d=l.computed(()=>a.value||c.value||n()>e.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),u=l.computed(()=>a.value?{className:"bg-fm-color-primary"}:r.value?{config:{name:"warning",color:"system-error-300"}}:i.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,p)=>{const h=l.resolveDirective("wave");return l.withDirectives((l.openBlock(),l.createElementBlock("div",{"data-title":t.title,"data-description":t.description,"data-disabled":i.value,class:l.normalizeClass(`fm-step gap-4 grow ${i.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",Nb,[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]",u.value.className])},[u.value.config?(l.openBlock(),l.createBlock(H,{key:0,name:u.value.config.name,color:u.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):l.createCommentVNode("",!0)],2),l.createVNode(aa,{title:t.title,description:t.description,disabled:i.value,class:"grow"},null,8,["title","description","disabled"])])],10,Ob)),[[h,!i.value]])}}}),E_="",Lb=te(Ib,[["__scopeId","data-v-ee172cad"]]),Tb={class:"hidden items-center xs:flex"},zb={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},Hb=l.defineComponent({__name:"FmStepper",props:{modelValue:{type:Number,required:!0},orientation:{type:String,default:"horizontal"}},emits:["update:model-value"],setup(t,{emit:e}){const n=t,o=e,s=f=>{o("update:model-value",f)};l.provide(li,{currentStep:()=>n.modelValue,goToStep:s});const i=l.ref(),r=l.ref([]),a=l.computed(()=>r.value[n.modelValue-1]),c=l.computed(()=>n.modelValue/r.value.length*100),d=l.computed(()=>`${n.modelValue} of ${r.value.length}`),u=()=>{var p;const f=Array.from(((p=i.value)==null?void 0:p.querySelectorAll(":scope > .fm-step"))??[]);r.value=f.map(h=>({title:h.dataset.title??"",description:h.dataset.description,disabled:h.dataset.disabled=="true"}))};return l.onMounted(()=>{u()}),(f,p)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(`fm-stepper fm-stepper__${t.orientation}`)},[l.createElementVNode("div",{ref_key:"stepperRef",ref:i,class:l.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${t.orientation==="vertical"?"flex-col":""}`)},[l.renderSlot(f.$slots,"default")],2),l.createElementVNode("div",Tb,[l.createVNode(la,{"model-value":c.value,class:"mr-12",style:{"min-width":"60px"}},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.value),1)]),_:1},8,["model-value"]),a.value?(l.openBlock(),l.createBlock(aa,{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)]),f.$slots.contents?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${t.orientation==="vertical"?"w-2/3":""}`)},[l.renderSlot(f.$slots,"contents"),l.createElementVNode("div",zb,[l.renderSlot(f.$slots,"actions")])],2)):l.createCommentVNode("",!0)],2))}});let jb=0;function Wb(){return jb++}const Yb=t=>(l.pushScopeId("data-v-431e2921"),t=t(),l.popScopeId(),t),Gb=["disabled"],Ub=[Yb(()=>l.createElementVNode("div",{class:"fm-tab__indicator"},null,-1))],qb={class:"max-w-[360px] min-w-[186px]"},Xb=l.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:()=>Wb()},children:{default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=l.ref(!1),o=t,s=e,i=l.ref(!1);function r(f){n.value=f}const a=()=>{o.disabled||o.children.length>0||s("update:modelValue",o.value)},c=f=>{o.children.length!==0&&(i.value=f)},d=l.computed(()=>o.children.length>0?o.children.some(f=>f.value===o.modelValue):o.modelValue===o.value),u=f=>{i.value=!1,s("update:modelValue",f)};return(f,p)=>(l.openBlock(),l.createBlock(_n,{"show-menu":i.value,disabled:f.children.length===0,class:l.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":f.vertical}]),placement:f.vertical?"right-start":"bottom-start",onDropdownChanged:c},{"menu-button":l.withCtx(()=>[l.createElementVNode("button",{class:l.normalizeClass(["fm-tab",`fm-tab--${f.vertical?"vertical":"horizontal"}`,f.disabled?"cursor-not-allowed":"cursor-pointer",{"fm-tab--selected":d.value}]),disabled:f.disabled,onMousedown:p[0]||(p[0]=()=>r(!0)),onMouseup:p[1]||(p[1]=()=>r(!1)),onMouseleave:p[2]||(p[2]=()=>r(!1)),onClick:a},[l.renderSlot(f.$slots,"prepend",{},void 0,!0),f.icon?(l.openBlock(),l.createBlock(H,{key:0,name:f.icon,outline:!n.value&&!d.value,color:f.disabled?"neutral-gray-200":d.value?"primary":"neutral-black",size:"md"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),f.label?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-lg-700 text-fm-color-typo-primary col-start-2 row-start-1",d.value?"visible":"invisible"])},l.toDisplayString(f.label),3)):l.createCommentVNode("",!0),f.label?(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass(["fm-typo-body-lg-400 col-start-2 row-start-1",f.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary",!d.value||f.disabled?"visible":"invisible"])},l.toDisplayString(f.label),3)):l.createCommentVNode("",!0),f.badge?(l.openBlock(),l.createBlock(kn,{key:3,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):l.createCommentVNode("",!0),f.children.length>0?(l.openBlock(),l.createBlock(H,{key:4,size:"md",name:i.value?"expand_less":"expand_more"},null,8,["name"])):l.createCommentVNode("",!0),l.renderSlot(f.$slots,"append",{},void 0,!0),d.value?(l.openBlock(),l.createElementBlock("div",{key:5,class:l.normalizeClass([`fm-tab__indicator__wrapper--${f.vertical?"vertical":"horizontal"}`])},Ub,2)):l.createCommentVNode("",!0)],42,Gb)]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",qb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.children,h=>l.renderSlot(f.$slots,"list-item",l.normalizeProps(l.guardReactiveProps(h)),()=>[l.createVNode(Ke,{"model-value":o.modelValue===h.value,label:h.label,icon:h.icon,disabled:h.disabled,onClick:g=>u(h.value)},{append:l.withCtx(()=>[h.badge?(l.openBlock(),l.createBlock(kn,{key:0,value:h.badge,inline:"",variant:"numeric"},null,8,["value"])):l.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])],!0)),256))])]),_:3},8,["show-menu","disabled","class","placement"]))}}),R_="",ca=te(Xb,[["__scopeId","data-v-431e2921"]]);/**
|
|
27
27
|
* table-core
|
|
28
28
|
*
|
|
29
29
|
* Copyright (c) TanStack
|
|
@@ -32,10 +32,10 @@ var Hy=Object.defineProperty;var jy=(ie,l,Ue)=>l in ie?Hy(ie,l,{enumerable:!0,co
|
|
|
32
32
|
* LICENSE.md file in the root directory of this source tree.
|
|
33
33
|
*
|
|
34
34
|
* @license MIT
|
|
35
|
-
*/function
|
|
35
|
+
*/function ut(t,e){return typeof t=="function"?t(e):t}function Ce(t,e){return n=>{e.setState(o=>({...o,[t]:ut(n,o[t])}))}}function bo(t){return t instanceof Function}function Kb(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function Zb(t,e){const n=[],o=s=>{s.forEach(i=>{n.push(i);const r=e(i);r!=null&&r.length&&o(r)})};return o(t),n}function L(t,e,n){let o=[],s;return()=>{let i;n.key&&n.debug&&(i=Date.now());const r=t();if(!(r.length!==o.length||r.some((d,u)=>o[u]!==d)))return s;o=r;let c;if(n.key&&n.debug&&(c=Date.now()),s=e(...r),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-i)*100)/100,u=Math.round((Date.now()-c)*100)/100,f=u/16,p=(h,g)=>{for(h=String(h);h.length<g;)h=" "+h;return h};console.info(`%c⏱ ${p(u,5)} /${p(d,5)} ms`,`
|
|
36
36
|
font-size: .6rem;
|
|
37
37
|
font-weight: bold;
|
|
38
|
-
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function Wb(t,e,n,o){var i,s;const a={...t._getDefaultColumnDef(),...e},c=a.accessorKey;let d=(i=(s=a.id)!=null?s:c?c.replace(".","_"):void 0)!=null?i:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:c&&(c.includes(".")?u=p=>{let h=p;for(const m of c.split(".")){var g;h=(g=h)==null?void 0:g[m],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${m}" in deeply nested key "${c}" returned undefined.`)}return h}:u=p=>p[a.accessorKey]),!d)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(d)}`,accessorFn:u,parent:o,depth:n,columnDef:a,columns:[],getFlatColumns:I(()=>[!0],()=>{var p;return[f,...(p=f.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var p;return(p=t.options.debugAll)!=null?p:t.options.debugColumns}}),getLeafColumns:I(()=>[t._getOrderColumnsFn()],p=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(m=>m.getLeafColumns());return p(g)}return[f]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var p;return(p=t.options.debugAll)!=null?p:t.options.debugColumns}})};for(const p of t._features)p.createColumn==null||p.createColumn(f,t);return f}function ea(t,e,n){var o;let s={id:(o=n.id)!=null?o:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const r=[],a=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(a),r.push(c)};return a(s),r},getContext:()=>({table:t,header:s,column:e})};return t._features.forEach(r=>{r.createHeader==null||r.createHeader(s,t)}),s}const Yb={createTable:t=>{t.getHeaderGroups=I(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,i)=>{var s,r;const a=(s=o==null?void 0:o.map(f=>n.find(p=>p.id===f)).filter(Boolean))!=null?s:[],c=(r=i==null?void 0:i.map(f=>n.find(p=>p.id===f)).filter(Boolean))!=null?r:[],d=n.filter(f=>!(o!=null&&o.includes(f.id))&&!(i!=null&&i.includes(f.id)));return uo(e,[...a,...d,...c],t)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterHeaderGroups=I(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,i)=>(n=n.filter(s=>!(o!=null&&o.includes(s.id))&&!(i!=null&&i.includes(s.id))),uo(e,n,t,"center")),{key:process.env.NODE_ENV==="development"&&"getCenterHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftHeaderGroups=I(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,o)=>{var i;const s=(i=o==null?void 0:o.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?i:[];return uo(e,s,t,"left")},{key:process.env.NODE_ENV==="development"&&"getLeftHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightHeaderGroups=I(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,o)=>{var i;const s=(i=o==null?void 0:o.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?i:[];return uo(e,s,t,"right")},{key:process.env.NODE_ENV==="development"&&"getRightHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getFooterGroups=I(()=>[t.getHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftFooterGroups=I(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getLeftFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterFooterGroups=I(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getCenterFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightFooterGroups=I(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getRightFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getFlatHeaders=I(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftFlatHeaders=I(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getLeftFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterFlatHeaders=I(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getCenterFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightFlatHeaders=I(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getRightFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterLeafHeaders=I(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:process.env.NODE_ENV==="development"&&"getCenterLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftLeafHeaders=I(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:process.env.NODE_ENV==="development"&&"getLeftLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightLeafHeaders=I(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:process.env.NODE_ENV==="development"&&"getRightLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeafHeaders=I(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,o)=>{var i,s,r,a,c,d;return[...(i=(s=e[0])==null?void 0:s.headers)!=null?i:[],...(r=(a=n[0])==null?void 0:a.headers)!=null?r:[],...(c=(d=o[0])==null?void 0:d.headers)!=null?c:[]].map(u=>u.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}})}};function uo(t,e,n,o){var i,s;let r=0;const a=function(p,h){h===void 0&&(h=1),r=Math.max(r,h),p.filter(g=>g.getIsVisible()).forEach(g=>{var m;(m=g.columns)!=null&&m.length&&a(g.columns,h+1)},0)};a(t);let c=[];const d=(p,h)=>{const g={depth:h,id:[o,`${h}`].filter(Boolean).join("_"),headers:[]},m=[];p.forEach(b=>{const x=[...m].reverse()[0],y=b.column.depth===g.depth;let w,S=!1;if(y&&b.column.parent?w=b.column.parent:(w=b.column,S=!0),x&&(x==null?void 0:x.column)===w)x.subHeaders.push(b);else{const _=ea(n,w,{id:[o,h,w.id,b==null?void 0:b.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${m.filter(C=>C.column===w).length}`:void 0,depth:h,index:m.length});_.subHeaders.push(b),m.push(_)}g.headers.push(b),b.headerGroup=g}),c.push(g),h>0&&d(m,h-1)},u=e.map((p,h)=>ea(n,p,{depth:r,index:h}));d(u,r-1),c.reverse();const f=p=>p.filter(g=>g.column.getIsVisible()).map(g=>{let m=0,b=0,x=[0];g.subHeaders&&g.subHeaders.length?(x=[],f(g.subHeaders).forEach(w=>{let{colSpan:S,rowSpan:_}=w;m+=S,x.push(_)})):m=1;const y=Math.min(...x);return b=b+y,g.colSpan=m,g.rowSpan=b,{colSpan:m,rowSpan:b}});return f((i=(s=c[0])==null?void 0:s.headers)!=null?i:[]),c}const fo={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ki=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Gb={getDefaultColumnDef:()=>fo,getInitialState:t=>({columnSizing:{},columnSizingInfo:ki(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ce("columnSizing",t),onColumnSizingInfoChange:Ce("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,o,i;const s=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:fo.minSize,(o=s??t.columnDef.size)!=null?o:fo.size),(i=t.columnDef.maxSize)!=null?i:fo.maxSize)},t.getStart=n=>{const o=n?n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns(),i=o.findIndex(s=>s.id===t.id);if(i>0){const s=o[i-1];return s.getStart(n)+s.getSize()}return 0},t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:o,...i}=n;return i})},t.getCanResize=()=>{var n,o;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((o=e.options.enableColumnResizing)!=null?o:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const o=i=>{if(i.subHeaders.length)i.subHeaders.forEach(o);else{var s;n+=(s=i.column.getSize())!=null?s:0}};return o(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=()=>{const n=e.getColumn(t.column.id),o=n==null?void 0:n.getCanResize();return i=>{if(!n||!o||(i.persist==null||i.persist(),Si(i)&&i.touches&&i.touches.length>1))return;const s=t.getSize(),r=t?t.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[n.id,n.getSize()]],a=Si(i)?Math.round(i.touches[0].clientX):i.clientX,c={},d=(m,b)=>{typeof b=="number"&&(e.setColumnSizingInfo(x=>{var y,w;const S=e.options.columnResizeDirection==="rtl"?-1:1,_=(b-((y=x==null?void 0:x.startOffset)!=null?y:0))*S,C=Math.max(_/((w=x==null?void 0:x.startSize)!=null?w:0),-.999999);return x.columnSizingStart.forEach(v=>{let[k,M]=v;c[k]=Math.round(Math.max(M+M*C,0)*100)/100}),{...x,deltaOffset:_,deltaPercentage:C}}),(e.options.columnResizeMode==="onChange"||m==="end")&&e.setColumnSizing(x=>({...x,...c})))},u=m=>d("move",m),f=m=>{d("end",m),e.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p={moveHandler:m=>u(m.clientX),upHandler:m=>{document.removeEventListener("mousemove",p.moveHandler),document.removeEventListener("mouseup",p.upHandler),f(m.clientX)}},h={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),u(m.touches[0].clientX),!1),upHandler:m=>{var b;document.removeEventListener("touchmove",h.moveHandler),document.removeEventListener("touchend",h.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),f((b=m.touches[0])==null?void 0:b.clientX)}},g=Ub()?{passive:!1}:!1;Si(i)?(document.addEventListener("touchmove",h.moveHandler,g),document.addEventListener("touchend",h.upHandler,g)):(document.addEventListener("mousemove",p.moveHandler,g),document.addEventListener("mouseup",p.upHandler,g)),e.setColumnSizingInfo(m=>({...m,startOffset:a,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?ki():(n=t.initialState.columnSizingInfo)!=null?n:ki())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,i)=>o+i.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,i)=>o+i.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,i)=>o+i.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,i)=>o+i.getSize(),0))!=null?e:0}}};let ho=null;function Ub(){if(typeof ho=="boolean")return ho;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return ho=t,ho}function Si(t){return t.type==="touchstart"}const qb={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Ce("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var o,i;if(!e){t._queue(()=>{e=!0});return}if((o=(i=t.options.autoResetAll)!=null?i:t.options.autoResetExpanded)!=null?o:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=o=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(o),t.toggleAllRowsExpanded=o=>{o??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=o=>{var i,s;t.setExpanded(o?{}:(i=(s=t.initialState)==null?void 0:s.expanded)!=null?i:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const o=t.getState().expanded;return o===!0||Object.values(o).some(Boolean)},t.getIsAllRowsExpanded=()=>{const o=t.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||t.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},t.getExpandedDepth=()=>{let o=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(s=>{const r=s.split(".");o=Math.max(o,r.length)}),o},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(o=>{var i;const s=o===!0?!0:!!(o!=null&&o[t.id]);let r={};if(o===!0?Object.keys(e.getRowModel().rowsById).forEach(a=>{r[a]=!0}):r=o,n=(i=n)!=null?i:!s,!s&&n)return{...r,[t.id]:!0};if(s&&!n){const{[t.id]:a,...c}=r;return c}return o})},t.getIsExpanded=()=>{var n;const o=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:o===!0||o!=null&&o[t.id])},t.getCanExpand=()=>{var n,o,i;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((o=e.options.enableExpanding)!=null?o:!0)&&!!((i=t.subRows)!=null&&i.length)},t.getIsAllParentsExpanded=()=>{let n=!0,o=t;for(;n&&o.parentId;)o=e.getRow(o.parentId,!0),n=o.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},ta=(t,e,n)=>{var o;const i=n.toLowerCase();return!!(!((o=t.getValue(e))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};ta.autoRemove=t=>De(t);const na=(t,e,n)=>{var o;return!!(!((o=t.getValue(e))==null||(o=o.toString())==null)&&o.includes(n))};na.autoRemove=t=>De(t);const oa=(t,e,n)=>{var o;return((o=t.getValue(e))==null||(o=o.toString())==null?void 0:o.toLowerCase())===(n==null?void 0:n.toLowerCase())};oa.autoRemove=t=>De(t);const ia=(t,e,n)=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(n)};ia.autoRemove=t=>De(t)||!(t!=null&&t.length);const sa=(t,e,n)=>!n.some(o=>{var i;return!((i=t.getValue(e))!=null&&i.includes(o))});sa.autoRemove=t=>De(t)||!(t!=null&&t.length);const ra=(t,e,n)=>n.some(o=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(o)});ra.autoRemove=t=>De(t)||!(t!=null&&t.length);const la=(t,e,n)=>t.getValue(e)===n;la.autoRemove=t=>De(t);const aa=(t,e,n)=>t.getValue(e)==n;aa.autoRemove=t=>De(t);const vi=(t,e,n)=>{let[o,i]=n;const s=t.getValue(e);return s>=o&&s<=i};vi.resolveFilterValue=t=>{let[e,n]=t,o=typeof e!="number"?parseFloat(e):e,i=typeof n!="number"?parseFloat(n):n,s=e===null||Number.isNaN(o)?-1/0:o,r=n===null||Number.isNaN(i)?1/0:i;if(s>r){const a=s;s=r,r=a}return[s,r]},vi.autoRemove=t=>De(t)||De(t[0])&&De(t[1]);const Ge={includesString:ta,includesStringSensitive:na,equalsString:oa,arrIncludes:ia,arrIncludesAll:sa,arrIncludesSome:ra,equals:la,weakEquals:aa,inNumberRange:vi};function De(t){return t==null||t===""}const Xb={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],globalFilter:void 0,...t}),getDefaultOptions:t=>({onColumnFiltersChange:Ce("columnFilters",t),onGlobalFilterChange:Ce("globalFilter",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const o=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(t.id);return typeof o=="string"?Ge.includesString:typeof o=="number"?Ge.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Ge.equals:Array.isArray(o)?Ge.arrIncludes:Ge.weakEquals},t.getFilterFn=()=>{var n,o;return co(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(o=e.options.filterFns)==null?void 0:o[t.columnDef.filterFn])!=null?n:Ge[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,o,i;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((o=e.options.enableColumnFilters)!=null?o:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&!!t.accessorFn},t.getCanGlobalFilter=()=>{var n,o,i,s;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=e.options.enableGlobalFilter)!=null?o:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&((s=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?s:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(o=>o.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,o;return(n=(o=e.getState().columnFilters)==null?void 0:o.findIndex(i=>i.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(o=>{const i=t.getFilterFn(),s=o==null?void 0:o.find(u=>u.id===t.id),r=rt(n,s?s.value:void 0);if(ca(i,r,t)){var a;return(a=o==null?void 0:o.filter(u=>u.id!==t.id))!=null?a:[]}const c={id:t.id,value:r};if(s){var d;return(d=o==null?void 0:o.map(u=>u.id===t.id?c:u))!=null?d:[]}return o!=null&&o.length?[...o,c]:[c]})},t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Ge.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:o}=t.options;return co(o)?o:o==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[o])!=null?e:Ge[o]},t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),o=i=>{var s;return(s=rt(e,i))==null?void 0:s.filter(r=>{const a=n.find(c=>c.id===r.id);if(a){const c=a.getFilterFn();if(ca(c,r.value,a))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(o)},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)},t.resetColumnFilters=e=>{var n,o;t.setColumnFilters(e?[]:(n=(o=t.initialState)==null?void 0:o.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel()),t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}};function ca(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const Mi={sum:(t,e,n)=>n.reduce((o,i)=>{const s=i.getValue(t);return o+(typeof s=="number"?s:0)},0),min:(t,e,n)=>{let o;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(o>s||o===void 0&&s>=s)&&(o=s)}),o},max:(t,e,n)=>{let o;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(o<s||o===void 0&&s>=s)&&(o=s)}),o},extent:(t,e,n)=>{let o,i;return n.forEach(s=>{const r=s.getValue(t);r!=null&&(o===void 0?r>=r&&(o=i=r):(o>r&&(o=r),i<r&&(i=r)))}),[o,i]},mean:(t,e)=>{let n=0,o=0;if(e.forEach(i=>{let s=i.getValue(t);s!=null&&(s=+s)>=s&&(++n,o+=s)}),n)return o/n},median:(t,e)=>{if(!e.length)return;const n=e.map(s=>s.getValue(t));if(!Hb(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),i=n.sort((s,r)=>s-r);return n.length%2!==0?i[o]:(i[o-1]+i[o])/2},unique:(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),uniqueCount:(t,e)=>new Set(e.map(n=>n.getValue(t))).size,count:(t,e)=>e.length},Kb={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Ce("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(o=>o!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,o,i,s;return(n=(o=(i=(s=t.columnDef.enableGrouping)!=null?s:!0)!=null?i:e.options.enableGrouping)!=null?o:!0)!=null?n:!!t.accessorFn},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(t.id);if(typeof o=="number")return Mi.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Mi.extent},t.getAggregationFn=()=>{var n,o;if(!t)throw new Error;return co(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(o=e.options.aggregationFns)==null?void 0:o[t.columnDef.aggregationFn])!=null?n:Mi[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,o;t.setGrouping(e?[]:(n=(o=t.initialState)==null?void 0:o.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const o=e.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(t._groupingValuesCache[n]=o.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,o)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var i;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function Zb(t,e,n){if(!(e!=null&&e.length)||!n)return t;const o=t.filter(s=>!e.includes(s.id));return n==="remove"?o:[...e.map(s=>t.find(r=>r.id===s)).filter(Boolean),...o]}const Jb={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Ce("columnOrder",t)}),createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=I(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,o)=>i=>{let s=[];if(!(e!=null&&e.length))s=i;else{const r=[...e],a=[...i];for(;a.length&&r.length;){const c=r.shift(),d=a.findIndex(u=>u.id===c);d>-1&&s.push(a.splice(d,1)[0])}s=[...s,...a]}return Zb(s,n,o)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},Ei=0,Di=10,Vi=()=>({pageIndex:Ei,pageSize:Di}),Qb={getInitialState:t=>({...t,pagination:{...Vi(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:Ce("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var o,i;if(!e){t._queue(()=>{e=!0});return}if((o=(i=t.options.autoResetAll)!=null?i:t.options.autoResetPageIndex)!=null?o:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=o=>{const i=s=>rt(o,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=o=>{var i;t.setPagination(o?Vi():(i=t.initialState.pagination)!=null?i:Vi())},t.setPageIndex=o=>{t.setPagination(i=>{let s=rt(o,i.pageIndex);const r=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return s=Math.max(0,Math.min(s,r)),{...i,pageIndex:s}})},t.resetPageIndex=o=>{var i,s;t.setPageIndex(o?Ei:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:Ei)},t.resetPageSize=o=>{var i,s;t.setPageSize(o?Di:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:Di)},t.setPageSize=o=>{t.setPagination(i=>{const s=Math.max(1,rt(o,i.pageSize)),r=i.pageSize*i.pageIndex,a=Math.floor(r/s);return{...i,pageIndex:a,pageSize:s}})},t.setPageCount=o=>t.setPagination(i=>{var s;let r=rt(o,(s=t.options.pageCount)!=null?s:-1);return typeof r=="number"&&(r=Math.max(-1,r)),{...i,pageCount:r}}),t.getPageOptions=I(()=>[t.getPageCount()],o=>{let i=[];return o&&o>0&&(i=[...new Array(o)].fill(null).map((s,r)=>r)),i},{key:process.env.NODE_ENV==="development"&&"getPageOptions",debug:()=>{var o;return(o=t.options.debugAll)!=null?o:t.options.debugTable}}),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:o}=t.getState().pagination,i=t.getPageCount();return i===-1?!0:i===0?!1:o<i-1},t.previousPage=()=>t.setPageIndex(o=>o-1),t.nextPage=()=>t.setPageIndex(o=>o+1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var o;return(o=t.options.pageCount)!=null?o:Math.ceil(t.getPrePaginationRowModel().rows.length/t.getState().pagination.pageSize)}}},Ri=()=>({left:[],right:[]}),Fi=()=>({top:[],bottom:[]}),ey={getInitialState:t=>({columnPinning:Ri(),rowPinning:Fi(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Ce("columnPinning",t),onRowPinningChange:Ce("rowPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const o=t.getLeafColumns().map(i=>i.id).filter(Boolean);e.setColumnPinning(i=>{var s,r;if(n==="right"){var a,c;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(f=>!(o!=null&&o.includes(f))),right:[...((c=i==null?void 0:i.right)!=null?c:[]).filter(f=>!(o!=null&&o.includes(f))),...o]}}if(n==="left"){var d,u;return{left:[...((d=i==null?void 0:i.left)!=null?d:[]).filter(f=>!(o!=null&&o.includes(f))),...o],right:((u=i==null?void 0:i.right)!=null?u:[]).filter(f=>!(o!=null&&o.includes(f)))}}return{left:((s=i==null?void 0:i.left)!=null?s:[]).filter(f=>!(o!=null&&o.includes(f))),right:((r=i==null?void 0:i.right)!=null?r:[]).filter(f=>!(o!=null&&o.includes(f)))}})},t.getCanPin=()=>t.getLeafColumns().some(o=>{var i,s,r;return((i=o.columnDef.enablePinning)!=null?i:!0)&&((s=(r=e.options.enableColumnPinning)!=null?r:e.options.enablePinning)!=null?s:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(a=>a.id),{left:o,right:i}=e.getState().columnPinning,s=n.some(a=>o==null?void 0:o.includes(a)),r=n.some(a=>i==null?void 0:i.includes(a));return s?"left":r?"right":!1},t.getPinnedIndex=()=>{var n,o;const i=t.getIsPinned();return i?(n=(o=e.getState().columnPinning)==null||(o=o[i])==null?void 0:o.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.pin=(n,o,i)=>{const s=o?t.getLeafRows().map(c=>{let{id:d}=c;return d}):[],r=i?t.getParentRows().map(c=>{let{id:d}=c;return d}):[],a=new Set([...r,t.id,...s]);e.setRowPinning(c=>{var d,u;if(n==="bottom"){var f,p;return{top:((f=c==null?void 0:c.top)!=null?f:[]).filter(m=>!(a!=null&&a.has(m))),bottom:[...((p=c==null?void 0:c.bottom)!=null?p:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=c==null?void 0:c.top)!=null?h:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)],bottom:((g=c==null?void 0:c.bottom)!=null?g:[]).filter(m=>!(a!=null&&a.has(m)))}}return{top:((d=c==null?void 0:c.top)!=null?d:[]).filter(m=>!(a!=null&&a.has(m))),bottom:((u=c==null?void 0:c.bottom)!=null?u:[]).filter(m=>!(a!=null&&a.has(m)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:i}=e.options;return typeof o=="function"?o(t):(n=o??i)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:o,bottom:i}=e.getState().rowPinning,s=n.some(a=>o==null?void 0:o.includes(a)),r=n.some(a=>i==null?void 0:i.includes(a));return s?"top":r?"bottom":!1},t.getPinnedIndex=()=>{var n,o;const i=t.getIsPinned();if(!i)return-1;const s=(n=e._getPinnedRows(i))==null?void 0:n.map(r=>{let{id:a}=r;return a});return(o=s==null?void 0:s.indexOf(t.id))!=null?o:-1},t.getCenterVisibleCells=I(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,o,i)=>{const s=[...o??[],...i??[]];return n.filter(r=>!s.includes(r.column.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}}),t.getLeftVisibleCells=I(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,,],(n,o)=>(o??[]).map(s=>n.find(r=>r.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),{key:process.env.NODE_ENV==="development"&&"row.getLeftVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}}),t.getRightVisibleCells=I(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,o)=>(o??[]).map(s=>n.find(r=>r.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),{key:process.env.NODE_ENV==="development"&&"row.getRightVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,o;return t.setColumnPinning(e?Ri():(n=(o=t.initialState)==null?void 0:o.columnPinning)!=null?n:Ri())},t.getIsSomeColumnsPinned=e=>{var n;const o=t.getState().columnPinning;if(!e){var i,s;return!!((i=o.left)!=null&&i.length||(s=o.right)!=null&&s.length)}return!!((n=o[e])!=null&&n.length)},t.getLeftLeafColumns=I(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(o=>e.find(i=>i.id===o)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getLeftLeafColumns",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugColumns}}),t.getRightLeafColumns=I(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(o=>e.find(i=>i.id===o)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getRightLeafColumns",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugColumns}}),t.getCenterLeafColumns=I(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o)=>{const i=[...n??[],...o??[]];return e.filter(s=>!i.includes(s.id))},{key:process.env.NODE_ENV==="development"&&"getCenterLeafColumns",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugColumns}}),t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,o;return t.setRowPinning(e?Fi():(n=(o=t.initialState)==null?void 0:o.rowPinning)!=null?n:Fi())},t.getIsSomeRowsPinned=e=>{var n;const o=t.getState().rowPinning;if(!e){var i,s;return!!((i=o.top)!=null&&i.length||(s=o.bottom)!=null&&s.length)}return!!((n=o[e])!=null&&n.length)},t._getPinnedRows=e=>I(()=>[t.getRowModel().rows,t.getState().rowPinning[e]],(n,o)=>{var i;return((i=t.options.keepPinnedRows)==null||i?(o??[]).map(r=>{const a=t.getRow(r,!0);return a.getIsAllParentsExpanded()?a:null}):(o??[]).map(r=>n.find(a=>a.id===r))).filter(Boolean).map(r=>({...r,position:e}))},{key:process.env.NODE_ENV==="development"&&`row.get${e==="top"?"Top":"Bottom"}Rows`,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})(),t.getTopRows=()=>t._getPinnedRows("top"),t.getBottomRows=()=>t._getPinnedRows("bottom"),t.getCenterRows=I(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,o)=>{const i=new Set([...n??[],...o??[]]);return e.filter(s=>!i.has(s.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterRows",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugRows}})}},ty={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Ce("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const o={...n},i=t.getPreGroupedRowModel().flatRows;return e?i.forEach(s=>{s.getCanSelect()&&(o[s.id]=!0)}):i.forEach(s=>{delete o[s.id]}),o})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const o=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),i={...n};return t.getRowModel().rows.forEach(s=>{Bi(i,s.id,o,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=I(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?$i(t,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="development"&&"getSelectedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable}}),t.getFilteredSelectedRowModel=I(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?$i(t,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getFilteredSelectedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable}}),t.getGroupedSelectedRowModel=I(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?$i(t,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getGroupedSelectedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable}}),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let o=!!(e.length&&Object.keys(n).length);return o&&e.some(i=>i.getCanSelect()&&!n[i.id])&&(o=!1),o},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=t.getState();let o=!!e.length;return o&&e.some(i=>!n[i.id])&&(o=!1),o},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,o)=>{const i=t.getIsSelected();e.setRowSelection(s=>{var r;if(n=typeof n<"u"?n:!i,t.getCanSelect()&&i===n)return s;const a={...s};return Bi(a,t.id,n,(r=o==null?void 0:o.selectChildren)!=null?r:!0,e),a})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Pi(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return Ai(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return Ai(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return o=>{var i;n&&t.toggleSelected((i=o.target)==null?void 0:i.checked)}}}},Bi=(t,e,n,o,i)=>{var s;const r=i.getRow(e,!0);n?(r.getCanMultiSelect()||Object.keys(t).forEach(a=>delete t[a]),r.getCanSelect()&&(t[e]=!0)):delete t[e],o&&(s=r.subRows)!=null&&s.length&&r.getCanSelectSubRows()&&r.subRows.forEach(a=>Bi(t,a.id,n,o,i))};function $i(t,e){const n=t.getState().rowSelection,o=[],i={},s=function(r,a){return r.map(c=>{var d;const u=Pi(c,n);if(u&&(o.push(c),i[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:s(c.subRows)}),u)return c}).filter(Boolean)};return{rows:s(e.rows),flatRows:o,rowsById:i}}function Pi(t,e){var n;return(n=e[t.id])!=null?n:!1}function Ai(t,e,n){var o;if(!((o=t.subRows)!=null&&o.length))return!1;let i=!0,s=!1;return t.subRows.forEach(r=>{if(!(s&&!i)&&(r.getCanSelect()&&(Pi(r,e)?s=!0:i=!1),r.subRows&&r.subRows.length)){const a=Ai(r,e);a==="all"?s=!0:(a==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const Oi=/([0-9]+)/gm,ny=(t,e,n)=>da(lt(t.getValue(n)).toLowerCase(),lt(e.getValue(n)).toLowerCase()),oy=(t,e,n)=>da(lt(t.getValue(n)),lt(e.getValue(n))),iy=(t,e,n)=>Ni(lt(t.getValue(n)).toLowerCase(),lt(e.getValue(n)).toLowerCase()),sy=(t,e,n)=>Ni(lt(t.getValue(n)),lt(e.getValue(n))),ry=(t,e,n)=>{const o=t.getValue(n),i=e.getValue(n);return o>i?1:o<i?-1:0},ly=(t,e,n)=>Ni(t.getValue(n),e.getValue(n));function Ni(t,e){return t===e?0:t>e?1:-1}function lt(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function da(t,e){const n=t.split(Oi).filter(Boolean),o=e.split(Oi).filter(Boolean);for(;n.length&&o.length;){const i=n.shift(),s=o.shift(),r=parseInt(i,10),a=parseInt(s,10),c=[r,a].sort();if(isNaN(c[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(c[1]))return isNaN(r)?-1:1;if(r>a)return 1;if(a>r)return-1}return n.length-o.length}const pn={alphanumeric:ny,alphanumericCaseSensitive:oy,text:iy,textCaseSensitive:sy,datetime:ry,basic:ly},ua=[Yb,{getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Ce("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(o=>({...o,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,o;return(n=(o=e.getState().columnVisibility)==null?void 0:o[t.id])!=null?n:!0},t.getCanHide=()=>{var n,o;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((o=e.options.enableHiding)!=null?o:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=I(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),{key:process.env.NODE_ENV==="production"&&"row._getAllVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}}),t.getVisibleCells=I(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,o,i)=>[...n,...o,...i],{key:process.env.NODE_ENV==="development"&&"row.getVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})},createTable:t=>{const e=(n,o)=>I(()=>[o(),o().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),{key:n,debug:()=>{var i;return(i=t.options.debugAll)!=null?i:t.options.debugColumns}});t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var o;t.setColumnVisibility(n?{}:(o=t.initialState.columnVisibility)!=null?o:{})},t.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((i,s)=>({...i,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;t.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}},Jb,ey,Xb,{getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Ce("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const i of n){const s=i==null?void 0:i.getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]")return pn.datetime;if(typeof s=="string"&&(o=!0,s.split(Oi).length>1))return pn.alphanumeric}return o?pn.text:pn.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(t.id))=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,o;if(!t)throw new Error;return co(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(o=e.options.sortingFns)==null?void 0:o[t.columnDef.sortingFn])!=null?n:pn[t.columnDef.sortingFn]},t.toggleSorting=(n,o)=>{const i=t.getNextSortingOrder(),s=typeof n<"u"&&n!==null;e.setSorting(r=>{const a=r==null?void 0:r.find(h=>h.id===t.id),c=r==null?void 0:r.findIndex(h=>h.id===t.id);let d=[],u,f=s?n:i==="desc";if(r!=null&&r.length&&t.getCanMultiSort()&&o?a?u="toggle":u="add":r!=null&&r.length&&c!==r.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(s||i||(u="remove")),u==="add"){var p;d=[...r,{id:t.id,desc:f}],d.splice(0,d.length-((p=e.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else u==="toggle"?d=r.map(h=>h.id===t.id?{...h,desc:f}:h):u==="remove"?d=r.filter(h=>h.id!==t.id):d=[{id:t.id,desc:f}];return d})},t.getFirstSortDir=()=>{var n,o;return((n=(o=t.columnDef.sortDescFirst)!=null?o:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var o,i;const s=t.getFirstSortDir(),r=t.getIsSorted();return r?r!==s&&((o=e.options.enableSortingRemoval)==null||o)&&(!(n&&(i=e.options.enableMultiRemove)!=null)||i)?!1:r==="desc"?"asc":"desc":s},t.getCanSort=()=>{var n,o;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((o=e.options.enableSorting)!=null?o:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,o;return(n=(o=t.columnDef.enableMultiSort)!=null?o:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const o=(n=e.getState().sorting)==null?void 0:n.find(i=>i.id===t.id);return o?o.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,o;return(n=(o=e.getState().sorting)==null?void 0:o.findIndex(i=>i.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return o=>{n&&(o.persist==null||o.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(o):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,o;t.setSorting(e?[]:(n=(o=t.initialState)==null?void 0:o.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},Kb,qb,Qb,ty,Gb];function ay(t){var e;(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");let n={_features:ua};const o=n._features.reduce((u,f)=>Object.assign(u,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),i=u=>n.options.mergeOptions?n.options.mergeOptions(o,u):{...o,...u};let r={...{},...(e=t.initialState)!=null?e:{}};n._features.forEach(u=>{var f;r=(f=u.getInitialState==null?void 0:u.getInitialState(r))!=null?f:r});const a=[];let c=!1;const d={_features:ua,options:{...o,...t},initialState:r,_queue:u=>{a.push(u),c||(c=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();c=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const f=rt(u,n.options);n.options=i(f)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,f,p)=>{var h;return(h=n.options.getRowId==null?void 0:n.options.getRowId(u,f,p))!=null?h:`${p?[p.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(u,f)=>{const p=(f?n.getCoreRowModel():n.getRowModel()).rowsById[u];if(!p)throw process.env.NODE_ENV!=="production"?new Error(`getRow expected an ID, but got ${u}`):new Error;return p},_getDefaultColumnDef:I(()=>[n.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:p=>{const h=p.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:p=>{var h,g;return(h=(g=p.renderValue())==null||g.toString==null?void 0:g.toString())!=null?h:null},...n._features.reduce((p,h)=>Object.assign(p,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...u}},{debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:I(()=>[n._getColumnDefs()],u=>{const f=function(p,h,g){return g===void 0&&(g=0),p.map(m=>{const b=Wb(n,m,g,h),x=m;return b.columns=x.columns?f(x.columns,b,g+1):[],b})};return f(u)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:I(()=>[n.getAllColumns()],u=>u.flatMap(f=>f.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:I(()=>[n.getAllFlatColumns()],u=>u.reduce((f,p)=>(f[p.id]=p,f),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:I(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,f)=>{let p=u.flatMap(h=>h.getLeafColumns());return f(p)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>{const f=n._getAllFlatColumnsById()[u];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${u}' does not exist.`),f}};Object.assign(n,d);for(let u=0;u<n._features.length;u++){const f=n._features[u];f==null||f.createTable==null||f.createTable(n)}return n}function cy(t,e,n,o){const i=()=>{var r;return(r=s.getValue())!=null?r:t.options.renderFallbackValue},s={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(o),renderValue:i,getContext:I(()=>[t,n,e,s],(r,a,c,d)=>({table:r,column:a,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),{key:process.env.NODE_ENV==="development"&&"cell.getContext",debug:()=>t.options.debugAll})};return t._features.forEach(r=>{r.createCell==null||r.createCell(s,n,e,t)},{}),s}const Ii=(t,e,n,o,i,s,r)=>{let a={id:e,index:o,original:n,depth:i,parentId:r,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(a._valuesCache.hasOwnProperty(c))return a._valuesCache[c];const d=t.getColumn(c);if(d!=null&&d.accessorFn)return a._valuesCache[c]=d.accessorFn(a.original,o),a._valuesCache[c]},getUniqueValues:c=>{if(a._uniqueValuesCache.hasOwnProperty(c))return a._uniqueValuesCache[c];const d=t.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(a._uniqueValuesCache[c]=d.columnDef.getUniqueValues(a.original,o),a._uniqueValuesCache[c]):(a._uniqueValuesCache[c]=[a.getValue(c)],a._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=a.getValue(c))!=null?d:t.options.renderFallbackValue},subRows:s??[],getLeafRows:()=>jb(a.subRows,c=>c.subRows),getParentRow:()=>a.parentId?t.getRow(a.parentId,!0):void 0,getParentRows:()=>{let c=[],d=a;for(;;){const u=d.getParentRow();if(!u)break;c.push(u),d=u}return c.reverse()},getAllCells:I(()=>[t.getAllLeafColumns()],c=>c.map(d=>cy(t,a,d,d.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var c;return(c=t.options.debugAll)!=null?c:t.options.debugRows}}),_getAllCellsByColumnId:I(()=>[a.getAllCells()],c=>c.reduce((d,u)=>(d[u.column.id]=u,d),{}),{key:process.env.NODE_ENV==="production"&&"row.getAllCellsByColumnId",debug:()=>{var c;return(c=t.options.debugAll)!=null?c:t.options.debugRows}})};for(let c=0;c<t._features.length;c++){const d=t._features[c];d==null||d.createRow==null||d.createRow(a,t)}return a};function dy(){return t=>I(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(i,s,r){s===void 0&&(s=0);const a=[];for(let d=0;d<i.length;d++){const u=Ii(t,t._getRowId(i[d],d,r),i[d],d,s,void 0,r==null?void 0:r.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),t.options.getSubRows){var c;u.originalSubRows=t.options.getSubRows(i[d],d),(c=u.originalSubRows)!=null&&c.length&&(u.subRows=o(u.originalSubRows,s+1,u))}}return a};return n.rows=o(e),n},{key:process.env.NODE_ENV==="development"&&"getRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable},onChange:()=>{t._autoResetPageIndex()}})}function uy(t,e,n){return n.options.filterFromLeafRows?fy(t,e,n):hy(t,e,n)}function fy(t,e,n){var o;const i=[],s={},r=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(c,d){d===void 0&&(d=0);const u=[];for(let p=0;p<c.length;p++){var f;let h=c[p];const g=Ii(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(g.columnFilters=h.columnFilters,(f=h.subRows)!=null&&f.length&&d<r){if(g.subRows=a(h.subRows,d+1),h=g,e(h)&&!g.subRows.length){u.push(h),s[h.id]=h,i.push(h);continue}if(e(h)||g.subRows.length){u.push(h),s[h.id]=h,i.push(h);continue}}else h=g,e(h)&&(u.push(h),s[h.id]=h,i.push(h))}return u};return{rows:a(t),flatRows:i,rowsById:s}}function hy(t,e,n){var o;const i=[],s={},r=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(c,d){d===void 0&&(d=0);const u=[];for(let p=0;p<c.length;p++){let h=c[p];if(e(h)){var f;if((f=h.subRows)!=null&&f.length&&d<r){const m=Ii(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);m.subRows=a(h.subRows,d+1),h=m}u.push(h),i.push(h),s[h.id]=h}}return u};return{rows:a(t),flatRows:i,rowsById:s}}function py(){return t=>I(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,o)=>{if(!e.rows.length||!(n!=null&&n.length)&&!o){for(let p=0;p<e.flatRows.length;p++)e.flatRows[p].columnFilters={},e.flatRows[p].columnFiltersMeta={};return e}const i=[],s=[];(n??[]).forEach(p=>{var h;const g=t.getColumn(p.id);if(!g)return;const m=g.getFilterFn();if(!m){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${g.id}.`);return}i.push({id:p.id,filterFn:m,resolvedValue:(h=m.resolveFilterValue==null?void 0:m.resolveFilterValue(p.value))!=null?h:p.value})});const r=n.map(p=>p.id),a=t.getGlobalFilterFn(),c=t.getAllLeafColumns().filter(p=>p.getCanGlobalFilter());o&&a&&c.length&&(r.push("__global__"),c.forEach(p=>{var h;s.push({id:p.id,filterFn:a,resolvedValue:(h=a.resolveFilterValue==null?void 0:a.resolveFilterValue(o))!=null?h:o})}));let d,u;for(let p=0;p<e.flatRows.length;p++){const h=e.flatRows[p];if(h.columnFilters={},i.length)for(let g=0;g<i.length;g++){d=i[g];const m=d.id;h.columnFilters[m]=d.filterFn(h,m,d.resolvedValue,b=>{h.columnFiltersMeta[m]=b})}if(s.length){for(let g=0;g<s.length;g++){u=s[g];const m=u.id;if(u.filterFn(h,m,u.resolvedValue,b=>{h.columnFiltersMeta[m]=b})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const f=p=>{for(let h=0;h<r.length;h++)if(p.columnFilters[r[h]]===!1)return!1;return!0};return uy(e.rows,f,t)},{key:process.env.NODE_ENV==="development"&&"getFilteredRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable},onChange:()=>{t._autoResetPageIndex()}})}function gy(){return t=>I(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const o=t.getState().sorting,i=[],s=o.filter(c=>{var d;return(d=t.getColumn(c.id))==null?void 0:d.getCanSort()}),r={};s.forEach(c=>{const d=t.getColumn(c.id);d&&(r[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const a=c=>{const d=c.map(u=>({...u}));return d.sort((u,f)=>{for(let h=0;h<s.length;h+=1){var p;const g=s[h],m=r[g.id],b=(p=g==null?void 0:g.desc)!=null?p:!1;let x=0;if(m.sortUndefined){const y=u.getValue(g.id),w=f.getValue(g.id),S=y===void 0,_=w===void 0;(S||_)&&(x=S&&_?0:S?m.sortUndefined:-m.sortUndefined)}if(x===0&&(x=m.sortingFn(u,f,g.id)),x!==0)return b&&(x*=-1),m.invertSorting&&(x*=-1),x}return u.index-f.index}),d.forEach(u=>{var f;i.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),d};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},{key:process.env.NODE_ENV==="development"&&"getSortedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable},onChange:()=>{t._autoResetPageIndex()}})}function my(t){const e=[],n=o=>{var i;e.push(o),(i=o.subRows)!=null&&i.length&&o.getIsExpanded()&&o.subRows.forEach(n)};return t.rows.forEach(n),{rows:e,flatRows:t.flatRows,rowsById:t.rowsById}}function by(t){return e=>I(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(n,o)=>{if(!o.rows.length)return o;const{pageSize:i,pageIndex:s}=n;let{rows:r,flatRows:a,rowsById:c}=o;const d=i*s,u=d+i;r=r.slice(d,u);let f;e.options.paginateExpandedRows?f={rows:r,flatRows:a,rowsById:c}:f=my({rows:r,flatRows:a,rowsById:c}),f.flatRows=[];const p=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(p)};return f.rows.forEach(p),f},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable}})}/**
|
|
38
|
+
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function Jb(t,e,n,o){var s,i;const a={...t._getDefaultColumnDef(),...e},c=a.accessorKey;let d=(s=(i=a.id)!=null?i:c?c.replace(".","_"):void 0)!=null?s:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:c&&(c.includes(".")?u=p=>{let h=p;for(const m of c.split(".")){var g;h=(g=h)==null?void 0:g[m],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${m}" in deeply nested key "${c}" returned undefined.`)}return h}:u=p=>p[a.accessorKey]),!d)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(d)}`,accessorFn:u,parent:o,depth:n,columnDef:a,columns:[],getFlatColumns:L(()=>[!0],()=>{var p;return[f,...(p=f.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var p;return(p=t.options.debugAll)!=null?p:t.options.debugColumns}}),getLeafColumns:L(()=>[t._getOrderColumnsFn()],p=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(m=>m.getLeafColumns());return p(g)}return[f]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var p;return(p=t.options.debugAll)!=null?p:t.options.debugColumns}})};for(const p of t._features)p.createColumn==null||p.createColumn(f,t);return f}function da(t,e,n){var o;let i={id:(o=n.id)!=null?o:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const r=[],a=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(a),r.push(c)};return a(i),r},getContext:()=>({table:t,header:i,column:e})};return t._features.forEach(r=>{r.createHeader==null||r.createHeader(i,t)}),i}const Qb={createTable:t=>{t.getHeaderGroups=L(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,s)=>{var i,r;const a=(i=o==null?void 0:o.map(f=>n.find(p=>p.id===f)).filter(Boolean))!=null?i:[],c=(r=s==null?void 0:s.map(f=>n.find(p=>p.id===f)).filter(Boolean))!=null?r:[],d=n.filter(f=>!(o!=null&&o.includes(f.id))&&!(s!=null&&s.includes(f.id)));return yo(e,[...a,...d,...c],t)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterHeaderGroups=L(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,s)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(s!=null&&s.includes(i.id))),yo(e,n,t,"center")),{key:process.env.NODE_ENV==="development"&&"getCenterHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftHeaderGroups=L(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,o)=>{var s;const i=(s=o==null?void 0:o.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?s:[];return yo(e,i,t,"left")},{key:process.env.NODE_ENV==="development"&&"getLeftHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightHeaderGroups=L(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,o)=>{var s;const i=(s=o==null?void 0:o.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?s:[];return yo(e,i,t,"right")},{key:process.env.NODE_ENV==="development"&&"getRightHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getFooterGroups=L(()=>[t.getHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftFooterGroups=L(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getLeftFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterFooterGroups=L(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getCenterFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightFooterGroups=L(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getRightFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getFlatHeaders=L(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftFlatHeaders=L(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getLeftFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterFlatHeaders=L(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getCenterFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightFlatHeaders=L(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getRightFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterLeafHeaders=L(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:process.env.NODE_ENV==="development"&&"getCenterLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftLeafHeaders=L(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:process.env.NODE_ENV==="development"&&"getLeftLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightLeafHeaders=L(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:process.env.NODE_ENV==="development"&&"getRightLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeafHeaders=L(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,o)=>{var s,i,r,a,c,d;return[...(s=(i=e[0])==null?void 0:i.headers)!=null?s:[],...(r=(a=n[0])==null?void 0:a.headers)!=null?r:[],...(c=(d=o[0])==null?void 0:d.headers)!=null?c:[]].map(u=>u.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}})}};function yo(t,e,n,o){var s,i;let r=0;const a=function(p,h){h===void 0&&(h=1),r=Math.max(r,h),p.filter(g=>g.getIsVisible()).forEach(g=>{var m;(m=g.columns)!=null&&m.length&&a(g.columns,h+1)},0)};a(t);let c=[];const d=(p,h)=>{const g={depth:h,id:[o,`${h}`].filter(Boolean).join("_"),headers:[]},m=[];p.forEach(b=>{const y=[...m].reverse()[0],_=b.column.depth===g.depth;let w,S=!1;if(_&&b.column.parent?w=b.column.parent:(w=b.column,S=!0),y&&(y==null?void 0:y.column)===w)y.subHeaders.push(b);else{const x=da(n,w,{id:[o,h,w.id,b==null?void 0:b.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${m.filter(E=>E.column===w).length}`:void 0,depth:h,index:m.length});x.subHeaders.push(b),m.push(x)}g.headers.push(b),b.headerGroup=g}),c.push(g),h>0&&d(m,h-1)},u=e.map((p,h)=>da(n,p,{depth:r,index:h}));d(u,r-1),c.reverse();const f=p=>p.filter(g=>g.column.getIsVisible()).map(g=>{let m=0,b=0,y=[0];g.subHeaders&&g.subHeaders.length?(y=[],f(g.subHeaders).forEach(w=>{let{colSpan:S,rowSpan:x}=w;m+=S,y.push(x)})):m=1;const _=Math.min(...y);return b=b+_,g.colSpan=m,g.rowSpan=b,{colSpan:m,rowSpan:b}});return f((s=(i=c[0])==null?void 0:i.headers)!=null?s:[]),c}const _o={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Fs=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ey={getDefaultColumnDef:()=>_o,getInitialState:t=>({columnSizing:{},columnSizingInfo:Fs(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ce("columnSizing",t),onColumnSizingInfoChange:Ce("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,o,s;const i=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:_o.minSize,(o=i??t.columnDef.size)!=null?o:_o.size),(s=t.columnDef.maxSize)!=null?s:_o.maxSize)},t.getStart=n=>{const o=n?n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns(),s=o.findIndex(i=>i.id===t.id);if(s>0){const i=o[s-1];return i.getStart(n)+i.getSize()}return 0},t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:o,...s}=n;return s})},t.getCanResize=()=>{var n,o;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((o=e.options.enableColumnResizing)!=null?o:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const o=s=>{if(s.subHeaders.length)s.subHeaders.forEach(o);else{var i;n+=(i=s.column.getSize())!=null?i:0}};return o(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=()=>{const n=e.getColumn(t.column.id),o=n==null?void 0:n.getCanResize();return s=>{if(!n||!o||(s.persist==null||s.persist(),$s(s)&&s.touches&&s.touches.length>1))return;const i=t.getSize(),r=t?t.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[n.id,n.getSize()]],a=$s(s)?Math.round(s.touches[0].clientX):s.clientX,c={},d=(m,b)=>{typeof b=="number"&&(e.setColumnSizingInfo(y=>{var _,w;const S=e.options.columnResizeDirection==="rtl"?-1:1,x=(b-((_=y==null?void 0:y.startOffset)!=null?_:0))*S,E=Math.max(x/((w=y==null?void 0:y.startSize)!=null?w:0),-.999999);return y.columnSizingStart.forEach(v=>{let[R,P]=v;c[R]=Math.round(Math.max(P+P*E,0)*100)/100}),{...y,deltaOffset:x,deltaPercentage:E}}),(e.options.columnResizeMode==="onChange"||m==="end")&&e.setColumnSizing(y=>({...y,...c})))},u=m=>d("move",m),f=m=>{d("end",m),e.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p={moveHandler:m=>u(m.clientX),upHandler:m=>{document.removeEventListener("mousemove",p.moveHandler),document.removeEventListener("mouseup",p.upHandler),f(m.clientX)}},h={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),u(m.touches[0].clientX),!1),upHandler:m=>{var b;document.removeEventListener("touchmove",h.moveHandler),document.removeEventListener("touchend",h.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),f((b=m.touches[0])==null?void 0:b.clientX)}},g=ty()?{passive:!1}:!1;$s(s)?(document.addEventListener("touchmove",h.moveHandler,g),document.addEventListener("touchend",h.upHandler,g)):(document.addEventListener("mousemove",p.moveHandler,g),document.addEventListener("mouseup",p.upHandler,g)),e.setColumnSizingInfo(m=>({...m,startOffset:a,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Fs():(n=t.initialState.columnSizingInfo)!=null?n:Fs())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,s)=>o+s.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,s)=>o+s.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,s)=>o+s.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,s)=>o+s.getSize(),0))!=null?e:0}}};let xo=null;function ty(){if(typeof xo=="boolean")return xo;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return xo=t,xo}function $s(t){return t.type==="touchstart"}const ny={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Ce("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var o,s;if(!e){t._queue(()=>{e=!0});return}if((o=(s=t.options.autoResetAll)!=null?s:t.options.autoResetExpanded)!=null?o:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=o=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(o),t.toggleAllRowsExpanded=o=>{o??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=o=>{var s,i;t.setExpanded(o?{}:(s=(i=t.initialState)==null?void 0:i.expanded)!=null?s:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const o=t.getState().expanded;return o===!0||Object.values(o).some(Boolean)},t.getIsAllRowsExpanded=()=>{const o=t.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||t.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},t.getExpandedDepth=()=>{let o=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(i=>{const r=i.split(".");o=Math.max(o,r.length)}),o},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(o=>{var s;const i=o===!0?!0:!!(o!=null&&o[t.id]);let r={};if(o===!0?Object.keys(e.getRowModel().rowsById).forEach(a=>{r[a]=!0}):r=o,n=(s=n)!=null?s:!i,!i&&n)return{...r,[t.id]:!0};if(i&&!n){const{[t.id]:a,...c}=r;return c}return o})},t.getIsExpanded=()=>{var n;const o=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:o===!0||o!=null&&o[t.id])},t.getCanExpand=()=>{var n,o,s;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((o=e.options.enableExpanding)!=null?o:!0)&&!!((s=t.subRows)!=null&&s.length)},t.getIsAllParentsExpanded=()=>{let n=!0,o=t;for(;n&&o.parentId;)o=e.getRow(o.parentId,!0),n=o.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},ua=(t,e,n)=>{var o;const s=n.toLowerCase();return!!(!((o=t.getValue(e))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};ua.autoRemove=t=>Ve(t);const fa=(t,e,n)=>{var o;return!!(!((o=t.getValue(e))==null||(o=o.toString())==null)&&o.includes(n))};fa.autoRemove=t=>Ve(t);const ha=(t,e,n)=>{var o;return((o=t.getValue(e))==null||(o=o.toString())==null?void 0:o.toLowerCase())===(n==null?void 0:n.toLowerCase())};ha.autoRemove=t=>Ve(t);const pa=(t,e,n)=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(n)};pa.autoRemove=t=>Ve(t)||!(t!=null&&t.length);const ga=(t,e,n)=>!n.some(o=>{var s;return!((s=t.getValue(e))!=null&&s.includes(o))});ga.autoRemove=t=>Ve(t)||!(t!=null&&t.length);const ma=(t,e,n)=>n.some(o=>{var s;return(s=t.getValue(e))==null?void 0:s.includes(o)});ma.autoRemove=t=>Ve(t)||!(t!=null&&t.length);const ba=(t,e,n)=>t.getValue(e)===n;ba.autoRemove=t=>Ve(t);const ya=(t,e,n)=>t.getValue(e)==n;ya.autoRemove=t=>Ve(t);const Ps=(t,e,n)=>{let[o,s]=n;const i=t.getValue(e);return i>=o&&i<=s};Ps.resolveFilterValue=t=>{let[e,n]=t,o=typeof e!="number"?parseFloat(e):e,s=typeof n!="number"?parseFloat(n):n,i=e===null||Number.isNaN(o)?-1/0:o,r=n===null||Number.isNaN(s)?1/0:s;if(i>r){const a=i;i=r,r=a}return[i,r]},Ps.autoRemove=t=>Ve(t)||Ve(t[0])&&Ve(t[1]);const Je={includesString:ua,includesStringSensitive:fa,equalsString:ha,arrIncludes:pa,arrIncludesAll:ga,arrIncludesSome:ma,equals:ba,weakEquals:ya,inNumberRange:Ps};function Ve(t){return t==null||t===""}const oy={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],globalFilter:void 0,...t}),getDefaultOptions:t=>({onColumnFiltersChange:Ce("columnFilters",t),onGlobalFilterChange:Ce("globalFilter",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const o=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(t.id);return typeof o=="string"?Je.includesString:typeof o=="number"?Je.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Je.equals:Array.isArray(o)?Je.arrIncludes:Je.weakEquals},t.getFilterFn=()=>{var n,o;return bo(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(o=e.options.filterFns)==null?void 0:o[t.columnDef.filterFn])!=null?n:Je[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,o,s;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((o=e.options.enableColumnFilters)!=null?o:!0)&&((s=e.options.enableFilters)!=null?s:!0)&&!!t.accessorFn},t.getCanGlobalFilter=()=>{var n,o,s,i;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=e.options.enableGlobalFilter)!=null?o:!0)&&((s=e.options.enableFilters)!=null?s:!0)&&((i=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?i:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(o=>o.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,o;return(n=(o=e.getState().columnFilters)==null?void 0:o.findIndex(s=>s.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(o=>{const s=t.getFilterFn(),i=o==null?void 0:o.find(u=>u.id===t.id),r=ut(n,i?i.value:void 0);if(_a(s,r,t)){var a;return(a=o==null?void 0:o.filter(u=>u.id!==t.id))!=null?a:[]}const c={id:t.id,value:r};if(i){var d;return(d=o==null?void 0:o.map(u=>u.id===t.id?c:u))!=null?d:[]}return o!=null&&o.length?[...o,c]:[c]})},t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Je.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:o}=t.options;return bo(o)?o:o==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[o])!=null?e:Je[o]},t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),o=s=>{var i;return(i=ut(e,s))==null?void 0:i.filter(r=>{const a=n.find(c=>c.id===r.id);if(a){const c=a.getFilterFn();if(_a(c,r.value,a))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(o)},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)},t.resetColumnFilters=e=>{var n,o;t.setColumnFilters(e?[]:(n=(o=t.initialState)==null?void 0:o.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel()),t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}};function _a(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const As={sum:(t,e,n)=>n.reduce((o,s)=>{const i=s.getValue(t);return o+(typeof i=="number"?i:0)},0),min:(t,e,n)=>{let o;return n.forEach(s=>{const i=s.getValue(t);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(t,e,n)=>{let o;return n.forEach(s=>{const i=s.getValue(t);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(t,e,n)=>{let o,s;return n.forEach(i=>{const r=i.getValue(t);r!=null&&(o===void 0?r>=r&&(o=s=r):(o>r&&(o=r),s<r&&(s=r)))}),[o,s]},mean:(t,e)=>{let n=0,o=0;if(e.forEach(s=>{let i=s.getValue(t);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},median:(t,e)=>{if(!e.length)return;const n=e.map(i=>i.getValue(t));if(!Kb(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),s=n.sort((i,r)=>i-r);return n.length%2!==0?s[o]:(s[o-1]+s[o])/2},unique:(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),uniqueCount:(t,e)=>new Set(e.map(n=>n.getValue(t))).size,count:(t,e)=>e.length},sy={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Ce("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(o=>o!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,o,s,i;return(n=(o=(s=(i=t.columnDef.enableGrouping)!=null?i:!0)!=null?s:e.options.enableGrouping)!=null?o:!0)!=null?n:!!t.accessorFn},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(t.id);if(typeof o=="number")return As.sum;if(Object.prototype.toString.call(o)==="[object Date]")return As.extent},t.getAggregationFn=()=>{var n,o;if(!t)throw new Error;return bo(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(o=e.options.aggregationFns)==null?void 0:o[t.columnDef.aggregationFn])!=null?n:As[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,o;t.setGrouping(e?[]:(n=(o=t.initialState)==null?void 0:o.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const o=e.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(t._groupingValuesCache[n]=o.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,o)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var s;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function iy(t,e,n){if(!(e!=null&&e.length)||!n)return t;const o=t.filter(i=>!e.includes(i.id));return n==="remove"?o:[...e.map(i=>t.find(r=>r.id===i)).filter(Boolean),...o]}const ry={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Ce("columnOrder",t)}),createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=L(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,o)=>s=>{let i=[];if(!(e!=null&&e.length))i=s;else{const r=[...e],a=[...s];for(;a.length&&r.length;){const c=r.shift(),d=a.findIndex(u=>u.id===c);d>-1&&i.push(a.splice(d,1)[0])}i=[...i,...a]}return iy(i,n,o)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},Os=0,Ns=10,Is=()=>({pageIndex:Os,pageSize:Ns}),ly={getInitialState:t=>({...t,pagination:{...Is(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:Ce("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var o,s;if(!e){t._queue(()=>{e=!0});return}if((o=(s=t.options.autoResetAll)!=null?s:t.options.autoResetPageIndex)!=null?o:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=o=>{const s=i=>ut(o,i);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(s)},t.resetPagination=o=>{var s;t.setPagination(o?Is():(s=t.initialState.pagination)!=null?s:Is())},t.setPageIndex=o=>{t.setPagination(s=>{let i=ut(o,s.pageIndex);const r=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return i=Math.max(0,Math.min(i,r)),{...s,pageIndex:i}})},t.resetPageIndex=o=>{var s,i;t.setPageIndex(o?Os:(s=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:Os)},t.resetPageSize=o=>{var s,i;t.setPageSize(o?Ns:(s=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:Ns)},t.setPageSize=o=>{t.setPagination(s=>{const i=Math.max(1,ut(o,s.pageSize)),r=s.pageSize*s.pageIndex,a=Math.floor(r/i);return{...s,pageIndex:a,pageSize:i}})},t.setPageCount=o=>t.setPagination(s=>{var i;let r=ut(o,(i=t.options.pageCount)!=null?i:-1);return typeof r=="number"&&(r=Math.max(-1,r)),{...s,pageCount:r}}),t.getPageOptions=L(()=>[t.getPageCount()],o=>{let s=[];return o&&o>0&&(s=[...new Array(o)].fill(null).map((i,r)=>r)),s},{key:process.env.NODE_ENV==="development"&&"getPageOptions",debug:()=>{var o;return(o=t.options.debugAll)!=null?o:t.options.debugTable}}),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:o}=t.getState().pagination,s=t.getPageCount();return s===-1?!0:s===0?!1:o<s-1},t.previousPage=()=>t.setPageIndex(o=>o-1),t.nextPage=()=>t.setPageIndex(o=>o+1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var o;return(o=t.options.pageCount)!=null?o:Math.ceil(t.getPrePaginationRowModel().rows.length/t.getState().pagination.pageSize)}}},Ls=()=>({left:[],right:[]}),Ts=()=>({top:[],bottom:[]}),ay={getInitialState:t=>({columnPinning:Ls(),rowPinning:Ts(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Ce("columnPinning",t),onRowPinningChange:Ce("rowPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const o=t.getLeafColumns().map(s=>s.id).filter(Boolean);e.setColumnPinning(s=>{var i,r;if(n==="right"){var a,c;return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(f=>!(o!=null&&o.includes(f))),right:[...((c=s==null?void 0:s.right)!=null?c:[]).filter(f=>!(o!=null&&o.includes(f))),...o]}}if(n==="left"){var d,u;return{left:[...((d=s==null?void 0:s.left)!=null?d:[]).filter(f=>!(o!=null&&o.includes(f))),...o],right:((u=s==null?void 0:s.right)!=null?u:[]).filter(f=>!(o!=null&&o.includes(f)))}}return{left:((i=s==null?void 0:s.left)!=null?i:[]).filter(f=>!(o!=null&&o.includes(f))),right:((r=s==null?void 0:s.right)!=null?r:[]).filter(f=>!(o!=null&&o.includes(f)))}})},t.getCanPin=()=>t.getLeafColumns().some(o=>{var s,i,r;return((s=o.columnDef.enablePinning)!=null?s:!0)&&((i=(r=e.options.enableColumnPinning)!=null?r:e.options.enablePinning)!=null?i:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(a=>a.id),{left:o,right:s}=e.getState().columnPinning,i=n.some(a=>o==null?void 0:o.includes(a)),r=n.some(a=>s==null?void 0:s.includes(a));return i?"left":r?"right":!1},t.getPinnedIndex=()=>{var n,o;const s=t.getIsPinned();return s?(n=(o=e.getState().columnPinning)==null||(o=o[s])==null?void 0:o.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.pin=(n,o,s)=>{const i=o?t.getLeafRows().map(c=>{let{id:d}=c;return d}):[],r=s?t.getParentRows().map(c=>{let{id:d}=c;return d}):[],a=new Set([...r,t.id,...i]);e.setRowPinning(c=>{var d,u;if(n==="bottom"){var f,p;return{top:((f=c==null?void 0:c.top)!=null?f:[]).filter(m=>!(a!=null&&a.has(m))),bottom:[...((p=c==null?void 0:c.bottom)!=null?p:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=c==null?void 0:c.top)!=null?h:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)],bottom:((g=c==null?void 0:c.bottom)!=null?g:[]).filter(m=>!(a!=null&&a.has(m)))}}return{top:((d=c==null?void 0:c.top)!=null?d:[]).filter(m=>!(a!=null&&a.has(m))),bottom:((u=c==null?void 0:c.bottom)!=null?u:[]).filter(m=>!(a!=null&&a.has(m)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:s}=e.options;return typeof o=="function"?o(t):(n=o??s)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:o,bottom:s}=e.getState().rowPinning,i=n.some(a=>o==null?void 0:o.includes(a)),r=n.some(a=>s==null?void 0:s.includes(a));return i?"top":r?"bottom":!1},t.getPinnedIndex=()=>{var n,o;const s=t.getIsPinned();if(!s)return-1;const i=(n=e._getPinnedRows(s))==null?void 0:n.map(r=>{let{id:a}=r;return a});return(o=i==null?void 0:i.indexOf(t.id))!=null?o:-1},t.getCenterVisibleCells=L(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,o,s)=>{const i=[...o??[],...s??[]];return n.filter(r=>!i.includes(r.column.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}}),t.getLeftVisibleCells=L(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,,],(n,o)=>(o??[]).map(i=>n.find(r=>r.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),{key:process.env.NODE_ENV==="development"&&"row.getLeftVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}}),t.getRightVisibleCells=L(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(r=>r.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),{key:process.env.NODE_ENV==="development"&&"row.getRightVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,o;return t.setColumnPinning(e?Ls():(n=(o=t.initialState)==null?void 0:o.columnPinning)!=null?n:Ls())},t.getIsSomeColumnsPinned=e=>{var n;const o=t.getState().columnPinning;if(!e){var s,i;return!!((s=o.left)!=null&&s.length||(i=o.right)!=null&&i.length)}return!!((n=o[e])!=null&&n.length)},t.getLeftLeafColumns=L(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(o=>e.find(s=>s.id===o)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getLeftLeafColumns",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugColumns}}),t.getRightLeafColumns=L(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(o=>e.find(s=>s.id===o)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getRightLeafColumns",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugColumns}}),t.getCenterLeafColumns=L(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o)=>{const s=[...n??[],...o??[]];return e.filter(i=>!s.includes(i.id))},{key:process.env.NODE_ENV==="development"&&"getCenterLeafColumns",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugColumns}}),t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,o;return t.setRowPinning(e?Ts():(n=(o=t.initialState)==null?void 0:o.rowPinning)!=null?n:Ts())},t.getIsSomeRowsPinned=e=>{var n;const o=t.getState().rowPinning;if(!e){var s,i;return!!((s=o.top)!=null&&s.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[e])!=null&&n.length)},t._getPinnedRows=e=>L(()=>[t.getRowModel().rows,t.getState().rowPinning[e]],(n,o)=>{var s;return((s=t.options.keepPinnedRows)==null||s?(o??[]).map(r=>{const a=t.getRow(r,!0);return a.getIsAllParentsExpanded()?a:null}):(o??[]).map(r=>n.find(a=>a.id===r))).filter(Boolean).map(r=>({...r,position:e}))},{key:process.env.NODE_ENV==="development"&&`row.get${e==="top"?"Top":"Bottom"}Rows`,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})(),t.getTopRows=()=>t._getPinnedRows("top"),t.getBottomRows=()=>t._getPinnedRows("bottom"),t.getCenterRows=L(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,o)=>{const s=new Set([...n??[],...o??[]]);return e.filter(i=>!s.has(i.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterRows",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugRows}})}},cy={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Ce("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const o={...n},s=t.getPreGroupedRowModel().flatRows;return e?s.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):s.forEach(i=>{delete o[i.id]}),o})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const o=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),s={...n};return t.getRowModel().rows.forEach(i=>{zs(s,i.id,o,!0,t)}),s}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=L(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Hs(t,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="development"&&"getSelectedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable}}),t.getFilteredSelectedRowModel=L(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Hs(t,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getFilteredSelectedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable}}),t.getGroupedSelectedRowModel=L(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Hs(t,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getGroupedSelectedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable}}),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let o=!!(e.length&&Object.keys(n).length);return o&&e.some(s=>s.getCanSelect()&&!n[s.id])&&(o=!1),o},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=t.getState();let o=!!e.length;return o&&e.some(s=>!n[s.id])&&(o=!1),o},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,o)=>{const s=t.getIsSelected();e.setRowSelection(i=>{var r;if(n=typeof n<"u"?n:!s,t.getCanSelect()&&s===n)return i;const a={...i};return zs(a,t.id,n,(r=o==null?void 0:o.selectChildren)!=null?r:!0,e),a})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return js(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return Ws(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return Ws(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return o=>{var s;n&&t.toggleSelected((s=o.target)==null?void 0:s.checked)}}}},zs=(t,e,n,o,s)=>{var i;const r=s.getRow(e,!0);n?(r.getCanMultiSelect()||Object.keys(t).forEach(a=>delete t[a]),r.getCanSelect()&&(t[e]=!0)):delete t[e],o&&(i=r.subRows)!=null&&i.length&&r.getCanSelectSubRows()&&r.subRows.forEach(a=>zs(t,a.id,n,o,s))};function Hs(t,e){const n=t.getState().rowSelection,o=[],s={},i=function(r,a){return r.map(c=>{var d;const u=js(c,n);if(u&&(o.push(c),s[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:i(c.subRows)}),u)return c}).filter(Boolean)};return{rows:i(e.rows),flatRows:o,rowsById:s}}function js(t,e){var n;return(n=e[t.id])!=null?n:!1}function Ws(t,e,n){var o;if(!((o=t.subRows)!=null&&o.length))return!1;let s=!0,i=!1;return t.subRows.forEach(r=>{if(!(i&&!s)&&(r.getCanSelect()&&(js(r,e)?i=!0:s=!1),r.subRows&&r.subRows.length)){const a=Ws(r,e);a==="all"?i=!0:(a==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const Ys=/([0-9]+)/gm,dy=(t,e,n)=>xa(ft(t.getValue(n)).toLowerCase(),ft(e.getValue(n)).toLowerCase()),uy=(t,e,n)=>xa(ft(t.getValue(n)),ft(e.getValue(n))),fy=(t,e,n)=>Gs(ft(t.getValue(n)).toLowerCase(),ft(e.getValue(n)).toLowerCase()),hy=(t,e,n)=>Gs(ft(t.getValue(n)),ft(e.getValue(n))),py=(t,e,n)=>{const o=t.getValue(n),s=e.getValue(n);return o>s?1:o<s?-1:0},gy=(t,e,n)=>Gs(t.getValue(n),e.getValue(n));function Gs(t,e){return t===e?0:t>e?1:-1}function ft(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function xa(t,e){const n=t.split(Ys).filter(Boolean),o=e.split(Ys).filter(Boolean);for(;n.length&&o.length;){const s=n.shift(),i=o.shift(),r=parseInt(s,10),a=parseInt(i,10),c=[r,a].sort();if(isNaN(c[0])){if(s>i)return 1;if(i>s)return-1;continue}if(isNaN(c[1]))return isNaN(r)?-1:1;if(r>a)return 1;if(a>r)return-1}return n.length-o.length}const xn={alphanumeric:dy,alphanumericCaseSensitive:uy,text:fy,textCaseSensitive:hy,datetime:py,basic:gy},wa=[Qb,{getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Ce("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(o=>({...o,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,o;return(n=(o=e.getState().columnVisibility)==null?void 0:o[t.id])!=null?n:!0},t.getCanHide=()=>{var n,o;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((o=e.options.enableHiding)!=null?o:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=L(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),{key:process.env.NODE_ENV==="production"&&"row._getAllVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}}),t.getVisibleCells=L(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,o,s)=>[...n,...o,...s],{key:process.env.NODE_ENV==="development"&&"row.getVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})},createTable:t=>{const e=(n,o)=>L(()=>[o(),o().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),{key:n,debug:()=>{var s;return(s=t.options.debugAll)!=null?s:t.options.debugColumns}});t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var o;t.setColumnVisibility(n?{}:(o=t.initialState.columnVisibility)!=null?o:{})},t.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((s,i)=>({...s,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;t.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}},ry,ay,oy,{getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Ce("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const s of n){const i=s==null?void 0:s.getValue(t.id);if(Object.prototype.toString.call(i)==="[object Date]")return xn.datetime;if(typeof i=="string"&&(o=!0,i.split(Ys).length>1))return xn.alphanumeric}return o?xn.text:xn.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(t.id))=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,o;if(!t)throw new Error;return bo(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(o=e.options.sortingFns)==null?void 0:o[t.columnDef.sortingFn])!=null?n:xn[t.columnDef.sortingFn]},t.toggleSorting=(n,o)=>{const s=t.getNextSortingOrder(),i=typeof n<"u"&&n!==null;e.setSorting(r=>{const a=r==null?void 0:r.find(h=>h.id===t.id),c=r==null?void 0:r.findIndex(h=>h.id===t.id);let d=[],u,f=i?n:s==="desc";if(r!=null&&r.length&&t.getCanMultiSort()&&o?a?u="toggle":u="add":r!=null&&r.length&&c!==r.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||s||(u="remove")),u==="add"){var p;d=[...r,{id:t.id,desc:f}],d.splice(0,d.length-((p=e.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else u==="toggle"?d=r.map(h=>h.id===t.id?{...h,desc:f}:h):u==="remove"?d=r.filter(h=>h.id!==t.id):d=[{id:t.id,desc:f}];return d})},t.getFirstSortDir=()=>{var n,o;return((n=(o=t.columnDef.sortDescFirst)!=null?o:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var o,s;const i=t.getFirstSortDir(),r=t.getIsSorted();return r?r!==i&&((o=e.options.enableSortingRemoval)==null||o)&&(!(n&&(s=e.options.enableMultiRemove)!=null)||s)?!1:r==="desc"?"asc":"desc":i},t.getCanSort=()=>{var n,o;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((o=e.options.enableSorting)!=null?o:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,o;return(n=(o=t.columnDef.enableMultiSort)!=null?o:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const o=(n=e.getState().sorting)==null?void 0:n.find(s=>s.id===t.id);return o?o.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,o;return(n=(o=e.getState().sorting)==null?void 0:o.findIndex(s=>s.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return o=>{n&&(o.persist==null||o.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(o):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,o;t.setSorting(e?[]:(n=(o=t.initialState)==null?void 0:o.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},sy,ny,ly,cy,ey];function my(t){var e;(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");let n={_features:wa};const o=n._features.reduce((u,f)=>Object.assign(u,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),s=u=>n.options.mergeOptions?n.options.mergeOptions(o,u):{...o,...u};let r={...{},...(e=t.initialState)!=null?e:{}};n._features.forEach(u=>{var f;r=(f=u.getInitialState==null?void 0:u.getInitialState(r))!=null?f:r});const a=[];let c=!1;const d={_features:wa,options:{...o,...t},initialState:r,_queue:u=>{a.push(u),c||(c=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();c=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const f=ut(u,n.options);n.options=s(f)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,f,p)=>{var h;return(h=n.options.getRowId==null?void 0:n.options.getRowId(u,f,p))!=null?h:`${p?[p.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(u,f)=>{const p=(f?n.getCoreRowModel():n.getRowModel()).rowsById[u];if(!p)throw process.env.NODE_ENV!=="production"?new Error(`getRow expected an ID, but got ${u}`):new Error;return p},_getDefaultColumnDef:L(()=>[n.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:p=>{const h=p.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:p=>{var h,g;return(h=(g=p.renderValue())==null||g.toString==null?void 0:g.toString())!=null?h:null},...n._features.reduce((p,h)=>Object.assign(p,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...u}},{debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:L(()=>[n._getColumnDefs()],u=>{const f=function(p,h,g){return g===void 0&&(g=0),p.map(m=>{const b=Jb(n,m,g,h),y=m;return b.columns=y.columns?f(y.columns,b,g+1):[],b})};return f(u)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:L(()=>[n.getAllColumns()],u=>u.flatMap(f=>f.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:L(()=>[n.getAllFlatColumns()],u=>u.reduce((f,p)=>(f[p.id]=p,f),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:L(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,f)=>{let p=u.flatMap(h=>h.getLeafColumns());return f(p)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>{const f=n._getAllFlatColumnsById()[u];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${u}' does not exist.`),f}};Object.assign(n,d);for(let u=0;u<n._features.length;u++){const f=n._features[u];f==null||f.createTable==null||f.createTable(n)}return n}function by(t,e,n,o){const s=()=>{var r;return(r=i.getValue())!=null?r:t.options.renderFallbackValue},i={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(o),renderValue:s,getContext:L(()=>[t,n,e,i],(r,a,c,d)=>({table:r,column:a,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),{key:process.env.NODE_ENV==="development"&&"cell.getContext",debug:()=>t.options.debugAll})};return t._features.forEach(r=>{r.createCell==null||r.createCell(i,n,e,t)},{}),i}const Us=(t,e,n,o,s,i,r)=>{let a={id:e,index:o,original:n,depth:s,parentId:r,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(a._valuesCache.hasOwnProperty(c))return a._valuesCache[c];const d=t.getColumn(c);if(d!=null&&d.accessorFn)return a._valuesCache[c]=d.accessorFn(a.original,o),a._valuesCache[c]},getUniqueValues:c=>{if(a._uniqueValuesCache.hasOwnProperty(c))return a._uniqueValuesCache[c];const d=t.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(a._uniqueValuesCache[c]=d.columnDef.getUniqueValues(a.original,o),a._uniqueValuesCache[c]):(a._uniqueValuesCache[c]=[a.getValue(c)],a._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=a.getValue(c))!=null?d:t.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>Zb(a.subRows,c=>c.subRows),getParentRow:()=>a.parentId?t.getRow(a.parentId,!0):void 0,getParentRows:()=>{let c=[],d=a;for(;;){const u=d.getParentRow();if(!u)break;c.push(u),d=u}return c.reverse()},getAllCells:L(()=>[t.getAllLeafColumns()],c=>c.map(d=>by(t,a,d,d.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var c;return(c=t.options.debugAll)!=null?c:t.options.debugRows}}),_getAllCellsByColumnId:L(()=>[a.getAllCells()],c=>c.reduce((d,u)=>(d[u.column.id]=u,d),{}),{key:process.env.NODE_ENV==="production"&&"row.getAllCellsByColumnId",debug:()=>{var c;return(c=t.options.debugAll)!=null?c:t.options.debugRows}})};for(let c=0;c<t._features.length;c++){const d=t._features[c];d==null||d.createRow==null||d.createRow(a,t)}return a};function yy(){return t=>L(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(s,i,r){i===void 0&&(i=0);const a=[];for(let d=0;d<s.length;d++){const u=Us(t,t._getRowId(s[d],d,r),s[d],d,i,void 0,r==null?void 0:r.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),t.options.getSubRows){var c;u.originalSubRows=t.options.getSubRows(s[d],d),(c=u.originalSubRows)!=null&&c.length&&(u.subRows=o(u.originalSubRows,i+1,u))}}return a};return n.rows=o(e),n},{key:process.env.NODE_ENV==="development"&&"getRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable},onChange:()=>{t._autoResetPageIndex()}})}function _y(t,e,n){return n.options.filterFromLeafRows?xy(t,e,n):wy(t,e,n)}function xy(t,e,n){var o;const s=[],i={},r=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(c,d){d===void 0&&(d=0);const u=[];for(let p=0;p<c.length;p++){var f;let h=c[p];const g=Us(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(g.columnFilters=h.columnFilters,(f=h.subRows)!=null&&f.length&&d<r){if(g.subRows=a(h.subRows,d+1),h=g,e(h)&&!g.subRows.length){u.push(h),i[h.id]=h,s.push(h);continue}if(e(h)||g.subRows.length){u.push(h),i[h.id]=h,s.push(h);continue}}else h=g,e(h)&&(u.push(h),i[h.id]=h,s.push(h))}return u};return{rows:a(t),flatRows:s,rowsById:i}}function wy(t,e,n){var o;const s=[],i={},r=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(c,d){d===void 0&&(d=0);const u=[];for(let p=0;p<c.length;p++){let h=c[p];if(e(h)){var f;if((f=h.subRows)!=null&&f.length&&d<r){const m=Us(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);m.subRows=a(h.subRows,d+1),h=m}u.push(h),s.push(h),i[h.id]=h}}return u};return{rows:a(t),flatRows:s,rowsById:i}}function Cy(){return t=>L(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,o)=>{if(!e.rows.length||!(n!=null&&n.length)&&!o){for(let p=0;p<e.flatRows.length;p++)e.flatRows[p].columnFilters={},e.flatRows[p].columnFiltersMeta={};return e}const s=[],i=[];(n??[]).forEach(p=>{var h;const g=t.getColumn(p.id);if(!g)return;const m=g.getFilterFn();if(!m){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${g.id}.`);return}s.push({id:p.id,filterFn:m,resolvedValue:(h=m.resolveFilterValue==null?void 0:m.resolveFilterValue(p.value))!=null?h:p.value})});const r=n.map(p=>p.id),a=t.getGlobalFilterFn(),c=t.getAllLeafColumns().filter(p=>p.getCanGlobalFilter());o&&a&&c.length&&(r.push("__global__"),c.forEach(p=>{var h;i.push({id:p.id,filterFn:a,resolvedValue:(h=a.resolveFilterValue==null?void 0:a.resolveFilterValue(o))!=null?h:o})}));let d,u;for(let p=0;p<e.flatRows.length;p++){const h=e.flatRows[p];if(h.columnFilters={},s.length)for(let g=0;g<s.length;g++){d=s[g];const m=d.id;h.columnFilters[m]=d.filterFn(h,m,d.resolvedValue,b=>{h.columnFiltersMeta[m]=b})}if(i.length){for(let g=0;g<i.length;g++){u=i[g];const m=u.id;if(u.filterFn(h,m,u.resolvedValue,b=>{h.columnFiltersMeta[m]=b})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const f=p=>{for(let h=0;h<r.length;h++)if(p.columnFilters[r[h]]===!1)return!1;return!0};return _y(e.rows,f,t)},{key:process.env.NODE_ENV==="development"&&"getFilteredRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable},onChange:()=>{t._autoResetPageIndex()}})}function ky(){return t=>L(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const o=t.getState().sorting,s=[],i=o.filter(c=>{var d;return(d=t.getColumn(c.id))==null?void 0:d.getCanSort()}),r={};i.forEach(c=>{const d=t.getColumn(c.id);d&&(r[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const a=c=>{const d=c.map(u=>({...u}));return d.sort((u,f)=>{for(let h=0;h<i.length;h+=1){var p;const g=i[h],m=r[g.id],b=(p=g==null?void 0:g.desc)!=null?p:!1;let y=0;if(m.sortUndefined){const _=u.getValue(g.id),w=f.getValue(g.id),S=_===void 0,x=w===void 0;(S||x)&&(y=S&&x?0:S?m.sortUndefined:-m.sortUndefined)}if(y===0&&(y=m.sortingFn(u,f,g.id)),y!==0)return b&&(y*=-1),m.invertSorting&&(y*=-1),y}return u.index-f.index}),d.forEach(u=>{var f;s.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),d};return{rows:a(n.rows),flatRows:s,rowsById:n.rowsById}},{key:process.env.NODE_ENV==="development"&&"getSortedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable},onChange:()=>{t._autoResetPageIndex()}})}function Sy(t){const e=[],n=o=>{var s;e.push(o),(s=o.subRows)!=null&&s.length&&o.getIsExpanded()&&o.subRows.forEach(n)};return t.rows.forEach(n),{rows:e,flatRows:t.flatRows,rowsById:t.rowsById}}function vy(t){return e=>L(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(n,o)=>{if(!o.rows.length)return o;const{pageSize:s,pageIndex:i}=n;let{rows:r,flatRows:a,rowsById:c}=o;const d=s*i,u=d+s;r=r.slice(d,u);let f;e.options.paginateExpandedRows?f={rows:r,flatRows:a,rowsById:c}:f=Sy({rows:r,flatRows:a,rowsById:c}),f.flatRows=[];const p=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(p)};return f.rows.forEach(p),f},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable}})}/**
|
|
39
39
|
* vue-table
|
|
40
40
|
*
|
|
41
41
|
* Copyright (c) TanStack
|
|
@@ -44,4 +44,4 @@ var Hy=Object.defineProperty;var jy=(ie,l,Ue)=>l in ie?Hy(ie,l,{enumerable:!0,co
|
|
|
44
44
|
* LICENSE.md file in the root directory of this source tree.
|
|
45
45
|
*
|
|
46
46
|
* @license MIT
|
|
47
|
-
*/function po(){return!0}const yy=Symbol("merge-proxy"),_y={get(t,e,n){return e===yy?n:t.get(e)},has(t,e){return t.has(e)},set:po,deleteProperty:po,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:po,deleteProperty:po}},ownKeys(t){return t.keys()}};function Li(t){return"value"in t?t.value:t}function go(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Proxy({get(o){for(let i=e.length-1;i>=0;i--){const s=Li(e[i])[o];if(s!==void 0)return s}},has(o){for(let i=e.length-1;i>=0;i--)if(o in Li(e[i]))return!0;return!1},keys(){const o=[];for(let i=0;i<e.length;i++)o.push(...Object.keys(Li(e[i])));return[...Array.from(new Set(o))]}},_y)}const fa=l.defineComponent({props:["render","props"],setup:t=>()=>typeof t.render=="function"||typeof t.render=="object"?l.h(t.render,t.props):t.render});function xy(t){const e=go({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions(i,s){return go(i,s)}},t),n=ay(e),o=l.ref(n.initialState);return l.watchEffect(()=>{n.setOptions(i=>{var s;const r=new Proxy({},{get:(a,c)=>o.value[c]});return go(i,t,{state:go(r,(s=t.state)!=null?s:{}),onStateChange:a=>{a instanceof Function?o.value=a(o.value):o.value=a,t.onStateChange==null||t.onStateChange(a)}})})}),n}const wy=["checked","disabled","indeterminate"],Cy=l.defineComponent({__name:"FmTableCheckbox",props:{checked:{type:Boolean},disabled:{type:Boolean},indeterminate:{type:Boolean},onChange:{type:Function}},setup(t){const e=t,n=l.computed(()=>e.indeterminate&&!e.checked?"remove":e.checked?"check_small":"");return(o,i)=>(l.openBlock(),l.createElementBlock("div",{class:"fm-checkbox__input--container",onClick:i[0]||(i[0]=(...s)=>o.onChange&&o.onChange(...s))},[l.createElementVNode("input",{class:l.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":o.checked}),type:"checkbox",checked:o.checked,disabled:o.disabled,indeterminate:o.indeterminate},null,10,wy),o.indeterminate||o.checked?(l.openBlock(),l.createBlock(L,{key:0,class:"fm-checkbox__input--checkmark",name:n.value,size:"md",color:"#FFFFFF"},null,8,["name"])):l.createCommentVNode("",!0)]))}}),B_="",ha=Q(Cy,[["__scopeId","data-v-2508b8c4"]]),ky={class:"bg-fm-color-neutral-white flex flex-col max-h-[264px] overflow-y-auto px-4 py-12 rounded-md shadow-light-300 w-[75px]"},pa=l.defineComponent({__name:"FmTableSelection",props:{modelValue:{},items:{}},emits:["update:modelValue"],setup(t){const n=de(t,"modelValue"),o=l.ref(!1);return(i,s)=>(l.openBlock(),l.createBlock(Kl,{onMenuChanged:s[0]||(s[0]=r=>o.value=r)},{"menu-button":l.withCtx(()=>{var r;return[l.createVNode(fe,{variant:"secondary",label:(r=i.items.find(a=>a.value===i.modelValue))==null?void 0:r.label,size:"md",icon:o.value?"expand_less":"expand_more","icon-position":"append"},null,8,["label","icon"])]}),"menu-wrapper":l.withCtx(()=>[l.createElementVNode("div",ky,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.items,r=>(l.openBlock(),l.createBlock(Ee,{key:r.value,"model-value":r.value===l.unref(n),label:r.label,value:r.value,"onUpdate:modelValue":a=>n.value=r.value},null,8,["model-value","label","value","onUpdate:modelValue"]))),128))])]),_:1}))}}),Sy={class:"flex flex-col"},vy={class:"h-full overflow-auto"},My={class:"w-full"},Ey=["colSpan","onClick"],Dy={class:"flex gap-8 items-center justify-between"},Vy={class:"fm-typo-body-lg-400 line-clamp-2 w-full"},Ry={className:"h-72 flex items-center justify-between px-24 shrink-0"},Fy={class:"flex gap-24 items-center justify-between"},By={class:"flex gap-8 items-center"},$y=l.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-primary"}," Items per page: ",-1),Py={class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"},Ay={class:"flex gap-8 items-center"},Oy={class:"fm-typo-body-lg-400 text-fm-color-typo-primary"},Ny=l.defineComponent({__name:"FmTable",props:{modelValue:{default:{}},selection:{default:void 0},rowData:{default:()=>[]},columnDefs:{default:()=>[]},searchValue:{default:""},pageCount:{default:0},fetchFn:{type:Function,default:void 0},pageSize:{default:10},pinHeaderRow:{type:Boolean,default:!0}},setup(t){const e=t,n=de(e,"modelValue"),o=de(e,"searchValue"),i=l.computed(()=>{const c=[...e.columnDefs];return e.selection&&c.unshift({id:"row-selection",header:({table:d})=>l.createVNode(ha,{checked:d.getIsAllPageRowsSelected(),indeterminate:d.getIsSomePageRowsSelected(),onChange:d.getToggleAllPageRowsSelectedHandler()},null),cell:({row:d})=>l.createVNode(ha,{checked:d.getIsSelected(),disabled:!d.getCanSelect(),onChange:d.getToggleSelectedHandler()},null),enableResizing:!1,meta:{headerClass:"py-4 pl-4 pr-16",cellClass:"py-16 pl-4 pr-16",width:"60px"}}),c}),s=l.ref([]),r=l.ref({pageIndex:0,pageSize:e.pageSize}),a=xy({enableRowSelection:!!e.selection,enableMultiRowSelection:e.selection==="multiple",columns:i.value,get data(){return e.rowData},state:{get pagination(){return typeof e.fetchFn=="function"?r.value:void 0},get globalFilter(){return o.value},get rowSelection(){return n.value},get sorting(){return s.value}},getCoreRowModel:dy(),getSortedRowModel:gy(),getFilteredRowModel:py(),getPaginationRowModel:by(),onRowSelectionChange:c=>n.value=typeof c=="function"?c(n.value):c,onSortingChange:c=>{s.value=typeof c=="function"?c(s.value):c},onGlobalFilterChange:c=>{o.value=typeof c=="function"?c(o.value):c},manualPagination:typeof e.fetchFn=="function",...typeof e.fetchFn=="function"&&{onPaginationChange:c=>r.value=typeof c=="function"?c(r.value):c},pageCount:typeof e.fetchFn=="function"?e.pageCount:void 0});return l.watch(()=>r.value,c=>{e.fetchFn&&e.fetchFn(c)}),l.watch(()=>e.rowData,()=>{a.setOptions(c=>({...c,data:e.rowData}))}),l.watch(()=>e.pageCount,()=>{a.setOptions(c=>({...c,pageCount:e.pageCount}))}),l.watch(()=>e.pageSize,()=>{a.setPageSize(e.pageSize)}),l.onMounted(()=>{e.fetchFn&&e.fetchFn(a.getState().pagination),a.setPageSize(e.pageSize)}),(c,d)=>(l.openBlock(),l.createElementBlock("div",Sy,[l.createElementVNode("div",vy,[l.createElementVNode("table",My,[l.createElementVNode("thead",{class:l.normalizeClass({"bg-fm-color-neutral-white sticky top-0 z-[1]":c.pinHeaderRow})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(a).getHeaderGroups(),u=>(l.openBlock(),l.createElementBlock("tr",{key:u.id},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.headers,f=>{var p,h,g,m;return l.openBlock(),l.createElementBlock("th",{key:f.id,colSpan:f.colSpan,class:l.normalizeClass(["fm-typo-body-lg-700 text-fm-color-typo-secondary border-b border-fm-color-neutral-gray-100 h-24 hover:bg-fm-color-opacity-sm",f.column.getCanSort()?"cursor-pointer select-none":"",((p=f.column.columnDef.meta)==null?void 0:p.headerClass)??"px-16 py-12"]),style:l.normalizeStyle({width:`${(h=f.column.columnDef.meta)==null?void 0:h.width}`,maxWidth:(g=f.column.columnDef.meta)==null?void 0:g.maxWidth,textAlign:((m=f.column.columnDef.meta)==null?void 0:m.textAlign)??"left"}),onClick:b=>{var x;return(x=f.column.getToggleSortingHandler())==null?void 0:x(b)}},[l.createElementVNode("div",Dy,[f.isPlaceholder?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(fa),{key:0,render:f.column.columnDef.header,props:f.getContext()},null,8,["render","props"])),f.column.getCanSort()?(l.openBlock(),l.createBlock(L,{key:1,color:"neutral-gray-400",name:{asc:"arrow_upward",desc:"arrow_downward"}[f.column.getIsSorted()]??"unfold_more"},null,8,["name"])):l.createCommentVNode("",!0)])],14,Ey)}),128))]))),128))],2),l.createElementVNode("tbody",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(a).getRowModel().rows,u=>(l.openBlock(),l.createElementBlock("tr",{key:u.id,class:l.normalizeClass(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm",{"bg-fm-color-neutral-gray-100":u.getIsSelected()}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.getVisibleCells(),f=>{var p,h,g,m;return l.openBlock(),l.createElementBlock("td",{key:f.id,class:l.normalizeClass(["h-48 px-16 py-12 text-fm-color-typo-primary",((p=f.column.columnDef.meta)==null?void 0:p.cellClass)??"px-16 py-12"]),style:l.normalizeStyle({width:(h=f.column.columnDef.meta)==null?void 0:h.width,maxWidth:(g=f.column.columnDef.meta)==null?void 0:g.maxWidth,textAlign:((m=f.column.columnDef.meta)==null?void 0:m.textAlign)??"left"})},[l.createElementVNode("span",Vy,[l.createVNode(l.unref(fa),{render:f.column.columnDef.cell,props:f.getContext()},null,8,["render","props"])])],6)}),128))],2))),128))])])]),l.createElementVNode("div",Ry,[l.createElementVNode("div",Fy,[l.createElementVNode("div",By,[$y,l.createVNode(pa,{"model-value":l.unref(a).getState().pagination.pageSize,items:[...Array.from(Array(5),(u,f)=>(f+1)*10).map(u=>({label:u.toString(),value:u})),{label:"All",value:e.rowData.length}],"onUpdate:modelValue":d[0]||(d[0]=u=>l.unref(a).setPageSize(u))},null,8,["model-value","items"])]),l.createElementVNode("span",Py,l.toDisplayString(e.rowData.length<l.unref(a).getState().pagination.pageSize?e.rowData.length:l.unref(a).getState().pagination.pageIndex*l.unref(a).getState().pagination.pageSize+1)+" - "+l.toDisplayString((l.unref(a).getState().pagination.pageIndex+1)*l.unref(a).getState().pagination.pageSize)+" of "+l.toDisplayString(e.rowData.length)+" items ",1)]),l.createElementVNode("div",Ay,[l.createVNode(pa,{"model-value":l.unref(a).getState().pagination.pageIndex+1,items:Array.from(Array(l.unref(a).getPageCount()),(u,f)=>f+1).map(u=>({label:u.toString(),value:u})),"onUpdate:modelValue":d[1]||(d[1]=u=>l.unref(a).setPageIndex(u?u-1:0))},null,8,["model-value","items"]),l.createElementVNode("span",Oy," of "+l.toDisplayString(l.unref(a).getPageCount())+" pages ",1),l.createVNode(fe,{disabled:!l.unref(a).getCanPreviousPage(),icon:"chevron_left",variant:"tertiary","icon-color":"neutral-black",onClick:d[2]||(d[2]=()=>l.unref(a).previousPage())},null,8,["disabled"]),l.createVNode(fe,{disabled:!l.unref(a).getCanNextPage(),icon:"chevron_right",variant:"tertiary","icon-color":"neutral-black",onClick:d[3]||(d[3]=()=>l.unref(a).nextPage())},null,8,["disabled"])])])]))}}),Iy=l.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"}," More ",-1),Ly={class:"max-w-[360px] min-w-[186px]"},ga={FmBadge:yn,FmBreadcrumb:Ba,FmButton:fe,FmButtonGroup:Xa,FmCard:Ja,FmCardActions:Qa,FmCardSection:ec,FmCardTitle:Gi,FmChip:Ui,FmChipGroup:qi,FmDialog:ic,FmDropField:ac,FmDynamicDialog:ts,FmLineChart:Vp,FmCheckbox:wl,FmDatePicker:jg,FmDateRangePicker:bm,FmField:it,FmForm:ym,FmFormGroup:We,FmHelperText:jl,FmLabel:Yl,FmRadio:Mm,FmRadioGroup:Em,FmSelect:Fm,FmStepperField:Am,FmSwitch:Gm,FmTextField:qm,FmTextarea:Zm,FmTimeInput:Xl,FmTimePicker:db,FmIcon:L,FmList:fb,FmListItem:pb,FmMenu:Kl,FmMenuDeprecated:we,FmMenuDivider:bb,FmMenuHeader:_b,FmMenuItem:Ee,FmProgressIndicator:Zl,FmSnackbar:Mb,FmSpacer:Xi,FmStep:Fb,FmStepper:Pb,FmTab:Ql,FmTable:Ny,FmTabs:l.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(t,{emit:e}){const n=t,o=e,i=l.ref(!1),s=l.computed(()=>({vertical:n.vertical,disabled:n.disabled})),r=l.computed(()=>n.items.slice(0,n.showMoreAt)),a=l.computed(()=>n.items.slice(n.showMoreAt)),c=d=>{i.value=!1,o("update:modelValue",d)};return(d,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex",d.vertical?"flex-col":"flex-row items-center"])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,f=>l.renderSlot(d.$slots,"default",l.normalizeProps(l.guardReactiveProps({...f,tabsProps:s.value})),()=>[l.createVNode(Ql,l.mergeProps({"model-value":n.modelValue},{children:f.children,label:f.label,icon:f.icon,disabled:f.disabled,badge:f.badge,value:f.value,tabsProps:s.value},{disabled:f.disabled===void 0?d.disabled:f.disabled,vertical:d.vertical,"onUpdate:modelValue":u[0]||(u[0]=p=>o("update:modelValue",p))}),null,16,["model-value","disabled","vertical"])])),256)),a.value.length>0?(l.openBlock(),l.createBlock(we,{key:0,"show-menu":i.value,class:l.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":d.vertical}]),placement:d.vertical?"right-start":"bottom-start",onDropdownChanged:u[1]||(u[1]=f=>i.value=f)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["flex gap-8 hover:bg-fm-color-opacity-sm items-center px-16 rounded-sm",[d.vertical?"h-40":"h-[46px]"]])},[l.createVNode(L,{name:"more_vert"}),Iy],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Ly,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,f=>l.renderSlot(d.$slots,"list-item",l.normalizeProps(l.guardReactiveProps(f)),()=>[l.createVNode(Ee,{"model-value":n.modelValue===f.value,label:f.label,icon:f.icon,disabled:f.disabled,onClick:p=>c(f.value)},{append:l.withCtx(()=>[f.badge?(l.openBlock(),l.createBlock(yn,{key:0,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):l.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])])),256))])]),_:3},8,["show-menu","class","placement"])):l.createCommentVNode("",!0)],2))}}),FmTooltip:Wl};function Ty(){const t=l.inject(Qi);if(!t)throw new Error("No provider");return t}const zy=t=>{t.use(va,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),t.use(fc),Object.entries(ga).forEach(([e,n])=>{t.component(e,n)})};ie.components=ga,ie.uiPlugin=zy,ie.useDialog=Ty,ie.useFormChild=Ul,ie.useValidation=Gl,Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"})});
|
|
47
|
+
*/function wo(){return!0}const My=Symbol("merge-proxy"),Dy={get(t,e,n){return e===My?n:t.get(e)},has(t,e){return t.has(e)},set:wo,deleteProperty:wo,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:wo,deleteProperty:wo}},ownKeys(t){return t.keys()}};function qs(t){return"value"in t?t.value:t}function Co(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Proxy({get(o){for(let s=e.length-1;s>=0;s--){const i=qs(e[s])[o];if(i!==void 0)return i}},has(o){for(let s=e.length-1;s>=0;s--)if(o in qs(e[s]))return!0;return!1},keys(){const o=[];for(let s=0;s<e.length;s++)o.push(...Object.keys(qs(e[s])));return[...Array.from(new Set(o))]}},Dy)}const Ca=l.defineComponent({props:["render","props"],setup:t=>()=>typeof t.render=="function"||typeof t.render=="object"?l.h(t.render,t.props):t.render});function Ey(t){const e=Co({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions(s,i){return Co(s,i)}},t),n=my(e),o=l.ref(n.initialState);return l.watchEffect(()=>{n.setOptions(s=>{var i;const r=new Proxy({},{get:(a,c)=>o.value[c]});return Co(s,t,{state:Co(r,(i=t.state)!=null?i:{}),onStateChange:a=>{a instanceof Function?o.value=a(o.value):o.value=a,t.onStateChange==null||t.onStateChange(a)}})})}),n}const Vy=["checked","disabled","indeterminate"],Ry=l.defineComponent({__name:"FmTableCheckbox",props:{checked:{type:Boolean},disabled:{type:Boolean},indeterminate:{type:Boolean},onChange:{type:Function}},setup(t){const e=t,n=l.computed(()=>e.indeterminate&&!e.checked?"remove":e.checked?"check_small":"");return(o,s)=>(l.openBlock(),l.createElementBlock("div",{class:"fm-checkbox__input--container",onClick:s[0]||(s[0]=(...i)=>o.onChange&&o.onChange(...i))},[l.createElementVNode("input",{class:l.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":o.checked}),type:"checkbox",checked:o.checked,disabled:o.disabled,indeterminate:o.indeterminate},null,10,Vy),o.indeterminate||o.checked?(l.openBlock(),l.createBlock(H,{key:0,class:"fm-checkbox__input--checkmark",name:n.value,size:"md",color:"#FFFFFF"},null,8,["name"])):l.createCommentVNode("",!0)]))}}),H_="",ka=te(Ry,[["__scopeId","data-v-2508b8c4"]]),By={class:"bg-fm-color-neutral-white flex flex-col max-h-[264px] overflow-y-auto px-4 py-12 rounded-md shadow-light-300 w-[75px]"},Sa=l.defineComponent({__name:"FmTableSelection",props:{modelValue:{},items:{}},emits:["update:modelValue"],setup(t){const n=pe(t,"modelValue"),o=l.ref(!1);return(s,i)=>(l.openBlock(),l.createBlock(Vs,{onMenuChanged:i[0]||(i[0]=r=>o.value=r)},{"menu-button":l.withCtx(()=>{var r;return[l.createVNode(ge,{variant:"secondary",label:(r=s.items.find(a=>a.value===s.modelValue))==null?void 0:r.label,size:"md",icon:o.value?"expand_less":"expand_more","icon-position":"append"},null,8,["label","icon"])]}),"menu-wrapper":l.withCtx(()=>[l.createElementVNode("div",By,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.items,r=>(l.openBlock(),l.createBlock(Ke,{key:r.value,"model-value":r.value===l.unref(n),label:r.label,value:r.value,"onUpdate:modelValue":a=>n.value=r.value},null,8,["model-value","label","value","onUpdate:modelValue"]))),128))])]),_:1}))}}),Fy={class:"flex flex-col"},$y={class:"h-full overflow-auto"},Py={class:"w-full"},Ay=["colSpan","onClick"],Oy={class:"flex gap-8 items-center justify-between"},Ny={class:"fm-typo-body-lg-400 line-clamp-2 w-full"},Iy={className:"h-72 flex items-center justify-between px-24 shrink-0"},Ly={class:"flex gap-24 items-center justify-between"},Ty={class:"flex gap-8 items-center"},zy=l.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-primary"}," Items per page: ",-1),Hy={class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"},jy={class:"flex gap-8 items-center"},Wy={class:"fm-typo-body-lg-400 text-fm-color-typo-primary"},Yy=l.defineComponent({__name:"FmTable",props:{modelValue:{default:{}},selection:{default:void 0},rowData:{default:()=>[]},columnDefs:{default:()=>[]},searchValue:{default:""},pageCount:{default:0},fetchFn:{type:Function,default:void 0},pageSize:{default:10},pinHeaderRow:{type:Boolean,default:!0}},setup(t){const e=t,n=pe(e,"modelValue"),o=pe(e,"searchValue"),s=l.computed(()=>{const c=[...e.columnDefs];return e.selection&&c.unshift({id:"row-selection",header:({table:d})=>l.createVNode(ka,{checked:d.getIsAllPageRowsSelected(),indeterminate:d.getIsSomePageRowsSelected(),onChange:d.getToggleAllPageRowsSelectedHandler()},null),cell:({row:d})=>l.createVNode(ka,{checked:d.getIsSelected(),disabled:!d.getCanSelect(),onChange:d.getToggleSelectedHandler()},null),enableResizing:!1,meta:{headerClass:"py-4 pl-4 pr-16",cellClass:"py-16 pl-4 pr-16",width:"60px"}}),c}),i=l.ref([]),r=l.ref({pageIndex:0,pageSize:e.pageSize}),a=Ey({enableRowSelection:!!e.selection,enableMultiRowSelection:e.selection==="multiple",columns:s.value,get data(){return e.rowData},state:{get pagination(){return typeof e.fetchFn=="function"?r.value:void 0},get globalFilter(){return o.value},get rowSelection(){return n.value},get sorting(){return i.value}},getCoreRowModel:yy(),getSortedRowModel:ky(),getFilteredRowModel:Cy(),getPaginationRowModel:vy(),onRowSelectionChange:c=>n.value=typeof c=="function"?c(n.value):c,onSortingChange:c=>{i.value=typeof c=="function"?c(i.value):c},onGlobalFilterChange:c=>{o.value=typeof c=="function"?c(o.value):c},manualPagination:typeof e.fetchFn=="function",...typeof e.fetchFn=="function"&&{onPaginationChange:c=>r.value=typeof c=="function"?c(r.value):c},pageCount:typeof e.fetchFn=="function"?e.pageCount:void 0});return l.watch(()=>r.value,c=>{e.fetchFn&&e.fetchFn(c)}),l.watch(()=>e.rowData,()=>{a.setOptions(c=>({...c,data:e.rowData}))}),l.watch(()=>e.pageCount,()=>{a.setOptions(c=>({...c,pageCount:e.pageCount}))}),l.watch(()=>e.pageSize,()=>{a.setPageSize(e.pageSize)}),l.onMounted(()=>{e.fetchFn&&e.fetchFn(a.getState().pagination),a.setPageSize(e.pageSize)}),(c,d)=>(l.openBlock(),l.createElementBlock("div",Fy,[l.createElementVNode("div",$y,[l.createElementVNode("table",Py,[l.createElementVNode("thead",{class:l.normalizeClass({"bg-fm-color-neutral-white sticky top-0 z-[1]":c.pinHeaderRow})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(a).getHeaderGroups(),u=>(l.openBlock(),l.createElementBlock("tr",{key:u.id},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.headers,f=>{var p,h,g,m;return l.openBlock(),l.createElementBlock("th",{key:f.id,colSpan:f.colSpan,class:l.normalizeClass(["fm-typo-body-lg-700 text-fm-color-typo-secondary border-b border-fm-color-neutral-gray-100 h-24 hover:bg-fm-color-opacity-sm",f.column.getCanSort()?"cursor-pointer select-none":"",((p=f.column.columnDef.meta)==null?void 0:p.headerClass)??"px-16 py-12"]),style:l.normalizeStyle({width:`${(h=f.column.columnDef.meta)==null?void 0:h.width}`,maxWidth:(g=f.column.columnDef.meta)==null?void 0:g.maxWidth,textAlign:((m=f.column.columnDef.meta)==null?void 0:m.textAlign)??"left"}),onClick:b=>{var y;return(y=f.column.getToggleSortingHandler())==null?void 0:y(b)}},[l.createElementVNode("div",Oy,[f.isPlaceholder?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ca),{key:0,render:f.column.columnDef.header,props:f.getContext()},null,8,["render","props"])),f.column.getCanSort()?(l.openBlock(),l.createBlock(H,{key:1,color:"neutral-gray-400",name:{asc:"arrow_upward",desc:"arrow_downward"}[f.column.getIsSorted()]??"unfold_more"},null,8,["name"])):l.createCommentVNode("",!0)])],14,Ay)}),128))]))),128))],2),l.createElementVNode("tbody",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(a).getRowModel().rows,u=>(l.openBlock(),l.createElementBlock("tr",{key:u.id,class:l.normalizeClass(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm",{"bg-fm-color-neutral-gray-100":u.getIsSelected()}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.getVisibleCells(),f=>{var p,h,g,m;return l.openBlock(),l.createElementBlock("td",{key:f.id,class:l.normalizeClass(["h-48 px-16 py-12 text-fm-color-typo-primary",((p=f.column.columnDef.meta)==null?void 0:p.cellClass)??"px-16 py-12"]),style:l.normalizeStyle({width:(h=f.column.columnDef.meta)==null?void 0:h.width,maxWidth:(g=f.column.columnDef.meta)==null?void 0:g.maxWidth,textAlign:((m=f.column.columnDef.meta)==null?void 0:m.textAlign)??"left"})},[l.createElementVNode("span",Ny,[l.createVNode(l.unref(Ca),{render:f.column.columnDef.cell,props:f.getContext()},null,8,["render","props"])])],6)}),128))],2))),128))])])]),l.createElementVNode("div",Iy,[l.createElementVNode("div",Ly,[l.createElementVNode("div",Ty,[zy,l.createVNode(Sa,{"model-value":l.unref(a).getState().pagination.pageSize,items:[...Array.from(Array(5),(u,f)=>(f+1)*10).map(u=>({label:u.toString(),value:u})),{label:"All",value:e.rowData.length}],"onUpdate:modelValue":d[0]||(d[0]=u=>l.unref(a).setPageSize(u))},null,8,["model-value","items"])]),l.createElementVNode("span",Hy,l.toDisplayString(e.rowData.length<l.unref(a).getState().pagination.pageSize?e.rowData.length:l.unref(a).getState().pagination.pageIndex*l.unref(a).getState().pagination.pageSize+1)+" - "+l.toDisplayString((l.unref(a).getState().pagination.pageIndex+1)*l.unref(a).getState().pagination.pageSize)+" of "+l.toDisplayString(e.rowData.length)+" items ",1)]),l.createElementVNode("div",jy,[l.createVNode(Sa,{"model-value":l.unref(a).getState().pagination.pageIndex+1,items:Array.from(Array(l.unref(a).getPageCount()),(u,f)=>f+1).map(u=>({label:u.toString(),value:u})),"onUpdate:modelValue":d[1]||(d[1]=u=>l.unref(a).setPageIndex(u?u-1:0))},null,8,["model-value","items"]),l.createElementVNode("span",Wy," of "+l.toDisplayString(l.unref(a).getPageCount())+" pages ",1),l.createVNode(ge,{disabled:!l.unref(a).getCanPreviousPage(),icon:"chevron_left",variant:"tertiary","icon-color":"neutral-black",onClick:d[2]||(d[2]=()=>l.unref(a).previousPage())},null,8,["disabled"]),l.createVNode(ge,{disabled:!l.unref(a).getCanNextPage(),icon:"chevron_right",variant:"tertiary","icon-color":"neutral-black",onClick:d[3]||(d[3]=()=>l.unref(a).nextPage())},null,8,["disabled"])])])]))}}),Gy=l.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"}," More ",-1),Uy={class:"max-w-[360px] min-w-[186px]"},va={FmBadge:kn,FmBreadcrumb:Ha,FmButton:ge,FmButtonGroup:ic,FmCard:ac,FmCardActions:cc,FmCardSection:dc,FmCardTitle:ti,FmChip:ni,FmChipGroup:oi,FmDialog:pc,FmDropField:yc,FmDynamicDialog:ui,FmLineChart:Lp,FmCheckbox:Bl,FmDatePicker:Xg,FmDateRangePicker:Pm,FmField:Ee,FmForm:Am,FmFormGroup:Xe,FmHelperText:$l,FmLabel:yn,FmRadio:jm,FmRadioGroup:Wm,FmSelect:Qm,FmStepperField:ob,FmSwitch:oa,FmTextField:ib,FmTextarea:ab,FmTimeInput:ra,FmTimePicker:wb,FmIcon:H,FmList:kb,FmListItem:vb,FmMenu:Vs,FmMenuDeprecated:_n,FmMenuDivider:na,FmMenuHeader:Db,FmMenuItem:Ke,FmProgressIndicator:la,FmSnackbar:Pb,FmSpacer:si,FmStep:Lb,FmStepper:Hb,FmTab:ca,FmTable:Yy,FmTabs:l.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(t,{emit:e}){const n=t,o=e,s=l.ref(!1),i=l.computed(()=>({vertical:n.vertical,disabled:n.disabled})),r=l.computed(()=>n.items.slice(0,n.showMoreAt)),a=l.computed(()=>n.items.slice(n.showMoreAt)),c=d=>{s.value=!1,o("update:modelValue",d)};return(d,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex",d.vertical?"flex-col":"flex-row items-center"])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,f=>l.renderSlot(d.$slots,"default",l.normalizeProps(l.guardReactiveProps({...f,tabsProps:i.value})),()=>[l.createVNode(ca,l.mergeProps({"model-value":n.modelValue},{children:f.children,label:f.label,icon:f.icon,disabled:f.disabled,badge:f.badge,value:f.value,tabsProps:i.value},{disabled:f.disabled===void 0?d.disabled:f.disabled,vertical:d.vertical,"onUpdate:modelValue":u[0]||(u[0]=p=>o("update:modelValue",p))}),null,16,["model-value","disabled","vertical"])])),256)),a.value.length>0?(l.openBlock(),l.createBlock(_n,{key:0,"show-menu":s.value,class:l.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":d.vertical}]),placement:d.vertical?"right-start":"bottom-start",onDropdownChanged:u[1]||(u[1]=f=>s.value=f)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["flex gap-8 hover:bg-fm-color-opacity-sm items-center px-16 rounded-sm",[d.vertical?"h-40":"h-[46px]"]])},[l.createVNode(H,{name:"more_vert"}),Gy],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Uy,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,f=>l.renderSlot(d.$slots,"list-item",l.normalizeProps(l.guardReactiveProps(f)),()=>[l.createVNode(Ke,{"model-value":n.modelValue===f.value,label:f.label,icon:f.icon,disabled:f.disabled,onClick:p=>c(f.value)},{append:l.withCtx(()=>[f.badge?(l.openBlock(),l.createBlock(kn,{key:0,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):l.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])])),256))])]),_:3},8,["show-menu","class","placement"])):l.createCommentVNode("",!0)],2))}}),FmTooltip:Jl};function qy(){const t=l.inject(ai);if(!t)throw new Error("No provider");return t}const Xy=t=>{t.use(Aa,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),t.use(Cc),Object.entries(va).forEach(([e,n])=>{t.component(e,n)})};le.components=va,le.uiPlugin=Xy,le.useDialog=qy,le.useFormChild=ea,le.useValidation=Ql,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})});
|