@feedmepos/ui-library 0.0.21 → 0.0.22
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.d.ts +45 -6117
- package/dist/federation/{index-d94664c6.js → index-f468c03d.js} +5 -4
- package/dist/feedmepos-ui-library.js +530 -484
- package/dist/feedmepos-ui-library.umd.cjs +9 -9
- package/dist/global-components.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
var
|
|
1
|
+
var $y=Object.defineProperty;var Py=(A,l,qe)=>l in A?$y(A,l,{enumerable:!0,configurable:!0,writable:!0,value:qe}):A[l]=qe;var R=(A,l,qe)=>(Py(A,typeof l!="symbol"?l+"":l,qe),qe);(function(A,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):(A=typeof globalThis<"u"?globalThis:A||self,l(A["feedmepos-ui-library"]={},A.Vue,A.VueRouter))})(this,function(A,l,qe){var mo;"use strict";const Ay="",Ji={directive:"wave",color:"currentColor",initialOpacity:.2,finalOpacity:.1,duration:.4,dissolveDuration:.15,easing:"ease-out",cancellationPeriod:75,trigger:"auto",tagName:"div"},Ia=t=>"config"in t&&"globalProperties"in t.config,La=t=>{let e;return t==="vue2"?e=!1:t==="vue3"?e=!0:e=Ia(t),e?{mounted:"mounted",updated:"updated"}:{mounted:"inserted",updated:"componentUpdated"}},Qi=t=>typeof t=="string"&&t!=="auto",es=(t,e)=>{t.dataset.vWaveBoundary=Qi(e)?e:"true"},Ta=({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},za=(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 yn(t,e,n,o){const i=t-n,s=e-o;return Math.sqrt(i*i+s*s)}function Ha(t,e,{width:n,height:o}){const i=yn(t,e,0,0),s=yn(t,e,n,0),r=yn(t,e,0,o),a=yn(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 ja(t){const e=_o(t);ts(t,e+1)}function Ya(t){const e=_o(t);ts(t,e-1)}function ts(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 Ga(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*Ha(s,r,o),c=Ta(i,n.tagName),d=za(s,r,a,n);ja(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(),Ya(e),_o(e)===0&&(Ga(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,ns=(t={},e="vue3")=>{const n=Object.assign(Object.assign({},Ji),t),o=La(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),es(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(Qi(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),es(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}},Ua={install(t,e={}){if(this.installed)return;this.installed=!0;const n=Object.assign(Object.assign({},Ji),e),{vWave:o,vWaveTrigger:i}=ns(n,t);t.directive(n.directive,o),t.directive(`${n.directive}-trigger`,i)},installed:!1,createLocalWaveDirective:ns},qa={class:"gap-8 inline-flex items-center relative select-none"},Xa={key:0,class:"fm-typo-body-sm-400 justify-center"},Ka=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",qa,[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",Xa,l.toDisplayString(n.value),1)):l.createCommentVNode("",!0)],2)]))}}),Oy="",ee=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Ot=ee(Ka,[["__scopeId","data-v-02018628"]]),Za={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},Ja=["onMouseenter"],Qa={key:0},os=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&&(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",Za,[(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",Qa,l.toDisplayString(r.value),1)):l.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,Ja))),128))])])}}}),Ny="",ec=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,tc=/^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}[)]$/,nc=/^^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*[)]$/,oc=/^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*[)]$/,ic=/^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[ec,tc,nc,oc,ic].some(e=>e.test(t))}const sc=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))}}),Iy="",T=ee(sc,[["__scopeId","data-v-fd802d37"]]),rc=["disabled","type"],lc={key:1,class:"fm-typo-body-lg-700"},ac=l.defineComponent({__name:"FmButton",props:{variant:{default:"primary"},label:{default:""},icon:{default:""},size:{default:"lg"},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},iconColor:{default:""},type:{default:"button"},iconPosition:{default:"prepend"}},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",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white rounded-lg",tertiary:"bg-transparent text-fm-color-primary rounded-lg",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white rounded-xxxl"};function 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(`
|
|
2
2
|
fm-btn
|
|
3
3
|
${o.value}
|
|
4
4
|
fm-btn--${r.size}
|
|
5
5
|
${r.label?"":`fm-btn--${r.size}--just-icon`}
|
|
6
6
|
fm-btn--${r.variant}
|
|
7
7
|
${r.disabled?"fm-btn--disabled":""}
|
|
8
|
-
`),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"?(l.openBlock(),l.createBlock(L,{key:0,name:r.icon,outline:!n.value,color:r.disabled?"neutral-gray-200":r.iconColor??"",size:"md"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),r.label?(l.openBlock(),l.createElementBlock("span",Oa,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),r.icon&&r.iconPosition==="append"?(l.openBlock(),l.createBlock(L,{key:2,name:r.icon,outline:!n.value,color:r.disabled?"neutral-gray-200":r.iconColor??"",size:"md"},null,8,["name","outline","color"])):l.createCommentVNode("",!0)],42,Aa)),[[c,!r.disabled]])}}}),Iy="",fe=Q(Na,[["__scopeId","data-v-8c5319b7"]]),Ia={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},La=["v-wave","disabled","onClick","onMousedown"],Ta=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",Ia,[(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,La))),128))]))}}),za={class:"grow"},Yi=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",za,[l.renderSlot(e.$slots,"default")]),l.renderSlot(e.$slots,"actions")],2))}}),Ha={class:"fm-typo-title-md-700 grow"},Wa=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(Yi,{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",Ha,l.toDisplayString(e.title),1)])])]),_:3})):l.createCommentVNode("",!0)]),l.renderSlot(o.$slots,"default"),l.renderSlot(o.$slots,"actions")],2))}}),Ly="",ja=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))}}),Ya=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))}}),Gi=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))}}),Ui=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(Gi,{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))}}),Ga={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Ua={class:"overflow-y-auto"},qa={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},Xa=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",Ga,[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",Ua,[l.renderSlot(r.$slots,"dialog-content")]),l.createElementVNode("div",qa,[l.renderSlot(r.$slots,"dialog-footer")])],2)],2)):l.createCommentVNode("",!0)]),_:3})]))}}),Ty="",Ka={class:"fm-drop-field"},Za=["accept","disabled"],Ja=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 k=a.value;if(s.value=g(k[0]),r.value=m(k[0]),s.value&&r.value)o("file-upload",k[0]);else{const C=h();o("file-rejected",[{file:k[0],reason:C}])}},h=()=>{const _=[];return s.value||_.push("invalid-type"),r.value||_.push("invalid-size"),_},g=_=>{if(!n.accept)return!0;const k=n.accept.split(",").map(v=>v.trim());for(const v of k)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(_,k)=>(l.openBlock(),l.createElementBlock("label",Ka,[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,Za)],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)]))}}),zy="",Qa=Q(Ja,[["__scopeId","data-v-c914dc32"]]),ec={},tc={class:"flex-grow"};function nc(t,e){return l.openBlock(),l.createElementBlock("div",tc)}const qi=Q(ec,[["render",nc]]),Xi=Symbol.for("fm:form"),Ki=Symbol.for("fm:radio-group"),Zi=Symbol.for("fm:stepper"),Ji=Symbol.for("fm:dialog"),Qi=Symbol.for("fm:menu"),oc={install:t=>{const e={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(es);let c=l.createVNode(a,{...n,unmount:s,storedFunctions:o});return c.appContext=t._context,l.render(c,r),i}};t.config.globalProperties.$dialog=e,t.provide(Ji,e)}},ic={key:0,class:"block relative"},sc={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},rc={class:"fm-typo-title-md-700 text-fm-color-typo-primary"},lc={key:0,class:"overflow-y-auto"},ac={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},cc={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},es=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(),i("dialog-closed"))},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")}),(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",ic,[(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",sc,[l.createElementVNode("div",rc,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",lc,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(d.contentComponent),l.normalizeProps(l.guardReactiveProps(d.contentComponentProps)),null,16))])):(l.openBlock(),l.createElementBlock("div",ac,l.toDisplayString(d.message),1)),l.createElementVNode("div",cc,[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(qi,{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}))}}),Hy="";/*!
|
|
8
|
+
`),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"?(l.openBlock(),l.createBlock(T,{key:0,name:r.icon,outline:!n.value,color:r.disabled?"neutral-gray-200":r.iconColor??"",size:"md"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),r.label?(l.openBlock(),l.createElementBlock("span",lc,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),r.icon&&r.iconPosition==="append"?(l.openBlock(),l.createBlock(T,{key:2,name:r.icon,outline:!n.value,color:r.disabled?"neutral-gray-200":r.iconColor??"",size:"md"},null,8,["name","outline","color"])):l.createCommentVNode("",!0)],42,rc)),[[c,!r.disabled]])}}}),Ly="",le=ee(ac,[["__scopeId","data-v-8c5319b7"]]),cc={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},dc=["v-wave","disabled","onClick","onMousedown"],is=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",cc,[(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(T,{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,dc))),128))]))}}),uc={class:"grow"},Co=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",uc,[l.renderSlot(e.$slots,"default")]),l.renderSlot(e.$slots,"actions")],2))}}),fc={class:"fm-typo-title-md-700 grow"},ss=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(Co,{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",fc,l.toDisplayString(e.title),1)])])]),_:3})):l.createCommentVNode("",!0)]),l.renderSlot(o.$slots,"default"),l.renderSlot(o.$slots,"actions")],2))}}),Ty="",rs=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))}}),ls=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))}}),ko=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(T,{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(T,{name:"close",size:"sm",color:d.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black"},null,8,["color"])],2)):l.createCommentVNode("",!0)],34))}}),So=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(ko,{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))}}),hc={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},pc={class:"overflow-y-auto"},gc={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},as=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",hc,[l.renderSlot(r.$slots,"dialog-header"),r.closeButton?(l.openBlock(),l.createBlock(T,{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",pc,[l.renderSlot(r.$slots,"dialog-content")]),l.createElementVNode("div",gc,[l.renderSlot(r.$slots,"dialog-footer")])],2)],2)):l.createCommentVNode("",!0)]),_:3})]))}}),zy="",mc={class:"fm-drop-field"},bc=["accept","disabled"],yc=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 k=a.value;if(s.value=g(k[0]),r.value=m(k[0]),s.value&&r.value)o("file-upload",k[0]);else{const C=h();o("file-rejected",[{file:k[0],reason:C}])}},h=()=>{const _=[];return s.value||_.push("invalid-type"),r.value||_.push("invalid-size"),_},g=_=>{if(!n.accept)return!0;const k=n.accept.split(",").map(v=>v.trim());for(const v of k)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(_,k)=>(l.openBlock(),l.createElementBlock("label",mc,[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(le,{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,bc)],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)]))}}),Hy="",cs=ee(yc,[["__scopeId","data-v-c914dc32"]]),_c={},xc={class:"flex-grow"};function wc(t,e){return l.openBlock(),l.createElementBlock("div",xc)}const vo=ee(_c,[["render",wc]]),ds=Symbol.for("fm:form"),us=Symbol.for("fm:radio-group"),fs=Symbol.for("fm:stepper"),hs=Symbol.for("fm:dialog"),ps=Symbol.for("fm:menu"),Cc={install:t=>{const e={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(Mo);let c=l.createVNode(a,{...n,unmount:s,storedFunctions:o});return c.appContext=t._context,l.render(c,r),i}};t.config.globalProperties.$dialog=e,t.provide(hs,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"},Ec={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},Dc={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},Mo=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(),i("dialog-closed"))},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")}),(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",kc,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(d.dialogComponent),l.normalizeProps(l.guardReactiveProps(d.dialogComponentProps)),null,16)),d.closeButton?(l.openBlock(),l.createBlock(T,{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(T,{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",Ec,l.toDisplayString(d.message),1)),l.createElementVNode("div",Dc,[d.tertiaryActions?(l.openBlock(),l.createBlock(le,{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(vo,{class:"sm:hidden xs:hidden"}),d.secondaryActions?(l.openBlock(),l.createBlock(le,{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(le,{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}))}}),Wy="";/*!
|
|
9
9
|
* @kurkle/color v0.3.2
|
|
10
10
|
* https://github.com/kurkle/color#readme
|
|
11
11
|
* (c) 2023 Jukka Kurkela
|
|
12
12
|
* Released under the MIT License
|
|
13
|
-
*/function
|
|
13
|
+
*/function Nt(t){return t+.5|0}const Xe=(t,e,n)=>Math.max(Math.min(t,n),e);function It(t){return Xe(Nt(t*2.55),0,255)}function Ke(t){return Xe(Nt(t*255),0,255)}function Pe(t){return Xe(Nt(t/2.55)/100,0,1)}function gs(t){return Xe(Nt(t*100),0,100)}const ke={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],Fc=t=>Eo[(t&240)>>4]+Eo[t&15],_n=t=>(t&240)>>4===(t&15),Rc=t=>_n(t.r)&&_n(t.g)&&_n(t.b)&&_n(t.a);function Bc(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&ke[t[1]]*17,g:255&ke[t[2]]*17,b:255&ke[t[3]]*17,a:e===5?ke[t[4]]*17:255}:(e===7||e===9)&&(n={r:ke[t[1]]<<4|ke[t[2]],g:ke[t[3]]<<4|ke[t[4]],b:ke[t[5]]<<4|ke[t[6]],a:e===9?ke[t[7]]<<4|ke[t[8]]:255})),n}const $c=(t,e)=>t<255?e(t):"";function Pc(t){var e=Rc(t)?Vc:Fc;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 ms(t,e,n){const o=e*Math.min(n,1-n),i=(s,r=(s+t/30)%12)=>n-o*Math.max(Math.min(r-3,9-r,1),-1);return[i(0),i(8),i(4)]}function Oc(t,e,n){const o=(i,s=(i+t/60)%6)=>n-n*e*Math.max(Math.min(s,4-s,1),0);return[o(5),o(3),o(1)]}function Nc(t,e,n){const o=ms(t,1,.5);let i;for(e+n>1&&(i=1/(e+n),e*=i,n*=i),i=0;i<3;i++)o[i]*=1-e-n,o[i]+=e;return o}function Ic(t,e,n,o,i){return t===i?(e-n)/o+(e<n?6:0):e===i?(n-t)/o+2:(t-e)/o+4}function Do(t){const n=t.r/255,o=t.g/255,i=t.b/255,s=Math.max(n,o,i),r=Math.min(n,o,i),a=(s+r)/2;let c,d,u;return s!==r&&(u=s-r,d=a>.5?u/(2-s-r):u/(s+r),c=Ic(n,o,i,u,s),c=c*60+.5),[c|0,d||0,a]}function Vo(t,e,n,o){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,o)).map(Ke)}function Fo(t,e,n){return Vo(ms,t,e,n)}function Lc(t,e,n){return Vo(Nc,t,e,n)}function Tc(t,e,n){return Vo(Oc,t,e,n)}function bs(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]?It(+e[5]):Ke(+e[5]));const i=bs(+e[2]),s=+e[3]/100,r=+e[4]/100;return e[1]==="hwb"?o=Lc(i,s,r):e[1]==="hsv"?o=Tc(i,s,r):o=Fo(i,s,r),{r:o[0],g:o[1],b:o[2],a:n}}function Hc(t,e){var n=Do(t);n[0]=bs(n[0]+e),n=Fo(n),t.r=n[0],t.g=n[1],t.b=n[2]}function Wc(t){if(!t)return;const e=Do(t),n=e[0],o=gs(e[1]),i=gs(e[2]);return t.a<255?`hsla(${n}, ${o}%, ${i}%, ${Pe(t.a)})`:`hsl(${n}, ${o}%, ${i}%)`}const ys={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"},_s={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 jc(){const t={},e=Object.keys(_s),n=Object.keys(ys);let o,i,s,r,a;for(o=0;o<e.length;o++){for(r=a=e[o],i=0;i<n.length;i++)s=n[i],a=a.replace(s,ys[s]);s=parseInt(_s[r],16),t[a]=[s>>16&255,s>>8&255,s&255]}return t}let xn;function Yc(t){xn||(xn=jc(),xn.transparent=[0,0,0,0]);const e=xn[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,i,s;if(e){if(e[7]!==o){const r=+e[7];n=e[8]?It(r):Xe(r*255,0,255)}return o=+e[1],i=+e[3],s=+e[5],o=255&(e[2]?It(o):Xe(o,0,255)),i=255&(e[4]?It(i):Xe(i,0,255)),s=255&(e[6]?It(s):Xe(s,0,255)),{r:o,g:i,b:s,a:n}}}function qc(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Pe(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Ro=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Mt=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Xc(t,e,n){const o=Mt(Pe(t.r)),i=Mt(Pe(t.g)),s=Mt(Pe(t.b));return{r:Ke(Ro(o+n*(Mt(Pe(e.r))-o))),g:Ke(Ro(i+n*(Mt(Pe(e.g))-i))),b:Ke(Ro(s+n*(Mt(Pe(e.b))-s))),a:t.a+n*(e.a-t.a)}}function wn(t,e,n){if(t){let o=Do(t);o[e]=Math.max(0,Math.min(o[e]+o[e]*n,e===0?360:1)),o=Fo(o),t.r=o[0],t.g=o[1],t.b=o[2]}}function xs(t,e){return t&&Object.assign(e||{},t)}function ws(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=Ke(t[3]))):(e=xs(t,{r:0,g:0,b:0,a:1}),e.a=Ke(e.a)),e}function Kc(t){return t.charAt(0)==="r"?Uc(t):zc(t)}class Lt{constructor(e){if(e instanceof Lt)return e;const n=typeof e;let o;n==="object"?o=ws(e):n==="string"&&(o=Bc(e)||Yc(e)||Kc(e)),this._rgb=o,this._valid=!!o}get valid(){return this._valid}get rgb(){var e=xs(this._rgb);return e&&(e.a=Pe(e.a)),e}set rgb(e){this._rgb=ws(e)}rgbString(){return this._valid?qc(this._rgb):void 0}hexString(){return this._valid?Pc(this._rgb):void 0}hslString(){return this._valid?Wc(this._rgb):void 0}mix(e,n){if(e){const o=this.rgb,i=e.rgb;let s;const r=n===s?.5:n,a=2*r-1,c=o.a-i.a,d=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;s=1-d,o.r=255&d*o.r+s*i.r+.5,o.g=255&d*o.g+s*i.g+.5,o.b=255&d*o.b+s*i.b+.5,o.a=r*o.a+(1-r)*i.a,this.rgb=o}return this}interpolate(e,n){return e&&(this._rgb=Xc(this._rgb,e._rgb,n)),this}clone(){return new Lt(this.rgb)}alpha(e){return this._rgb.a=Ke(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=Nt(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 wn(this._rgb,2,e),this}darken(e){return wn(this._rgb,2,-e),this}saturate(e){return wn(this._rgb,1,e),this}desaturate(e){return wn(this._rgb,1,-e),this}rotate(e){return Hc(this._rgb,e),this}}/*!
|
|
14
14
|
* Chart.js v4.4.1
|
|
15
15
|
* https://www.chartjs.org
|
|
16
16
|
* (c) 2023 Chart.js Contributors
|
|
17
17
|
* Released under the MIT License
|
|
18
|
-
*/function Pe(){}const Bc=(()=>{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 $c=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,as=(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 j(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 cs(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Pc(t,e,n,o){if(!cs(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||Pc;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:Ac})}function Ac(t,e,n){if(!cs(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 ds={"":t=>t,x:t=>t.x,y:t=>t.y};function Oc(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 Nc(t){const e=Oc(t);return n=>{for(const o of e){if(o==="")break;n=n&&n[o]}return n}}function Ke(t,e){return(ds[e]||(ds[e]=Nc(e)))(t)}function Eo(t){return t.charAt(0).toUpperCase()+t.slice(1)}const zt=t=>typeof t<"u",Ze=t=>typeof t=="function",us=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function Ic(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const X=Math.PI,K=2*X,Lc=K+X,Sn=Number.POSITIVE_INFINITY,Tc=X/180,ne=X/2,ct=X/4,fs=X*2/3,Je=Math.log10,Ve=Math.sign;function Ht(t,e,n){return Math.abs(t-e)<n}function hs(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 zc(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 Hc(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function ps(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 gs(t){if(!ee(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function ms(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 Wc(t,e){return(t-e+Lc)%K-X}function _e(t){return(t%K+K)%K}function Wt(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 ie(t,e,n){return Math.max(e,Math.min(n,t))}function jc(t){return ie(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),Yc=(t,e,n)=>Ro(t,n,o=>t[o][e]>=n);function Gc(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 bs=["push","pop","shift","splice","unshift"];function Uc(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),bs.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 ys(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)&&(bs.forEach(s=>{delete t[s]}),delete t._chartjs)}function _s(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const xs=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function ws(t,e){let n=[],o=!1;return function(...i){n=i,o||(o=!0,xs.call(window,()=>{o=!1,t.apply(e,n)}))}}function qc(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,Xc=(t,e,n,o)=>t===(o?"left":"right")?n:t==="center"?(e+n)/2:e;function Cs(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=ie(Math.min(Oe(a,c,d).lo,n?o:Oe(e,c,r.getPixelForValue(d)).lo),0,o-1)),p?s=ie(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 ks(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,Ss=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*K/n)),vs=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*K/n)+1,jt={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:Ss(t,.075,.3),easeOutElastic:t=>vn(t)?t:vs(t,.075,.3),easeInOutElastic(t){return vn(t)?t:t<.5?.5*Ss(t*2,.1125,.45):.5+.5*vs(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-jt.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?jt.easeInBounce(t*2)*.5:jt.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 Ms(t){return Bo(t)?t:new It(t)}function $o(t){return Bo(t)?t:new It(t).saturate(.5).darken(.1).hexString()}const Kc=["x","y","borderWidth","radius","tension"],Zc=["color","borderColor","backgroundColor"];function Jc(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:Zc},numbers:{type:"number",properties:Kc}}),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 Qc(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Es=new Map;function ed(t,e){e=e||{};const n=t+JSON.stringify(e);let o=Es.get(n);return o||(o=new Intl.NumberFormat(t,e),Es.set(n,o)),o}function Yt(t,e,n){return ed(e,n).format(t)}const Ds={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=td(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?Ds.numeric.call(this,t,e,n):""}};function td(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:Ds};function nd(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 od{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 od({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Jc,Qc,nd]);function id(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 sd(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 Vs(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){Rs(t,e,n,o,null)}function Rs(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)*Tc;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+=fs,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*m),b+=fs,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 rd(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 ld(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 ad(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 cd(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 dd(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,ad(t,s),c=0;c<r.length;++c)d=r[c],s.backdrop&&dd(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),cd(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 ud=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,fd=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function hd(t,e){const n=(""+t).match(ud);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 pd=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]=pd(s(r));return n}function Fs(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=Fs(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(fd)&&(console.warn('Invalid font style specified: "'+o+'"'),o=void 0);const i={family:T(t.family,e.family),lineHeight:hd(T(t.lineHeight,e.lineHeight),n),size:n,style:o,weight:T(t.weight,e.weight),string:""};return i.string=id(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 gd(t,e,n){const{min:o,max:i}=t,s=as(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=Os("_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 $s(a,c,()=>kd(c,e,t,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,c){return Ns(a).includes(c)},ownKeys(a){return Ns(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:Bs(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 $s(s,r,()=>bd(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 Bs(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 md=(t,e)=>t?t+Eo(e):e,Lo=(t,e)=>z(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function $s(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const o=n();return t[e]=o,o}function bd(t,e,n){const{_proxy:o,_context:i,_subProxy:s,_descriptors:r}=t;let a=o[e];return Ze(a)&&r.isScriptable(e)&&(a=yd(e,a,t,n)),q(a)&&a.length&&(a=_d(e,a,t,r.isIndexable)),Lo(e,a)&&(a=Dt(a,i,s&&s[e],r)),a}function yd(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 _d(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 Ps(t,e,n){return Ze(t)?t(e,n):t}const xd=(t,e)=>t===!0?e:typeof t=="string"?Ke(e,t):void 0;function wd(t,e,n,o,i){for(const s of e){const r=xd(n,s);if(r){t.add(r);const a=Ps(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=Ps(e._fallback,n,o),r=[...t,...i],a=new Set;a.add(o);let c=As(a,r,n,s||n,o);return c===null||typeof s<"u"&&s!==n&&(c=As(a,r,s,c,o),c===null)?!1:Io(Array.from(a),[""],i,s,()=>Cd(e,n,o))}function As(t,e,n,o,i){for(;n;)n=wd(t,e,n,o,i);return n}function Cd(t,e,n){const o=t._getTarget();e in o||(o[e]={});const i=o[e];return q(i)&&z(n)?n:i||{}}function kd(t,e,n,o){let i;for(const s of e)if(i=Os(md(s,t),n),typeof i<"u")return Lo(t,i)?To(n,o,t,i):i}function Os(t,e){for(const n of e){if(!n)continue;const o=n[t];if(typeof o<"u")return o}}function Ns(t){let e=t._keys;return e||(e=t._keys=Sd(t._scopes)),e}function Sd(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 Is(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 vd=Number.EPSILON||1e-14,Vt=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ls=t=>t==="x"?"y":"x";function Md(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 Ed(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,vd)){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 Dd(t,e,n="x"){const o=Ls(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 Vd(t,e="x"){const n=Ls(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]}Ed(t,i,s),Dd(t,s,e)}function Rn(t,e,n){return Math.max(Math.min(t,n),e)}function Rd(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 Fd(t,e,n,o,i){let s,r,a,c;if(e.spanGaps&&(t=t.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")Vd(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=Md(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&&Rd(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 Bd(t,e){return Bn(t).getPropertyValue(e)}const $d=["top","right","bottom","left"];function pt(t,e,n){const o={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=$d[i];o[s]=parseFloat(t[e+"-"+s+n])||0}return o.width=o.left+o.right,o.height=o.top+o.bottom,o}const Pd=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function Ad(t,e){const n=t.touches,o=n&&n.length?n[0]:t,{offsetX:i,offsetY:s}=o;let r=!1,a,c;if(Pd(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}=Ad(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 Od(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 Nd(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=Od(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 Ts(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 Id=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 zs(t,e){const n=Bd(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 Ld(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 Td(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 zd=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}}},Hd=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?zd(e,n):Hd()}function Hs(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 js(t){return t==="angle"?{between:Wt,compare:Wc,normalize:_e}:{between:Ae,compare:(e,n)=>e-n,normalize:e=>e}}function Ys({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 Wd(t,e,n){const{property:o,start:i,end:s}=n,{between:r,normalize:a}=js(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 Gs(t,e,n){if(!n)return[t];const{property:o,start:i,end:s}=n,r=e.length,{compare:a,between:c,normalize:d}=js(o),{start:u,end:f,loop:p,style:h}=Wd(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),k=()=>m||S(),v=()=>!m||_();for(let C=u,D=u;C<=f;++C)y=e[C%r],!y.skip&&(x=d(y[o]),x!==w&&(m=c(x,i,s),b===null&&k()&&(b=a(x,i)===0?C:D),b!==null&&v()&&(g.push(Ys({start:b,end:C,loop:p,count:r,style:h})),b=null),D=C,w=x));return b!==null&&g.push(Ys({start:b,end:f,loop:p,count:r,style:h})),g}function Us(t,e){const n=[],o=t.segments;for(let i=0;i<o.length;i++){const s=Gs(o[i],t.points,e);s.length&&n.push(...s)}return n}function jd(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 Yd(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 Gd(t,e){const n=t.points,o=t.options.spanGaps,i=n.length;if(!i)return[];const s=!!t._loop,{start:r,end:a}=jd(n,i,s,o);if(o===!0)return qs(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 qs(t,Yd(n,r,c,d),n,e)}function qs(t,e,n,o){return!o||!o.setContext||!n?e:Ud(t,e,n,o)}function Ud(t,e,n,o){const i=t._chart.getContext(),s=Xs(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=Xs(o.setContext(Qe(i,{type:"segment",p0:m,p1:x,p0DataIndex:(p-1)%c,p1DataIndex:p%c,datasetIndex:r}))),qd(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 Xs(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function qd(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)}/*!
|
|
18
|
+
*/function Ae(){}const Zc=(()=>{let t=0;return()=>t++})();function W(t){return t===null||typeof t>"u"}function X(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 H(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function te(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function _e(t,e){return te(t)?t:e}function z(t,e){return typeof t>"u"?e:t}const Jc=(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 U(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Y(t,e,n,o){let i,s,r;if(X(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(H(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(X(t))return t.map(kn);if(H(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 ks(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Qc(t,e,n,o){if(!ks(t))return;const i=e[t],s=n[t];H(i)&&H(s)?Tt(i,s,o):e[t]=kn(s)}function Tt(t,e,n){const o=X(e)?e:[e],i=o.length;if(!H(t))return t;n=n||{};const s=n.merger||Qc;let r;for(let a=0;a<i;++a){if(r=o[a],!H(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 zt(t,e){return Tt(t,e,{merger:ed})}function ed(t,e,n){if(!ks(t))return;const o=e[t],i=n[t];H(o)&&H(i)?zt(o,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=kn(i))}const Ss={"":t=>t,x:t=>t.x,y:t=>t.y};function td(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 nd(t){const e=td(t);return n=>{for(const o of e){if(o==="")break;n=n&&n[o]}return n}}function Ze(t,e){return(Ss[e]||(Ss[e]=nd(e)))(t)}function Bo(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Ht=t=>typeof t<"u",Je=t=>typeof t=="function",vs=(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 K=Math.PI,Z=2*K,id=Z+K,Sn=Number.POSITIVE_INFINITY,sd=K/180,oe=K/2,ct=K/4,Ms=K*2/3,Qe=Math.log10,Ve=Math.sign;function Wt(t,e,n){return Math.abs(t-e)<n}function Es(t){const e=Math.round(t);t=Wt(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Qe(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((i,s)=>i-s).pop(),e}function Et(t){return!isNaN(parseFloat(t))&&isFinite(t)}function ld(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function Ds(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 Me(t){return t*(K/180)}function $o(t){return t*(180/K)}function Vs(t){if(!te(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Fs(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*K&&(s+=Z),{angle:s,distance:i}}function Po(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+id)%Z-K}function xe(t){return(t%Z+Z)%Z}function jt(t,e,n,o){const i=xe(t),s=xe(e),r=xe(n),a=xe(s-i),c=xe(r-i),d=xe(i-s),u=xe(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 cd(t){return se(t,-32768,32767)}function Oe(t,e,n,o=1e-6){return t>=Math.min(e,n)-o&&t<=Math.max(e,n)+o}function Ao(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 Ne=(t,e,n,o)=>Ao(t,n,o?i=>{const s=t[i][e];return s<n||s===n&&t[i+1][e]===n}:i=>t[i][e]<n),dd=(t,e,n)=>Ao(t,n,o=>t[o][e]>=n);function ud(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 Rs=["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]}}),Rs.forEach(n=>{const o="_onData"+Bo(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 Bs(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)&&(Rs.forEach(s=>{delete t[s]}),delete t._chartjs)}function $s(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Ps=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function As(t,e){let n=[],o=!1;return function(...i){n=i,o||(o=!0,Ps.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 Oo=t=>t==="start"?"left":t==="end"?"right":"center",ae=(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 Os(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(Ne(a,c,d).lo,n?o:Ne(e,c,r.getPixelForValue(d)).lo),0,o-1)),p?s=se(Math.max(Ne(a,r.axis,u,!0).hi+1,n?0:Ne(e,c,r.getPixelForValue(u),!0).hi+1),i,o)-i:s=o-i}return{start:i,count:s}}function Ns(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,Is=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Z/n)),Ls=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*Z/n)+1,Yt={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*oe)+1,easeOutSine:t=>Math.sin(t*oe),easeInOutSine:t=>-.5*(Math.cos(K*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:Is(t,.075,.3),easeOutElastic:t=>vn(t)?t:Ls(t,.075,.3),easeInOutElastic(t){return vn(t)?t:t<.5?.5*Is(t*2,.1125,.45):.5+.5*Ls(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-Yt.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?Yt.easeInBounce(t*2)*.5:Yt.easeOutBounce(t*2-1)*.5+.5};function No(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Ts(t){return No(t)?t:new Lt(t)}function Io(t){return No(t)?t:new Lt(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 zs=new Map;function _d(t,e){e=e||{};const n=t+JSON.stringify(e);let o=zs.get(n);return o||(o=new Intl.NumberFormat(t,e),zs.set(n,o)),o}function Gt(t,e,n){return _d(e,n).format(t)}const Hs={values(t){return X(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=xd(t,n)}const r=Qe(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),Gt(t,o,c)},logarithmic(t,e,n){if(t===0)return"0";const o=n[e].significand||t/Math.pow(10,Math.floor(Qe(t)));return[1,2,3,5,10,15].includes(o)||e>.8*n.length?Hs.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 Mn={formatters:Hs};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: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),Lo=Object.create(null);function Ut(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 To(t,e,n){return typeof e=="string"?Tt(Ut(t,e),n):Tt(Ut(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,i)=>Io(i.backgroundColor),this.hoverBorderColor=(o,i)=>Io(i.borderColor),this.hoverColor=(o,i)=>Io(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 To(this,e,n)}get(e){return Ut(this,e)}describe(e,n){return To(Lo,e,n)}override(e,n){return To(dt,e,n)}route(e,n,o,i){const s=Ut(this,e),r=Ut(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 H(c)?Object.assign({},d,c):z(c,d)},set(c){this[a]=c}}})}apply(e){e.forEach(n=>n(this))}}var ne=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||W(t.size)||W(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 Sd(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&&!X(f))r=En(t,i,s,r,f);else if(X(f))for(d=0,u=f.length;d<u;d++)p=f[d],p!=null&&!X(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 Ws(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function zo(t,e,n,o){js(t,e,n,o,null)}function js(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)*sd;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,Z):t.arc(n,o,m,0,Z),t.closePath();break;case"triangle":u=i?i/2:m,t.moveTo(n+Math.sin(b)*u,o-Math.cos(b)*m),b+=Ms,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*m),b+=Ms,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-K,b-oe),t.arc(n+p,o-r,d,b-oe,b),t.arc(n+f,o+a,d,b,b+oe),t.arc(n-p,o+r,d,b+oe,b+K),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 Ie(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 vd(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 Ed(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),W(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 Dd(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 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 ft(t,e,n,o,i,s={}){const r=X(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=i.string,Ed(t,s),c=0;c<r.length;++c)d=r[c],s.backdrop&&Vd(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),W(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,n,o,s.maxWidth)),t.fillText(d,n,o,s.maxWidth),Dd(t,n,o,d,s),o+=Number(i.lineHeight);t.restore()}function qt(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*K,K,!0),t.lineTo(n,o+s-r.bottomLeft),t.arc(n+r.bottomLeft,o+s-r.bottomLeft,r.bottomLeft,K,oe,!0),t.lineTo(n+i-r.bottomRight,o+s),t.arc(n+i-r.bottomRight,o+s-r.bottomRight,r.bottomRight,oe,0,!0),t.lineTo(n+i,o+r.topRight),t.arc(n+i-r.topRight,o+r.topRight,r.topRight,0,-oe,!0),t.lineTo(n+r.topLeft,o)}const Fd=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Rd=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Bd(t,e){const n=(""+t).match(Fd);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 Ho(t,e){const n={},o=H(e),i=o?Object.keys(e):e,s=H(t)?o?r=>z(t[r],t[e[r]]):r=>t[r]:()=>t;for(const r of i)n[r]=$d(s(r));return n}function Ys(t){return Ho(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ht(t){return Ho(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ce(t){const e=Ys(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ie(t,e){t=t||{},e=e||ne.font;let n=z(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let o=z(t.style,e.style);o&&!(""+o).match(Rd)&&(console.warn('Invalid font style specified: "'+o+'"'),o=void 0);const i={family:z(t.family,e.family),lineHeight:Bd(z(t.lineHeight,e.lineHeight),n),size:n,style:o,weight:z(t.weight,e.weight),string:""};return i.string=kd(i),i}function Xt(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&&X(a)&&(a=a[n%a.length],i=!1),a!==void 0))return o&&!i&&(o.cacheable=!1),a}function Pd(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 et(t,e){return Object.assign(Object.create(t),e)}function Wo(t,e=[""],n,o,i=()=>t[0]){const s=n||t;typeof o>"u"&&(o=Ks("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:o,_getTarget:i,override:a=>Wo([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 Us(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 Zs(a).includes(c)},ownKeys(a){return Zs(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:Gs(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 Us(s,r,()=>Od(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 Gs(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:Je(n)?n:()=>n,isIndexable:Je(o)?o:()=>o}}const Ad=(t,e)=>t?t+Bo(e):e,jo=(t,e)=>H(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Us(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:i,_subProxy:s,_descriptors:r}=t;let a=o[e];return Je(a)&&r.isScriptable(e)&&(a=Nd(e,a,t,n)),X(a)&&a.length&&(a=Id(e,a,t,r.isIndexable)),jo(e,a)&&(a=Dt(a,i,s&&s[e],r)),a}function Nd(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),jo(t,c)&&(c=Yo(i._scopes,i,t,c)),c}function Id(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(H(e[0])){const c=e,d=i._scopes.filter(u=>u!==c);e=[];for(const u of c){const f=Yo(d,i,t,u);e.push(Dt(f,s,r&&r[t],a))}}return e}function qs(t,e,n){return Je(t)?t(e,n):t}const Ld=(t,e)=>t===!0?e:typeof t=="string"?Ze(e,t):void 0;function Td(t,e,n,o,i){for(const s of e){const r=Ld(n,s);if(r){t.add(r);const a=qs(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 Yo(t,e,n,o){const i=e._rootScopes,s=qs(e._fallback,n,o),r=[...t,...i],a=new Set;a.add(o);let c=Xs(a,r,n,s||n,o);return c===null||typeof s<"u"&&s!==n&&(c=Xs(a,r,s,c,o),c===null)?!1:Wo(Array.from(a),[""],i,s,()=>zd(e,n,o))}function Xs(t,e,n,o,i){for(;n;)n=Td(t,e,n,o,i);return n}function zd(t,e,n){const o=t._getTarget();e in o||(o[e]={});const i=o[e];return X(i)&&H(n)?n:i||{}}function Hd(t,e,n,o){let i;for(const s of e)if(i=Ks(Ad(s,t),n),typeof i<"u")return jo(t,i)?Yo(n,o,t,i):i}function Ks(t,e){for(const n of e){if(!n)continue;const o=n[t];if(typeof o<"u")return o}}function Zs(t){let e=t._keys;return e||(e=t._keys=Wd(t._scopes)),e}function Wd(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 Js(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(Ze(u,s),d)};return r}const jd=Number.EPSILON||1e-14,Vt=(t,e)=>e<t.length&&!t[e].skip&&t[e],Qs=t=>t==="x"?"y":"x";function Yd(t,e,n,o){const i=t.skip?e:t,s=e,r=n.skip?e:n,a=Po(s,i),c=Po(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 Gd(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(Wt(e[u],0,jd)){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 Ud(t,e,n="x"){const o=Qs(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 qd(t,e="x"){const n=Qs(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]}Gd(t,i,s),Ud(t,s,e)}function Fn(t,e,n){return Math.max(Math.min(t,n),e)}function Xd(t,e){let n,o,i,s,r,a=Ie(t[0],e);for(n=0,o=t.length;n<o;++n)r=s,s=a,a=n<o-1&&Ie(t[n+1],e),s&&(i=t[n],r&&(i.cp1x=Fn(i.cp1x,e.left,e.right),i.cp1y=Fn(i.cp1y,e.top,e.bottom)),a&&(i.cp2x=Fn(i.cp2x,e.left,e.right),i.cp2y=Fn(i.cp2y,e.top,e.bottom)))}function Kd(t,e,n,o,i){let s,r,a,c;if(e.spanGaps&&(t=t.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")qd(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=Yd(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&&Xd(t,n)}function Go(){return typeof window<"u"&&typeof document<"u"}function Uo(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Rn(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 Jd=["top","right","bottom","left"];function pt(t,e,n){const o={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=Jd[i];o[s]=parseFloat(t[e+"-"+s+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:i,offsetY:s}=o;let r=!1,a,c;if(Qd(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}=eu(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 tu(t,e,n){let o,i;if(e===void 0||n===void 0){const s=Uo(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=Rn(a.maxWidth,s,"clientWidth"),i=Rn(a.maxHeight,s,"clientHeight")}}return{width:e,height:n,maxWidth:o||Sn,maxHeight:i||Sn}}const $n=t=>Math.round(t*10)/10;function nu(t,e,n,o){const i=Bn(t),s=pt(i,"margin"),r=Rn(i.maxWidth,t,"clientWidth")||Sn,a=Rn(i.maxHeight,t,"clientHeight")||Sn,c=tu(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 er(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 ou=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Go()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function tr(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 iu(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 su(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 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 Ft(t,e,n){return t?ru(e,n):lu()}function nr(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 or(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function ir(t){return t==="angle"?{between:jt,compare:ad,normalize:xe}:{between:Oe,compare:(e,n)=>e-n,normalize:e=>e}}function sr({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 au(t,e,n){const{property:o,start:i,end:s}=n,{between:r,normalize:a}=ir(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 rr(t,e,n){if(!n)return[t];const{property:o,start:i,end:s}=n,r=e.length,{compare:a,between:c,normalize:d}=ir(o),{start:u,end:f,loop:p,style:h}=au(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),k=()=>m||S(),v=()=>!m||_();for(let C=u,D=u;C<=f;++C)y=e[C%r],!y.skip&&(x=d(y[o]),x!==w&&(m=c(x,i,s),b===null&&k()&&(b=a(x,i)===0?C:D),b!==null&&v()&&(g.push(sr({start:b,end:C,loop:p,count:r,style:h})),b=null),D=C,w=x));return b!==null&&g.push(sr({start:b,end:f,loop:p,count:r,style:h})),g}function lr(t,e){const n=[],o=t.segments;for(let i=0;i<o.length;i++){const s=rr(o[i],t.points,e);s.length&&n.push(...s)}return n}function cu(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 du(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 uu(t,e){const n=t.points,o=t.options.spanGaps,i=n.length;if(!i)return[];const s=!!t._loop,{start:r,end:a}=cu(n,i,s,o);if(o===!0)return ar(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 ar(t,du(n,r,c,d),n,e)}function ar(t,e,n,o){return!o||!o.setContext||!n?e:fu(t,e,n,o)}function fu(t,e,n,o){const i=t._chart.getContext(),s=cr(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=cr(o.setContext(et(i,{type:"segment",p0:m,p1:x,p0DataIndex:(p-1)%c,p1DataIndex:p%c,datasetIndex:r}))),hu(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 cr(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(i,s){return No(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(t,o)!==JSON.stringify(e,o)}/*!
|
|
19
19
|
* Chart.js v4.4.1
|
|
20
20
|
* https://www.chartjs.org
|
|
21
21
|
* (c) 2023 Chart.js Contributors
|
|
22
22
|
* Released under the MIT License
|
|
23
|
-
*/class Xd{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=xs.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 Xd;const Ks="transparent",Kd={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const o=Ms(t||Ks),i=o.valid&&Ms(e||Ks);return i&&i.valid?i.mix(o,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class Zd{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||Kd[e.type||typeof r],this._easing=jt[e.easing]||jt.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 Zs{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=Qd(e,o);if(!i)return[];const s=this._createAnimations(i,o);return o.$shared&&Jd(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 Zd(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 Jd(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 Qd(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 Js(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 eu(t,e,n){if(n===!1)return!1;const o=Js(t,n),i=Js(e,n);return{top:i.end,right:o.end,bottom:i.start,left:o.start}}function tu(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 Qs(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 er(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 nu(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 tr(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function ou(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function iu(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 su(t,e,n){const o=t[e]||(t[e]={});return o[n]||(o[n]={})}function nr(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 or(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=ou(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]=su(i,u,m),p[a]=b,p._top=nr(p,r,!0,o.type),p._bottom=nr(p,r,!1,o.type);const y=p._visualValues||(p._visualValues={});y[a]=b}}function Wo(t,e){const n=t.scales;return Object.keys(n).filter(o=>n[o].axis===e).shift()}function ru(t,e){return Qe(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function lu(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 jo=t=>t==="reset"||t==="none",ir=(t,e)=>e?t:Object.assign({},t),au=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Qs(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=tr(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,Wo(e,"x")),r=n.yAxisID=T(o.yAxisID,Wo(e,"y")),a=n.rAxisID=T(o.rAxisID,Wo(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&&ys(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=nu(n);else if(o!==n){if(o){ys(o,this);const i=this._cachedMeta;Xt(i),i._parsed=[]}n&&Object.isExtensible(n)&&Uc(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=tr(n.vScale,n),n.stack!==o.stack&&(i=!0,Xt(n),n.stack=o.stack),this._resyncElements(e),(i||s!==n._stacked)&&or(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&&or(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:Qs(i,!0),values:n._stacks[e.axis]._visualValues};return er(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=er(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=au(n,o,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=iu(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=tu(T(this.options.clip,eu(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=lu(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=ru(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 ir(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(ir(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 Zs(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||jo(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){jo(i)?Object.assign(e,o):this._resolveAnimations(n,i).update(e,o)}updateSharedOptions(e,n,o){e&&!jo(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 cu(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=_s(o.sort((i,s)=>i-s))}return t._cache.$bar}function du(t){const e=t.iScale,n=cu(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 uu(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 fu(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 hu(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 sr(t,e,n,o){return q(t)?hu(t,e,n,o):e[n.axis]=n.parse(t,o),e}function rr(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(sr(p,f,s,d));return c}function Yo(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function pu(t,e,n){return t!==0?Ve(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function gu(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 mu(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}=gu(t);i==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===o?i=d:(n._bottom||0)===o?i=u:(s[lr(u,r,a,c)]=!0,i=d)),s[lr(i,r,a,c)]=!0,t.borderSkipped=s}function lr(t,e,n,o){return o?(t=bu(t,e,n),t=ar(t,n,e)):t=ar(t,e,n),t}function bu(t,e,n){return t===e?n:t===n?e:t}function ar(t,e,n){return t==="start"?e:t==="end"?n:t}function yu(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class Pn extends Me{parsePrimitiveData(e,n,o,i){return rr(e,n,o,i)}parseArrayData(e,n,o,i){return rr(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(sr(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;mu(y,w,x,r),yu(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||du(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=pu(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"?fu(e,n,i,d):uu(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 _u(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,_)=>Wt(w,a,c,!0)?1:Math.max(S,S*n,_,_*n),g=(w,S,_)=>Wt(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($c(this.options.cutout,a),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:g,offsetY:m}=_u(f,u,c),b=(o.width-r)/p,x=(o.height-r)/h,y=Math.max(Math.min(b,x)/2,0),w=as(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}=Cs(n,i,r);this._drawStart=a,this._drawCount=c,ks(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 k=e[_],v=x?k:{};if(_<n||_>=y){v.skip=!0;continue}const C=this.getParsed(_),D=H(C[h]),V=v[p]=r.getPixelForValue(C[p],_),$=v[h]=s||D?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,C,c):C[h],_);v.skip=isNaN(V)||isNaN($)||D,v.stop=_>0&&Math.abs(C[p]-S[p])>b,m&&(v.parsed=C,v.raw=d.data[_]),f&&(v.options=u||this.resolveDataElementOptions(_,k.active?"active":i)),x||this.updateElement(k,_,v,i),S=C}}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 Is.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 Is.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}=Cs(n,o,i);if(this._drawStart=s,this._drawCount=r,ks(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],k=this.getParsed(S),v=y?_:{},C=H(k[g]),D=v[h]=r.getPixelForValue(k[h],S),V=v[g]=s||C?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,k,c):k[g],S);v.skip=isNaN(D)||isNaN(V)||C,v.stop=S>0&&Math.abs(k[h]-w[h])>x,b&&(v.parsed=k,v.raw=d.data[S]),p&&(v.options=f||this.resolveDataElementOptions(S,_.active?"active":i)),y||this.updateElement(_,S,v,i),w=k}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 xu=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 wu={_date:Uo};function Cu(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?Yc: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}=Cu(s[a],e,r,i);for(let h=f;h<=p;++h){const g=u[h];g.skip||o(g,d,h)}}}function ku(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 Su(t,e,n,o){let i=[];function s(r,a,c){const{startAngle:d,endAngle:u}=r.getProps(["startAngle","endAngle"],o),{angle:f}=ms(r,{x:e.x,y:e.y});Wt(f,d,u)&&i.push({element:r,datasetIndex:a,index:c})}return Zt(t,n,e,s),i}function vu(t,e,n,o,i,s){let r=[];const a=ku(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?Su(t,e,n,i):vu(t,e,n,o,i,s)}function cr(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 Mu={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 cr(t,i,"x",n.intersect,o)},y(t,e,n,o){const i=gt(e,t);return cr(t,i,"y",n.intersect,o)}}};const dr=["left","top","right","bottom"];function Jt(t,e){return t.filter(n=>n.pos===e)}function ur(t,e){return t.filter(n=>dr.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 Eu(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 Du(t){const e={};for(const n of t){const{stack:o,pos:i,stackWeight:s}=n;if(!o||!dr.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 Vu(t,e){const n=Du(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 Ru(t){const e=Eu(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=ur(e,"x"),c=ur(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 fr(t,e,n,o){return Math.max(t[n],e[n])+Math.max(t[o],e[o])}function hr(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 Fu(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&&hr(r,s.getPadding());const a=Math.max(0,e.outerWidth-fr(r,t,"left","right")),c=Math.max(0,e.outerHeight-fr(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 Bu(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 $u(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,$u(a.horizontal,e));const{same:f,other:p}=Fu(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 pr(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=Ru(t.boxes),c=a.vertical,d=a.horizontal;j(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);hr(p,ae(o));const h=Object.assign({maxPadding:p,w:s,h:r,x:i.left,y:i.top},i),g=Vu(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),Bu(h),pr(a.leftAndTop,h,f,g),h.x+=h.w,h.y+=h.h,pr(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},j(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 gr{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 Pu extends gr{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Tn="$chartjs",Au={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mr=t=>t===null||t==="";function Ou(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",mr(i)){const s=zs(t,"width");s!==void 0&&(t.width=s)}if(mr(o))if(t.style.height==="")t.height=t.width/(e||2);else{const s=zs(t,"height");s!==void 0&&(t.height=s)}return t}const br=Id?{passive:!0}:!1;function Nu(t,e,n){t.addEventListener(e,n,br)}function Iu(t,e,n){t.canvas.removeEventListener(e,n,br)}function Lu(t,e){const n=Au[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 Tu(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 zu(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 yr=0;function _r(){const t=window.devicePixelRatio;t!==yr&&(yr=t,tn.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Hu(t,e){tn.size||window.addEventListener("resize",_r),tn.set(t,e)}function Wu(t){tn.delete(t),tn.size||window.removeEventListener("resize",_r)}function ju(t,e,n){const o=t.canvas,i=o&&Ho(o);if(!i)return;const s=ws((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),Hu(t,s),r}function Ko(t,e,n){n&&n.disconnect(),e==="resize"&&Wu(t)}function Yu(t,e,n){const o=t.canvas,i=ws(s=>{t.ctx!==null&&n(Lu(s,t))},t);return Nu(o,e,i),i}class Gu extends gr{acquireContext(e,n){const o=e&&e.getContext&&e.getContext("2d");return o&&o.canvas===e?(Ou(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:Tu,detach:zu,resize:ju}[n]||Yu;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]||Iu)(e,n,i),o[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,o,i){return Nd(e,n,o,i)}isAttached(e){const n=Ho(e);return!!(n&&n.isConnected)}}function Uu(t){return!zo()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Pu:Gu}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 qu(t,e){const n=t.options.ticks,o=Xu(t),i=Math.min(n.maxTicksLimit||o,o),s=n.major.enabled?Zu(e):[],r=s.length,a=s[0],c=s[r-1],d=[];if(r>i)return Ju(e,d,s,r/i),d;const u=Ku(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 Xu(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 Ku(t,e,n){const o=Qu(t),i=e.length/n;if(!o)return Math.max(i,1);const s=zc(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 Zu(t){const e=[];let n,o;for(n=0,o=t.length;n<o;n++)t[n].major&&e.push(n);return e}function Ju(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 Qu(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 ef=t=>t==="left"?"right":t==="right"?"left":t,xr=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,wr=(t,e)=>Math.min(e||t,t);function Cr(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 tf(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 nf(t,e){j(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 kr(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 of(t,e){return Qe(t,{scale:e,type:"scale"})}function sf(t,e,n){return Qe(t,{tick:n,index:e,type:"tick"})}function rf(t,e,n){let o=Fo(t);return(n&&e!=="right"||!n&&e==="right")&&(o=ef(o)),o}function lf(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=xr(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=xr(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=gd(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?Cr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=qu(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=wr(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=ie(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-kr(e.title,this.chart.options.font),d=Math.sqrt(f*f+p*p),r=Do(Math.min(Math.asin(ie((u.highest.height+6)/a,-1,1)),Math.asin(ie(c/d,-1,1))-Math.asin(ie(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=kr(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=Cr(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/wr(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)}nf(s,n);const k=r.indexOf(d),v=a.indexOf(u),C=D=>({width:r[D]||0,height:a[D]||0});return{first:C(0),last:C(n-1),widest:C(k),highest:C(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 jc(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=sf(this.getContext(),e,o))}return this.$context||(this.$context=of(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(M){return ut(o,M,m)};let y,w,S,_,k,v,C,D,V,$,O,U;if(r==="top")y=x(this.bottom),v=this.bottom-p,D=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,D=this.top+p;else if(r==="left")y=x(this.right),k=this.right-p,C=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,k=y+b,C=this.left+p;else if(n==="x"){if(r==="center")y=x((e.top+e.bottom)/2+.5);else if(z(r)){const M=Object.keys(r)[0],R=r[M];y=x(this.chart.scales[M].getPixelForValue(R))}$=e.top,U=e.bottom,v=y+b,D=v+p}else if(n==="y"){if(r==="center")y=x((e.left+e.right)/2);else if(z(r)){const M=Object.keys(r)[0],R=r[M];y=x(this.chart.scales[M].getPixelForValue(R))}k=y-b,C=k-p,V=e.left,O=e.right}const P=T(i.ticks.maxTicksLimit,f),E=Math.max(1,Math.ceil(f/P));for(w=0;w<f;w+=E){const M=this.getContext(w),R=s.setContext(M),B=a.setContext(M),A=R.lineWidth,N=R.color,W=B.dash||[],Y=B.dashOffset,Z=R.tickWidth,J=R.tickColor,se=R.tickBorderDash||[],me=R.tickBorderDashOffset;S=tf(this,w,c),S!==void 0&&(_=ut(o,S,A),d?k=C=V=O=_:v=D=$=U=_,h.push({tx1:k,ty1:v,tx2:C,ty2:D,x1:V,y1:$,x2:O,y2:U,width:A,color:N,borderDash:W,borderDashOffset:Y,tickWidth:Z,tickColor:J,tickBorderDash:se,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,_,k,v,C,D,V,$,O,U="middle";if(i==="top")k=this.bottom-g,v=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+g,v=this._getXAxisLabelAlignment();else if(i==="left"){const E=this._getYAxisLabelAlignment(p);v=E.textAlign,_=E.x}else if(i==="right"){const E=this._getYAxisLabelAlignment(p);v=E.textAlign,_=E.x}else if(n==="x"){if(i==="center")k=(e.top+e.bottom)/2+h;else if(z(i)){const E=Object.keys(i)[0],M=i[E];k=this.chart.scales[E].getPixelForValue(M)+h}v=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")_=(e.left+e.right)/2-h;else if(z(i)){const E=Object.keys(i)[0],M=i[E];_=this.chart.scales[E].getPixelForValue(M)}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 E=s.setContext(this.getContext(x));C=this.getPixelForTick(x)+s.labelOffset,D=this._resolveTickFontOptions(x),V=D.lineHeight,$=q(S)?S.length:1;const M=$/2,R=E.color,B=E.textStrokeColor,A=E.textStrokeWidth;let N=v;r?(_=C,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-M*V+V:O=-P.highest.height+V/2:d==="near"||m!==0?O=V/2:d==="center"?O=P.highest.height/2-M*V:O=P.highest.height-$*V,f&&(O*=-1),m!==0&&!E.showLabelBackdrop&&(_+=V/2*Math.sin(m))):(k=C,O=(1-$)*V/2);let W;if(E.showLabelBackdrop){const Y=ae(E.backdropPadding),Z=P.heights[x],J=P.widths[x];let se=O-Y.top,me=0-Y.left;switch(U){case"middle":se-=Z/2;break;case"bottom":se-=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}W={left:me,top:se,width:J+Y.width,height:Z+Y.height,color:E.backdropColor}}b.push({label:S,font:D,textOffset:O,options:{rotation:m,color:R,strokeColor:B,strokeWidth:A,textAlign:N,textBaseline:U,translation:[_,k],backdrop:W}})}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}=lf(this,c,n,a);ft(e,o.text,0,0,s,{color:o.color,maxWidth:f,rotation:p,textAlign:rf(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 Wn{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;df(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,af(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 af(t,e,n){const o=Lt(Object.create(null),[n?te.get(n):{},te.get(e),t.defaults]);te.set(e,o),t.defaultRoutes&&cf(e,t.defaultRoutes),t.descriptors&&te.describe(e,t.descriptors)}function cf(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 df(t){return"id"in t&&"defaults"in t}class uf{constructor(){this.controllers=new Wn(Me,"datasets",!0),this.elements=new Wn(Le,"elements"),this.plugins=new Wn(Object,"plugins"),this.scales=new Wn(_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):j(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 uf;class ff{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=hf(o);return i===!1&&!n?[]:gf(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 hf(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 pf(t,e){return!e&&t===!1?null:t===!0?{}:t}function gf(t,{plugins:e,localIds:n},o,i){const s=[],r=t.getContext();for(const a of e){const c=a.id,d=pf(o[c],i);d!==null&&s.push({plugin:a,options:mf(t.config,{plugin:a,local:n[c]},d,r)})}return s}function mf(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 bf(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function yf(t,e){return t===e?"_index_":"_value_"}function Sr(t){if(t==="x"||t==="y"||t==="r")return t}function _f(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Jo(t,...e){if(Sr(t))return t;for(const n of e){const o=n.axis||_f(n.position)||t.length>1&&Sr(t[0].toLowerCase());if(o)return o}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function vr(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function xf(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 vr(t,"x",n[0])||vr(t,"y",n[0])}return{}}function wf(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,xf(r,t),te.scales[a.type]),d=yf(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=bf(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 Mr(t){const e=t.options||(t.options={});e.plugins=T(e.plugins,{}),e.scales=wf(t,e)}function Er(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Cf(t){return t=t||{},t.data=Er(t.data),Mr(t),t}const Dr=new Map,Vr=new Set;function jn(t,e){let n=Dr.get(t);return n||(n=e(),Dr.set(t,n),Vr.add(n)),n}const on=(t,e,n)=>{const o=Ke(e,n);o!==void 0&&t.add(o)};class kf{constructor(e){this._config=Cf(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=Er(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(),Mr(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return jn(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return jn(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return jn(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,o=this.type;return jn(`${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)),Vr.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}=Rr(this._resolverCache,e,i);let c=r;if(vf(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}=Rr(this._resolverCache,e,o);return z(n)?Dt(s,n,void 0,i):s}}function Rr(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 Sf=t=>z(t)&&Object.getOwnPropertyNames(t).some(e=>Ze(t[e]));function vf(t,e){const{isScriptable:n,isIndexable:o}=Bs(t);for(const i of e){const s=n(i),r=o(i),a=(r||s)&&t[i];if(s&&(Ze(a)||Sf(a))||r&&q(a))return!0}return!1}var Mf="4.4.1";const Ef=["top","bottom","left","right","chartArea"];function Fr(t,e){return t==="top"||t==="bottom"||Ef.indexOf(t)===-1&&e==="x"}function Br(t,e){return function(n,o){return n[t]===o[t]?n[e]-o[e]:n[t]-o[t]}}function $r(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),G(n&&n.onComplete,[t],e)}function Df(t){const e=t.chart,n=e.options.animation;G(n&&n.onProgress,[t],e)}function Pr(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={},Ar=t=>{const e=Pr(t);return Object.values(Yn).filter(n=>n.canvas===e).pop()};function Vf(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 Rf(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 Ff(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),Or()}static unregister(...e){Re.remove(...e),Or()}constructor(e,n){const o=this.config=new kf(n),i=Pr(e),s=Ar(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||Uu(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=Bc(),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 ff,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qc(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",$r),Ie.listen(this,"progress",Df),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():Ts(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Vs(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,Ts(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||{};j(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"}}))),j(s,r=>{const a=r.options,c=a.id,d=Jo(c,a),u=T(a.type,r.dtype);(a.position===void 0||Fr(a.position,d)!==Fr(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)}),j(i,(r,a)=>{r||delete o[a]}),j(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(Br("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(){j(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||j(s,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Br("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){j(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);(!us(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;Vf(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(!us(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=[],j(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(),$r({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=Ff(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=Mu.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(),Vs(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)};j(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(){j(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},j(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=Ic(e),d=Rf(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",Mf),F(Te,"getChart",Ar);function Or(){return j(Te.instances,t=>t._plugins.invalidate())}function Bf(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 $f(t){return No(t,["outerStart","outerEnd","innerStart","innerEnd"])}function Pf(t,e,n,o){const i=$f(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 ie(c,0,Math.min(s,d))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:ie(i.innerStart,0,r),innerEnd:ie(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 E=u>0?u-o:0,M=f>0?f-o:0,R=(E+M)/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:k}=Pf(e,p,f,y-x),v=f-w,C=f-S,D=x+w/v,V=y-S/C,$=p+_,O=p+k,U=x+_/$,P=y-k/O;if(t.beginPath(),s){const E=(D+V)/2;if(t.arc(r,a,f,D,E),t.arc(r,a,f,E,V),S>0){const A=Ft(C,V,r,a);t.arc(A.x,A.y,S,V,y+ne)}const M=Ft(O,y,r,a);if(t.lineTo(M.x,M.y),k>0){const A=Ft(O,P,r,a);t.arc(A.x,A.y,k,y+ne,P+Math.PI)}const R=(y-k/p+(x+_/p))/2;if(t.arc(r,a,p,y-k/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,D,r,a);t.arc(A.x,A.y,w,x-ne,D)}}else{t.moveTo(r,a);const E=Math.cos(D)*f+r,M=Math.sin(D)*f+a;t.lineTo(E,M);const R=Math.cos(V)*f+r,B=Math.sin(V)*f+a;t.lineTo(R,B)}t.closePath()}function Af(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 Of(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&&Bf(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}=ms(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||Wt(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,Af(n,this,u,r,a),Of(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 Nr(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 Nf(t,e,n){t.lineTo(n.x,n.y)}function If(t){return t.stepped?rd:t.tension||t.cubicInterpolationMode==="monotone"?ld:Nf}function Ir(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 Lf(t,e,n,o){const{points:i,options:s}=e,{count:r,start:a,loop:c,ilen:d}=Ir(i,n,o),u=If(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 Tf(t,e,n,o){const i=e.points,{count:s,start:r,ilen:a}=Ir(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,k=S|0;k===g?(_<m?m=_:_>b&&(b=_),u=(f*u+S)/++f):(w(),t.lineTo(S,_),g=k,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?Tf:Lf}function zf(t){return t.stepped?Ld:t.tension||t.cubicInterpolationMode==="monotone"?Td:mt}function Hf(t,e,n,o){let i=e._path;i||(i=e._path=new Path2D,e.path(i,n,o)&&i.closePath()),Nr(t,e.options),t.stroke(i)}function Wf(t,e,n,o){const{segments:i,options:s}=e,r=Qo(e);for(const a of i)Nr(t,s,a.style),t.beginPath(),r(t,e,a,{start:n,end:n+o-1})&&t.closePath(),t.stroke()}const jf=typeof Path2D=="function";function Yf(t,e,n,o){jf&&!e.options.segment?Hf(t,e,n,o):Wf(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;Fd(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=Gd(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=Us(this,{property:n,start:i,end:i});if(!r.length)return;const a=[],c=zf(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(),Yf(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 Lr(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 Lr(this,n,"x",o)}inYRange(n,o){return Lr(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 Tr(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:ie(e,n,o)}function Gf(t,e,n){const o=t.options.borderWidth,i=t.borderSkipped,s=Fs(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 Uf(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 qf(t){const e=Tr(t),n=e.right-e.left,o=e.bottom-e.top,i=Gf(t,n/2,o/2),s=Uf(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)&&Tr(t,o);return a&&(i||Ae(e,a.left,a.right))&&(s||Ae(n,a.top,a.bottom))}function Xf(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function Kf(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}=qf(this),a=Xf(r.radius)?Ut:Kf;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 Zf=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)"],zr=ni.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Hr(t){return ni[t%ni.length]}function Wr(t){return zr[t%zr.length]}function Jf(t,e){return t.borderColor=Hr(e),t.backgroundColor=Wr(e),++e}function Qf(t,e){return t.backgroundColor=t.data.map(()=>Hr(e++)),e}function eh(t,e){return t.backgroundColor=t.data.map(()=>Wr(e++)),e}function th(t){let e=0;return(n,o)=>{const i=t.getDatasetMeta(o).controller;i instanceof bt?e=Qf(n,e):i instanceof Kt?e=eh(n,e):i&&(e=Jf(n,e))}}function jr(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function nh(t){return t&&(t.borderColor||t.backgroundColor)}var oh={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&&(jr(o)||nh(i)||s&&jr(s)))return;const r=th(t);o.forEach(r)}};function ih(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 k=Math.floor(f*a)+1+e,v=Math.min(Math.floor((f+1)*a)+1,n)+e,{x:C,y:D}=t[u];for(h=g=-1,y=k;y<v;y++)g=.5*Math.abs((C-b)*(t[y].y-D)-(C-t[y].x)*(x-D)),g>h&&(h=g,p=t[y],m=y);r[c++]=p,u=m}return r[c++]=t[d],r}function sh(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 k=r-1;if(!H(f)&&!H(p)){const v=Math.min(f,p),C=Math.max(f,p);v!==h&&v!==k&&b.push({...t[v],x:i}),C!==h&&C!==k&&b.push({...t[C],x:i})}r>0&&k!==h&&b.push(t[k]),b.push(a),u=_,s=0,g=m=d,f=p=h=r}}return b}function Yr(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 Gr(t){t.data.datasets.forEach(e=>{Yr(e)})}function rh(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=ie(Oe(e,s.axis,r).lo,0,n-1)),d?i=ie(Oe(e,s.axis,a).hi+1,o,n)-o:i=n-o,{start:o,count:i}}var lh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){Gr(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}=rh(c,d);const h=n.threshold||4*o;if(p<=h){Yr(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=ih(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}'`)}i._decimated=g})},destroy(t){Gr(t)}};function ah(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=Us(e,u);for(const p of f){const h=oi(n,s[p.start],s[p.end],p.loop),g=Gs(a,i,h);for(const m of g)r.push({source:m,target:p,start:{[n]:Ur(u,h,"start",Math.max)},end:{[n]:Ur(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 ch(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 Ur(t,e,n,o){return t&&e?o(t[n],e[n]):t?t[n]:e?e[n]:0}function qr(t,e){let n=[],o=!1;return q(t)?(o=!0,n=t):n=ch(t,e),n.length?new et({points:n,options:{tension:0},_loop:o,_fullLoop:o}):null}function Xr(t){return t&&t.fill!==!1}function dh(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 uh(t,e,n){const o=gh(t);if(z(o))return isNaN(o.value)?!1:o;let i=parseFloat(o);return ee(i)&&Math.floor(i)===i?fh(o[0],e,i,n):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}function fh(t,e,n,o){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=o?!1:n}function hh(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 ph(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 gh(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 mh(t){const{scale:e,index:n,line:o}=t,i=[],s=o.segments,r=o.points,a=bh(e,n);a.push(qr({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++)yh(i,r[u],a)}return new et({points:i,options:{}})}function bh(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 yh(t,e,n){const o=[];for(let i=0;i<n.length;i++){const s=n[i],{first:r,last:a,point:c}=_h(s,e,"x");if(!(!c||r&&a)){if(r)o.unshift(c);else if(t.push(c),!a)break}}t.push(...o)}function _h(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 Kr{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 xh(t){const{chart:e,fill:n,line:o}=t;if(ee(n))return wh(e,n);if(n==="stack")return mh(t);if(n==="shape")return!0;const i=Ch(t);return i instanceof Kr?i:qr(i,o)}function wh(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function Ch(t){return(t.scale||{}).getPointPositionForValue?Sh(t):kh(t)}function kh(t){const{scale:e={},fill:n}=t,o=hh(n,e);if(ee(o)){const i=e.isHorizontal();return{x:i?o:null,y:i?null:o}}return null}function Sh(t){const{scale:e,fill:n}=t,o=e.options,i=e.getLabels().length,s=o.reverse?e.max:e.min,r=ph(n,e,s),a=[];if(o.grid.circular){const c=e.getPointPositionForValue(0,s);return new Kr({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=xh(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),vh(t,{line:i,target:o,above:u,below:f,area:n,scale:s,axis:r}),Vn(t))}function vh(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&&(Zr(t,o,r.top),Jr(t,{line:n,target:o,color:i,scale:a,property:c}),t.restore(),t.save(),Zr(t,o,r.bottom)),Jr(t,{line:n,target:o,color:s,scale:a,property:c}),t.restore()}function Zr(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 Jr(t,e){const{line:n,target:o,property:i,color:s,scale:r}=e,a=ah(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,Mh(t,r,h&&oi(i,u,f)),t.beginPath();const g=!!n.pathSegment(t,c);let m;if(h){g?t.closePath():Qr(t,o,f,i);const b=!!o.pathSegment(t,d,{move:g,reverse:!0});m=g&&b,m||Qr(t,o,u,i)}t.closePath(),t.fill(m?"evenodd":"nonzero"),t.restore()}}function Mh(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 Qr(t,e,n,o){const i=e.interpolate(n,o);i&&t.lineTo(i.x,i.y)}var Eh={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:uh(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=dh(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;Xr(s)&&si(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,e,n){const o=e.meta.$filler;!Xr(o)||n.drawTime!=="beforeDatasetDraw"||si(t.ctx,o,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const el=(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)}},Dh=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class tl 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}=el(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}=Vh(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}=el(r,f),x=function(k,v,C){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const D=T(C.lineWidth,1);if(i.fillStyle=T(C.fillStyle,a),i.lineCap=T(C.lineCap,"butt"),i.lineDashOffset=T(C.lineDashOffset,0),i.lineJoin=T(C.lineJoin,"miter"),i.lineWidth=D,i.strokeStyle=T(C.strokeStyle,a),i.setLineDash(T(C.lineDash,[])),r.usePointStyle){const V={radius:m*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:D},$=c.xPlus(k,g/2),O=v+p;Rs(i,V,$,O,r.pointStyleWidth&&g)}else{const V=v+Math.max((f-m)/2,0),$=c.leftForLtr(k,g),O=ht(C.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(),D!==0&&i.stroke()}i.restore()},y=function(k,v,C){ft(i,C.text,k,v+b/2,d,{strikethrough:C.hidden,textAlign:c.textAlign(C.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},Hs(this.ctx,e.textDirection);const _=b+u;this.legendItems.forEach((k,v)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const C=i.measureText(k.text).width,D=c.textAlign(k.textAlign||(k.textAlign=r.textAlign)),V=g+p+C;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,k),$=Xc(D,$+g+p,w?$+V:this.right,e.rtl),y(c.x($),O,k),w)h.x+=V+u;else if(typeof k.text!="string"){const P=d.lineHeight;h.y+=nl(k,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(!Bh(e.type,n))return;const o=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const i=this._hoveredItem,s=Dh(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 Vh(t,e,n,o,i){const s=Rh(o,t,e,n),r=Fh(i,o,e.lineHeight);return{itemWidth:s,itemHeight:r}}function Rh(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 Fh(t,e,n){let o=t;return typeof e.text!="string"&&(o=nl(e,n)),o}function nl(t,e){const n=t.text?t.text.length:0;return e*n}function Bh(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var $h={id:"legend",_element:tl,start(t,e,n){const o=t.legend=new tl({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 Ph(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 Ah={id:"title",_element:ri,start(t,e,n){Ph(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 Oh={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(`
|
|
23
|
+
*/class pu{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=Ps.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 Le=new pu;const dr="transparent",gu={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const o=Ts(t||dr),i=o.valid&&Ts(e||dr);return i&&i.valid?i.mix(o,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class mu{constructor(e,n,o,i){const s=n[o];i=Xt([e.to,i,s,e.from]);const r=Xt([e.from,s,i]);this._active=!0,this._fn=e.fn||gu[e.type||typeof r],this._easing=Yt[e.easing]||Yt.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=Xt([e.to,n,i,e.from]),this._from=Xt([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 ur{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!H(e))return;const n=Object.keys(ne.animation),o=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!H(s))return;const r={};for(const a of n)r[a]=s[a];(X(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!o.has(a))&&o.set(a,r)})})}_animateOptions(e,n){const o=n.options,i=yu(e,o);if(!i)return[];const s=this._createAnimations(i,o);return o.$shared&&bu(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 mu(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 Le.add(this._chart,o),!0}}function bu(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 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 fr(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 _u(t,e,n){if(n===!1)return!1;const o=fr(t,n),i=fr(e,n);return{top:i.end,right:o.end,bottom:i.start,left:o.start}}function xu(t){let e,n,o,i;return H(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 hr(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 pr(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],te(d)&&(s||e===0||Ve(e)===Ve(d))&&(e+=d)}return e}}function wu(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 gr(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:i}=t.getUserBounds();return{min:o?e:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function Su(t,e,n){const o=t[e]||(t[e]={});return o[n]||(o[n]={})}function mr(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 br(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=Cu(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]=Su(i,u,m),p[a]=b,p._top=mr(p,r,!0,o.type),p._bottom=mr(p,r,!1,o.type);const y=p._visualValues||(p._visualValues={});y[a]=b}}function qo(t,e){const n=t.scales;return Object.keys(n).filter(o=>n[o].axis===e).shift()}function vu(t,e){return et(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Mu(t,e,n){return et(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function Kt(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 Xo=t=>t==="reset"||t==="none",yr=(t,e)=>e?t:Object.assign({},t),Eu=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:hr(n,!0),values:null};class Ee{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=gr(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&&Kt(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=z(o.xAxisID,qo(e,"x")),r=n.yAxisID=z(o.yAxisID,qo(e,"y")),a=n.rAxisID=z(o.rAxisID,qo(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&&Bs(this._data,this),e._stacked&&Kt(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),o=this._data;if(H(n))this._data=wu(n);else if(o!==n){if(o){Bs(o,this);const i=this._cachedMeta;Kt(i),i._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 i=!1;this._dataCheck();const s=n._stacked;n._stacked=gr(n.vScale,n),n.stack!==o.stack&&(i=!0,Kt(n),n.stack=o.stack),this._resyncElements(e),(i||s!==n._stacked)&&br(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{X(i[e])?p=this.parseArrayData(o,i,e,n):H(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&&br(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(Ze(h,a),p),y:r.parse(Ze(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:hr(i,!0),values:n._stacks[e.axis]._visualValues};return pr(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=pr(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=Eu(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=i[p];const m=h[a.axis];return!te(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],te(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=xu(z(this.options.clip,_u(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=vu(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&&Ht(o);if(a)return yr(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(ne.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(yr(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 ur(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||Xo(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){Xo(i)?Object.assign(e,o):this._resolveAnimations(n,i).update(e,o)}updateSharedOptions(e,n,o){e&&!Xo(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&&Kt(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])}}R(Ee,"defaults",{}),R(Ee,"datasetElementType",null),R(Ee,"dataElementType",null);function Du(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=$s(o.sort((i,s)=>i-s))}return t._cache.$bar}function Vu(t){const e=t.iScale,n=Du(e,t.type);let o=e._length,i,s,r,a;const c=()=>{r===32767||r===-32768||(Ht(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 Fu(t,e,n,o){const i=n.barThickness;let s,r;return W(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 Ru(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 Bu(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 _r(t,e,n,o){return X(t)?Bu(t,e,n,o):e[n.axis]=n.parse(t,o),e}function xr(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(_r(p,f,s,d));return c}function Ko(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function $u(t,e,n){return t!==0?Ve(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function Pu(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 Au(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}=Pu(t);i==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===o?i=d:(n._bottom||0)===o?i=u:(s[wr(u,r,a,c)]=!0,i=d)),s[wr(i,r,a,c)]=!0,t.borderSkipped=s}function wr(t,e,n,o){return o?(t=Ou(t,e,n),t=Cr(t,n,e)):t=Cr(t,e,n),t}function Ou(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 Nu(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class Pn extends Ee{parsePrimitiveData(e,n,o,i){return xr(e,n,o,i)}parseArrayData(e,n,o,i){return xr(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(Ze(m,d),p),f.push(_r(Ze(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=Ko(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||W(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||Ko(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;Au(y,w,x,r),Nu(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(W(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||Vu(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=Ko(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=!W(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=$u(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=z(i.maxBarThickness,1/0);let a,c;if(n.grouped){const d=s?this._getStackCount(e):n.stackCount,u=i.barThickness==="flex"?Ru(e,n,i,d):Fu(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)}}R(Pn,"id","bar"),R(Pn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),R(Pn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class An extends Ee{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=z(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=z(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+=z(o&&o._custom,s),i}}R(An,"id","bubble"),R(An,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),R(An,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Iu(t,e,n){let o=1,i=1,s=0,r=0;if(e<Z){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(oe,u,p),x=g(K,d,f),y=g(K+oe,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 Ee{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(H(o[e])){const{key:c="value"}=this._parsing;s=d=>+Ze(o[d],c)}let r,a;for(r=e,a=e+n;r<a;++r)i._parsed[r]=s(r)}}_getRotation(){return Me(this.options.rotation-90)}_getCircumference(){return Me(this.options.circumference)}_getRotationExtents(){let e=Z,n=-Z;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(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,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/Z)}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)?Z*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart,i=o.data.labels||[],s=Gt(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(z(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}R(bt,"id","doughnut"),R(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"}),R(bt,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),R(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 Ee{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}=Os(n,i,r);this._drawStart=a,this._drawCount=c,Ns(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 k=e[_],v=x?k:{};if(_<n||_>=y){v.skip=!0;continue}const C=this.getParsed(_),D=W(C[h]),V=v[p]=r.getPixelForValue(C[p],_),$=v[h]=s||D?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,C,c):C[h],_);v.skip=isNaN(V)||isNaN($)||D,v.stop=_>0&&Math.abs(C[p]-S[p])>b,m&&(v.parsed=C,v.raw=d.data[_]),f&&(v.options=u||this.resolveDataElementOptions(_,k.active?"active":i)),x||this.updateElement(k,_,v,i),S=C}}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()}}R(On,"id","line"),R(On,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),R(On,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Zt extends Ee{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=Gt(n._parsed[e].r,o.options.locale);return{label:i[e]||"",value:s}}parseObjectData(e,n,o,i){return Js.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*K;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)?Me(this.resolveDataElementOptions(e,n).angle||o):0}}R(Zt,"id","polarArea"),R(Zt,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),R(Zt,"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 Zo extends bt{}R(Zo,"id","pie"),R(Zo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Nn extends Ee{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 Js.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)}}}R(Nn,"id","radar"),R(Nn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),R(Nn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class In extends Ee{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}=Os(n,o,i);if(this._drawStart=s,this._drawCount=r,Ns(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],k=this.getParsed(S),v=y?_:{},C=W(k[g]),D=v[h]=r.getPixelForValue(k[h],S),V=v[g]=s||C?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,k,c):k[g],S);v.skip=isNaN(D)||isNaN(V)||C,v.stop=S>0&&Math.abs(k[h]-w[h])>x,b&&(v.parsed=k,v.raw=d.data[S]),p&&(v.options=f||this.resolveDataElementOptions(S,_.active?"active":i)),y||this.updateElement(_,S,v,i),w=k}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}}R(In,"id","scatter"),R(In,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),R(In,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Lu=Object.freeze({__proto__:null,BarController:Pn,BubbleController:An,DoughnutController:bt,LineController:On,PieController:Zo,PolarAreaController:Zt,RadarController:Nn,ScatterController:In});function yt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Jo{constructor(e){R(this,"options");this.options=e||{}}static override(e){Object.assign(Jo.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 Tu={_date:Jo};function zu(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?dd:Ne;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 Jt(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}=zu(s[a],e,r,i);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,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)||Jt(t,n,e,function(a,c,d){!i&&!Ie(a,t.chartArea,0)||a.inRange(e.x,e.y,o)&&s.push({element:a,datasetIndex:c,index:d})},!0),s}function Wu(t,e,n,o){let i=[];function s(r,a,c){const{startAngle:d,endAngle:u}=r.getProps(["startAngle","endAngle"],o),{angle:f}=Fs(r,{x:e.x,y:e.y});jt(f,d,u)&&i.push({element:r,datasetIndex:a,index:c})}return Jt(t,n,e,s),i}function ju(t,e,n,o,i,s){let r=[];const a=Hu(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 Jt(t,n,e,d),r}function ei(t,e,n,o,i,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!o?Wu(t,e,n,i):ju(t,e,n,o,i,s)}function kr(t,e,n,o,i){const s=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return Jt(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 Yu={evaluateInteractionItems:Jt,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):ei(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):ei(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 ei(t,i,s,n.intersect,o,r)},x(t,e,n,o){const i=gt(e,t);return kr(t,i,"x",n.intersect,o)},y(t,e,n,o){const i=gt(e,t);return kr(t,i,"y",n.intersect,o)}}};const Sr=["left","top","right","bottom"];function Qt(t,e){return t.filter(n=>n.pos===e)}function vr(t,e){return t.filter(n=>Sr.indexOf(n.pos)===-1&&n.box.axis===e)}function en(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 Gu(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 Uu(t){const e={};for(const n of t){const{stack:o,pos:i,stackWeight:s}=n;if(!o||!Sr.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 qu(t,e){const n=Uu(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 Xu(t){const e=Gu(t),n=en(e.filter(d=>d.box.fullSize),!0),o=en(Qt(e,"left"),!0),i=en(Qt(e,"right")),s=en(Qt(e,"top"),!0),r=en(Qt(e,"bottom")),a=vr(e,"x"),c=vr(e,"y");return{fullSize:n,leftAndTop:o.concat(s),rightAndBottom:i.concat(c).concat(r).concat(a),chartArea:Qt(e,"chartArea"),vertical:o.concat(i).concat(c),horizontal:s.concat(r).concat(a)}}function Mr(t,e,n,o){return Math.max(t[n],e[n])+Math.max(t[o],e[o])}function Er(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:i,box:s}=n,r=t.maxPadding;if(!H(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&&Er(r,s.getPadding());const a=Math.max(0,e.outerWidth-Mr(r,t,"left","right")),c=Math.max(0,e.outerHeight-Mr(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 Ju(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 tn(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,Ju(a.horizontal,e));const{same:f,other:p}=Ku(e,n,a,o);d|=f&&i.length,u=u||p,c.fullSize||i.push(a)}return d&&tn(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 Dr(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;Ht(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;Ht(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 de={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=ce(t.options.layout.padding),s=Math.max(e-i.width,0),r=Math.max(n-i.height,0),a=Xu(t.boxes),c=a.vertical,d=a.horizontal;Y(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);Er(p,ce(o));const h=Object.assign({maxPadding:p,w:s,h:r,x:i.left,y:i.top},i),g=qu(c.concat(d),f);tn(a.fullSize,h,f,g),tn(c,h,f,g),tn(d,h,f,g)&&tn(c,h,f,g),Zu(h),Dr(a.leftAndTop,h,f,g),h.x+=h.w,h.y+=h.h,Dr(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},Y(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 Vr{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 Qu extends Vr{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Tn="$chartjs",ef={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Fr=t=>t===null||t==="";function tf(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",Fr(i)){const s=tr(t,"width");s!==void 0&&(t.width=s)}if(Fr(o))if(t.style.height==="")t.height=t.width/(e||2);else{const s=tr(t,"height");s!==void 0&&(t.height=s)}return t}const Rr=ou?{passive:!0}:!1;function nf(t,e,n){t.addEventListener(e,n,Rr)}function of(t,e,n){t.canvas.removeEventListener(e,n,Rr)}function sf(t,e){const n=ef[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 rf(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 lf(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 nn=new Map;let Br=0;function $r(){const t=window.devicePixelRatio;t!==Br&&(Br=t,nn.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function af(t,e){nn.size||window.addEventListener("resize",$r),nn.set(t,e)}function cf(t){nn.delete(t),nn.size||window.removeEventListener("resize",$r)}function df(t,e,n){const o=t.canvas,i=o&&Uo(o);if(!i)return;const s=As((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),af(t,s),r}function ti(t,e,n){n&&n.disconnect(),e==="resize"&&cf(t)}function uf(t,e,n){const o=t.canvas,i=As(s=>{t.ctx!==null&&n(sf(s,t))},t);return nf(o,e,i),i}class ff extends Vr{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[Tn])return!1;const o=n[Tn].initial;["height","width"].forEach(s=>{const r=o[s];W(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:rf,detach:lf,resize:df}[n]||uf;i[n]=r(e,n,o)}removeEventListener(e,n){const o=e.$proxies||(e.$proxies={}),i=o[n];if(!i)return;({attach:ti,detach:ti,resize:ti}[n]||of)(e,n,i),o[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,o,i){return nu(e,n,o,i)}isAttached(e){const n=Uo(e);return!!(n&&n.isConnected)}}function hf(t){return!Go()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Qu:ff}let Te=(mo=class{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(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}},R(mo,"defaults",{}),R(mo,"defaultRoutes"),mo);function pf(t,e){const n=t.options.ticks,o=gf(t),i=Math.min(n.maxTicksLimit||o,o),s=n.major.enabled?bf(e):[],r=s.length,a=s[0],c=s[r-1],d=[];if(r>i)return yf(e,d,s,r/i),d;const u=mf(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,W(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,W(h)?e.length:c+h),d}return Hn(e,d,u),d}function gf(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 mf(t,e,n){const o=_f(t),i=e.length/n;if(!o)return Math.max(i,1);const s=rd(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 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 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=z(o,0),r=Math.min(z(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 _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,Pr=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,Ar=(t,e)=>Math.min(e||t,t);function Or(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 wf(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 Cf(t,e){Y(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 on(t){return t.drawTicks?t.tickLength:0}function Nr(t,e){if(!t.display)return 0;const n=ie(t.font,e),o=ce(t.padding);return(X(t.text)?t.text.length:1)*n.lineHeight+o.height}function kf(t,e){return et(t,{scale:e,type:"scale"})}function Sf(t,e,n){return et(t,{tick:n,index:e,type:"tick"})}function vf(t,e,n){let o=Oo(t);return(n&&e!=="right"||!n&&e==="right")&&(o=xf(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=ae(o,s,a),H(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=Pr(t,n,e);p=a-s}else{if(H(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=Pr(t,n,e);g=ae(o,r,i),f=n==="left"?-oe:oe}return{titleX:h,titleY:g,maxWidth:p,rotation:f}}class _t extends Te{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=_e(e,Number.POSITIVE_INFINITY),n=_e(n,Number.NEGATIVE_INFINITY),o=_e(o,Number.POSITIVE_INFINITY),i=_e(i,Number.NEGATIVE_INFINITY),{min:_e(e,o),max:_e(n,i),minDefined:te(e),maxDefined:te(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:_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(){U(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=Pd(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?Or(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(){U(this.options.afterUpdate,[this])}beforeSetDimensions(){U(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(){U(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),U(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){U(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=U(n.callback,[s.value,o,e],this)}afterTickToLabelConversion(){U(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){U(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,o=Ar(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-on(e.grid)-n.padding-Nr(e.title,this.chart.options.font),d=Math.sqrt(f*f+p*p),r=$o(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(){U(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){U(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=Nr(i,n.options.font);if(a?(e.width=this.maxWidth,e.height=on(s)+c):(e.height=this.maxHeight,e.width=on(s)+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 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(){U(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++)W(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=Or(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/Ar(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,!W(g)&&!X(g))w=En(i,x.data,x.gc,w,g),S=y;else if(X(g))for(p=0,h=g.length;p<h;++p)_=g[p],!W(_)&&!X(_)&&(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)}Cf(s,n);const k=r.indexOf(d),v=a.indexOf(u),C=D=>({width:r[D]||0,height:a[D]||0});return{first:C(0),last:C(n-1),widest:C(k),highest:C(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?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=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)),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=on(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,b=m/2,x=function(M){return ut(o,M,m)};let y,w,S,_,k,v,C,D,V,$,N,q;if(r==="top")y=x(this.bottom),v=this.bottom-p,D=y-b,$=x(e.top)+b,q=e.bottom;else if(r==="bottom")y=x(this.top),$=e.top,q=x(e.bottom)-b,v=y+b,D=this.top+p;else if(r==="left")y=x(this.right),k=this.right-p,C=y-b,V=x(e.left)+b,N=e.right;else if(r==="right")y=x(this.left),V=e.left,N=x(e.right)-b,k=y+b,C=this.left+p;else if(n==="x"){if(r==="center")y=x((e.top+e.bottom)/2+.5);else if(H(r)){const M=Object.keys(r)[0],F=r[M];y=x(this.chart.scales[M].getPixelForValue(F))}$=e.top,q=e.bottom,v=y+b,D=v+p}else if(n==="y"){if(r==="center")y=x((e.left+e.right)/2);else if(H(r)){const M=Object.keys(r)[0],F=r[M];y=x(this.chart.scales[M].getPixelForValue(F))}k=y-b,C=k-p,V=e.left,N=e.right}const P=z(i.ticks.maxTicksLimit,f),E=Math.max(1,Math.ceil(f/P));for(w=0;w<f;w+=E){const M=this.getContext(w),F=s.setContext(M),B=a.setContext(M),O=F.lineWidth,I=F.color,j=B.dash||[],G=B.dashOffset,J=F.tickWidth,Q=F.tickColor,re=F.tickBorderDash||[],be=F.tickBorderDashOffset;S=wf(this,w,c),S!==void 0&&(_=ut(o,S,O),d?k=C=V=N=_:v=D=$=q=_,h.push({tx1:k,ty1:v,tx2:C,ty2:D,x1:V,y1:$,x2:N,y2:q,width:O,color:I,borderDash:j,borderDashOffset:G,tickWidth:J,tickColor:Q,tickBorderDash:re,tickBorderDashOffset:be}))}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=on(o.grid),h=p+u,g=f?-u:h,m=-Me(this.labelRotation),b=[];let x,y,w,S,_,k,v,C,D,V,$,N,q="middle";if(i==="top")k=this.bottom-g,v=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+g,v=this._getXAxisLabelAlignment();else if(i==="left"){const E=this._getYAxisLabelAlignment(p);v=E.textAlign,_=E.x}else if(i==="right"){const E=this._getYAxisLabelAlignment(p);v=E.textAlign,_=E.x}else if(n==="x"){if(i==="center")k=(e.top+e.bottom)/2+h;else if(H(i)){const E=Object.keys(i)[0],M=i[E];k=this.chart.scales[E].getPixelForValue(M)+h}v=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")_=(e.left+e.right)/2-h;else if(H(i)){const E=Object.keys(i)[0],M=i[E];_=this.chart.scales[E].getPixelForValue(M)}v=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(c==="start"?q="top":c==="end"&&(q="bottom"));const P=this._getLabelSizes();for(x=0,y=a.length;x<y;++x){w=a[x],S=w.label;const E=s.setContext(this.getContext(x));C=this.getPixelForTick(x)+s.labelOffset,D=this._resolveTickFontOptions(x),V=D.lineHeight,$=X(S)?S.length:1;const M=$/2,F=E.color,B=E.textStrokeColor,O=E.textStrokeWidth;let I=v;r?(_=C,v==="inner"&&(x===y-1?I=this.options.reverse?"left":"right":x===0?I=this.options.reverse?"right":"left":I="center"),i==="top"?d==="near"||m!==0?N=-$*V+V/2:d==="center"?N=-P.highest.height/2-M*V+V:N=-P.highest.height+V/2:d==="near"||m!==0?N=V/2:d==="center"?N=P.highest.height/2-M*V:N=P.highest.height-$*V,f&&(N*=-1),m!==0&&!E.showLabelBackdrop&&(_+=V/2*Math.sin(m))):(k=C,N=(1-$)*V/2);let j;if(E.showLabelBackdrop){const G=ce(E.backdropPadding),J=P.heights[x],Q=P.widths[x];let re=N-G.top,be=0-G.left;switch(q){case"middle":re-=J/2;break;case"bottom":re-=J;break}switch(v){case"center":be-=Q/2;break;case"right":be-=Q;break;case"inner":x===y-1?be-=Q:x>0&&(be-=Q/2);break}j={left:be,top:re,width:Q+G.width,height:J+G.height,color:E.backdropColor}}b.push({label:S,font:D,textOffset:N,options:{rotation:m,color:F,strokeColor:B,strokeWidth:O,textAlign:I,textBaseline:q,translation:[_,k],backdrop:j}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Me(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=ie(o.font),r=ce(o.padding),a=o.align;let c=s.lineHeight/2;n==="bottom"||n==="center"||H(n)?(c+=r.bottom,X(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:vf(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=z(e.grid&&e.grid.z,-1),i=z(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 ie(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Wn{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 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,Ef(e,r,o),this.override&&ne.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 ne[i]&&(delete ne[i][o],this.override&&delete dt[o])}}function Ef(t,e,n){const o=Tt(Object.create(null),[n?ne.get(n):{},ne.get(e),t.defaults]);ne.set(e,o),t.defaultRoutes&&Df(e,t.defaultRoutes),t.descriptors&&ne.describe(e,t.descriptors)}function Df(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(".");ne.route(s,i,c,a)})}function Vf(t){return"id"in t&&"defaults"in t}class Ff{constructor(){this.controllers=new Wn(Ee,"datasets",!0),this.elements=new Wn(Te,"elements"),this.plugins=new Wn(Object,"plugins"),this.scales=new Wn(_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):Y(i,r=>{const a=o||this._getRegistryForType(r);this._exec(e,a,r)})})}_exec(e,n,o){const i=Bo(e);U(o["before"+i],[],o),n[e](o),U(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 Fe=new Ff;class Rf{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(U(a,c,r)===!1&&i.cancelable)return!1}return!0}invalidate(){W(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=z(o.options&&o.options.plugins,{}),s=Bf(o);return i===!1&&!n?[]:Pf(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 Bf(t){const e={},n=[],o=Object.keys(Fe.plugins.items);for(let s=0;s<o.length;s++)n.push(Fe.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 $f(t,e){return!e&&t===!1?null:t===!0?{}:t}function Pf(t,{plugins:e,localIds:n},o,i){const s=[],r=t.getContext();for(const a of e){const c=a.id,d=$f(o[c],i);d!==null&&s.push({plugin:a,options:Af(t.config,{plugin:a,local:n[c]},d,r)})}return s}function Af(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 ni(t,e){const n=ne.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 Ir(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 oi(t,...e){if(Ir(t))return t;for(const n of e){const o=n.axis||If(n.position)||t.length>1&&Ir(t[0].toLowerCase());if(o)return o}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Lr(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 Lr(t,"x",n[0])||Lr(t,"y",n[0])}return{}}function Tf(t,e){const n=dt[t.type]||{scales:{}},o=e.scales||{},i=ni(t.type,e),s=Object.create(null);return Object.keys(o).forEach(r=>{const a=o[r];if(!H(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=oi(r,a,Lf(r,t),ne.scales[a.type]),d=Nf(c,i),u=n.scales||{};s[r]=zt(Object.create(null),[{axis:c},a,u[c],u[d]])}),t.data.datasets.forEach(r=>{const a=r.type||t.type,c=r.indexAxis||ni(a,e),u=(dt[a]||{}).scales||{};Object.keys(u).forEach(f=>{const p=Of(f,c),h=r[p+"AxisID"]||p;s[h]=s[h]||Object.create(null),zt(s[h],[{axis:p},o[h],u[f]])})}),Object.keys(s).forEach(r=>{const a=s[r];zt(a,[ne.scales[a.type],ne.scale])}),s}function Tr(t){const e=t.options||(t.options={});e.plugins=z(e.plugins,{}),e.scales=Tf(t,e)}function zr(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function zf(t){return t=t||{},t.data=zr(t.data),Tr(t),t}const Hr=new Map,Wr=new Set;function jn(t,e){let n=Hr.get(t);return n||(n=e(),Hr.set(t,n),Wr.add(n)),n}const sn=(t,e,n)=>{const o=Ze(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=zr(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(),Tr(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return jn(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return jn(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return jn(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,o=this.type;return jn(`${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=>sn(c,e,f))),u.forEach(f=>sn(c,i,f)),u.forEach(f=>sn(c,dt[s]||{},f)),u.forEach(f=>sn(c,ne,f)),u.forEach(f=>sn(c,Lo,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Wr.has(n)&&r.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,dt[n]||{},ne.datasets[n]||{},{type:n},ne,Lo]}resolveNamedOptions(e,n,o,i=[""]){const s={$shared:!0},{resolver:r,subPrefixes:a}=jr(this._resolverCache,e,i);let c=r;if(jf(r,n)){s.$shared=!1,o=Je(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}=jr(this._resolverCache,e,o);return H(n)?Dt(s,n,void 0,i):s}}function jr(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:Wo(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},o.set(i,s)),s}const Wf=t=>H(t)&&Object.getOwnPropertyNames(t).some(e=>Je(t[e]));function jf(t,e){const{isScriptable:n,isIndexable:o}=Gs(t);for(const i of e){const s=n(i),r=o(i),a=(r||s)&&t[i];if(s&&(Je(a)||Wf(a))||r&&X(a))return!0}return!1}var Yf="4.4.1";const Gf=["top","bottom","left","right","chartArea"];function Yr(t,e){return t==="top"||t==="bottom"||Gf.indexOf(t)===-1&&e==="x"}function Gr(t,e){return function(n,o){return n[t]===o[t]?n[e]-o[e]:n[t]-o[t]}}function Ur(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),U(n&&n.onComplete,[t],e)}function Uf(t){const e=t.chart,n=e.options.animation;U(n&&n.onProgress,[t],e)}function qr(t){return Go()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Yn={},Xr=t=>{const e=qr(t);return Object.values(Yn).filter(n=>n.canvas===e).pop()};function qf(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 Xf(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 Kf(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 ze{static register(...e){Fe.add(...e),Kr()}static unregister(...e){Fe.remove(...e),Kr()}constructor(e,n){const o=this.config=new Hf(n),i=qr(e),s=Xr(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||hf(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 Rf,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=[],Yn[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Le.listen(this,"complete",Ur),Le.listen(this,"progress",Uf),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:o,height:i,_aspectRatio:s}=this;return W(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 Fe}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():er(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ws(this.canvas,this.ctx),this}stop(){return Le.stop(this),this}resize(e,n){Le.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,er(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),U(o.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Y(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=oi(r,a),d=c==="r",u=c==="x";return{options:a,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Y(s,r=>{const a=r.options,c=a.id,d=oi(c,a),u=z(a.type,r.dtype);(a.position===void 0||Yr(a.position,d)!==Yr(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=Fe.getScale(u);f=new p({id:c,type:u,ctx:this.ctx,chart:this}),o[f.id]=f}f.init(a,e)}),Y(i,(r,a)=>{r||delete o[a]}),Y(o,r=>{de.configure(this,r,r.options),de.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(Gr("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||ni(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=Fe.getController(a),{datasetElementType:d,dataElementType:u}=ne.datasets[a];Object.assign(c,{dataElementType:Fe.getElement(u),datasetElementType:d&&Fe.getElement(d)}),r.controller=new c(this,o),e.push(r.controller)}}return this._updateMetasets(),e}_resetElements(){Y(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||Y(s,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Gr("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Y(this.scales,e=>{de.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),o=new Set(e.events);(!vs(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;qf(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(!vs(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;de.update(this,this.width,this.height,e);const n=this.chartArea,o=n.width<=0||n.height<=0;this._layers=[],Y(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,Je(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&&(Le.has(this)?this.attached&&!Le.running(this)&&Le.start(this):(this.draw(),Ur({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=Kf(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 Ie(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,o,i){const s=Yu.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=et(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);Ht(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(),Le.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(),Ws(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)};Y(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(){Y(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Y(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=od(e),d=Xf(e,this._lastEvent,o,c);o&&(this._lastEvent=null,U(s.onHover,[e,a,this],this),c&&U(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)}}R(ze,"defaults",ne),R(ze,"instances",Yn),R(ze,"overrides",dt),R(ze,"registry",Fe),R(ze,"version",Yf),R(ze,"getChart",Xr);function Kr(){return Y(ze.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+oe,o-oe),t.closePath(),t.clip()}function Jf(t){return Ho(t,["outerStart","outerEnd","innerStart","innerEnd"])}function Qf(t,e,n,o){const i=Jf(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 Rt(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 E=u>0?u-o:0,M=f>0?f-o:0,F=(E+M)/2,B=F!==0?g*F/(F+o):g;h=(g-B)/2}const m=Math.max(.001,g*f-n/K)/f,b=(g-m)/2,x=c+b+h,y=i-b-h,{outerStart:w,outerEnd:S,innerStart:_,innerEnd:k}=Qf(e,p,f,y-x),v=f-w,C=f-S,D=x+w/v,V=y-S/C,$=p+_,N=p+k,q=x+_/$,P=y-k/N;if(t.beginPath(),s){const E=(D+V)/2;if(t.arc(r,a,f,D,E),t.arc(r,a,f,E,V),S>0){const O=Rt(C,V,r,a);t.arc(O.x,O.y,S,V,y+oe)}const M=Rt(N,y,r,a);if(t.lineTo(M.x,M.y),k>0){const O=Rt(N,P,r,a);t.arc(O.x,O.y,k,y+oe,P+Math.PI)}const F=(y-k/p+(x+_/p))/2;if(t.arc(r,a,p,y-k/p,F,!0),t.arc(r,a,p,F,x+_/p,!0),_>0){const O=Rt($,q,r,a);t.arc(O.x,O.y,_,q+Math.PI,x-oe)}const B=Rt(v,x,r,a);if(t.lineTo(B.x,B.y),w>0){const O=Rt(v,D,r,a);t.arc(O.x,O.y,w,x-oe,D)}}else{t.moveTo(r,a);const E=Math.cos(D)*f+r,M=Math.sin(D)*f+a;t.lineTo(E,M);const F=Math.cos(V)*f+r,B=Math.sin(V)*f+a;t.lineTo(F,B)}t.closePath()}function eh(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%Z||Z))}return Un(t,e,n,o,c,i),t.fill(),c}function th(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%Z||Z))}h&&Zf(t,e,g),s||(Un(t,e,n,o,g,i),t.stroke())}class rn extends Te{constructor(n){super();R(this,"circumference");R(this,"endAngle");R(this,"fullCircles");R(this,"innerRadius");R(this,"outerRadius");R(this,"pixelMargin");R(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}=Fs(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=z(p,d-c)>=Z||jt(r,c,d),b=Oe(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>Z?Math.floor(i/Z):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(K,i||0)),u=s*d;n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,eh(n,this,u,r,a),th(n,this,u,r,a),n.restore()}}R(rn,"id","arc"),R(rn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),R(rn,"defaultRoutes",{backgroundColor:"backgroundColor"}),R(rn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Zr(t,e,n=e){t.lineCap=z(n.borderCapStyle,e.borderCapStyle),t.setLineDash(z(n.borderDash,e.borderDash)),t.lineDashOffset=z(n.borderDashOffset,e.borderDashOffset),t.lineJoin=z(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=z(n.borderWidth,e.borderWidth),t.strokeStyle=z(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 Jr(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 ih(t,e,n,o){const{points:i,options:s}=e,{count:r,start:a,loop:c,ilen:d}=Jr(i,n,o),u=oh(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 sh(t,e,n,o){const i=e.points,{count:s,start:r,ilen:a}=Jr(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,k=S|0;k===g?(_<m?m=_:_>b&&(b=_),u=(f*u+S)/++f):(w(),t.lineTo(S,_),g=k,f=0,m=b=_),x=_}w()}function ii(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?sh:ih}function rh(t){return t.stepped?iu:t.tension||t.cubicInterpolationMode==="monotone"?su:mt}function lh(t,e,n,o){let i=e._path;i||(i=e._path=new Path2D,e.path(i,n,o)&&i.closePath()),Zr(t,e.options),t.stroke(i)}function ah(t,e,n,o){const{segments:i,options:s}=e,r=ii(e);for(const a of i)Zr(t,s,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 tt extends Te{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;Kd(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=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,i=e[n],s=this.points,r=lr(this,{property:n,start:i,end:i});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=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 ii(this)(e,this,n,o)}path(e,n,o){const i=this.segments,s=ii(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(),dh(e,this,o,i),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}R(tt,"id","line"),R(tt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),R(tt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),R(tt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Qr(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 Te{constructor(n){super();R(this,"parsed");R(this,"skip");R(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 Qr(this,n,"x",o)}inYRange(n,o){return Qr(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||!Ie(this,o,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,zo(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}R(qn,"id","point"),R(qn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),R(qn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function el(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 nt(t,e,n,o){return t?0:se(e,n,o)}function uh(t,e,n){const o=t.options.borderWidth,i=t.borderSkipped,s=Ys(o);return{t:nt(i.top,s.top,0,n),r:nt(i.right,s.right,0,e),b:nt(i.bottom,s.bottom,0,n),l:nt(i.left,s.left,0,e)}}function fh(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||H(i);return{topLeft:nt(!c||a.top||a.left,s.topLeft,0,r),topRight:nt(!c||a.top||a.right,s.topRight,0,r),bottomLeft:nt(!c||a.bottom||a.left,s.bottomLeft,0,r),bottomRight:nt(!c||a.bottom||a.right,s.bottomRight,0,r)}}function hh(t){const e=el(t),n=e.right-e.left,o=e.bottom-e.top,i=uh(t,n/2,o/2),s=fh(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 si(t,e,n,o){const i=e===null,s=n===null,a=t&&!(i&&s)&&el(t,o);return a&&(i||Oe(e,a.left,a.right))&&(s||Oe(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 ri(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 Te{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}=hh(this),a=ph(r.radius)?qt:gh;e.save(),(r.w!==s.w||r.h!==s.h)&&(e.beginPath(),a(e,ri(r,n,s)),e.clip(),a(e,ri(s,-n,r)),e.fillStyle=o,e.fill("evenodd")),e.beginPath(),a(e,ri(s,n)),e.fillStyle=i,e.fill(),e.restore()}inRange(e,n,o){return si(this,e,n,o)}inXRange(e,n){return si(this,e,null,n)}inYRange(e,n){return si(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}}R(Xn,"id","bar"),R(Xn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),R(Xn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var mh=Object.freeze({__proto__:null,ArcElement:rn,BarElement:Xn,LineElement:tt,PointElement:qn});const li=["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)"],tl=li.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function nl(t){return li[t%li.length]}function ol(t){return tl[t%tl.length]}function bh(t,e){return t.borderColor=nl(e),t.backgroundColor=ol(e),++e}function yh(t,e){return t.backgroundColor=t.data.map(()=>nl(e++)),e}function _h(t,e){return t.backgroundColor=t.data.map(()=>ol(e++)),e}function xh(t){let e=0;return(n,o)=>{const i=t.getDatasetMeta(o).controller;i instanceof bt?e=yh(n,e):i instanceof Zt?e=_h(n,e):i&&(e=bh(n,e))}}function il(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:i}=t.config,{elements:s}=i;if(!n.forceOverride&&(il(o)||wh(i)||s&&il(s)))return;const r=xh(t);o.forEach(r)}};function kh(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 k=Math.floor(f*a)+1+e,v=Math.min(Math.floor((f+1)*a)+1,n)+e,{x:C,y:D}=t[u];for(h=g=-1,y=k;y<v;y++)g=.5*Math.abs((C-b)*(t[y].y-D)-(C-t[y].x)*(x-D)),g>h&&(h=g,p=t[y],m=y);r[c++]=p,u=m}return r[c++]=t[d],r}function Sh(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 k=r-1;if(!W(f)&&!W(p)){const v=Math.min(f,p),C=Math.max(f,p);v!==h&&v!==k&&b.push({...t[v],x:i}),C!==h&&C!==k&&b.push({...t[C],x:i})}r>0&&k!==h&&b.push(t[k]),b.push(a),u=_,s=0,g=m=d,f=p=h=r}}return b}function sl(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 rl(t){t.data.datasets.forEach(e=>{sl(e)})}function vh(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(Ne(e,s.axis,r).lo,0,n-1)),d?i=se(Ne(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){rl(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(Xt([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){sl(i);return}W(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=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}'`)}i._decimated=g})},destroy(t){rl(t)}};function Eh(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=ci(c,d,i);const u=ai(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=lr(e,u);for(const p of f){const h=ai(n,s[p.start],s[p.end],p.loop),g=rr(a,i,h);for(const m of g)r.push({source:m,target:p,start:{[n]:ll(u,h,"start",Math.max)},end:{[n]:ll(u,h,"end",Math.min)}})}}return r}function ai(t,e,n,o){if(o)return;let i=e[t],s=n[t];return t==="angle"&&(i=xe(i),s=xe(s)),{property:t,start:i,end:s}}function Dh(t,e){const{x:n=null,y:o=null}=t||{},i=e.points,s=[];return e.segments.forEach(({start:r,end:a})=>{a=ci(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 ci(t,e,n){for(;e>t;e--){const o=n[e];if(!isNaN(o.x)&&!isNaN(o.y))break}return e}function ll(t,e,n,o){return t&&e?o(t[n],e[n]):t?t[n]:e?e[n]:0}function al(t,e){let n=[],o=!1;return X(t)?(o=!0,n=t):n=Dh(t,e),n.length?new tt({points:n,options:{tension:0},_loop:o,_fullLoop:o}):null}function cl(t){return t&&t.fill!==!1}function Vh(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(!te(i))return i;if(r=t[i],!r)return!1;if(r.visible)return i;s.push(i),i=r.fill}return!1}function Fh(t,e,n){const o=Ph(t);if(H(o))return isNaN(o.value)?!1:o;let i=parseFloat(o);return te(i)&&Math.floor(i)===i?Rh(o[0],e,i,n):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}function Rh(t,e,n,o){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=o?!1:n}function Bh(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:H(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:H(t)?o=t.value:o=e.getBaseValue(),o}function Ph(t){const e=t.options,n=e.fill;let o=z(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,i=[],s=o.segments,r=o.points,a=Oh(e,n);a.push(al({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++)Nh(i,r[u],a)}return new tt({points:i,options:{}})}function Oh(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 Nh(t,e,n){const o=[];for(let i=0;i<n.length;i++){const s=n[i],{first:r,last:a,point:c}=Ih(s,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 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(Oe(i,f,p)){a=i===f,c=i===p;break}}return{first:a,last:c,point:o}}class dl{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:Z},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 Lh(t){const{chart:e,fill:n,line:o}=t;if(te(n))return Th(e,n);if(n==="stack")return Ah(t);if(n==="shape")return!0;const i=zh(t);return i instanceof dl?i:al(i,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?Wh(t):Hh(t)}function Hh(t){const{scale:e={},fill:n}=t,o=Bh(n,e);if(te(o)){const i=e.isHorizontal();return{x:i?o:null,y:i?null:o}}return null}function Wh(t){const{scale:e,fill:n}=t,o=e.options,i=e.getLabels().length,s=o.reverse?e.max:e.min,r=$h(n,e,s),a=[];if(o.grid.circular){const c=e.getPointPositionForValue(0,s);return new dl({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 di(t,e,n){const o=Lh(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),jh(t,{line:i,target:o,above:u,below:f,area:n,scale:s,axis:r}),Vn(t))}function jh(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&&(ul(t,o,r.top),fl(t,{line:n,target:o,color:i,scale:a,property:c}),t.restore(),t.save(),ul(t,o,r.bottom)),fl(t,{line:n,target:o,color:s,scale:a,property:c}),t.restore()}function ul(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[ci(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 fl(t,e){const{line:n,target:o,property:i,color:s,scale:r}=e,a=Eh(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,Yh(t,r,h&&ai(i,u,f)),t.beginPath();const g=!!n.pathSegment(t,c);let m;if(h){g?t.closePath():hl(t,o,f,i);const b=!!o.pathSegment(t,d,{move:g,reverse:!0});m=g&&b,m||hl(t,o,u,i)}t.closePath(),t.fill(m?"evenodd":"nonzero"),t.restore()}}function Yh(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 hl(t,e,n,o){const i=e.interpolate(n,o);i&&t.lineTo(i.x,i.y)}var Gh={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 tt&&(c={visible:t.isDatasetVisible(r),index:r,fill:Fh(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=Vh(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&&di(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;cl(s)&&di(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,e,n){const o=e.meta.$filler;!cl(o)||n.drawTime!=="beforeDatasetDraw"||di(t.ctx,o,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const pl=(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 gl extends Te{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=U(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=ie(o.font),s=i.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=pl(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}=qh(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=Ft(s,this.left,this.width);if(this.isHorizontal()){let a=0,c=ae(o,this.left+i,this.right-this.lineWidths[a]);for(const d of n)a!==d.row&&(a=d.row,c=ae(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=ae(o,this.top+e+i,this.bottom-this.columnSizes[a].height);for(const d of n)d.col!==a&&(a=d.col,c=ae(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=ne.color,c=Ft(e.rtl,this.left,this.width),d=ie(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}=pl(r,f),x=function(k,v,C){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const D=z(C.lineWidth,1);if(i.fillStyle=z(C.fillStyle,a),i.lineCap=z(C.lineCap,"butt"),i.lineDashOffset=z(C.lineDashOffset,0),i.lineJoin=z(C.lineJoin,"miter"),i.lineWidth=D,i.strokeStyle=z(C.strokeStyle,a),i.setLineDash(z(C.lineDash,[])),r.usePointStyle){const V={radius:m*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:D},$=c.xPlus(k,g/2),N=v+p;js(i,V,$,N,r.pointStyleWidth&&g)}else{const V=v+Math.max((f-m)/2,0),$=c.leftForLtr(k,g),N=ht(C.borderRadius);i.beginPath(),Object.values(N).some(q=>q!==0)?qt(i,{x:$,y:V,w:g,h:m,radius:N}):i.rect($,V,g,m),i.fill(),D!==0&&i.stroke()}i.restore()},y=function(k,v,C){ft(i,C.text,k,v+b/2,d,{strikethrough:C.hidden,textAlign:c.textAlign(C.textAlign)})},w=this.isHorizontal(),S=this._computeTitleHeight();w?h={x:ae(s,this.left+u,this.right-o[0]),y:this.top+u+S,line:0}:h={x:this.left+u,y:ae(s,this.top+S+u,this.bottom-n[0].height),line:0},nr(this.ctx,e.textDirection);const _=b+u;this.legendItems.forEach((k,v)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const C=i.measureText(k.text).width,D=c.textAlign(k.textAlign||(k.textAlign=r.textAlign)),V=g+p+C;let $=h.x,N=h.y;c.setWidth(this.width),w?v>0&&$+V+u>this.right&&(N=h.y+=_,h.line++,$=h.x=ae(s,this.left+u,this.right-o[h.line])):v>0&&N+_>this.bottom&&($=h.x=$+n[h.line].width+u,h.line++,N=h.y=ae(s,this.top+S+u,this.bottom-n[h.line].height));const q=c.x($);if(x(q,N,k),$=pd(D,$+g+p,w?$+V:this.right,e.rtl),y(c.x($),N,k),w)h.x+=V+u;else if(typeof k.text!="string"){const P=d.lineHeight;h.y+=ml(k,P)+u}else h.y+=_}),or(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,o=ie(n.font),i=ce(n.padding);if(!n.display)return;const s=Ft(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=ae(e.align,f,this.right-p);else{const g=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);u=d+ae(e.align,this.top,this.bottom-g-e.labels.padding-this._computeTitleHeight())}const h=ae(a,f,f+p);r.textAlign=s.textAlign(Oo(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=ie(e.font),o=ce(e.padding);return e.display?n.lineHeight+o.height:0}_getLegendItemAt(e,n){let o,i,s;if(Oe(e,this.left,this.right)&&Oe(n,this.top,this.bottom)){for(s=this.legendHitBoxes,o=0;o<s.length;++o)if(i=s[o],Oe(e,i.left,i.left+i.width)&&Oe(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=Uh(i,o);i&&!s&&U(n.onLeave,[e,i,this],this),this._hoveredItem=o,o&&!s&&U(n.onHover,[e,o,this],this)}else o&&U(n.onClick,[e,o,this],this)}}function qh(t,e,n,o,i){const s=Xh(o,t,e,n),r=Kh(i,o,e.lineHeight);return{itemWidth:s,itemHeight:r}}function Xh(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 Kh(t,e,n){let o=t;return typeof e.text!="string"&&(o=ml(e,n)),o}function ml(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:gl,start(t,e,n){const o=t.legend=new gl({ctx:t.ctx,options:n,chart:t});de.configure(t,o,n),de.addBox(t,o)},stop(t){de.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const o=t.legend;de.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=ce(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 ui extends Te{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=X(o.text)?o.text.length:1;this._padding=ce(o.padding);const s=i*ie(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=ae(a,o,s),f=n+e,d=s-o):(r.position==="left"?(u=o+e,f=ae(a,i,n),c=K*-.5):(u=s-e,f=ae(a,n,i),c=K*.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=ie(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:Oo(n.align),textBaseline:"middle",translation:[r,a]})}}function Qh(t,e){const n=new ui({ctx:t.ctx,options:e,chart:t});de.configure(t,n,e),de.addBox(t,n),t.titleBlock=n}var ep={id:"title",_element:ui,start(t,e,n){Qh(t,n)},stop(t){const e=t.titleBlock;de.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const o=t.titleBlock;de.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 tp={id:"subtitle",start(t,e,n){const o=new ui({ctx:t.ctx,options:n,chart:t});de.configure(t,o,n),de.addBox(t,o),Kn.set(t,o)},stop(t){de.removeBox(t,Kn.get(t)),Kn.delete(t)},beforeUpdate(t,e,n){const o=Kn.get(t);de.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 ln={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=Po(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 Re(t,e){return e&&(X(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function He(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
24
24
|
`)>-1?t.split(`
|
|
25
|
-
`):t}function Nh(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 ol(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,j(t.title,w),n.font=c.string,j(t.beforeBody.concat(t.afterBody),w),y=e.displayColors?r+2+e.boxPadding:0,j(o,S=>{j(S.before,w),j(S.lines,w),j(S.after,w)}),y=0,n.font=u.string,j(t.footer,w),n.restore(),b+=g.width,{width:b,height:m}}function Ih(t,e){const{y:n,height:o}=e;return n<o/2?"top":n>t.height-o/2?"bottom":"center"}function Lh(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 Th(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"),Lh(d,t,e,n)&&(d="center"),d}function il(t,e,n){const o=n.yAlign||e.yAlign||Ih(t,n);return{xAlign:n.xAlign||e.xAlign||Th(t,e,n,o),yAlign:o}}function zh(t,e){let{x:n,width:o}=t;return e==="right"?n-=o:e==="center"&&(n-=o/2),n}function Hh(t,e,n){let{y:o,height:i}=t;return e==="top"?o+=n:e==="bottom"?o-=i+n:o-=i/2,o}function sl(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=zh(e,a);const m=Hh(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:ie(g,0,o.width-e.width),y:ie(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 rl(t){return Fe([],ze(t))}function Wh(t,e,n){return Qe(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function ll(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const al={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"?al[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 Zs(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Wh(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 rl(he(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:o}=n,i=[];return j(e,s=>{const r={before:[],lines:[],after:[]},a=ll(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 rl(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(Nh(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))),j(a,u=>{const f=ll(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=ol(this,o),d=Object.assign({},a,c),u=il(this.chart,o,d),f=sl(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(C){n.fillText(C,g.x(e.x+h),e.y+p/2),e.y+=p+s},b=g.textAlign(r);let x,y,w,S,_,k,v;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,e.x=Zn(this,b,o),n.fillStyle=o.bodyColor,j(this.beforeBody,m),h=a&&b!=="right"?r==="center"?d/2+u:d+2+u:0,S=0,k=i.length;S<k;++S){for(x=i[S],y=this.labelTextColors[S],n.fillStyle=y,j(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;j(x.after,m)}h=0,p=f.lineHeight,j(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=ol(this,e),c=Object.assign({},r,this._size),d=il(n,e,c),u=sl(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),Hs(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 jh={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:al},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"]},Yh=Object.freeze({__proto__:null,Colors:oh,Decimation:lh,Filler:Eh,Legend:$h,SubTitle:Oh,Title:Ah,Tooltip:jh});const Gh=(t,e,n,o)=>(typeof e=="string"?(n=t.push(e)-1,o.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function Uh(t,e,n,o){const i=t.indexOf(e);if(i===-1)return Gh(t,e,n,o);const s=t.lastIndexOf(e);return i!==s?n:i}const qh=(t,e)=>t===null?null:ie(Math.round(t),0,e);function cl(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:Uh(o,e,T(n,e),this._addedLabels),qh(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 cl.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:cl}});function Xh(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 _=hs((b-m)/g/h)*h,k,v,C,D;if(_<1e-14&&!x&&!y)return[{value:m},{value:b}];D=Math.ceil(b/_)-Math.floor(m/_),D>g&&(_=hs(D*_/g/h)*h),H(c)||(k=Math.pow(10,c),_=Math.ceil(_*k)/k),i==="ticks"?(v=Math.floor(m/_)*_,C=Math.ceil(b/_)*_):(v=m,C=b),x&&y&&s&&Hc((a-r)/s,_/1e3)?(D=Math.round(Math.min((a-r)/_,u)),_=(a-r)/D,v=r,C=a):w?(v=x?r:v,C=y?a:C,D=d-1,_=(C-v)/D):(D=(C-v)/_,Ht(D,Math.round(D),_/1e3)?D=Math.round(D):D=Math.ceil(D));const V=Math.max(gs(_),gs(v));k=Math.pow(10,H(c)?V:c),v=Math.round(v*k)/k,C=Math.round(C*k)/k;let $=0;for(x&&(p&&v!==r?(n.push({value:r}),v<r&&$++,Ht(Math.round((v+$*_)*k)/k,r,dl(r,S,t))&&$++):v<r&&$++);$<D;++$){const O=Math.round((v+$*_)*k)/k;if(y&&O>a)break;n.push({value:O})}return y&&p&&C!==a?n.length&&Ht(n[n.length-1].value,a,dl(a,S,t))?n[n.length-1].value=a:n.push({value:a}):(!y||C===a)&&n.push({value:C}),n}function dl(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=Xh(i,s);return e.bounds==="ticks"&&ps(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 ul(t){return t/Math.pow(10,ln(t))===1}function fl(t,e,n){const o=Math.pow(10,n),i=Math.floor(t/o);return Math.ceil(e/o)-i}function Kh(t,e){const n=e-t;let o=ln(n);for(;fl(t,e,o)>10;)o++;for(;fl(t,e,o)<10;)o--;return Math.min(o,ln(t))}function Zh(t,{min:e,max:n}){e=ye(t.min,e);const o=[],i=ln(e);let s=Kh(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:ul(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:ul(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=Zh(n,this);return e.bounds==="ticks"&&ps(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 Jh(t,e,n){return n=q(n)?n:[n],{w:sd(t,e.string,n),h:n.length*e.lineHeight}}function hl(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 Qh(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=Jh(t.ctx,f,t._pointLabels[c]);o[c]=p;const h=_e(t.getIndexAngle(c)+a),g=Math.round(Do(h)),m=hl(g,u.x,p.w,0,180),b=hl(g,u.y,p.h,90,270);ep(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=op(t,o,i)}function ep(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 tp(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=rp(c.y,a.h,d),f=ip(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 np(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 op(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=tp(t,u,c);o.push(f),a==="auto"&&(f.visible=np(f,d),f.visible&&(d=f))}return o}function ip(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 rp(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function lp(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 ap(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));lp(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 pl(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 cp(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(),pl(t,n,r,o),s.closePath(),s.stroke(),s.restore())}function dp(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?Qh(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 dp(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(),pl(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&&ap(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);cp(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 gl(t,e){return t-e}function ml(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 bl(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 up(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 fp(t){for(let e=pe.indexOf(t)+1,n=pe.length;e<n;++e)if(Qn[pe[e]].common)return pe[e]}function yl(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 hp(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 _l(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:hp(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 wu._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:ml(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=Gc(i,s,r);return this._unit=n.unit||(o.autoSkip?bl(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):up(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!o.major.enabled||this._unit==="year"?void 0:fp(this._unit),this.initOffsets(i),e.reverse&&a.reverse(),_l(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=ie(n,0,r),o=ie(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||bl(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++)yl(u,p,g);return(p===o||i.bounds==="ticks"||h===1)&&yl(u,p,g),Object.keys(u).sort(gl).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,_l(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(ml(this,i[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return _s(e.sort(gl))}}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 pp=Object.freeze({__proto__:null,CategoryScale:ai,LinearScale:ci,LogarithmicScale:di,RadialLinearScale:an,TimeScale:cn,TimeSeriesScale:fi});const gp=[xu,Zf,Yh,pp];Te.register(...gp);const mp={class:"px-24 py-16"},bp={class:"flex flex-col gap-8"},yp={class:"fm-color-typo-primary fm-typo-body-lg-400"},_p={class:"fm-color-typo-secondary fm-typo-body-md-400"},xp=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",mp,[l.createElementVNode("div",bp,[l.createElementVNode("div",yp,l.toDisplayString(d.name),1),l.createElementVNode("div",_p,l.toDisplayString(d.paragraph),1)]),l.createElementVNode("canvas",{ref_key:"canvas",ref:n},null,512)]))}});function wp(){var t;return(t=l.getCurrentInstance())==null?void 0:t.emit}function de(t,e){const n=wp(),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 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 Cp={class:"fm-checkbox"},kp={class:"fm-checkbox--wrapper"},Sp={class:"fm-checkbox__input--container"},vp=["checked","disabled","indeterminate"],Mp={key:0,class:"fm-checkbox__label-container"},Ep={class:"fm-typo-body-lg-400"},Dp={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},xl=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",Cp,[l.createElementVNode("label",kp,[l.createElementVNode("div",Sp,[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,vp),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",Mp,[l.renderSlot(c.$slots,"label"),l.createElementVNode("div",Ep,l.toDisplayString(e.label),1),e.sublabel?(l.openBlock(),l.createElementBlock("div",Dp,l.toDisplayString(e.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])]))}}),Wy="";var Vp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wl={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Vp,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 E=["th","st","nd","rd"],M=P%100;return"["+P+(E[(M-20)%10]||E[M]||E[0])+"]"}},w=function(P,E,M){var R=String(P);return!R||R.length>=E?P:""+Array(E+1-R.length).join(M)+P},S={s:w,z:function(P){var E=-P.utcOffset(),M=Math.abs(E),R=Math.floor(M/60),B=M%60;return(E<=0?"+":"-")+w(R,2,"0")+":"+w(B,2,"0")},m:function P(E,M){if(E.date()<M.date())return-P(M,E);var R=12*(M.year()-E.year())+(M.month()-E.month()),B=E.clone().add(R,f),A=M-B<0,N=E.clone().add(R+(A?-1:1),f);return+(-(R+(M-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",k={};k[_]=y;var v="$isDayjsObject",C=function(P){return P instanceof O||!(!P||!P[v])},D=function P(E,M,R){var B;if(!E)return _;if(typeof E=="string"){var A=E.toLowerCase();k[A]&&(B=A),M&&(k[A]=M,B=A);var N=E.split("-");if(!B&&N.length>1)return P(N[0])}else{var W=E.name;k[W]=E,B=W}return!R&&B&&(_=B),B||!R&&_},V=function(P,E){if(C(P))return P.clone();var M=typeof E=="object"?E:{};return M.date=P,M.args=arguments,new O(M)},$=S;$.l=D,$.i=C,$.w=function(P,E){return V(P,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var O=function(){function P(M){this.$L=D(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[v]=!0}var E=P.prototype;return E.parse=function(M){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 W=N[2]-1||0,Y=(N[7]||"0").substring(0,3);return A?new Date(Date.UTC(N[1],W,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Y)):new Date(N[1],W,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Y)}}return new Date(B)}(M),this.init()},E.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},E.$utils=function(){return $},E.isValid=function(){return this.$d.toString()!==m},E.isSame=function(M,R){var B=V(M);return this.startOf(R)<=B&&B<=this.endOf(R)},E.isAfter=function(M,R){return V(M)<this.startOf(R)},E.isBefore=function(M,R){return this.endOf(R)<V(M)},E.$g=function(M,R,B){return $.u(M)?this[R]:this.set(B,M)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(M,R){var B=this,A=!!$.u(R)||R,N=$.p(M),W=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,se=this.$D,me="set"+(this.$u?"UTC":"");switch(N){case h:return A?W(1,0):W(31,11);case f:return A?W(1,J):W(0,J+1);case u:var St=this.$locale().weekStart||0,gn=(Z<St?Z+7:Z)-St;return W(A?se-gn:se+(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()}},E.endOf=function(M){return this.startOf(M,!1)},E.$set=function(M,R){var B,A=$.p(M),N="set"+(this.$u?"UTC":""),W=(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[W](Y),Z.init(),this.$d=Z.set(g,Math.min(this.$D,Z.daysInMonth())).$d}else W&&this.$d[W](Y);return this.init(),this},E.set=function(M,R){return this.clone().$set(M,R)},E.get=function(M){return this[$.p(M)]()},E.add=function(M,R){var B,A=this;M=Number(M);var N=$.p(R),W=function(J){var se=V(A);return $.w(se.date(se.date()+Math.round(J*M)),A)};if(N===f)return this.set(f,this.$M+M);if(N===h)return this.set(h,this.$y+M);if(N===d)return W(1);if(N===u)return W(7);var Y=(B={},B[a]=o,B[c]=i,B[r]=n,B)[N]||1,Z=this.$d.getTime()+M*Y;return $.w(Z,this)},E.subtract=function(M,R){return this.add(-1*M,R)},E.format=function(M){var R=this,B=this.$locale();if(!this.isValid())return B.invalidDate||m;var A=M||"YYYY-MM-DDTHH:mm:ssZ",N=$.z(this),W=this.$H,Y=this.$m,Z=this.$M,J=B.weekdays,se=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(W%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,se,3);case"MMMM":return St(se,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(W);case"HH":return $.s(W,2,"0");case"h":return gn(1);case"hh":return gn(2);case"a":return vt(W,Y,!0);case"A":return vt(W,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(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(M,R,B){var A,N=this,W=$.p(R),Y=V(M),Z=(Y.utcOffset()-this.utcOffset())*o,J=this-Y,se=function(){return $.m(N,Y)};switch(W){case h:A=se()/12;break;case f:A=se();break;case p:A=se()/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)},E.daysInMonth=function(){return this.endOf(f).$D},E.$locale=function(){return k[this.$L]},E.locale=function(M,R){if(!M)return this.$L;var B=this.clone(),A=D(M,R,!0);return A&&(B.$L=A),B},E.clone=function(){return $.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},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(E){return this.$g(E,P[0],P[1])}}),V.extend=function(P,E){return P.$i||(P(E,O,V),P.$i=!0),V},V.locale=D,V.isDayjs=C,V.unix=function(P){return V(1e3*P)},V.en=k[_],V.Ls=k,V.p={},V})})(wl);var Fp=wl.exports;const ue=Rp(Fp),Bt=Math.min,wt=Math.max,to=Math.round,no=Math.floor,nt=t=>({x:t,y:t}),Bp={left:"right",right:"left",bottom:"top",top:"bottom"},$p={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 Cl(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 Cl(oo(t))}function Pp(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 Ap(t){const e=io(t);return[mi(t),e,mi(e)]}function mi(t){return t.replace(/start|end/g,e=>$p[e])}function Op(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 Np(t,e,n,o){const i=un(t);let s=Op(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=>Bp[e])}function Ip(t){return{top:0,right:0,bottom:0,left:0,...t}}function kl(t){return typeof t!="number"?Ip(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 Sl(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 Lp=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}=Sl(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}=Sl(d,p,c)),m=-1;continue}}return{x:u,y:f,placement:p,strategy:i,middlewareData:h}};async function vl(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=kl(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 Tp=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=kl(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],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(d));let v=k?k[w]:0;(!v||!await(r.isElement==null?void 0:r.isElement(k)))&&(v=a.floating[w]||s.floating[g]);const C=S/2-_/2,D=v/2-m[g]/2-1,V=Bt(f[x],D),$=Bt(f[y],D),O=V,U=v-m[g]-$,P=v/2-m[g]/2+C,E=hi(O,P,U),M=!c.arrow&&un(i)!=null&&P!=E&&s.reference[g]/2-(P<O?V:$)-m[g]/2<0,R=M?P<O?P-O:P-U:0;return{[h]:p[h]+R,data:{[h]:E,centerOffset:P-E-R,...M&&{alignmentOffset:R}},reset:M}}}),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)]:Ap(a));!p&&g!=="none"&&S.push(...Np(a,m,g,w));const _=[a,...S],k=await vl(e,b),v=[];let C=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&v.push(k[x]),f){const O=Pp(i,r,w);v.push(k[O[0]],k[O[1]])}if(C=[...C,{placement:i,overflows:v}],!v.every(O=>O<=0)){var D,V;const O=(((D=s.flip)==null?void 0:D.index)||0)+1,U=_[O];if(U)return{data:{index:O,overflows:C},reset:{placement:U}};let P=(V=C.filter(E=>E.overflows[0]<=0).sort((E,M)=>E.overflows[1]-M.overflows[1])[0])==null?void 0:V.placement;if(!P)switch(h){case"bestFit":{var $;const E=($=C.map(M=>[M.placement,M.overflows.filter(R=>R>0).reduce((R,B)=>R+B,0)]).sort((M,R)=>M[1]-R[1])[0])==null?void 0:$[0];E&&(P=E);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};async function zp(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 zp(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}}}}},Hp=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 vl(e,c),f=oo(Ct(i)),p=Cl(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 Ml(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=(Ml(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ml(t){return t instanceof Node||t instanceof xe(t).Node}function We(t){return t instanceof Element||t instanceof xe(t).Element}function Be(t){return t instanceof HTMLElement||t instanceof xe(t).HTMLElement}function El(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 Wp(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 We(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||El(t)&&t.host||He(t);return El(e)?e.host:e}function Dl(t){const e=$t(t);return ro(e)?t.ownerDocument?t.ownerDocument.body:t.body:Be(e)&&fn(e)?e:Dl(e)}function hn(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Dl(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 Vl(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 We(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}=Vl(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 Yp=nt(0);function Rl(t){const e=xe(t);return!xi()||!e.visualViewport?Yp:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Gp(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?We(o)&&(r=Pt(o)):r=Pt(t));const a=Gp(s,n,o)?Rl(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&&We(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 Up(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 qp(t){return Array.from(t.getClientRects())}function Fl(t){return kt(He(t)).left+lo(t).scrollLeft}function Xp(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+Fl(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 Kp(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 Zp(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 Bl(t,e,n){let o;if(e==="viewport")o=Kp(t,n);else if(e==="document")o=Xp(He(t));else if(We(e))o=Zp(e,n);else{const i=Rl(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return so(o)}function $l(t,e){const n=$t(t);return n===e||!We(n)||ro(n)?!1:Se(n).position==="fixed"||$l(n,e)}function Jp(t,e){const n=e.get(t);if(n)return n;let o=hn(t,[],!1).filter(a=>We(a)&&ot(a)!=="body"),i=null;const s=Se(t).position==="fixed";let r=s?$t(t):t;for(;We(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&&$l(t,r))?o=o.filter(u=>u!==r):i=a,r=$t(r)}return e.set(t,o),o}function Qp(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?Jp(e,this._c):[].concat(n),o],a=r[0],c=r.reduce((d,u)=>{const f=Bl(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},Bl(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function eg(t){return Vl(t)}function tg(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=Fl(i));return{x:r.left+a.scrollLeft-c.x,y:r.top+a.scrollTop-c.y,width:r.width,height:r.height}}function Pl(t,e){return!Be(t)||Se(t).position==="fixed"?null:e?e(t):t.offsetParent}function Al(t,e){const n=xe(t);if(!Be(t))return n;let o=Pl(t,e);for(;o&&Wp(o)&&Se(o).position==="static";)o=Pl(o,e);return o&&(ot(o)==="html"||ot(o)==="body"&&Se(o).position==="static"&&!_i(o))?n:o||jp(t)||n}const ng=async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||Al,s=this.getDimensions;return{reference:tg(e,await i(n),o),floating:{x:0,y:0,...await s(n)}}};function og(t){return Se(t).direction==="rtl"}const ig={convertOffsetParentRelativeRectToViewportRelativeRect:Up,getDocumentElement:He,getClippingRect:Qp,getOffsetParent:Al,getElementRects:ng,getClientRects:qp,getDimensions:eg,getScale:Pt,isElement:We,isRTL:og};function sg(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 k=_[0].intersectionRatio;if(k!==c){if(!w)return r();k?r(!1,k):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 Ol(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?sg(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 Nl=(t,e,n)=>{const o=new Map,i={platform:ig,...n},s={...i.platform,_c:o};return Lp(t,e,{...i,platform:s})};function Ci(t){var e;return(e=t==null?void 0:t.$el)!=null?e:t}function rg(t){return{name:"arrow",options:t,fn(e){const n=Ci(l.unref(t.element));return n==null?{}:Tp({element:n,padding:t.padding}).fn(e)}}}function Il(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ll(t,e){const n=Il(t);return Math.round(e*n)/n}function Tl(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 C=Ll(u.value,f.value),D=Ll(u.value,p.value);return c.value?{...v,transform:"translate("+C+"px, "+D+"px)",...Il(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:C+"px",top:D+"px"}});let y;function w(){d.value==null||u.value==null||Nl(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 k(){i.value||(b.value=!1)}return l.watch([s,r,a],w,{flush:"sync"}),l.watch([d,u],_,{flush:"sync"}),l.watch(i,k,{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 lg(t){for(;t;){if(ag(t))return t;t=t.parentElement}return document.scrollingElement}function ag(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 cg{constructor(e,n){F(this,"onScroll");F(this,"scrollParent");this.onScroll=n,this.scrollParent=lg(e)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const dg={class:"fm-menu__wrapper"},ug=l.defineComponent({__name:"FmMenu",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}=Tl(s,r,{middleware:[yi(4),bi()],placement:o.placement,whileElementsMounted:Ol});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 cg(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",dg,[l.renderSlot(h.$slots,"menu-content",{},void 0,!0)])],!0)],6)):l.createCommentVNode("",!0)]))}}),jy="",we=Q(ug,[["__scopeId","data-v-6ad9d23d"]]),fg={class:"fm-menu-item--left"},hg={key:0,class:"fm-menu-item--right"},pg=l.defineComponent({__name:"FmMenuItem",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},icon:{default:""},expandable:{type:Boolean,default:!1},hasCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dividerPlacement:{default:null}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=l.ref(!1),i=e,s=c=>{c.preventDefault(),!n.disabled&&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}),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",fg,[!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(xl,{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),l.renderSlot(c.$slots,"label",{},()=>[l.createElementVNode("div",null,[l.createElementVNode("div",{class:l.normalizeClass(`fm-typo-body-lg-400 ${c.disabled?"fm-color-typo-disabled":"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?"fm-color-typo-disabled":"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",hg,[l.createVNode(L,{name:"chevron_right",size:"md",color:c.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):l.createCommentVNode("",!0)],34)]))}}),Yy="",Ee=Q(pg,[["__scopeId","data-v-a50682bb"]]),gg={class:"w-full"},mg=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",gg,[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"]))}}),Gy="",it=Q(mg,[["__scopeId","data-v-177cd78a"]]),bg={class:"flex gap-4"},zl=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",bg,[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))}}),yg={class:"px-2 py-0"},_g={key:0,class:"fm-typo-body-xl-700"},xg={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},Hl=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 Nl(n.value,o.value,{placement:e.beak,middleware:[yi(10),bi(),Hp({padding:5}),e.hasArrow?rg({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",yg,[h.variant=="rich"?(l.openBlock(),l.createElementBlock("div",_g,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",xg,[(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)]))}}),Wl=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(Hl,{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 jl(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 Yl(t,e=null,n=null){let o=null;const i=de(t,"modelValue"),s=l.ref(!0),r=l.inject(Xi,null),{validate:a,resetValidation:c,errorMessages:d}=jl(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 wg={key:1,class:"flex items-center justify-between"},je=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}=Yl(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(Wl,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",wg,[l.createVNode(zl,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"]))}}),Cg={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[360px]"},kg={class:"w-max"},Sg={class:"flex h-40 justify-between px-4 py-8"},vg={class:"flex gap-4 items-center"},Mg={class:"fm-typo-body-lg-700"},Eg={class:"h-[264px] w-[160px]"},Dg={class:"fm-typo-body-lg-700"},Vg={class:"h-[264px] w-[160px]"},Rg={class:"flex gap-4 items-center justify-center"},Fg={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Bg=["onClick"],$g={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},Pg=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(je,{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",Cg,[l.createElementVNode("div",kg,[l.createElementVNode("div",Sg,[l.createElementVNode("div",vg,[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",Mg,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",Eg,[(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",Dg,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",Vg,[(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",Rg,[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",Fg,[(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,Bg)):l.createCommentVNode("",!0)]))),128))]))),128))])])]),l.createElementVNode("div",$g,[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"]))}}),Uy="",Ag=Q(Pg,[["__scopeId","data-v-16edf7f9"]]),Og=t=>(l.pushScopeId("data-v-431b8ad3"),t=t(),l.popScopeId(),t),Ng={class:"flex gap-1 items-center relative w-full"},Ig={class:"flex flex-col gap-4 w-full"},Lg=Og(()=>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)),Tg={class:"flex flex-col gap-4 w-full"},zg={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[720px]"},Hg={class:"flex gap-24"},Wg={class:"w-max"},jg={class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},Yg={class:"flex gap-4 items-center"},Gg={class:"fm-typo-body-lg-700"},Ug={class:"h-[264px] w-[160px]"},qg={class:"fm-typo-body-lg-700"},Xg={class:"h-[264px] w-[160px]"},Kg={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Zg=["onClick","onMouseover"],Jg={class:"w-max"},Qg={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},em={class:"flex gap-4 items-center"},tm={class:"fm-typo-body-lg-700"},nm={class:"h-[264px] w-[160px]"},om={class:"fm-typo-body-lg-700"},im={class:"h-[264px] w-[160px]"},sm={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},rm=["onClick","onMouseover"],lm={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},am=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 k=o.value.startDate;o.value={startDate:_,endDate:k}}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 _,k;o.value={startDate:(_=n.value)!=null&&_.startDate?ue(n.value.startDate,"YYYY-MM-DD"):null,endDate:(k=n.value)!=null&&k.endDate?ue(n.value.endDate,"YYYY-MM-DD"):null},i.value=!1},m=_=>{const k=[],v=_.endOf("month"),C=_.month();let D=_.startOf("week"),V=[];for(;D.isBefore(v.endOf("week"));)D.day()===0&&V.length>0&&(k.push(V),V=[]),V.push({date:D,isCurrentMonth:D.month()===C}),D=D.add(1,"day");return V.length>0&&k.push(V),k},b=(_,k)=>{c.value=!1,u.value=!1,d.value=!1,f.value=!1,_==="left"?(s.value=k,r.value=k.add(1,"month")):_==="right"&&(r.value=k,s.value=k.subtract(1,"month"))},x=l.computed(()=>Array.from(Array(7),(_,k)=>ue().day(k).format("ddd"))),y=_=>{const k=o.value.startDate,v=o.value.endDate;a.value=k&&v?null:a.value;const C=a.value,D=k==null?void 0:k.isSame(_),V=v==null?void 0:v.isSame(_),$=C==null?void 0:C.isSame(_);return{"fm-calendar__cell__button--selected":D&&V||D&&!v,"fm-calendar__cell__button--selected-start":D&&v&&!(D&&V)||k&&!v&&D&&(C==null?void 0:C.isAfter(k))||k&&!v&&$&&(C==null?void 0:C.isBefore(k)),"fm-calendar__cell__button--selected-end":V&&k&&!(D&&V)||k&&!v&&D&&(C==null?void 0:C.isBefore(k))||k&&!v&&$&&(C==null?void 0:C.isAfter(k)),"fm-calendar__cell__button--selected-between":k&&(v||C)&&v?_.isAfter(k)&&_.isBefore(v):_.isAfter(C)&&_.isBefore(k)||_.isBefore(C)&&_.isAfter(k)}},w=_=>{a.value=_},S=l.computed(()=>{let _=-5;const k=[];for(;_!=5;)k.push(s.value.add(_,"year")),_++;return k});return l.watch(()=>n.value,()=>{var _,k;return o.value={startDate:(_=n.value)!=null&&_.startDate?ue(n.value.startDate,"YYYY-MM-DD"):null,endDate:(k=n.value)!=null&&k.endDate?ue(n.value.endDate,"YYYY-MM-DD"):null}}),(_,k)=>(l.openBlock(),l.createBlock(je,{modelValue:l.unref(n),"onUpdate:modelValue":k[7]||(k[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:k[6]||(k[6]=C=>i.value=C)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",Ng,[l.createElementVNode("label",Ig,[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 C,D;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":(C=l.unref(n))!=null&&C.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((D=l.unref(n))!=null&&D.startDate?l.unref(ue)(l.unref(n).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])]),Lg,l.createElementVNode("label",Tg,[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 C,D;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":(C=l.unref(n))!=null&&C.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((D=l.unref(n))!=null&&D.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",zg,[l.createElementVNode("div",Hg,[l.createElementVNode("div",Wg,[l.createElementVNode("div",jg,[l.createElementVNode("div",Yg,[l.createVNode(L,{class:"cursor-pointer select-none",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:k[0]||(k[0]=()=>b("left",s.value.subtract(1,"month")))}),l.createVNode(we,{"show-menu":c.value,onDropdownChanged:k[1]||(k[1]=C=>c.value=C)},{"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",Gg,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",Ug,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(C,D)=>s.value.month(D)),C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("MMMM")},[l.createVNode(Ee,{"model-value":s.value.format("MMMM")===C.format("MMMM"),label:C.format("MMMM"),"onUpdate:modelValue":D=>b("left",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(we,{"show-menu":u.value,onDropdownChanged:k[2]||(k[2]=C=>u.value=C)},{"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",qg,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",Xg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(S.value,C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("YYYY")},[l.createVNode(Ee,{"model-value":s.value.format("YYYY")===C.format("YYYY"),label:C.format("YYYY"),"onUpdate:modelValue":D=>b("left",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])])]),l.createElementVNode("div",null,[l.createElementVNode("div",Kg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(x.value,C=>(l.openBlock(),l.createElementBlock("div",{key:C,class:"fm-calendar__cell"},l.toDisplayString(C),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m(s.value),(C,D)=>(l.openBlock(),l.createElementBlock("div",{key:D,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(C,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,Zg)):l.createCommentVNode("",!0)]))),128))]))),128))])])]),l.createElementVNode("div",Jg,[l.createElementVNode("div",Qg,[l.createElementVNode("div",em,[l.createVNode(we,{"show-menu":d.value,onDropdownChanged:k[3]||(k[3]=C=>d.value=C)},{"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",tm,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",nm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(C,D)=>r.value.month(D)),C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("MMMM")},[l.createVNode(Ee,{"model-value":r.value.format("MMMM")===C.format("MMMM"),label:C.format("MMMM"),"onUpdate:modelValue":D=>b("right",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(we,{"show-menu":f.value,onDropdownChanged:k[4]||(k[4]=C=>f.value=C)},{"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",om,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",im,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(S.value,C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("YYYY")},[l.createVNode(Ee,{"model-value":r.value.format("YYYY")===C.format("YYYY"),label:C.format("YYYY"),"onUpdate:modelValue":D=>b("right",C)},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:k[5]||(k[5]=()=>b("left",s.value.add(1,"month")))})]),l.createElementVNode("div",null,[l.createElementVNode("div",sm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(x.value,C=>(l.openBlock(),l.createElementBlock("div",{key:C,class:"fm-calendar__cell"},l.toDisplayString(C),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m(r.value),(C,D)=>(l.openBlock(),l.createElementBlock("div",{key:D,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(C,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,rm)):l.createCommentVNode("",!0)]))),128))]))),128))])])])]),l.createElementVNode("div",lm,[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"]))}}),qy="",cm=Q(am,[["__scopeId","data-v-431b8ad3"]]),dm=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(Xi,{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))}}),um={class:"fm-radio-btn"},fm={class:"fm-radio-btn__input--container"},hm=["value","disabled","checked"],pm={class:"py-8"},gm={class:"fm-typo-body-lg-400"},mm={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},bm=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(Ki,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",um,[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",fm,[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,hm)])),[[u,!r.value]]),l.createElementVNode("div",pm,[l.renderSlot(c.$slots,"label",{},()=>[l.createElementVNode("div",gm,l.toDisplayString(c.label),1),c.sublabel?(l.openBlock(),l.createElementBlock("div",mm,l.toDisplayString(c.sublabel),1)):l.createCommentVNode("",!0)],!0)])],2)])}}}),Xy="",ym=Q(bm,[["__scopeId","data-v-24fa5bf9"]]),_m=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(Ki,{groupValue:n,getDisabled:()=>e.disabled,updateValue(o){n.value=o}}),(o,i)=>(l.openBlock(),l.createBlock(je,{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"]))}}),xm={class:"flex flex-col gap-4"},wm={class:"w-[280px]"},Cm={class:"flex flex-col gap-4 justify-center"},km=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",xm,[l.createVNode(je,{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)?"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",wm,[(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",Cm,[d.multiselect&&r.value.length>0?(l.openBlock(),l.createBlock(Ui,{key:0,items:a.value,removable:"",disabled:d.disabled,onChipClosed:s},null,8,["items","disabled"])):l.createCommentVNode("",!0)])]))}}),Sm=["inputMode","value","placeholder","readOnly"],vm={key:0},Mm=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.onMounted(()=>{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(je,{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",vm,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,Sm)]),_: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"]))}}),Ky="",Em=Q(Mm,[["__scopeId","data-v-46378d3b"]]),Dm={class:"cursor-pointer fm-switch__container"},Vm={key:0},Rm={class:"fm-typo-body-lg-400"},Fm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Bm={class:"fm-switch__input--container"},$m=["checked","value","disabled"],Pm={key:1},Am={class:"fm-typo-body-lg-400"},Om={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Nm=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",Dm,[i.labelPlacement==="left"?(l.openBlock(),l.createElementBlock("div",Vm,[l.renderSlot(i.$slots,"label",{},void 0,!0),l.createElementVNode("div",Rm,l.toDisplayString(i.label),1),i.sublabel?(l.openBlock(),l.createElementBlock("div",Fm,l.toDisplayString(i.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",Bm,[l.createElementVNode("input",{checked:l.unref(n),class:"fm-switch__input--btn",type:"checkbox",value:i.value,disabled:i.disabled,onClick:o},null,8,$m),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",Pm,[l.createElementVNode("div",Am,l.toDisplayString(i.label),1),i.sublabel?(l.openBlock(),l.createElementBlock("div",Om,l.toDisplayString(i.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)]))}}),Zy="",Im=Q(Nm,[["__scopeId","data-v-c967bf28"]]),Lm=["value","inputMode","type","placeholder","minlength","maxlength","disabled","readOnly"],Tm=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(je,{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,Lm)]),_: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"]))}}),Jy="",zm=["value","placeholder","minlength","maxlength","readOnly","disabled"],Hm=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(je,{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,zm)],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"]))}}),Qy="",Wm=Q(Hm,[["__scopeId","data-v-280a005d"]]),jm={class:"flex flex-col fm-time-input items-center"},Ym=["value"],Gm=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,Ym),l.createElementVNode("div",{class:"fm-time-input__scroller",onClick:d},[l.createVNode(L,{name:"expand_more",size:"lg"})])]))}}),e_="",Gl=Q(Gm,[["__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 Um={class:"flex fm-time-input gap-16 items-center"},qm=l.createElementVNode("div",{class:"fm-typo-title-sm-700"}," : ",-1),Xm={class:"fm-time-input-periods"},Km=["onClick"],Ul=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",Um,[l.createVNode(Gl,{"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"]),qm,l.createVNode(Gl,{"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",Xm,[(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,Km))),128))])]))}}),t_="",Zm={class:"flex gap-8"},Jm={class:"bg-fm-color-neutral-white flex flex-col p-12 rounded-lg shadow-light-300 w-[343px]"},Qm=l.createElementVNode("div",{class:"fm-typo-body-xl-700"}," Enter time ",-1),eb={class:"flex justify-center w-full"},tb={class:"flex justify-end"},nb=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(je,{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",Zm,[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",Jm,[Qm,l.createElementVNode("div",eb,[l.createVNode(Ul,{"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",tb,[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"]))}}),ob=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))}}),n_="",ib=Q(ob,[["__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 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]])}}}),o_="",rb=Q(sb,[["__scopeId","data-v-f565b558"]]),lb={class:"fm-progress-indicator relative"},ab=["data-progress"],cb={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},ql=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",lb,[l.createElementVNode("div",{ref_key:"progress",ref:n,class:"fm-progress-circular w-full","data-progress":o.value},null,8,ab),l.createElementVNode("div",cb,[l.renderSlot(s.$slots,"default")])]))}}),i_="",db={class:"flex"},ub={key:0,class:"mt-8"},fb=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",db,[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",ub,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))}}),s_="",hb=Q(fb,[["__scopeId","data-v-b6db34bb"]]),pb={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},Xl=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",pb,l.toDisplayString(t.description),1)):l.createCommentVNode("",!0)],2))}}),gb=["data-title","data-description","data-disabled"],mb={class:"flex fm-step-container gap-12 grow"},bb=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(Zi);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",mb,[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(Xl,{title:t.title,description:t.description,disabled:s.value,class:"grow"},null,8,["title","description","disabled"])])],10,gb)),[[h,!s.value]])}}}),r_="",yb=Q(bb,[["__scopeId","data-v-ee172cad"]]),_b={class:"hidden items-center xs:flex"},xb={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},wb=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(Zi,{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",_b,[l.createVNode(ql,{"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(Xl,{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",xb,[l.renderSlot(f.$slots,"actions")])],2)):l.createCommentVNode("",!0)],2))}});let Cb=0;function kb(){return Cb++}const Sb=t=>(l.pushScopeId("data-v-fae3740e"),t=t(),l.popScopeId(),t),vb=["disabled"],Mb=[Sb(()=>l.createElementVNode("div",{class:"fm-tab__indicator"},null,-1))],Eb={class:"max-w-[360px] min-w-[186px]"},Db=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:()=>kb()},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"}`])},Mb,2)):l.createCommentVNode("",!0)],42,vb)]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Eb,[(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"]))}}),a_="",Kl=Q(Db,[["__scopeId","data-v-fae3740e"]]);/**
|
|
25
|
+
`):t}function np(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 bl(t,e){const n=t.chart.ctx,{body:o,footer:i,title:s}=t,{boxWidth:r,boxHeight:a}=e,c=ie(e.bodyFont),d=ie(e.titleFont),u=ie(e.footerFont),f=s.length,p=i.length,h=o.length,g=ce(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,Y(t.title,w),n.font=c.string,Y(t.beforeBody.concat(t.afterBody),w),y=e.displayColors?r+2+e.boxPadding:0,Y(o,S=>{Y(S.before,w),Y(S.lines,w),Y(S.after,w)}),y=0,n.font=u.string,Y(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 ip(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 sp(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"),ip(d,t,e,n)&&(d="center"),d}function yl(t,e,n){const o=n.yAlign||e.yAlign||op(t,n);return{xAlign:n.xAlign||e.xAlign||sp(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:i}=t;return e==="top"?o+=n:e==="bottom"?o-=i+n:o-=i/2,o}function _l(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=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)+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=ce(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-o.right:t.x+o.left}function xl(t){return Re([],He(t))}function ap(t,e,n){return et(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function wl(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const Cl={beforeTitle:Ae,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:Ae,beforeBody:Ae,beforeLabel:Ae,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 W(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:Ae,afterBody:Ae,beforeFooter:Ae,footer:Ae,afterFooter:Ae};function he(t,e,n,o){const i=t[e].call(n,o);return typeof i>"u"?Cl[e].call(n,o):i}class fi extends Te{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 ur(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=ap(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=Re(a,He(i)),a=Re(a,He(s)),a=Re(a,He(r)),a}getBeforeBody(e,n){return xl(he(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:o}=n,i=[];return Y(e,s=>{const r={before:[],lines:[],after:[]},a=wl(o,s);Re(r.before,He(he(a,"beforeLabel",this,s))),Re(r.lines,he(a,"label",this,s)),Re(r.after,He(he(a,"afterLabel",this,s))),i.push(r)}),i}getAfterBody(e,n){return xl(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=Re(a,He(i)),a=Re(a,He(s)),a=Re(a,He(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(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))),Y(a,u=>{const f=wl(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=ln[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=bl(this,o),d=Object.assign({},a,c),u=yl(this.chart,o,d),f=_l(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=Ft(o.rtl,this.x,this.width);for(e.x=Zn(this,o.titleAlign,o),n.textAlign=d.textAlign(o.titleAlign),n.textBaseline="middle",r=ie(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=ie(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,zo(e,m,b,x),e.strokeStyle=r.borderColor,e.fillStyle=r.backgroundColor,zo(e,m,b,x)}else{e.lineWidth=H(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,qt(e,{x:m,y:g,w:d,h:c,radius:x}),e.fill(),e.stroke(),e.fillStyle=r.backgroundColor,e.beginPath(),qt(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=ie(o.bodyFont);let p=f.lineHeight,h=0;const g=Ft(o.rtl,this.x,this.width),m=function(C){n.fillText(C,g.x(e.x+h),e.y+p/2),e.y+=p+s},b=g.textAlign(r);let x,y,w,S,_,k,v;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,e.x=Zn(this,b,o),n.fillStyle=o.bodyColor,Y(this.beforeBody,m),h=a&&b!=="right"?r==="center"?d/2+u:d+2+u:0,S=0,k=i.length;S<k;++S){for(x=i[S],y=this.labelTextColors[S],n.fillStyle=y,Y(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;Y(x.after,m)}h=0,p=f.lineHeight,Y(this.afterBody,m),e.y-=s}drawFooter(e,n,o){const i=this.footer,s=i.length;let r,a;if(s){const c=Ft(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=ie(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=ln[e.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=bl(this,e),c=Object.assign({},r,this._size),d=yl(n,e,c),u=_l(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=ce(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),nr(e,n.textDirection),s.y+=r.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),or(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=ln[s.position].call(this,e,n);return r!==!1&&(o!==r.x||i!==r.y)}}R(fi,"positioners",ln);var cp={id:"tooltip",_element:fi,positioners:ln,afterInit(t,e,n){n&&(t.tooltip=new fi({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"]},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 i=t.indexOf(e);if(i===-1)return up(t,e,n,o);const s=t.lastIndexOf(e);return i!==s?n:i}const hp=(t,e)=>t===null?null:se(Math.round(t),0,e);function kl(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class hi 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(W(e))return null;const o=this.getLabels();return n=isFinite(n)&&o[n]===e?n:fp(o,e,z(n,e),this._addedLabels),hp(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 kl.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}}R(hi,"id","category"),R(hi,"defaults",{ticks:{callback:kl}});function pp(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=!W(r),y=!W(a),w=!W(d),S=(b-m)/(f+1);let _=Es((b-m)/g/h)*h,k,v,C,D;if(_<1e-14&&!x&&!y)return[{value:m},{value:b}];D=Math.ceil(b/_)-Math.floor(m/_),D>g&&(_=Es(D*_/g/h)*h),W(c)||(k=Math.pow(10,c),_=Math.ceil(_*k)/k),i==="ticks"?(v=Math.floor(m/_)*_,C=Math.ceil(b/_)*_):(v=m,C=b),x&&y&&s&&ld((a-r)/s,_/1e3)?(D=Math.round(Math.min((a-r)/_,u)),_=(a-r)/D,v=r,C=a):w?(v=x?r:v,C=y?a:C,D=d-1,_=(C-v)/D):(D=(C-v)/_,Wt(D,Math.round(D),_/1e3)?D=Math.round(D):D=Math.ceil(D));const V=Math.max(Vs(_),Vs(v));k=Math.pow(10,W(c)?V:c),v=Math.round(v*k)/k,C=Math.round(C*k)/k;let $=0;for(x&&(p&&v!==r?(n.push({value:r}),v<r&&$++,Wt(Math.round((v+$*_)*k)/k,r,Sl(r,S,t))&&$++):v<r&&$++);$<D;++$){const N=Math.round((v+$*_)*k)/k;if(y&&N>a)break;n.push({value:N})}return y&&p&&C!==a?n.length&&Wt(n[n.length-1].value,a,Sl(a,S,t))?n[n.length-1].value=a:n.push({value:a}):(!y||C===a)&&n.push({value:C}),n}function Sl(t,e,{horizontal:n,minRotation:o}){const i=Me(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 W(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=pp(i,s);return e.bounds==="ticks"&&Ds(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 Gt(e,this.chart.options.locale,this.options.ticks.format)}}class pi extends Jn{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=te(e)?e:0,this.max=te(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,o=Me(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}}R(pi,"id","linear"),R(pi,"defaults",{ticks:{callback:Mn.formatters.numeric}});const an=t=>Math.floor(Qe(t)),xt=(t,e)=>Math.pow(10,an(t)+e);function vl(t){return t/Math.pow(10,an(t))===1}function Ml(t,e,n){const o=Math.pow(10,n),i=Math.floor(t/o);return Math.ceil(e/o)-i}function gp(t,e){const n=e-t;let o=an(n);for(;Ml(t,e,o)>10;)o++;for(;Ml(t,e,o)<10;)o--;return Math.min(o,an(t))}function mp(t,{min:e,max:n}){e=_e(t.min,e);const o=[],i=an(e);let s=gp(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=_e(t.min,Math.round((c+u+f*Math.pow(10,s))*r)/r);for(;p<n;)o.push({value:p,major:vl(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=_e(t.max,p);return o.push({value:h,major:vl(h),significand:f}),o}class gi 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 te(o)&&o>0?o:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=te(e)?Math.max(0,e):null,this.max=te(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!te(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=mp(n,this);return e.bounds==="ticks"&&Ds(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":Gt(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Qe(e),this._valueRange=Qe(this.max)-Qe(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Qe(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}R(gi,"id","logarithmic"),R(gi,"defaults",{ticks:{callback:Mn.formatters.logarithmic,major:{enabled:!0}}});function mi(t){const e=t.ticks;if(e.display&&t.display){const n=ce(e.backdropPadding);return z(e.font&&e.font.size,ne.font.size)+n.height}return 0}function bp(t,e,n){return n=X(n)?n:[n],{w:Sd(t,e.string,n),h:n.length*e.lineHeight}}function El(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 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=[],i=[],s=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?K/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=ie(d.font),p=bp(t.ctx,f,t._pointLabels[c]);o[c]=p;const h=xe(t.getIndexAngle(c)+a),g=Math.round($o(h)),m=El(g,u.x,p.w,0,180),b=El(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,i)}function _p(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 xp(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($o(xe(c.angle+oe))),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:i,bottom:s}=t;return!(Ie({x:n,y:o},e)||Ie({x:n,y:s},e)||Ie({x:i,y:o},e)||Ie({x:i,y:s},e))}function Cp(t,e,n){const o=[],i=t._pointLabels.length,s=t.options,{centerPointLabels:r,display:a}=s.pointLabels,c={extra:mi(s)/2,additionalAngle:r?K/i:0};let d;for(let u=0;u<i;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:i,right:s,bottom:r}=n,{backdropColor:a}=e;if(!W(a)){const c=ht(e.borderRadius),d=ce(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(),qt(t,{x:u,y:f,w:p,h,radius:c}),t.fill()):t.fillRect(u,f,p,h)}}function Ep(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=ie(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 Dl(t,e,n,o){const{ctx:i}=t;if(n)i.arc(t.xCenter,t.yCenter,e,0,Z);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 Dp(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(),Dl(t,n,r,o),s.closePath(),s.stroke(),s.restore())}function Vp(t,e,n){return et(t,{label:n,index:e,type:"pointLabel"})}class cn 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=ce(mi(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=te(e)&&!isNaN(e)?e:0,this.max=te(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/mi(this.options))}generateTickLabels(e){Jn.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,o)=>{const i=U(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?yp(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=Z/(this._pointLabels.length||1),o=this.options.startAngle||0;return xe(e*n+Me(o))}getDistanceFromCenterForValue(e){if(W(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(W(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 i=this.getIndexAngle(e)-oe+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(),Dl(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&&Ep(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);Dp(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=ie(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=ce(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(){}}R(cn,"id","radialLinear"),R(cn,"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}}),R(cn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(cn,"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 Vl(t,e){return t-e}function Fl(t,e){if(W(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)),te(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 Rl(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 Fp(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 Rp(t){for(let e=pe.indexOf(t)+1,n=pe.length;e<n;++e)if(Qn[pe[e]].common)return pe[e]}function Bl(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:o,hi:i}=Ao(n,e),s=n[o]>=e?n[o]:n[i];t[s]=!0}}function Bp(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 $l(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:Bp(t,o,i,n)}class dn 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 Tu._date(e.adapters.date);i.init(n),zt(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:Fl(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=te(i)&&!isNaN(i)?i:+n.startOf(Date.now(),o),s=te(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=ud(i,s,r);return this._unit=n.unit||(o.autoSkip?Rl(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):Fp(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!o.major.enabled||this._unit==="year"?void 0:Rp(this._unit),this.initOffsets(i),e.reverse&&a.reverse(),$l(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||Rl(s.minUnit,n,o,this._getLabelCapacity(n)),a=z(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++)Bl(u,p,g);return(p===o||i.bounds==="ticks"||h===1)&&Bl(u,p,g),Object.keys(u).sort(Vl).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 U(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=Me(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,$l(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(Fl(this,i[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return $s(e.sort(Vl))}}R(dn,"id","time"),R(dn,"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}=Ne(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}=Ne(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 bi extends dn{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)}}R(bi,"id","timeseries"),R(bi,"defaults",dn.defaults);var $p=Object.freeze({__proto__:null,CategoryScale:hi,LinearScale:pi,LogarithmicScale:gi,RadialLinearScale:cn,TimeScale:dn,TimeSeriesScale:bi});const Pp=[Lu,mh,dp,$p];ze.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"},Pl=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 ze(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 Lp(){var t;return(t=l.getCurrentInstance())==null?void 0:t.emit}function ue(t,e){const n=Lp(),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 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 Tp={class:"fm-checkbox"},zp={class:"fm-checkbox--wrapper"},Hp={class:"fm-checkbox__input--container"},Wp=["checked","disabled","indeterminate"],jp={key:0,class:"fm-checkbox__label-container"},Yp={class:"fm-typo-body-lg-400"},Gp={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},yi=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=ue(e,"modelValue"),o=ue(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",Tp,[l.createElementVNode("label",zp,[l.createElementVNode("div",Hp,[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,Wp),l.unref(o)||s.value?(l.openBlock(),l.createBlock(T,{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",jp,[l.renderSlot(c.$slots,"label"),l.createElementVNode("div",Yp,l.toDisplayString(e.label),1),e.sublabel?(l.openBlock(),l.createElementBlock("div",Gp,l.toDisplayString(e.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])]))}}),jy="";var Up=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Al={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Up,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 E=["th","st","nd","rd"],M=P%100;return"["+P+(E[(M-20)%10]||E[M]||E[0])+"]"}},w=function(P,E,M){var F=String(P);return!F||F.length>=E?P:""+Array(E+1-F.length).join(M)+P},S={s:w,z:function(P){var E=-P.utcOffset(),M=Math.abs(E),F=Math.floor(M/60),B=M%60;return(E<=0?"+":"-")+w(F,2,"0")+":"+w(B,2,"0")},m:function P(E,M){if(E.date()<M.date())return-P(M,E);var F=12*(M.year()-E.year())+(M.month()-E.month()),B=E.clone().add(F,f),O=M-B<0,I=E.clone().add(F+(O?-1:1),f);return+(-(F+(M-B)/(O?B-I:I-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",k={};k[_]=y;var v="$isDayjsObject",C=function(P){return P instanceof N||!(!P||!P[v])},D=function P(E,M,F){var B;if(!E)return _;if(typeof E=="string"){var O=E.toLowerCase();k[O]&&(B=O),M&&(k[O]=M,B=O);var I=E.split("-");if(!B&&I.length>1)return P(I[0])}else{var j=E.name;k[j]=E,B=j}return!F&&B&&(_=B),B||!F&&_},V=function(P,E){if(C(P))return P.clone();var M=typeof E=="object"?E:{};return M.date=P,M.args=arguments,new N(M)},$=S;$.l=D,$.i=C,$.w=function(P,E){return V(P,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var N=function(){function P(M){this.$L=D(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[v]=!0}var E=P.prototype;return E.parse=function(M){this.$d=function(F){var B=F.date,O=F.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 I=B.match(b);if(I){var j=I[2]-1||0,G=(I[7]||"0").substring(0,3);return O?new Date(Date.UTC(I[1],j,I[3]||1,I[4]||0,I[5]||0,I[6]||0,G)):new Date(I[1],j,I[3]||1,I[4]||0,I[5]||0,I[6]||0,G)}}return new Date(B)}(M),this.init()},E.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},E.$utils=function(){return $},E.isValid=function(){return this.$d.toString()!==m},E.isSame=function(M,F){var B=V(M);return this.startOf(F)<=B&&B<=this.endOf(F)},E.isAfter=function(M,F){return V(M)<this.startOf(F)},E.isBefore=function(M,F){return this.endOf(F)<V(M)},E.$g=function(M,F,B){return $.u(M)?this[F]:this.set(B,M)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(M,F){var B=this,O=!!$.u(F)||F,I=$.p(M),j=function(vt,ye){var at=$.w(B.$u?Date.UTC(B.$y,ye,vt):new Date(B.$y,ye,vt),B);return O?at:at.endOf(d)},G=function(vt,ye){return $.w(B.toDate()[vt].apply(B.toDate("s"),(O?[0,0,0,0]:[23,59,59,999]).slice(ye)),B)},J=this.$W,Q=this.$M,re=this.$D,be="set"+(this.$u?"UTC":"");switch(I){case h:return O?j(1,0):j(31,11);case f:return O?j(1,Q):j(0,Q+1);case u:var St=this.$locale().weekStart||0,mn=(J<St?J+7:J)-St;return j(O?re-mn:re+(6-mn),Q);case d:case g:return G(be+"Hours",0);case c:return G(be+"Minutes",1);case a:return G(be+"Seconds",2);case r:return G(be+"Milliseconds",3);default:return this.clone()}},E.endOf=function(M){return this.startOf(M,!1)},E.$set=function(M,F){var B,O=$.p(M),I="set"+(this.$u?"UTC":""),j=(B={},B[d]=I+"Date",B[g]=I+"Date",B[f]=I+"Month",B[h]=I+"FullYear",B[c]=I+"Hours",B[a]=I+"Minutes",B[r]=I+"Seconds",B[s]=I+"Milliseconds",B)[O],G=O===d?this.$D+(F-this.$W):F;if(O===f||O===h){var J=this.clone().set(g,1);J.$d[j](G),J.init(),this.$d=J.set(g,Math.min(this.$D,J.daysInMonth())).$d}else j&&this.$d[j](G);return this.init(),this},E.set=function(M,F){return this.clone().$set(M,F)},E.get=function(M){return this[$.p(M)]()},E.add=function(M,F){var B,O=this;M=Number(M);var I=$.p(F),j=function(Q){var re=V(O);return $.w(re.date(re.date()+Math.round(Q*M)),O)};if(I===f)return this.set(f,this.$M+M);if(I===h)return this.set(h,this.$y+M);if(I===d)return j(1);if(I===u)return j(7);var G=(B={},B[a]=o,B[c]=i,B[r]=n,B)[I]||1,J=this.$d.getTime()+M*G;return $.w(J,this)},E.subtract=function(M,F){return this.add(-1*M,F)},E.format=function(M){var F=this,B=this.$locale();if(!this.isValid())return B.invalidDate||m;var O=M||"YYYY-MM-DDTHH:mm:ssZ",I=$.z(this),j=this.$H,G=this.$m,J=this.$M,Q=B.weekdays,re=B.months,be=B.meridiem,St=function(ye,at,bn,bo){return ye&&(ye[at]||ye(F,O))||bn[at].slice(0,bo)},mn=function(ye){return $.s(j%12||12,ye,"0")},vt=be||function(ye,at,bn){var bo=ye<12?"AM":"PM";return bn?bo.toLowerCase():bo};return O.replace(x,function(ye,at){return at||function(bn){switch(bn){case"YY":return String(F.$y).slice(-2);case"YYYY":return $.s(F.$y,4,"0");case"M":return J+1;case"MM":return $.s(J+1,2,"0");case"MMM":return St(B.monthsShort,J,re,3);case"MMMM":return St(re,J);case"D":return F.$D;case"DD":return $.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return St(B.weekdaysMin,F.$W,Q,2);case"ddd":return St(B.weekdaysShort,F.$W,Q,3);case"dddd":return Q[F.$W];case"H":return String(j);case"HH":return $.s(j,2,"0");case"h":return mn(1);case"hh":return mn(2);case"a":return vt(j,G,!0);case"A":return vt(j,G,!1);case"m":return String(G);case"mm":return $.s(G,2,"0");case"s":return String(F.$s);case"ss":return $.s(F.$s,2,"0");case"SSS":return $.s(F.$ms,3,"0");case"Z":return I}return null}(ye)||I.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(M,F,B){var O,I=this,j=$.p(F),G=V(M),J=(G.utcOffset()-this.utcOffset())*o,Q=this-G,re=function(){return $.m(I,G)};switch(j){case h:O=re()/12;break;case f:O=re();break;case p:O=re()/3;break;case u:O=(Q-J)/6048e5;break;case d:O=(Q-J)/864e5;break;case c:O=Q/i;break;case a:O=Q/o;break;case r:O=Q/n;break;default:O=Q}return B?O:$.a(O)},E.daysInMonth=function(){return this.endOf(f).$D},E.$locale=function(){return k[this.$L]},E.locale=function(M,F){if(!M)return this.$L;var B=this.clone(),O=D(M,F,!0);return O&&(B.$L=O),B},E.clone=function(){return $.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},P}(),q=N.prototype;return V.prototype=q,[["$ms",s],["$s",r],["$m",a],["$H",c],["$W",d],["$M",f],["$y",h],["$D",g]].forEach(function(P){q[P[1]]=function(E){return this.$g(E,P[0],P[1])}}),V.extend=function(P,E){return P.$i||(P(E,N,V),P.$i=!0),V},V.locale=D,V.isDayjs=C,V.unix=function(P){return V(1e3*P)},V.en=k[_],V.Ls=k,V.p={},V})})(Al);var Xp=Al.exports;const fe=qp(Xp),Bt=Math.min,wt=Math.max,to=Math.round,no=Math.floor,ot=t=>({x:t,y:t}),Kp={left:"right",right:"left",bottom:"top",top:"bottom"},Zp={start:"end",end:"start"};function _i(t,e,n){return wt(t,Bt(e,n))}function un(t,e){return typeof t=="function"?t(e):t}function Ct(t){return t.split("-")[0]}function fn(t){return t.split("-")[1]}function Ol(t){return t==="x"?"y":"x"}function xi(t){return t==="y"?"height":"width"}function oo(t){return["top","bottom"].includes(Ct(t))?"y":"x"}function wi(t){return Ol(oo(t))}function Jp(t,e,n){n===void 0&&(n=!1);const o=fn(t),i=wi(t),s=xi(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 Qp(t){const e=io(t);return[Ci(t),e,Ci(e)]}function Ci(t){return t.replace(/start|end/g,e=>Zp[e])}function eg(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 tg(t,e,n,o){const i=fn(t);let s=eg(Ct(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(Ci)))),s}function io(t){return t.replace(/left|right|bottom|top/g,e=>Kp[e])}function ng(t){return{top:0,right:0,bottom:0,left:0,...t}}function Nl(t){return typeof t!="number"?ng(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 Il(t,e,n){let{reference:o,floating:i}=t;const s=oo(e),r=wi(e),a=xi(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(fn(e)){case"start":h[r]-=p*(n&&d?-1:1);break;case"end":h[r]+=p*(n&&d?-1:1);break}return h}const og=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}=Il(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}=Il(d,p,c)),m=-1;continue}}return{x:u,y:f,placement:p,strategy:i,middlewareData:h}};async function Ll(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}=un(e,t),g=Nl(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 ig=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}=un(t,e)||{};if(d==null)return{};const f=Nl(u),p={x:n,y:o},h=wi(i),g=xi(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],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(d));let v=k?k[w]:0;(!v||!await(r.isElement==null?void 0:r.isElement(k)))&&(v=a.floating[w]||s.floating[g]);const C=S/2-_/2,D=v/2-m[g]/2-1,V=Bt(f[x],D),$=Bt(f[y],D),N=V,q=v-m[g]-$,P=v/2-m[g]/2+C,E=_i(N,P,q),M=!c.arrow&&fn(i)!=null&&P!=E&&s.reference[g]/2-(P<N?V:$)-m[g]/2<0,F=M?P<N?P-N:P-q:0;return{[h]:p[h]+F,data:{[h]:E,centerOffset:P-E-F,...M&&{alignmentOffset:F}},reset:M}}}),ki=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}=un(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)]:Qp(a));!p&&g!=="none"&&S.push(...tg(a,m,g,w));const _=[a,...S],k=await Ll(e,b),v=[];let C=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&v.push(k[x]),f){const N=Jp(i,r,w);v.push(k[N[0]],k[N[1]])}if(C=[...C,{placement:i,overflows:v}],!v.every(N=>N<=0)){var D,V;const N=(((D=s.flip)==null?void 0:D.index)||0)+1,q=_[N];if(q)return{data:{index:N,overflows:C},reset:{placement:q}};let P=(V=C.filter(E=>E.overflows[0]<=0).sort((E,M)=>E.overflows[1]-M.overflows[1])[0])==null?void 0:V.placement;if(!P)switch(h){case"bestFit":{var $;const E=($=C.map(M=>[M.placement,M.overflows.filter(F=>F>0).reduce((F,B)=>F+B,0)]).sort((M,F)=>M[1]-F[1])[0])==null?void 0:$[0];E&&(P=E);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};async function sg(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=fn(n),c=oo(n)==="y",d=["left","top"].includes(r)?-1:1,u=s&&c?-1:1,f=un(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 Si=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 sg(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}}}}},rg=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}=un(t,e),d={x:n,y:o},u=await Ll(e,c),f=oo(Ct(i)),p=Ol(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=_i(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=_i(y,g,w)}const m=a.fn({...e,[p]:h,[f]:g});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function it(t){return Tl(t)?(t.nodeName||"").toLowerCase():"#document"}function we(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function We(t){var e;return(e=(Tl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Tl(t){return t instanceof Node||t instanceof we(t).Node}function je(t){return t instanceof Element||t instanceof we(t).Element}function Be(t){return t instanceof HTMLElement||t instanceof we(t).HTMLElement}function zl(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof we(t).ShadowRoot}function hn(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 lg(t){return["table","td","th"].includes(it(t))}function vi(t){const e=Mi(),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 ag(t){let e=$t(t);for(;Be(e)&&!ro(e);){if(vi(e))return e;e=$t(e)}return null}function Mi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ro(t){return["html","body","#document"].includes(it(t))}function Se(t){return we(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(it(t)==="html")return t;const e=t.assignedSlot||t.parentNode||zl(t)&&t.host||We(t);return zl(e)?e.host:e}function Hl(t){const e=$t(t);return ro(e)?t.ownerDocument?t.ownerDocument.body:t.body:Be(e)&&hn(e)?e:Hl(e)}function pn(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Hl(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=we(i);return s?e.concat(r,r.visualViewport||[],hn(i)?i:[],r.frameElement&&n?pn(r.frameElement):[]):e.concat(i,pn(i,[],n))}function Wl(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 Ei(t){return je(t)?t:t.contextElement}function Pt(t){const e=Ei(t);if(!Be(e))return ot(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Wl(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 cg=ot(0);function jl(t){const e=we(t);return!Mi()||!e.visualViewport?cg:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function dg(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==we(t)?!1:e}function kt(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Ei(t);let r=ot(1);e&&(o?je(o)&&(r=Pt(o)):r=Pt(t));const a=dg(s,n,o)?jl(s):ot(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=we(s),h=o&&je(o)?we(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=we(g).frameElement}}return so({width:u,height:f,x:c,y:d})}function ug(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=Be(n),s=We(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0},a=ot(1);const c=ot(0);if((i||!i&&o!=="fixed")&&((it(n)!=="body"||hn(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 fg(t){return Array.from(t.getClientRects())}function Yl(t){return kt(We(t)).left+lo(t).scrollLeft}function hg(t){const e=We(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+Yl(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 pg(t,e){const n=we(t),o=We(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=Mi();(!d||d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:r,x:a,y:c}}function gg(t,e){const n=kt(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=Be(t)?Pt(t):ot(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 Gl(t,e,n){let o;if(e==="viewport")o=pg(t,n);else if(e==="document")o=hg(We(t));else if(je(e))o=gg(e,n);else{const i=jl(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return so(o)}function Ul(t,e){const n=$t(t);return n===e||!je(n)||ro(n)?!1:Se(n).position==="fixed"||Ul(n,e)}function mg(t,e){const n=e.get(t);if(n)return n;let o=pn(t,[],!1).filter(a=>je(a)&&it(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=vi(r);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||hn(r)&&!c&&Ul(t,r))?o=o.filter(u=>u!==r):i=a,r=$t(r)}return e.set(t,o),o}function bg(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?mg(e,this._c):[].concat(n),o],a=r[0],c=r.reduce((d,u)=>{const f=Gl(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},Gl(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function yg(t){return Wl(t)}function _g(t,e,n){const o=Be(e),i=We(e),s=n==="fixed",r=kt(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=ot(0);if(o||!o&&!s)if((it(e)!=="body"||hn(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=Yl(i));return{x:r.left+a.scrollLeft-c.x,y:r.top+a.scrollTop-c.y,width:r.width,height:r.height}}function ql(t,e){return!Be(t)||Se(t).position==="fixed"?null:e?e(t):t.offsetParent}function Xl(t,e){const n=we(t);if(!Be(t))return n;let o=ql(t,e);for(;o&&lg(o)&&Se(o).position==="static";)o=ql(o,e);return o&&(it(o)==="html"||it(o)==="body"&&Se(o).position==="static"&&!vi(o))?n:o||ag(t)||n}const xg=async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||Xl,s=this.getDimensions;return{reference:_g(e,await i(n),o),floating:{x:0,y:0,...await s(n)}}};function wg(t){return Se(t).direction==="rtl"}const Cg={convertOffsetParentRelativeRectToViewportRelativeRect:ug,getDocumentElement:We,getClippingRect:bg,getOffsetParent:Xl,getElementRects:xg,getClientRects:fg,getDimensions:yg,getScale:Pt,isElement:je,isRTL:wg};function kg(t,e){let n=null,o;const i=We(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 k=_[0].intersectionRatio;if(k!==c){if(!w)return r();k?r(!1,k):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 Kl(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=Ei(t),u=i||s?[...d?pn(d):[],...pn(e)]:[];u.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=d&&a?kg(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 Zl=(t,e,n)=>{const o=new Map,i={platform:Cg,...n},s={...i.platform,_c:o};return og(t,e,{...i,platform:s})};function Di(t){var e;return(e=t==null?void 0:t.$el)!=null?e:t}function Sg(t){return{name:"arrow",options:t,fn(e){const n=Di(l.unref(t.element));return n==null?{}:ig({element:n,padding:t.padding}).fn(e)}}}function Jl(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ql(t,e){const n=Jl(t);return Math.round(e*n)/n}function ea(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(()=>Di(t.value)),u=l.computed(()=>Di(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 C=Ql(u.value,f.value),D=Ql(u.value,p.value);return c.value?{...v,transform:"translate("+C+"px, "+D+"px)",...Jl(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:C+"px",top:D+"px"}});let y;function w(){d.value==null||u.value==null||Zl(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 k(){i.value||(b.value=!1)}return l.watch([s,r,a],w,{flush:"sync"}),l.watch([d,u],_,{flush:"sync"}),l.watch(i,k,{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 vg(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 Eg{constructor(e,n){R(this,"onScroll");R(this,"scrollParent");this.onScroll=n,this.scrollParent=vg(e)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const Dg={class:"fm-menu__wrapper"},Vg=l.defineComponent({__name:"FmMenu",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}=ea(s,r,{middleware:[Si(4),ki()],placement:o.placement,whileElementsMounted:Kl});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 Eg(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",Dg,[l.renderSlot(h.$slots,"menu-content",{},void 0,!0)])],!0)],6)):l.createCommentVNode("",!0)]))}}),Yy="",me=ee(Vg,[["__scopeId","data-v-6ad9d23d"]]),Fg={class:"fm-menu-item--left"},Rg={key:0,class:"fm-menu-item--right"},Bg=l.defineComponent({__name:"FmMenuItem",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},icon:{default:""},expandable:{type:Boolean,default:!1},hasCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dividerPlacement:{default:null}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=l.ref(!1),i=e,s=c=>{c.preventDefault(),!n.disabled&&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}),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",Fg,[!c.hasCheckbox&&c.icon?(l.openBlock(),l.createBlock(T,{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(yi,{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),l.renderSlot(c.$slots,"label",{},()=>[l.createElementVNode("div",null,[l.createElementVNode("div",{class:l.normalizeClass(`fm-typo-body-lg-400 ${c.disabled?"fm-color-typo-disabled":"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?"fm-color-typo-disabled":"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",Rg,[l.createVNode(T,{name:"chevron_right",size:"md",color:c.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):l.createCommentVNode("",!0)],34)]))}}),Gy="",ve=ee(Bg,[["__scopeId","data-v-a50682bb"]]),$g={class:"w-full"},Pg=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(T,{key:0,name:n.prependIcon,size:"md",color:n.disabled?"disabled":"neutral-black"},null,8,["name","color"])):l.createCommentVNode("",!0)],!0),l.createElementVNode("div",$g,[l.renderSlot(n.$slots,"default",{},void 0,!0)]),l.renderSlot(n.$slots,"append",{},()=>[n.appendIcon?(l.openBlock(),l.createBlock(T,{key:0,name:n.appendIcon,size:"md",color:n.disabled?"disabled":"neutral-black"},null,8,["name","color"])):l.createCommentVNode("",!0)],!0)]),_:3},8,["class"]))}}),Uy="",Ye=ee(Pg,[["__scopeId","data-v-177cd78a"]]),Ag={class:"flex gap-4"},Vi=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",Ag,[n.value?(l.openBlock(),l.createBlock(T,{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(T,{size:"sm",name:"error",class:"mt-[2px] text-fm-color-system-error-300"}),l.createElementVNode("span",null,l.toDisplayString(r),1)]))),128))])],2))}}),Og={class:"px-2 py-0"},Ng={key:0,class:"fm-typo-body-xl-700"},Ig={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},Fi=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 Zl(n.value,o.value,{placement:e.beak,middleware:[Si(10),ki(),rg({padding:5}),e.hasArrow?Sg({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",Og,[h.variant=="rich"?(l.openBlock(),l.createElementBlock("div",Ng,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",Ig,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.actionButtons,(m,b)=>(l.openBlock(),l.createElementBlock("div",{key:b},[l.createVNode(le,{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)]))}}),Ri=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(Fi,{key:2,beak:"top","content-text":e.info,disabled:e.disabled},{default:l.withCtx(()=>[l.createVNode(T,{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 ta(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 na(t,e=null,n=null){let o=null;const i=ue(t,"modelValue"),s=l.ref(!0),r=l.inject(ds,null),{validate:a,resetValidation:c,errorMessages:d}=ta(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 Lg={key:1,class:"flex items-center justify-between"},$e=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}=na(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(Ri,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",Lg,[l.createVNode(Vi,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"]))}}),Tg={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[360px]"},zg={class:"w-max"},Hg={class:"flex h-40 justify-between px-4 py-8"},Wg={class:"flex gap-4 items-center"},jg={class:"fm-typo-body-lg-700"},Yg={class:"h-[264px] w-[160px]"},Gg={class:"fm-typo-body-lg-700"},Ug={class:"h-[264px] w-[160px]"},qg={class:"flex gap-4 items-center justify-center"},Xg={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Kg=["onClick"],Zg={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},Jg=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=ue(e,"modelValue"),o=l.ref(fe(n.value,"YYYY-MM-DD")),i=l.ref(!1),s=l.ref(fe().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?fe(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)=>fe().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($e,{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(me,{"show-menu":i.value,disabled:m.disabled,onDropdownChanged:b[4]||(b[4]=y=>i.value=y)},{"menu-button":l.withCtx(()=>[l.createVNode(Ye,{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(fe)(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",Tg,[l.createElementVNode("div",zg,[l.createElementVNode("div",Hg,[l.createElementVNode("div",Wg,[l.createVNode(me,{"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",jg,l.toDisplayString(s.value.format("MMMM")),1),l.createVNode(T,{name:r.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",Yg,[(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(ve,{"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(me,{"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",Gg,l.toDisplayString(s.value.format("YYYY")),1),l.createVNode(T,{name:a.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",Ug,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(g.value,y=>(l.openBlock(),l.createElementBlock("li",{key:y.format("YYYY")},[l.createVNode(ve,{"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",qg,[l.createVNode(T,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[2]||(b[2]=()=>p(s.value.subtract(1,"month")))}),l.createVNode(T,{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",Xg,[(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,Kg)):l.createCommentVNode("",!0)]))),128))]))),128))])])]),l.createElementVNode("div",Zg,[l.createVNode(le,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),l.createVNode(le,{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"]))}}),qy="",oa=ee(Jg,[["__scopeId","data-v-16edf7f9"]]),Qg=t=>(l.pushScopeId("data-v-431b8ad3"),t=t(),l.popScopeId(),t),em={class:"flex gap-1 items-center relative w-full"},tm={class:"flex flex-col gap-4 w-full"},nm=Qg(()=>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)),om={class:"flex flex-col gap-4 w-full"},im={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[720px]"},sm={class:"flex gap-24"},rm={class:"w-max"},lm={class:"flex gap-16 h-40 items-center justify-start 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:"w-max"},mm={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},bm={class:"flex gap-4 items-center"},ym={class:"fm-typo-body-lg-700"},_m={class:"h-[264px] w-[160px]"},xm={class:"fm-typo-body-lg-700"},wm={class:"h-[264px] w-[160px]"},Cm={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},km=["onClick","onMouseover"],Sm={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},vm=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=ue(e,"modelValue"),o=l.ref({startDate:fe(n.value.startDate,"YYYY-MM-DD"),endDate:fe(n.value.endDate,"YYYY-MM-DD")}),i=l.ref(!1),s=l.ref(fe().startOf("month")),r=l.ref(fe().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 k=o.value.startDate;o.value={startDate:_,endDate:k}}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 _,k;o.value={startDate:(_=n.value)!=null&&_.startDate?fe(n.value.startDate,"YYYY-MM-DD"):null,endDate:(k=n.value)!=null&&k.endDate?fe(n.value.endDate,"YYYY-MM-DD"):null},i.value=!1},m=_=>{const k=[],v=_.endOf("month"),C=_.month();let D=_.startOf("week"),V=[];for(;D.isBefore(v.endOf("week"));)D.day()===0&&V.length>0&&(k.push(V),V=[]),V.push({date:D,isCurrentMonth:D.month()===C}),D=D.add(1,"day");return V.length>0&&k.push(V),k},b=(_,k)=>{c.value=!1,u.value=!1,d.value=!1,f.value=!1,_==="left"?(s.value=k,r.value=k.add(1,"month")):_==="right"&&(r.value=k,s.value=k.subtract(1,"month"))},x=l.computed(()=>Array.from(Array(7),(_,k)=>fe().day(k).format("ddd"))),y=_=>{const k=o.value.startDate,v=o.value.endDate;a.value=k&&v?null:a.value;const C=a.value,D=k==null?void 0:k.isSame(_),V=v==null?void 0:v.isSame(_),$=C==null?void 0:C.isSame(_);return{"fm-calendar__cell__button--selected":D&&V||D&&!v,"fm-calendar__cell__button--selected-start":D&&v&&!(D&&V)||k&&!v&&D&&(C==null?void 0:C.isAfter(k))||k&&!v&&$&&(C==null?void 0:C.isBefore(k)),"fm-calendar__cell__button--selected-end":V&&k&&!(D&&V)||k&&!v&&D&&(C==null?void 0:C.isBefore(k))||k&&!v&&$&&(C==null?void 0:C.isAfter(k)),"fm-calendar__cell__button--selected-between":k&&(v||C)&&v?_.isAfter(k)&&_.isBefore(v):_.isAfter(C)&&_.isBefore(k)||_.isBefore(C)&&_.isAfter(k)}},w=_=>{a.value=_},S=l.computed(()=>{let _=-5;const k=[];for(;_!=5;)k.push(s.value.add(_,"year")),_++;return k});return l.watch(()=>n.value,()=>{var _,k;return o.value={startDate:(_=n.value)!=null&&_.startDate?fe(n.value.startDate,"YYYY-MM-DD"):null,endDate:(k=n.value)!=null&&k.endDate?fe(n.value.endDate,"YYYY-MM-DD"):null}}),(_,k)=>(l.openBlock(),l.createBlock($e,{modelValue:l.unref(n),"onUpdate:modelValue":k[7]||(k[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(me,{"show-menu":i.value,disabled:_.disabled,onDropdownChanged:k[6]||(k[6]=C=>i.value=C)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",em,[l.createElementVNode("label",tm,[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(Ye,{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 C,D;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":(C=l.unref(n))!=null&&C.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((D=l.unref(n))!=null&&D.startDate?l.unref(fe)(l.unref(n).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])]),nm,l.createElementVNode("label",om,[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(Ye,{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 C,D;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":(C=l.unref(n))!=null&&C.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((D=l.unref(n))!=null&&D.endDate?l.unref(fe)(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",im,[l.createElementVNode("div",sm,[l.createElementVNode("div",rm,[l.createElementVNode("div",lm,[l.createElementVNode("div",am,[l.createVNode(T,{class:"cursor-pointer select-none",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:k[0]||(k[0]=()=>b("left",s.value.subtract(1,"month")))}),l.createVNode(me,{"show-menu":c.value,onDropdownChanged:k[1]||(k[1]=C=>c.value=C)},{"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",cm,l.toDisplayString(s.value.format("MMMM")),1),l.createVNode(T,{name:c.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),(C,D)=>s.value.month(D)),C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("MMMM")},[l.createVNode(ve,{"model-value":s.value.format("MMMM")===C.format("MMMM"),label:C.format("MMMM"),"onUpdate:modelValue":D=>b("left",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(me,{"show-menu":u.value,onDropdownChanged:k[2]||(k[2]=C=>u.value=C)},{"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",um,l.toDisplayString(s.value.format("YYYY")),1),l.createVNode(T,{name:u.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,C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("YYYY")},[l.createVNode(ve,{"model-value":s.value.format("YYYY")===C.format("YYYY"),label:C.format("YYYY"),"onUpdate:modelValue":D=>b("left",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])])]),l.createElementVNode("div",null,[l.createElementVNode("div",hm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(x.value,C=>(l.openBlock(),l.createElementBlock("div",{key:C,class:"fm-calendar__cell"},l.toDisplayString(C),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m(s.value),(C,D)=>(l.openBlock(),l.createElementBlock("div",{key:D,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(C,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.createElementVNode("div",mm,[l.createElementVNode("div",bm,[l.createVNode(me,{"show-menu":d.value,onDropdownChanged:k[3]||(k[3]=C=>d.value=C)},{"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",ym,l.toDisplayString(r.value.format("MMMM")),1),l.createVNode(T,{name:d.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",_m,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(C,D)=>r.value.month(D)),C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("MMMM")},[l.createVNode(ve,{"model-value":r.value.format("MMMM")===C.format("MMMM"),label:C.format("MMMM"),"onUpdate:modelValue":D=>b("right",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(me,{"show-menu":f.value,onDropdownChanged:k[4]||(k[4]=C=>f.value=C)},{"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",xm,l.toDisplayString(r.value.format("YYYY")),1),l.createVNode(T,{name:f.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",wm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(S.value,C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("YYYY")},[l.createVNode(ve,{"model-value":r.value.format("YYYY")===C.format("YYYY"),label:C.format("YYYY"),"onUpdate:modelValue":D=>b("right",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),l.createVNode(T,{class:"cursor-pointer select-none",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:k[5]||(k[5]=()=>b("left",s.value.add(1,"month")))})]),l.createElementVNode("div",null,[l.createElementVNode("div",Cm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(x.value,C=>(l.openBlock(),l.createElementBlock("div",{key:C,class:"fm-calendar__cell"},l.toDisplayString(C),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m(r.value),(C,D)=>(l.openBlock(),l.createElementBlock("div",{key:D,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(C,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,km)):l.createCommentVNode("",!0)]))),128))]))),128))])])])]),l.createElementVNode("div",Sm,[l.createVNode(le,{label:"Cancel",size:"md",variant:"tertiary",onClick:g}),l.createVNode(le,{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"]))}}),Xy="",ia=ee(vm,[["__scopeId","data-v-431b8ad3"]]),sa=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(ds,{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))}}),Mm={class:"fm-radio-btn"},Em={class:"fm-radio-btn__input--container"},Dm=["value","disabled","checked"],Vm={class:"py-8"},Fm={class:"fm-typo-body-lg-400"},Rm={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},Bm=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=ue(e,"modelValue"),o=l.ref(),i=l.inject(us,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",Mm,[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",Em,[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,Dm)])),[[u,!r.value]]),l.createElementVNode("div",Vm,[l.renderSlot(c.$slots,"label",{},()=>[l.createElementVNode("div",Fm,l.toDisplayString(c.label),1),c.sublabel?(l.openBlock(),l.createElementBlock("div",Rm,l.toDisplayString(c.sublabel),1)):l.createCommentVNode("",!0)],!0)])],2)])}}}),Ky="",ra=ee(Bm,[["__scopeId","data-v-24fa5bf9"]]),la=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=ue(e,"modelValue");return l.provide(us,{groupValue:n,getDisabled:()=>e.disabled,updateValue(o){n.value=o}}),(o,i)=>(l.openBlock(),l.createBlock($e,{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"]))}}),$m={class:"flex flex-col gap-4"},Pm={class:"w-[280px]"},Am={class:"flex flex-col gap-4 justify-center"},aa=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=ue(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",$m,[l.createVNode($e,{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(me,{"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(Ye,{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(T,{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)?"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",Pm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d.items,p=>(l.openBlock(),l.createBlock(ve,{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",Am,[d.multiselect&&r.value.length>0?(l.openBlock(),l.createBlock(So,{key:0,items:a.value,removable:"",disabled:d.disabled,onChipClosed:s},null,8,["items","disabled"])):l.createCommentVNode("",!0)])]))}}),Om=["inputMode","value","placeholder","readOnly"],Nm={key:0},Im=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=ue(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.onMounted(()=>{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($e,{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(Ye,{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",Nm,l.toDisplayString(y.appendText),1)):l.createCommentVNode("",!0),y.appendIcon?(l.openBlock(),l.createBlock(T,{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(T,{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(T,{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,Om)]),_: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"]))}}),Zy="",ca=ee(Im,[["__scopeId","data-v-46378d3b"]]),Lm={class:"cursor-pointer fm-switch__container"},Tm={key:0},zm={class:"fm-typo-body-lg-400"},Hm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Wm={class:"fm-switch__input--container"},jm=["checked","value","disabled"],Ym={key:1},Gm={class:"fm-typo-body-lg-400"},Um={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},qm=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=ue(e,"modelValue"),o=()=>{e.disabled||(n.value=!n.value)};return(i,s)=>(l.openBlock(),l.createElementBlock("label",Lm,[i.labelPlacement==="left"?(l.openBlock(),l.createElementBlock("div",Tm,[l.renderSlot(i.$slots,"label",{},void 0,!0),l.createElementVNode("div",zm,l.toDisplayString(i.label),1),i.sublabel?(l.openBlock(),l.createElementBlock("div",Hm,l.toDisplayString(i.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",Wm,[l.createElementVNode("input",{checked:l.unref(n),class:"fm-switch__input--btn",type:"checkbox",value:i.value,disabled:i.disabled,onClick:o},null,8,jm),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(T,{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",Ym,[l.createElementVNode("div",Gm,l.toDisplayString(i.label),1),i.sublabel?(l.openBlock(),l.createElementBlock("div",Um,l.toDisplayString(i.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)]))}}),Jy="",da=ee(qm,[["__scopeId","data-v-c967bf28"]]),Xm=["value","inputMode","type","placeholder","minlength","maxlength","disabled","readOnly"],ua=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=ue(e,"modelValue"),{isFocused:i,focus:s,blur:r}=ao(),a=c=>{o.value=c.target.value};return(c,d)=>(l.openBlock(),l.createBlock($e,{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(Ye,{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,Xm)]),_: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"]))}}),Qy="",Km=["value","placeholder","minlength","maxlength","readOnly","disabled"],Zm=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=ue(t,"modelValue"),{isFocused:o,focus:i,blur:s}=ao(),r=a=>{n.value=a.target.value};return(a,c)=>(l.openBlock(),l.createBlock($e,{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,Km)],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"]))}}),e_="",fa=ee(Zm,[["__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(T,{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(T,{name:"expand_more",size:"lg"})])]))}}),t_="",ha=ee(eb,[["__scopeId","data-v-e8ddb125"]]);var Ge=(t=>(t.AM="AM",t.PM="PM",t))(Ge||{});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"],Bi=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===Ge.AM?Ge.PM:Ge.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(ha,{"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(ha,{"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(Ge),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))])]))}}),n_="",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"},pa=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=ue(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===Ge.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?Ge.PM:Ge.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($e,{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(me,{ref_key:"dropdownRef",ref:d,onDropdownChanged:p},{"menu-button":l.withCtx(()=>[l.createVNode(Ye,{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(T,{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(Bi,{"model-value":o.value??{hours:0,minutes:0,period:l.unref(Ge).AM},class:"py-16","onUpdate:modelValue":g[0]||(g[0]=b=>o.value=b)},null,8,["model-value"])]),l.createElementVNode("div",cb,[l.createVNode(le,{label:"Cancel",variant:"tertiary",onClick:u}),l.createVNode(le,{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"]))}}),db=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))}}),o_="",ga=ee(db,[["__scopeId","data-v-884ba127"]]),ub=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]])}}}),i_="",ma=ee(ub,[["__scopeId","data-v-f565b558"]]),fb={class:"fm-progress-indicator relative"},hb=["data-progress"],pb={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},$i=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",fb,[l.createElementVNode("div",{ref_key:"progress",ref:n,class:"fm-progress-circular w-full","data-progress":o.value},null,8,hb),l.createElementVNode("div",pb,[l.renderSlot(s.$slots,"default")])]))}}),s_="",gb={class:"flex"},mb={key:0,class:"mt-8"},bb=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",gb,[i.value.icon?(l.openBlock(),l.createBlock(T,{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(T,{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",mb,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))}}),r_="",ba=ee(bb,[["__scopeId","data-v-b6db34bb"]]),yb={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},ya=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",yb,l.toDisplayString(t.description),1)):l.createCommentVNode("",!0)],2))}}),_b=["data-title","data-description","data-disabled"],xb={class:"flex fm-step-container gap-12 grow"},wb=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(fs);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",xb,[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(T,{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(ya,{title:t.title,description:t.description,disabled:s.value,class:"grow"},null,8,["title","description","disabled"])])],10,_b)),[[h,!s.value]])}}}),l_="",_a=ee(wb,[["__scopeId","data-v-ee172cad"]]),Cb={class:"hidden items-center xs:flex"},kb={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},xa=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(fs,{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",Cb,[l.createVNode($i,{"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(ya,{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",kb,[l.renderSlot(f.$slots,"actions")])],2)):l.createCommentVNode("",!0)],2))}});let Sb=0;function vb(){return Sb++}const Mb=t=>(l.pushScopeId("data-v-fae3740e"),t=t(),l.popScopeId(),t),Eb=["disabled"],Db=[Mb(()=>l.createElementVNode("div",{class:"fm-tab__indicator"},null,-1))],Vb={class:"max-w-[360px] min-w-[186px]"},Fb=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:()=>vb()},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(me,{"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(T,{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(Ot,{key:3,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):l.createCommentVNode("",!0),f.children.length>0?(l.openBlock(),l.createBlock(T,{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"}`])},Db,2)):l.createCommentVNode("",!0)],42,Eb)]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Vb,[(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(ve,{"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(Ot,{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"]))}}),c_="",Pi=ee(Fb,[["__scopeId","data-v-fae3740e"]]);/**
|
|
26
26
|
* table-core
|
|
27
27
|
*
|
|
28
28
|
* Copyright (c) TanStack
|
|
@@ -31,10 +31,10 @@ var By=Object.defineProperty;var $y=(re,l,Ue)=>l in re?By(re,l,{enumerable:!0,co
|
|
|
31
31
|
* LICENSE.md file in the root directory of this source tree.
|
|
32
32
|
*
|
|
33
33
|
* @license MIT
|
|
34
|
-
*/function rt(t,e){return typeof t=="function"?t(e):t}function Ce(t,e){return n=>{e.setState(o=>({...o,[t]:rt(n,o[t])}))}}function co(t){return t instanceof Function}function
|
|
34
|
+
*/function rt(t,e){return typeof t=="function"?t(e):t}function Ce(t,e){return n=>{e.setState(o=>({...o,[t]:rt(n,o[t])}))}}function co(t){return t instanceof Function}function Rb(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function Bb(t,e){const n=[],o=i=>{i.forEach(s=>{n.push(s);const r=e(s);r!=null&&r.length&&o(r)})};return o(t),n}function L(t,e,n){let o=[],i;return()=>{let s;n.key&&n.debug&&(s=Date.now());const r=t();if(!(r.length!==o.length||r.some((d,u)=>o[u]!==d)))return i;o=r;let c;if(n.key&&n.debug&&(c=Date.now()),i=e(...r),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-s)*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`,`
|
|
35
35
|
font-size: .6rem;
|
|
36
36
|
font-weight: bold;
|
|
37
|
-
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function Fb(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 Zl(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 Bb={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 _=Zl(n,w,{id:[o,h,w.id,b==null?void 0:b.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${m.filter(k=>k.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)=>Zl(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:[]}),$b={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,k=Math.max(_/((w=x==null?void 0:x.startSize)!=null?w:0),-.999999);return x.columnSizingStart.forEach(v=>{let[C,D]=v;c[C]=Math.round(Math.max(D+D*k,0)*100)/100}),{...x,deltaOffset:_,deltaPercentage:k}}),(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=Pb()?{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 Pb(){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 Ab={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()}}}},Jl=(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))};Jl.autoRemove=t=>De(t);const Ql=(t,e,n)=>{var o;return!!(!((o=t.getValue(e))==null||(o=o.toString())==null)&&o.includes(n))};Ql.autoRemove=t=>De(t);const ea=(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())};ea.autoRemove=t=>De(t);const ta=(t,e,n)=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(n)};ta.autoRemove=t=>De(t)||!(t!=null&&t.length);const na=(t,e,n)=>!n.some(o=>{var i;return!((i=t.getValue(e))!=null&&i.includes(o))});na.autoRemove=t=>De(t)||!(t!=null&&t.length);const oa=(t,e,n)=>n.some(o=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(o)});oa.autoRemove=t=>De(t)||!(t!=null&&t.length);const ia=(t,e,n)=>t.getValue(e)===n;ia.autoRemove=t=>De(t);const sa=(t,e,n)=>t.getValue(e)==n;sa.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:Jl,includesStringSensitive:Ql,equalsString:ea,arrIncludes:ta,arrIncludesAll:na,arrIncludesSome:oa,equals:ia,weakEquals:sa,inNumberRange:vi};function De(t){return t==null||t===""}const Ob={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(ra(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(ra(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 ra(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(!Vb(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},Nb={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 Ib(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 Lb={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 Ib(s,n,o)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},Ei=0,Di=10,Vi=()=>({pageIndex:Ei,pageSize:Di}),Tb={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:[]}),zb={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}})}},Hb={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,Wb=(t,e,n)=>la(lt(t.getValue(n)).toLowerCase(),lt(e.getValue(n)).toLowerCase()),jb=(t,e,n)=>la(lt(t.getValue(n)),lt(e.getValue(n))),Yb=(t,e,n)=>Ni(lt(t.getValue(n)).toLowerCase(),lt(e.getValue(n)).toLowerCase()),Gb=(t,e,n)=>Ni(lt(t.getValue(n)),lt(e.getValue(n))),Ub=(t,e,n)=>{const o=t.getValue(n),i=e.getValue(n);return o>i?1:o<i?-1:0},qb=(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 la(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:Wb,alphanumericCaseSensitive:jb,text:Yb,textCaseSensitive:Gb,datetime:Ub,basic:qb},aa=[Bb,{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)}}},Lb,zb,Ob,{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())}},Nb,Ab,Tb,Hb,$b];function Xb(t){var e;(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");let n={_features:aa};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:aa,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=Fb(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 Kb(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:()=>Rb(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=>Kb(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 Zb(){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 Jb(t,e,n){return n.options.filterFromLeafRows?Qb(t,e,n):ey(t,e,n)}function Qb(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 ey(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 ty(){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 Jb(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 ny(){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 oy(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 iy(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=oy({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}})}/**
|
|
37
|
+
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function $b(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: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 wa(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 Pb={createTable:t=>{t.getHeaderGroups=L(()=>[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=L(()=>[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=L(()=>[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=L(()=>[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=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 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 _=wa(n,w,{id:[o,h,w.id,b==null?void 0:b.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${m.filter(k=>k.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)=>wa(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},Ai=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Ab={getDefaultColumnDef:()=>fo,getInitialState:t=>({columnSizing:{},columnSizingInfo:Ai(),...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(),Oi(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=Oi(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,k=Math.max(_/((w=x==null?void 0:x.startSize)!=null?w:0),-.999999);return x.columnSizingStart.forEach(v=>{let[C,D]=v;c[C]=Math.round(Math.max(D+D*k,0)*100)/100}),{...x,deltaOffset:_,deltaPercentage:k}}),(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=Ob()?{passive:!1}:!1;Oi(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?Ai():(n=t.initialState.columnSizingInfo)!=null?n:Ai())},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 Ob(){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 Oi(t){return t.type==="touchstart"}const Nb={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()}}}},Ca=(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))};Ca.autoRemove=t=>De(t);const ka=(t,e,n)=>{var o;return!!(!((o=t.getValue(e))==null||(o=o.toString())==null)&&o.includes(n))};ka.autoRemove=t=>De(t);const Sa=(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())};Sa.autoRemove=t=>De(t);const va=(t,e,n)=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(n)};va.autoRemove=t=>De(t)||!(t!=null&&t.length);const Ma=(t,e,n)=>!n.some(o=>{var i;return!((i=t.getValue(e))!=null&&i.includes(o))});Ma.autoRemove=t=>De(t)||!(t!=null&&t.length);const Ea=(t,e,n)=>n.some(o=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(o)});Ea.autoRemove=t=>De(t)||!(t!=null&&t.length);const Da=(t,e,n)=>t.getValue(e)===n;Da.autoRemove=t=>De(t);const Va=(t,e,n)=>t.getValue(e)==n;Va.autoRemove=t=>De(t);const Ni=(t,e,n)=>{let[o,i]=n;const s=t.getValue(e);return s>=o&&s<=i};Ni.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]},Ni.autoRemove=t=>De(t)||De(t[0])&&De(t[1]);const Ue={includesString:Ca,includesStringSensitive:ka,equalsString:Sa,arrIncludes:va,arrIncludesAll:Ma,arrIncludesSome:Ea,equals:Da,weakEquals:Va,inNumberRange:Ni};function De(t){return t==null||t===""}const Ib={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"?Ue.includesString:typeof o=="number"?Ue.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Ue.equals:Array.isArray(o)?Ue.arrIncludes:Ue.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:Ue[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(Fa(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=()=>Ue.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:Ue[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(Fa(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 Fa(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const Ii={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(!Rb(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},Lb={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 Ii.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Ii.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:Ii[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 Tb(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 zb={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)=>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 Tb(s,n,o)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},Li=0,Ti=10,zi=()=>({pageIndex:Li,pageSize:Ti}),Hb={getInitialState:t=>({...t,pagination:{...zi(),...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?zi():(i=t.initialState.pagination)!=null?i:zi())},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?Li:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:Li)},t.resetPageSize=o=>{var i,s;t.setPageSize(o?Ti:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:Ti)},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=L(()=>[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)}}},Hi=()=>({left:[],right:[]}),Wi=()=>({top:[],bottom:[]}),Wb={getInitialState:t=>({columnPinning:Hi(),rowPinning:Wi(),...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=L(()=>[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=L(()=>[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=L(()=>[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?Hi():(n=(o=t.initialState)==null?void 0:o.columnPinning)!=null?n:Hi())},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=L(()=>[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=L(()=>[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=L(()=>[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?Wi():(n=(o=t.initialState)==null?void 0:o.rowPinning)!=null?n:Wi())},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=>L(()=>[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=L(()=>[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}})}},jb={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=>{ji(i,s.id,o,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=L(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Yi(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?Yi(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?Yi(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 ji(a,t.id,n,(r=o==null?void 0:o.selectChildren)!=null?r:!0,e),a})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Gi(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return Ui(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return Ui(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)}}}},ji=(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=>ji(t,a.id,n,o,i))};function Yi(t,e){const n=t.getState().rowSelection,o=[],i={},s=function(r,a){return r.map(c=>{var d;const u=Gi(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 Gi(t,e){var n;return(n=e[t.id])!=null?n:!1}function Ui(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()&&(Gi(r,e)?s=!0:i=!1),r.subRows&&r.subRows.length)){const a=Ui(r,e);a==="all"?s=!0:(a==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const qi=/([0-9]+)/gm,Yb=(t,e,n)=>Ra(lt(t.getValue(n)).toLowerCase(),lt(e.getValue(n)).toLowerCase()),Gb=(t,e,n)=>Ra(lt(t.getValue(n)),lt(e.getValue(n))),Ub=(t,e,n)=>Xi(lt(t.getValue(n)).toLowerCase(),lt(e.getValue(n)).toLowerCase()),qb=(t,e,n)=>Xi(lt(t.getValue(n)),lt(e.getValue(n))),Xb=(t,e,n)=>{const o=t.getValue(n),i=e.getValue(n);return o>i?1:o<i?-1:0},Kb=(t,e,n)=>Xi(t.getValue(n),e.getValue(n));function Xi(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 Ra(t,e){const n=t.split(qi).filter(Boolean),o=e.split(qi).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 gn={alphanumeric:Yb,alphanumericCaseSensitive:Gb,text:Ub,textCaseSensitive:qb,datetime:Xb,basic:Kb},Ba=[Pb,{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,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)=>L(()=>[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)}}},zb,Wb,Ib,{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 gn.datetime;if(typeof s=="string"&&(o=!0,s.split(qi).length>1))return gn.alphanumeric}return o?gn.text:gn.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:gn[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())}},Lb,Nb,Hb,jb,Ab];function Zb(t){var e;(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");let n={_features:Ba};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:Ba,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: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=$b(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: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 Jb(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:L(()=>[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 Ki=(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:()=>Bb(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=>Jb(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 Qb(){return t=>L(()=>[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=Ki(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 ey(t,e,n){return n.options.filterFromLeafRows?ty(t,e,n):ny(t,e,n)}function ty(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=Ki(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 ny(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=Ki(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 oy(){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 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 ey(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 iy(){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,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 sy(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 ry(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: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=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}})}/**
|
|
38
38
|
* vue-table
|
|
39
39
|
*
|
|
40
40
|
* Copyright (c) TanStack
|
|
@@ -43,4 +43,4 @@ var By=Object.defineProperty;var $y=(re,l,Ue)=>l in re?By(re,l,{enumerable:!0,co
|
|
|
43
43
|
* LICENSE.md file in the root directory of this source tree.
|
|
44
44
|
*
|
|
45
45
|
* @license MIT
|
|
46
|
-
*/function po(){return!0}const sy=Symbol("merge-proxy"),ry={get(t,e,n){return e===sy?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))]}},ry)}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 ly(t){const e=go({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions(i,s){return go(i,s)}},t),n=Xb(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 ay=["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,ay),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)]))}}),x_="",da=Q(cy,[["__scopeId","data-v-2508b8c4"]]),dy={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)}},uy={class:"fm-menu__wrapper"},fy=l.defineComponent({__name:"FmMenuList",props:{items:{default:()=>[]},placement:{default:"bottom-start"},level:{default:0},trigger:{default:"click"}},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(Qi,null),u=l.ref(null),f=l.ref(null),{floatingStyles:p}=Tl(u,f,{middleware:[yi({mainAxis:d?8:4,crossAxis:d?-12:0}),bi()],placement:n.placement,whileElementsMounted:Ol}),h=()=>{x&&clearTimeout(x)},g=()=>{v.value==="hover"&&b()},m=()=>{v.value==="click"&&b()},b=()=>{h(),c.value=!0,a.value=!0,d==null||d.setChildId(s)};let x;const y=()=>{v.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?a.value=i.value.some(({injectProps:C})=>C.mouseInMenu.value):(d&&d.closeParent(),v.value!=="click"&&(a.value=!1)))},1e3)},_=()=>{a.value=!1},k=l.computed(()=>({mouseInMenu:c}));l.provide(Qi,{register({injectProps:C}){return i.value=[...i.value,{injectProps:C}],i.value.length},closeParent(){a.value=!1,d==null||d.closeParent()},setChildId(C){r.value=C},mouseInChildId:r,trigger:n.trigger}),l.onMounted(()=>{d&&(s=d.register({injectProps:k}))}),l.watch(()=>d==null?void 0:d.mouseInChildId.value,C=>{C!==s&&(h(),a.value=!1)});const v=l.computed(()=>d===null?n.trigger:"hover");return l.watch(()=>a.value,()=>o("menu-changed",a.value)),(C,D)=>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(C.$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},[l.renderSlot(C.$slots,"menu-wrapper",{forceHide:()=>a.value=!1},()=>[l.createElementVNode("div",uy,[l.renderSlot(C.$slots,"default",{forceHide:()=>a.value=!1},void 0,!0)])],!0)],36)):l.createCommentVNode("",!0)]))])),[[l.unref(dy),_,"fm-menu"]])}}),w_="",hy=Q(fy,[["__scopeId","data-v-dec76cad"]]),py={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]"},ua=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(hy,{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(({forceHide:r})=>[l.createElementVNode("div",py,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.items,a=>(l.openBlock(),l.createBlock(Ee,{key:a.value,"model-value":a.value===l.unref(n),label:a.label,value:a.value,"onUpdate:modelValue":c=>n.value=a.value,onClick:r},null,8,["model-value","label","value","onUpdate:modelValue","onClick"]))),128))])]),_:1}))}}),gy={class:"overflow-x-auto"},my={class:"w-full"},by=["colSpan","onClick"],yy={class:"flex gap-8 items-center justify-between"},_y={className:"h-72 flex items-center justify-between px-24"},xy={class:"flex gap-24 items-center justify-between"},wy={class:"flex gap-8 items-center"},Cy=l.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-primary"}," Items per page: ",-1),ky={class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"},Sy={class:"flex gap-8 items-center"},vy={class:"fm-typo-body-lg-400 text-fm-color-typo-primary"},My=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}},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(da,{checked:d.getIsAllPageRowsSelected(),indeterminate:d.getIsSomePageRowsSelected(),onChange:d.getToggleAllPageRowsSelectedHandler()},null),cell:({row:d})=>l.createVNode(da,{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=ly({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:Zb(),getSortedRowModel:ny(),getFilteredRowModel:ty(),getPaginationRowModel:iy(),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",gy,[l.createElementVNode("table",my,[l.createElementVNode("thead",null,[(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",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",yy,[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(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,by)}),128))]))),128))]),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:"border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm"},[(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 fm-typo-body-lg-400 px-16 py-12 text-fm-color-typo-primary text-ellipsis whitespace-nowrap overflow-hidden",((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.createVNode(l.unref(ca),{render:f.column.columnDef.cell,props:f.getContext()},null,8,["render","props"])],6)}),128))]))),128))])]),l.createElementVNode("div",_y,[l.createElementVNode("div",xy,[l.createElementVNode("div",wy,[Cy,l.createVNode(ua,{"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",ky,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",Sy,[l.createVNode(ua,{"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",vy," 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"])])])]))}}),Ey=l.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"}," More ",-1),Dy={class:"max-w-[360px] min-w-[186px]"},Vy={FmBadge:yn,FmBreadcrumb:Da,FmButton:fe,FmButtonGroup:Ta,FmCard:Wa,FmCardActions:ja,FmCardSection:Ya,FmCardTitle:Yi,FmChip:Gi,FmChipGroup:Ui,FmDialog:Xa,FmDropField:Qa,FmDynamicDialog:es,FmLineChart:xp,FmCheckbox:xl,FmDatePicker:Ag,FmDateRangePicker:cm,FmField:it,FmForm:dm,FmFormGroup:je,FmHelperText:zl,FmLabel:Wl,FmRadio:ym,FmRadioGroup:_m,FmSelect:km,FmStepperField:Em,FmSwitch:Im,FmTextField:Tm,FmTextarea:Wm,FmTimeInput:Ul,FmTimePicker:nb,FmIcon:L,FmList:ib,FmListItem:rb,FmMenu:we,FmMenuItem:Ee,FmProgressIndicator:ql,FmSnackbar:hb,FmSpacer:qi,FmStep:yb,FmStepper:wb,FmTab:Kl,FmTable:My,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(Kl,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"}),Ey],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Dy,[(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:Hl};function Ry(){const t=l.inject(Ji);if(!t)throw new Error("No provider");return t}const Fy=t=>{t.use(wa,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),t.use(oc),Object.entries(Vy).forEach(([e,n])=>{t.component(e,n)})};re.uiPlugin=Fy,re.useDialog=Ry,re.useFormChild=Yl,re.useValidation=jl,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
|
|
46
|
+
*/function po(){return!0}const ly=Symbol("merge-proxy"),ay={get(t,e,n){return e===ly?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 Zi(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=Zi(e[i])[o];if(s!==void 0)return s}},has(o){for(let i=e.length-1;i>=0;i--)if(o in Zi(e[i]))return!0;return!1},keys(){const o=[];for(let i=0;i<e.length;i++)o.push(...Object.keys(Zi(e[i])));return[...Array.from(new Set(o))]}},ay)}const $a=l.defineComponent({props:["render","props"],setup:t=>()=>typeof t.render=="function"||typeof t.render=="object"?l.h(t.render,t.props):t.render});function cy(t){const e=go({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions(i,s){return go(i,s)}},t),n=Zb(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 dy=["checked","disabled","indeterminate"],uy=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,dy),o.indeterminate||o.checked?(l.openBlock(),l.createBlock(T,{key:0,class:"fm-checkbox__input--checkmark",name:n.value,size:"md",color:"#FFFFFF"},null,8,["name"])):l.createCommentVNode("",!0)]))}}),w_="",Pa=ee(uy,[["__scopeId","data-v-2508b8c4"]]),fy={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)}},hy={class:"fm-menu__wrapper"},py=l.defineComponent({__name:"FmMenuList",props:{items:{default:()=>[]},placement:{default:"bottom-start"},level:{default:0},trigger:{default:"click"}},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(ps,null),u=l.ref(null),f=l.ref(null),{floatingStyles:p}=ea(u,f,{middleware:[Si({mainAxis:d?8:4,crossAxis:d?-12:0}),ki()],placement:n.placement,whileElementsMounted:Kl}),h=()=>{x&&clearTimeout(x)},g=()=>{v.value==="hover"&&b()},m=()=>{v.value==="click"&&b()},b=()=>{h(),c.value=!0,a.value=!0,d==null||d.setChildId(s)};let x;const y=()=>{v.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?a.value=i.value.some(({injectProps:C})=>C.mouseInMenu.value):(d&&d.closeParent(),v.value!=="click"&&(a.value=!1)))},1e3)},_=()=>{a.value=!1},k=l.computed(()=>({mouseInMenu:c}));l.provide(ps,{register({injectProps:C}){return i.value=[...i.value,{injectProps:C}],i.value.length},closeParent(){a.value=!1,d==null||d.closeParent()},setChildId(C){r.value=C},mouseInChildId:r,trigger:n.trigger}),l.onMounted(()=>{d&&(s=d.register({injectProps:k}))}),l.watch(()=>d==null?void 0:d.mouseInChildId.value,C=>{C!==s&&(h(),a.value=!1)});const v=l.computed(()=>d===null?n.trigger:"hover");return l.watch(()=>a.value,()=>o("menu-changed",a.value)),(C,D)=>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(C.$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},[l.renderSlot(C.$slots,"menu-wrapper",{forceHide:()=>a.value=!1},()=>[l.createElementVNode("div",hy,[l.renderSlot(C.$slots,"default",{forceHide:()=>a.value=!1},void 0,!0)])],!0)],36)):l.createCommentVNode("",!0)]))])),[[l.unref(fy),_,"fm-menu"]])}}),C_="",gy=ee(py,[["__scopeId","data-v-dec76cad"]]),my={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]"},Aa=l.defineComponent({__name:"FmTableSelection",props:{modelValue:{},items:{}},emits:["update:modelValue"],setup(t){const n=ue(t,"modelValue"),o=l.ref(!1);return(i,s)=>(l.openBlock(),l.createBlock(gy,{onMenuChanged:s[0]||(s[0]=r=>o.value=r)},{"menu-button":l.withCtx(()=>{var r;return[l.createVNode(le,{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(({forceHide:r})=>[l.createElementVNode("div",my,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.items,a=>(l.openBlock(),l.createBlock(ve,{key:a.value,"model-value":a.value===l.unref(n),label:a.label,value:a.value,"onUpdate:modelValue":c=>n.value=a.value,onClick:r},null,8,["model-value","label","value","onUpdate:modelValue","onClick"]))),128))])]),_:1}))}}),by={class:"overflow-x-auto"},yy={class:"w-full"},_y=["colSpan","onClick"],xy={class:"flex gap-8 items-center justify-between"},wy={className:"h-72 flex items-center justify-between px-24"},Cy={class:"flex gap-24 items-center justify-between"},ky={class:"flex gap-8 items-center"},Sy=l.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-primary"}," Items per page: ",-1),vy={class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"},My={class:"flex gap-8 items-center"},Ey={class:"fm-typo-body-lg-400 text-fm-color-typo-primary"},Oa=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}},setup(t){const e=t,n=ue(e,"modelValue"),o=ue(e,"searchValue"),i=l.computed(()=>{const c=[...e.columnDefs];return e.selection&&c.unshift({id:"row-selection",header:({table:d})=>l.createVNode(Pa,{checked:d.getIsAllPageRowsSelected(),indeterminate:d.getIsSomePageRowsSelected(),onChange:d.getToggleAllPageRowsSelectedHandler()},null),cell:({row:d})=>l.createVNode(Pa,{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=cy({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:Qb(),getSortedRowModel:iy(),getFilteredRowModel:oy(),getPaginationRowModel:ry(),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",by,[l.createElementVNode("table",yy,[l.createElementVNode("thead",null,[(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",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",xy,[f.isPlaceholder?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref($a),{key:0,render:f.column.columnDef.header,props:f.getContext()},null,8,["render","props"])),f.column.getCanSort()?(l.openBlock(),l.createBlock(T,{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,_y)}),128))]))),128))]),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:"border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm"},[(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 fm-typo-body-lg-400 px-16 py-12 text-fm-color-typo-primary text-ellipsis whitespace-nowrap overflow-hidden",((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.createVNode(l.unref($a),{render:f.column.columnDef.cell,props:f.getContext()},null,8,["render","props"])],6)}),128))]))),128))])]),l.createElementVNode("div",wy,[l.createElementVNode("div",Cy,[l.createElementVNode("div",ky,[Sy,l.createVNode(Aa,{"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",vy,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",My,[l.createVNode(Aa,{"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",Ey," of "+l.toDisplayString(l.unref(a).getPageCount())+" pages ",1),l.createVNode(le,{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(le,{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"])])])]))}}),Dy=l.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"}," More ",-1),Vy={class:"max-w-[360px] min-w-[186px]"},Na=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(Pi,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(me,{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(T,{name:"more_vert"}),Dy],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Vy,[(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(ve,{"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(Ot,{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))}}),Fy=Object.freeze(Object.defineProperty({__proto__:null,FmBadge:Ot,FmBreadcrumb:os,FmButton:le,FmButtonGroup:is,FmCard:ss,FmCardActions:rs,FmCardSection:ls,FmCardTitle:Co,FmCheckbox:yi,FmChip:ko,FmChipGroup:So,FmDatePicker:oa,FmDateRangePicker:ia,FmDialog:as,FmDropField:cs,FmDynamicDialog:Mo,FmField:Ye,FmForm:sa,FmFormGroup:$e,FmHelperText:Vi,FmIcon:T,FmLabel:Ri,FmLineChart:Pl,FmList:ga,FmListItem:ma,FmMenu:me,FmMenuItem:ve,FmProgressIndicator:$i,FmRadio:ra,FmRadioGroup:la,FmSelect:aa,FmSnackbar:ba,FmSpacer:vo,FmStep:_a,FmStepper:xa,FmStepperField:ca,FmSwitch:da,FmTab:Pi,FmTable:Oa,FmTabs:Na,FmTextField:ua,FmTextarea:fa,FmTimeInput:Bi,FmTimePicker:pa,FmTooltip:Fi},Symbol.toStringTag,{value:"Module"}));function Ry(){const t=l.inject(hs);if(!t)throw new Error("No provider");return t}const By=t=>{t.use(Ua,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),t.use(Cc),Object.entries(Fy).forEach(([e,n])=>{t.component(e,n)})};A.FmBadge=Ot,A.FmBreadcrumb=os,A.FmButton=le,A.FmButtonGroup=is,A.FmCard=ss,A.FmCardActions=rs,A.FmCardSection=ls,A.FmCardTitle=Co,A.FmCheckbox=yi,A.FmChip=ko,A.FmChipGroup=So,A.FmDatePicker=oa,A.FmDateRangePicker=ia,A.FmDialog=as,A.FmDropField=cs,A.FmDynamicDialog=Mo,A.FmField=Ye,A.FmForm=sa,A.FmFormGroup=$e,A.FmHelperText=Vi,A.FmIcon=T,A.FmLabel=Ri,A.FmLineChart=Pl,A.FmList=ga,A.FmListItem=ma,A.FmMenu=me,A.FmMenuItem=ve,A.FmProgressIndicator=$i,A.FmRadio=ra,A.FmRadioGroup=la,A.FmSelect=aa,A.FmSnackbar=ba,A.FmSpacer=vo,A.FmStep=_a,A.FmStepper=xa,A.FmStepperField=ca,A.FmSwitch=da,A.FmTab=Pi,A.FmTable=Oa,A.FmTabs=Na,A.FmTextField=ua,A.FmTextarea=fa,A.FmTimeInput=Bi,A.FmTimePicker=pa,A.FmTooltip=Fi,A.uiPlugin=By,A.useDialog=Ry,A.useFormChild=na,A.useValidation=ta,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|