codesaaz-core 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- (function(Nt,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("vue-router"),require("primevue")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","primevue"],a):(Nt=typeof globalThis<"u"?globalThis:Nt||self,a(Nt.Codesaaz={},Nt.Vue,Nt.VueRouter,Nt.PrimeVue))})(this,function(Nt,a,Ht,Xo){"use strict";var rk=Object.defineProperty;var ak=(Nt,a,Ht)=>a in Nt?rk(Nt,a,{enumerable:!0,configurable:!0,writable:!0,value:Ht}):Nt[a]=Ht;var L=(Nt,a,Ht)=>ak(Nt,typeof a!="symbol"?a+"":a,Ht);const Oi={get:Di("GET"),post:Di("POST"),put:Di("PUT"),delete:Di("DELETE")};function Di(n){return(t,e)=>{const i={method:n,headers:{}};return e&&(i.headers["Content-Type"]="application/json",i.body=JSON.stringify(e)),fetch(t,i).then(fd)}}function fd(n){return n.text().then(t=>{const e=t&&JSON.parse(t);return n.ok?e:Promise.reject(e)})}/*!
1
+ (function($e,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("vue-router"),require("primevue")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","primevue"],r):($e=typeof globalThis<"u"?globalThis:$e||self,r($e.Codesaaz={},$e.Vue,$e.VueRouter,$e.PrimeVue))})(this,function($e,r,Je,ar){"use strict";var wS=Object.defineProperty;var ES=($e,r,Je)=>r in $e?wS($e,r,{enumerable:!0,configurable:!0,writable:!0,value:Je}):$e[r]=Je;var j=($e,r,Je)=>ES($e,typeof r!="symbol"?r+"":r,Je);var Rs;const Li={get:Ri("GET"),post:Ri("POST"),put:Ri("PUT"),delete:Ri("DELETE")};function Ri(n){return(e,t)=>{const i={method:n,headers:{}};return t&&(i.headers["Content-Type"]="application/json",i.body=JSON.stringify(t)),fetch(e,i).then(Rd)}}function Rd(n){return n.text().then(e=>{const t=e&&JSON.parse(e);return n.ok?t:Promise.reject(t)})}/*!
2
2
  * pinia v2.3.1
3
3
  * (c) 2025 Eduardo San Martin Morote
4
4
  * @license MIT
5
- */let Go;const Os=n=>Go=n,md=Symbol();function Ds(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var Pn;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(Pn||(Pn={}));const Qo=()=>{};function Jo(n,t,e,i=Qo){n.push(t);const s=()=>{const o=n.indexOf(t);o>-1&&(n.splice(o,1),i())};return!e&&a.getCurrentScope()&&a.onScopeDispose(s),s}function dn(n,...t){n.slice().forEach(e=>{e(...t)})}const pd=n=>n(),Zo=Symbol(),Ns=Symbol();function Ts(n,t){n instanceof Map&&t instanceof Map?t.forEach((e,i)=>n.set(i,e)):n instanceof Set&&t instanceof Set&&t.forEach(n.add,n);for(const e in t){if(!t.hasOwnProperty(e))continue;const i=t[e],s=n[e];Ds(s)&&Ds(i)&&n.hasOwnProperty(e)&&!a.isRef(i)&&!a.isReactive(i)?n[e]=Ts(s,i):n[e]=i}return n}const gd=Symbol();function yd(n){return!Ds(n)||!n.hasOwnProperty(gd)}const{assign:Ne}=Object;function bd(n){return!!(a.isRef(n)&&n.effect)}function _d(n,t,e,i){const{state:s,actions:o,getters:r}=t,l=e.state.value[n];let c;function d(){l||(e.state.value[n]=s?s():{});const u=a.toRefs(e.state.value[n]);return Ne(u,o,Object.keys(r||{}).reduce((h,f)=>(h[f]=a.markRaw(a.computed(()=>{Os(e);const m=e._s.get(n);return r[f].call(m,m)})),h),{}))}return c=tr(n,d,t,e,i,!0),c}function tr(n,t,e={},i,s,o){let r;const l=Ne({actions:{}},e),c={deep:!0};let d,u,h=[],f=[],m;const p=i.state.value[n];!o&&!p&&(i.state.value[n]={}),a.ref({});let g;function y(x){let O;d=u=!1,typeof x=="function"?(x(i.state.value[n]),O={type:Pn.patchFunction,storeId:n,events:m}):(Ts(i.state.value[n],x),O={type:Pn.patchObject,payload:x,storeId:n,events:m});const M=g=Symbol();a.nextTick().then(()=>{g===M&&(d=!0)}),u=!0,dn(h,O,i.state.value[n])}const b=o?function(){const{state:O}=e,M=O?O():{};this.$patch(v=>{Ne(v,M)})}:Qo;function _(){r.stop(),h=[],f=[],i._s.delete(n)}const w=(x,O="")=>{if(Zo in x)return x[Ns]=O,x;const M=function(){Os(i);const v=Array.from(arguments),T=[],$=[];function U(I){T.push(I)}function H(I){$.push(I)}dn(f,{args:v,name:M[Ns],store:k,after:U,onError:H});let F;try{F=x.apply(this&&this.$id===n?this:k,v)}catch(I){throw dn($,I),I}return F instanceof Promise?F.then(I=>(dn(T,I),I)).catch(I=>(dn($,I),Promise.reject(I))):(dn(T,F),F)};return M[Zo]=!0,M[Ns]=O,M},E={_p:i,$id:n,$onAction:Jo.bind(null,f),$patch:y,$reset:b,$subscribe(x,O={}){const M=Jo(h,x,O.detached,()=>v()),v=r.run(()=>a.watch(()=>i.state.value[n],T=>{(O.flush==="sync"?u:d)&&x({storeId:n,type:Pn.direct,events:m},T)},Ne({},c,O)));return M},$dispose:_},k=a.reactive(E);i._s.set(n,k);const S=(i._a&&i._a.runWithContext||pd)(()=>i._e.run(()=>(r=a.effectScope()).run(()=>t({action:w}))));for(const x in S){const O=S[x];if(a.isRef(O)&&!bd(O)||a.isReactive(O))o||(p&&yd(O)&&(a.isRef(O)?O.value=p[x]:Ts(O,p[x])),i.state.value[n][x]=O);else if(typeof O=="function"){const M=w(O,x);S[x]=M,l.actions[x]=O}}return Ne(k,S),Ne(a.toRaw(k),S),Object.defineProperty(k,"$state",{get:()=>i.state.value[n],set:x=>{y(O=>{Ne(O,x)})}}),i._p.forEach(x=>{Ne(k,r.run(()=>x({store:k,app:i._a,pinia:i,options:l})))}),p&&o&&e.hydrate&&e.hydrate(k.$state,p),d=!0,u=!0,k}/*! #__NO_SIDE_EFFECTS__ */function er(n,t,e){let i,s;const o=typeof t=="function";typeof n=="string"?(i=n,s=o?e:t):(s=n,i=n.id);function r(l,c){const d=a.hasInjectionContext();return l=l||(d?a.inject(md,null):null),l&&Os(l),l=Go,l._s.has(i)||(o?tr(i,t,s,l):_d(i,s,l)),l._s.get(i)}return r.$id=i,r}const me=er("globalConfigsStore",{state:()=>({globalConfigs:{}}),actions:{setBaseUrl(n){this.globalConfigs.baseUrl=n},setAppId(n){this.globalConfigs.appId=n}},getters:{getBaseUrl:n=>()=>n.globalConfigs.baseUrl,getAppId:n=>()=>n.globalConfigs.appId}});class nr{constructor(){let t="http://localhost:7070";const e=me();e.getBaseUrl()!=null&&e.getBaseUrl()!=""&&(t=e.getBaseUrl()),this.baseUrl=t}async post(t,e){return await Oi.post(this.baseUrl+t,e)}async put(t,e){return await Oi.put(this.baseUrl+t,e)}async delete(t,e){return await Oi.delete(this.baseUrl+t,e)}async get(t){return await Oi.get(this.baseUrl+t)}}class qe{constructor(){this.httpService=new nr}async getEntityRecords(t){return await this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${t}/record`)}async searchEntityRecords(t,e){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${t}/record/search`,e)}async getRelatedEntityRecord(t,e){return this.appId==null&&this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${t}/link/record/${e}?fetchRelatedEntities=true`)}async saveRelatedEntityRecord(t,e,i){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${t}/link/record/${e}`,i)}async getRecord(t,e){return this.appId==null&&this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${t}/record/${e}?fetchRelatedEntities=false`)}async addRecord(t,e){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${t}/record`,e)}async updateRecord(t,e,i){return this.appId==null&&this.getAppId(),await this.httpService.put(`/api/app/v1/${this.appId}/entity/${t}/record/${e}`,i)}async deleteRecord(t,e){return this.appId==null&&this.getAppId(),await this.httpService.delete(`/api/app/v1/${this.appId}/entity/${t}/record/${e}`)}async getAppId(){const t=me();this.appId=t.getAppId()}}function xd(n=""){const t=new qe,e={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};let i=a.ref({}),s=a.ref([]),o=a.ref([]),r=a.ref([]);const l=a.ref(""),c=a.ref(1),d=a.ref(25),u=a.ref(0),h=a.ref(0),f=a.ref(0),m=a.ref(!1),p=a.ref([]),g=a.ref(""),y=a.ref({}),b=async(v,T=!0)=>{m.value=!0;try{const $=await t.getEntityRecords(v);$&&$.response&&(i.value=$.response,s.value=$.response.result,r.value=$.response.entity.entityDefinition.columns,o.value=w($.response.entity.entityDefinition.columns),h.value=$.response.totalRecords,M())}catch($){console.error("Error fetching entity:",$.errorMessage)}finally{m.value=!1}},_=async(v=!0)=>{m.value=!0;try{const T={sortBy:[l.value],sortDirection:c.value===1?"ASC":"DESC",pageSize:d.value,currentPage:u.value,columnList:null,filter:p.value,fullTextSearch:g.value};Object.keys(T.filter).length===0&&(T.filter=[]);const $=await t.searchEntityRecords(n,T);$&&$.response&&(m.value=!1,i.value=$.response,s.value=$.response.result,h.value=$.response.totalRecords,f.value=u.value*d.value)}catch(T){console.error("Error fetching entity:",T.errorMessage)}finally{m.value=!1}},w=v=>v.map(T=>({field:T.name,name:T.displayName?T.displayName:T.name,filterable:T.filterable,datatype:T.type,sortable:!0,displayFormatKey:T.displayFormatKey,displayFormat:T.displayFormat})),E=v=>{l.value=v.sortField,c.value=v.sortOrder,f.value=0,_()},k=v=>{d.value=v.rows,u.value=v.page,f.value=v.first,_()},C=()=>{_()},S=()=>{_()},x=v=>{switch(v.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},O=v=>{const T=o.value.find($=>$.field===v);return T?T.datatype:null},M=()=>{for(let v=0;v<r.value.length;v++){const T=r.value[v];if(T.primaryKey&&T.primaryKey==!0){y.value=T,l.value=T.name;break}}};return{items:s,headers:o,first:f,totalRecords:h,pageSize:d,loading:m,sortBy:l,sortDirection:c,operatorMap:e,filterToSend:p,fullTextSearch:g,listingResponse:i,primarayKeyColumn:y,onFullTextSearch:S,getDatatypeByField:O,getColumnDatatype:x,onSort:E,onPage:k,onFilter:C,fetchEntityFilterData:_,fetchEntityByName:b}}const Bt=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},kd={key:0,class:"field flex flex-col mb-3"},Sd=["for"],wd={key:0},Ed={key:0,class:"font-bold"},Cd={key:1,class:"font-bold text-color-hint"},vd={key:1,class:"flex items-center"},Od={class:"ml-2"},Dd={key:0},Ni=Bt({__name:"EntityForm",props:a.mergeModels({column:Object,errors:Array},{modelValue:{},modelModifiers:{}}),emits:a.mergeModels(["input"],["update:modelValue"]),setup(n,{emit:t}){const e=a.useModel(n,"modelValue"),i=t,s=o=>{i("input",o.name)};if(n.column&&!n.column.inputComponent){let o="";switch(n.column.type.toLowerCase()){case"text":o="INPUT_TEXT";break;case"int":o="INPUT_NUMBER";break;case"float":o="INPUT_FLOAT";break;case"boolean":o="INPUT_BOOLEAN";break;case"uuid":o="INPUT_UUID";break;case"date":o="INPUT_DATE";break;default:o="INPUT_STRING"}n.column.inputComponent=o}return(o,r)=>{var h,f,m,p,g;const l=a.resolveComponent("Calendar"),c=a.resolveComponent("InputNumber"),d=a.resolveComponent("InputText"),u=a.resolveComponent("Checkbox");return a.openBlock(),a.createElementBlock(a.Fragment,null,[n.column.inputComponent.toLowerCase()!="input_boolean"?(a.openBlock(),a.createElementBlock("div",kd,[a.createElementVNode("label",{class:"mb-1",for:n.column.name},[a.createTextVNode(a.toDisplayString(n.column.displayName||n.column.name)+" ",1),n.column.required?(a.openBlock(),a.createElementBlock("span",wd,"*")):a.createCommentVNode("",!0)],8,Sd),n.column.inputComponent.toLowerCase()=="input_date"?(a.openBlock(),a.createBlock(l,{key:0,modelValue:e.value,"onUpdate:modelValue":r[0]||(r[0]=y=>e.value=y),id:n.column.name,name:n.column.name,onDateSelect:r[1]||(r[1]=y=>s(n.column)),invalid:((h=n.errors)==null?void 0:h.length)>0},null,8,["modelValue","id","name","invalid"])):n.column.inputComponent.toLowerCase()=="input_number"?(a.openBlock(),a.createBlock(c,{key:1,modelValue:e.value,"onUpdate:modelValue":r[2]||(r[2]=y=>e.value=y),id:n.column.name,name:n.column.name,allowEmpty:!0,format:!1,onInput:r[3]||(r[3]=y=>s(n.column)),invalid:((f=n.errors)==null?void 0:f.length)>0},null,8,["modelValue","id","name","invalid"])):n.column.type.toLowerCase()=="input_float"?(a.openBlock(),a.createBlock(c,{key:2,type:"decimal",minFractionDigits:1,id:n.column.name,allowEmpty:!0,format:!1,name:n.column.name,onInput:r[4]||(r[4]=y=>s(n.column)),invalid:((m=n.errors)==null?void 0:m.length)>0},null,8,["id","name","invalid"])):(a.openBlock(),a.createBlock(d,{key:3,modelValue:e.value,"onUpdate:modelValue":r[5]||(r[5]=y=>e.value=y),id:n.column.name,name:n.column.name,onInput:r[6]||(r[6]=y=>s(n.column)),invalid:((p=n.errors)==null?void 0:p.length)>0},null,8,["modelValue","id","name","invalid"])),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.errors,(y,b)=>(a.openBlock(),a.createElementBlock("div",{key:b,class:"text-red-500 mt-1 ml-2"},[y.includes("hint:")?(a.openBlock(),a.createElementBlock("small",Cd,a.toDisplayString(y.split(":")[1]),1)):(a.openBlock(),a.createElementBlock("small",Ed,a.toDisplayString(y),1))]))),128))])):a.createCommentVNode("",!0),n.column.inputComponent.toLowerCase()=="input_boolean"?(a.openBlock(),a.createElementBlock("div",vd,[a.createVNode(u,{modelValue:e.value,"onUpdate:modelValue":r[7]||(r[7]=y=>e.value=y),invalid:((g=n.errors)==null?void 0:g.length)>0,onInput:r[8]||(r[8]=y=>s(n.column.name)),binary:""},null,8,["modelValue","invalid"]),a.createElementVNode("label",Od,[a.createTextVNode(a.toDisplayString(n.column.displayName||n.column.name)+" ",1),n.column.required?(a.openBlock(),a.createElementBlock("span",Dd,"*")):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-bda1af7c"]]);/**
5
+ */let lr;const js=n=>lr=n,jd=Symbol();function zs(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var Ln;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(Ln||(Ln={}));const cr=()=>{};function dr(n,e,t,i=cr){n.push(e);const s=()=>{const o=n.indexOf(e);o>-1&&(n.splice(o,1),i())};return!t&&r.getCurrentScope()&&r.onScopeDispose(s),s}function kn(n,...e){n.slice().forEach(t=>{t(...e)})}const zd=n=>n(),ur=Symbol(),Ws=Symbol();function Hs(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],s=n[t];zs(s)&&zs(i)&&n.hasOwnProperty(t)&&!r.isRef(i)&&!r.isReactive(i)?n[t]=Hs(s,i):n[t]=i}return n}const Wd=Symbol();function Hd(n){return!zs(n)||!n.hasOwnProperty(Wd)}const{assign:$t}=Object;function Ud(n){return!!(r.isRef(n)&&n.effect)}function qd(n,e,t,i){const{state:s,actions:o,getters:a}=e,l=t.state.value[n];let c;function d(){l||(t.state.value[n]=s?s():{});const u=r.toRefs(t.state.value[n]);return $t(u,o,Object.keys(a||{}).reduce((f,h)=>(f[h]=r.markRaw(r.computed(()=>{js(t);const m=t._s.get(n);return a[h].call(m,m)})),f),{}))}return c=fr(n,d,e,t,i,!0),c}function fr(n,e,t={},i,s,o){let a;const l=$t({actions:{}},t),c={deep:!0};let d,u,f=[],h=[],m;const p=i.state.value[n];!o&&!p&&(i.state.value[n]={}),r.ref({});let g;function y(_){let D;d=u=!1,typeof _=="function"?(_(i.state.value[n]),D={type:Ln.patchFunction,storeId:n,events:m}):(Hs(i.state.value[n],_),D={type:Ln.patchObject,payload:_,storeId:n,events:m});const B=g=Symbol();r.nextTick().then(()=>{g===B&&(d=!0)}),u=!0,kn(f,D,i.state.value[n])}const b=o?function(){const{state:D}=t,B=D?D():{};this.$patch(w=>{$t(w,B)})}:cr;function x(){a.stop(),f=[],h=[],i._s.delete(n)}const E=(_,D="")=>{if(ur in _)return _[Ws]=D,_;const B=function(){js(i);const w=Array.from(arguments),T=[],I=[];function X(R){T.push(R)}function q(R){I.push(R)}kn(h,{args:w,name:B[Ws],store:k,after:X,onError:q});let $;try{$=_.apply(this&&this.$id===n?this:k,w)}catch(R){throw kn(I,R),R}return $ instanceof Promise?$.then(R=>(kn(T,R),R)).catch(R=>(kn(I,R),Promise.reject(R))):(kn(T,$),$)};return B[ur]=!0,B[Ws]=D,B},C={_p:i,$id:n,$onAction:dr.bind(null,h),$patch:y,$reset:b,$subscribe(_,D={}){const B=dr(f,_,D.detached,()=>w()),w=a.run(()=>r.watch(()=>i.state.value[n],T=>{(D.flush==="sync"?u:d)&&_({storeId:n,type:Ln.direct,events:m},T)},$t({},c,D)));return B},$dispose:x},k=r.reactive(C);i._s.set(n,k);const S=(i._a&&i._a.runWithContext||zd)(()=>i._e.run(()=>(a=r.effectScope()).run(()=>e({action:E}))));for(const _ in S){const D=S[_];if(r.isRef(D)&&!Ud(D)||r.isReactive(D))o||(p&&Hd(D)&&(r.isRef(D)?D.value=p[_]:Hs(D,p[_])),i.state.value[n][_]=D);else if(typeof D=="function"){const B=E(D,_);S[_]=B,l.actions[_]=D}}return $t(k,S),$t(r.toRaw(k),S),Object.defineProperty(k,"$state",{get:()=>i.state.value[n],set:_=>{y(D=>{$t(D,_)})}}),i._p.forEach(_=>{$t(k,a.run(()=>_({store:k,app:i._a,pinia:i,options:l})))}),p&&o&&t.hydrate&&t.hydrate(k.$state,p),d=!0,u=!0,k}/*! #__NO_SIDE_EFFECTS__ */function hr(n,e,t){let i,s;const o=typeof e=="function";typeof n=="string"?(i=n,s=o?t:e):(s=n,i=n.id);function a(l,c){const d=r.hasInjectionContext();return l=l||(d?r.inject(jd,null):null),l&&js(l),l=lr,l._s.has(i)||(o?fr(i,e,s,l):qd(i,s,l)),l._s.get(i)}return a.$id=i,a}const Ze=hr("globalConfigsStore",{state:()=>({globalConfigs:{}}),actions:{setBaseUrl(n){this.globalConfigs.baseUrl=n},setAppId(n){this.globalConfigs.appId=n}},getters:{getBaseUrl:n=>()=>n.globalConfigs.baseUrl,getAppId:n=>()=>n.globalConfigs.appId}});class mr{constructor(){let e="http://localhost:7070";const t=Ze();t.getBaseUrl()!=null&&t.getBaseUrl()!=""&&(e=t.getBaseUrl()),this.baseUrl=e}async post(e,t){return await Li.post(this.baseUrl+e,t)}async put(e,t){return await Li.put(this.baseUrl+e,t)}async delete(e,t){return await Li.delete(this.baseUrl+e,t)}async get(e){return await Li.get(this.baseUrl+e)}}class sn{constructor(){this.httpService=new mr}async getEntityRecords(e){return await this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${e}/record`)}async searchEntityRecords(e,t){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${e}/record/search`,t)}async getRelatedEntityRecord(e,t){return this.appId==null&&this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${e}/link/record/${t}?fetchRelatedEntities=true`)}async saveRelatedEntityRecord(e,t,i){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${e}/link/record/${t}`,i)}async getRecord(e,t){return this.appId==null&&this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${e}/record/${t}?fetchRelatedEntities=false`)}async addRecord(e,t){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${e}/record`,t)}async updateRecord(e,t,i){return this.appId==null&&this.getAppId(),await this.httpService.put(`/api/app/v1/${this.appId}/entity/${e}/record/${t}`,i)}async deleteRecord(e,t){return this.appId==null&&this.getAppId(),await this.httpService.delete(`/api/app/v1/${this.appId}/entity/${e}/record/${t}`)}async getAppId(){const e=Ze();this.appId=e.getAppId()}}function Yd(n=""){const e=new sn,t={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};let i=r.ref({}),s=r.ref([]),o=r.ref([]),a=r.ref([]);const l=r.ref(""),c=r.ref(1),d=r.ref(25),u=r.ref(0),f=r.ref(0),h=r.ref(0),m=r.ref(!1),p=r.ref([]),g=r.ref(""),y=r.ref({}),b=async(w,T=!0)=>{m.value=!0;try{const I=await e.getEntityRecords(w);I&&I.response&&(i.value=I.response,s.value=I.response.result,a.value=I.response.entity.entityDefinition.columns,o.value=E(I.response.entity.entityDefinition.columns),f.value=I.response.totalRecords,B())}catch(I){console.error("Error fetching entity:",I.errorMessage)}finally{m.value=!1}},x=async(w=!0)=>{m.value=!0;try{const T={sortBy:[l.value],sortDirection:c.value===1?"ASC":"DESC",pageSize:d.value,currentPage:u.value,columnList:null,filter:p.value,fullTextSearch:g.value};Object.keys(T.filter).length===0&&(T.filter=[]);const I=await e.searchEntityRecords(n,T);I&&I.response&&(m.value=!1,i.value=I.response,s.value=I.response.result,f.value=I.response.totalRecords,h.value=u.value*d.value)}catch(T){console.error("Error fetching entity:",T.errorMessage)}finally{m.value=!1}},E=w=>w.map(T=>({field:T.name,name:T.displayName?T.displayName:T.name,filterable:T.filterable,datatype:T.type,sortable:!0,displayFormatKey:T.displayFormatKey,displayFormat:T.displayFormat})),C=w=>{l.value=w.sortField,c.value=w.sortOrder,h.value=0,x()},k=w=>{d.value=w.rows,u.value=w.page,h.value=w.first,x()},v=()=>{x()},S=()=>{x()},_=w=>{switch(w.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},D=w=>{const T=o.value.find(I=>I.field===w);return T?T.datatype:null},B=()=>{for(let w=0;w<a.value.length;w++){const T=a.value[w];if(T.primaryKey&&T.primaryKey==!0){y.value=T,l.value=T.name;break}}};return{items:s,headers:o,first:h,totalRecords:f,pageSize:d,loading:m,sortBy:l,sortDirection:c,operatorMap:t,filterToSend:p,fullTextSearch:g,listingResponse:i,primarayKeyColumn:y,onFullTextSearch:S,getDatatypeByField:D,getColumnDatatype:_,onSort:C,onPage:k,onFilter:v,fetchEntityFilterData:x,fetchEntityByName:b}}const Be=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},Kd={key:0,class:"field flex flex-col mb-3"},Xd=["for"],Gd={key:0},Qd={key:0,class:"font-bold"},Jd={key:1,class:"font-bold text-color-hint"},Zd={key:1,class:"flex items-center"},eu={class:"ml-2"},tu={key:0},ji=Be({__name:"EntityForm",props:r.mergeModels({column:Object,errors:Array},{modelValue:{},modelModifiers:{}}),emits:r.mergeModels(["input"],["update:modelValue"]),setup(n,{emit:e}){const t=r.useModel(n,"modelValue"),i=e,s=o=>{i("input",o.name)};if(n.column&&!n.column.inputComponent){let o="";switch(n.column.type.toLowerCase()){case"text":o="INPUT_TEXT";break;case"int":o="INPUT_NUMBER";break;case"float":o="INPUT_FLOAT";break;case"boolean":o="INPUT_BOOLEAN";break;case"uuid":o="INPUT_UUID";break;case"date":o="INPUT_DATE";break;default:o="INPUT_STRING"}n.column.inputComponent=o}return(o,a)=>{var f,h,m,p,g;const l=r.resolveComponent("Calendar"),c=r.resolveComponent("InputNumber"),d=r.resolveComponent("InputText"),u=r.resolveComponent("Checkbox");return r.openBlock(),r.createElementBlock(r.Fragment,null,[n.column.inputComponent.toLowerCase()!="input_boolean"?(r.openBlock(),r.createElementBlock("div",Kd,[r.createElementVNode("label",{class:"mb-1",for:n.column.name},[r.createTextVNode(r.toDisplayString(n.column.displayName||n.column.name)+" ",1),n.column.required?(r.openBlock(),r.createElementBlock("span",Gd,"*")):r.createCommentVNode("",!0)],8,Xd),n.column.inputComponent.toLowerCase()=="input_date"?(r.openBlock(),r.createBlock(l,{key:0,modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=y=>t.value=y),id:n.column.name,name:n.column.name,onDateSelect:a[1]||(a[1]=y=>s(n.column)),invalid:((f=n.errors)==null?void 0:f.length)>0},null,8,["modelValue","id","name","invalid"])):n.column.inputComponent.toLowerCase()=="input_number"?(r.openBlock(),r.createBlock(c,{key:1,modelValue:t.value,"onUpdate:modelValue":a[2]||(a[2]=y=>t.value=y),id:n.column.name,name:n.column.name,allowEmpty:!0,format:!1,onInput:a[3]||(a[3]=y=>s(n.column)),invalid:((h=n.errors)==null?void 0:h.length)>0},null,8,["modelValue","id","name","invalid"])):n.column.type.toLowerCase()=="input_float"?(r.openBlock(),r.createBlock(c,{key:2,type:"decimal",minFractionDigits:1,id:n.column.name,allowEmpty:!0,format:!1,name:n.column.name,onInput:a[4]||(a[4]=y=>s(n.column)),invalid:((m=n.errors)==null?void 0:m.length)>0},null,8,["id","name","invalid"])):(r.openBlock(),r.createBlock(d,{key:3,modelValue:t.value,"onUpdate:modelValue":a[5]||(a[5]=y=>t.value=y),id:n.column.name,name:n.column.name,onInput:a[6]||(a[6]=y=>s(n.column)),invalid:((p=n.errors)==null?void 0:p.length)>0},null,8,["modelValue","id","name","invalid"])),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.errors,(y,b)=>(r.openBlock(),r.createElementBlock("div",{key:b,class:"text-red-500 mt-1 ml-2"},[y.includes("hint:")?(r.openBlock(),r.createElementBlock("small",Jd,r.toDisplayString(y.split(":")[1]),1)):(r.openBlock(),r.createElementBlock("small",Qd,r.toDisplayString(y),1))]))),128))])):r.createCommentVNode("",!0),n.column.inputComponent.toLowerCase()=="input_boolean"?(r.openBlock(),r.createElementBlock("div",Zd,[r.createVNode(u,{modelValue:t.value,"onUpdate:modelValue":a[7]||(a[7]=y=>t.value=y),invalid:((g=n.errors)==null?void 0:g.length)>0,onInput:a[8]||(a[8]=y=>s(n.column.name)),binary:""},null,8,["modelValue","invalid"]),r.createElementVNode("label",eu,[r.createTextVNode(r.toDisplayString(n.column.displayName||n.column.name)+" ",1),n.column.required?(r.openBlock(),r.createElementBlock("span",tu,"*")):r.createCommentVNode("",!0)])])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-bda1af7c"]]);/**
6
6
  * vee-validate v4.15.0
7
7
  * (c) 2024 Abdelrahman Awad
8
8
  * @license MIT
9
- */function Qt(n){return typeof n=="function"}function ir(n){return n==null}const un=n=>n!==null&&!!n&&typeof n=="object"&&!Array.isArray(n);function Ps(n){return Number(n)>=0}function Nd(n){return typeof n=="object"&&n!==null}function Td(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}function sr(n){if(!Nd(n)||Td(n)!=="[object Object]")return!1;if(Object.getPrototypeOf(n)===null)return!0;let t=n;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(n)===t}function Mn(n,t){return Object.keys(t).forEach(e=>{if(sr(t[e])&&sr(n[e])){n[e]||(n[e]={}),Mn(n[e],t[e]);return}n[e]=t[e]}),n}function Ti(n){const t=n.split(".");if(!t.length)return"";let e=String(t[0]);for(let i=1;i<t.length;i++){if(Ps(t[i])){e+=`[${t[i]}]`;continue}e+=`.${t[i]}`}return e}const Pd={};function Md(n){return Pd[n]}function or(n,t,e){typeof e.value=="object"&&(e.value=ht(e.value)),!e.enumerable||e.get||e.set||!e.configurable||!e.writable||t==="__proto__"?Object.defineProperty(n,t,e):n[t]=e.value}function ht(n){if(typeof n!="object")return n;var t=0,e,i,s,o=Object.prototype.toString.call(n);if(o==="[object Object]"?s=Object.create(n.__proto__||null):o==="[object Array]"?s=Array(n.length):o==="[object Set]"?(s=new Set,n.forEach(function(r){s.add(ht(r))})):o==="[object Map]"?(s=new Map,n.forEach(function(r,l){s.set(ht(l),ht(r))})):o==="[object Date]"?s=new Date(+n):o==="[object RegExp]"?s=new RegExp(n.source,n.flags):o==="[object DataView]"?s=new n.constructor(ht(n.buffer)):o==="[object ArrayBuffer]"?s=n.slice(0):o.slice(-6)==="Array]"&&(s=new n.constructor(n)),s){for(i=Object.getOwnPropertySymbols(n);t<i.length;t++)or(s,i[t],Object.getOwnPropertyDescriptor(n,i[t]));for(t=0,i=Object.getOwnPropertyNames(n);t<i.length;t++)Object.hasOwnProperty.call(s,e=i[t])&&s[e]===n[e]||or(s,e,Object.getOwnPropertyDescriptor(n,e))}return s||n}const Vd=Symbol("vee-validate-form"),Ad=Symbol("vee-validate-form-context"),Bd=typeof window<"u";function Fd(n){return Qt(n)&&!!n.__locatorRef}function Te(n){return!!n&&Qt(n.parse)&&n.__type==="VVTypedSchema"}function rr(n){return!!n&&Qt(n.validate)}function $d(n){return n==="checkbox"||n==="radio"}function Rd(n){return un(n)||Array.isArray(n)}function Ld(n){return Array.isArray(n)?n.length===0:un(n)&&Object.keys(n).length===0}function Pi(n){return/^\[.+\]$/i.test(n)}function Id(n){return ar(n)&&n.multiple}function ar(n){return n.tagName==="SELECT"}function jd(n){return lr(n)&&n.target&&"submit"in n.target}function lr(n){return n?!!(typeof Event<"u"&&Qt(Event)&&n instanceof Event||n&&n.srcElement):!1}function Vn(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var e,i,s;if(Array.isArray(n)){if(e=n.length,e!=t.length)return!1;for(i=e;i--!==0;)if(!Vn(n[i],t[i]))return!1;return!0}if(n instanceof Map&&t instanceof Map){if(n.size!==t.size)return!1;for(i of n.entries())if(!t.has(i[0]))return!1;for(i of n.entries())if(!Vn(i[1],t.get(i[0])))return!1;return!0}if(dr(n)&&dr(t))return!(n.size!==t.size||n.name!==t.name||n.lastModified!==t.lastModified||n.type!==t.type);if(n instanceof Set&&t instanceof Set){if(n.size!==t.size)return!1;for(i of n.entries())if(!t.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(n)&&ArrayBuffer.isView(t)){if(e=n.length,e!=t.length)return!1;for(i=e;i--!==0;)if(n[i]!==t[i])return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(s=Object.keys(n),e=s.length-cr(n,s),e!==Object.keys(t).length-cr(t,Object.keys(t)))return!1;for(i=e;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[i]))return!1;for(i=e;i--!==0;){var o=s[i];if(!Vn(n[o],t[o]))return!1}return!0}return n!==n&&t!==t}function cr(n,t){let e=0;for(let s=t.length;s--!==0;){var i=t[s];n[i]===void 0&&e++}return e}function dr(n){return Bd?n instanceof File:!1}function Ms(n){return Pi(n)?n.replace(/\[|\]/gi,""):n}function pe(n,t,e){return n?Pi(t)?n[Ms(t)]:(t||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((s,o)=>Rd(s)&&o in s?s[o]:e,n):e}function ge(n,t,e){if(Pi(t)){n[Ms(t)]=e;return}const i=t.split(/\.|\[(\d+)\]/).filter(Boolean);let s=n;for(let o=0;o<i.length;o++){if(o===i.length-1){s[i[o]]=e;return}(!(i[o]in s)||ir(s[i[o]]))&&(s[i[o]]=Ps(i[o+1])?[]:{}),s=s[i[o]]}}function Vs(n,t){if(Array.isArray(n)&&Ps(t)){n.splice(Number(t),1);return}un(n)&&delete n[t]}function ur(n,t){if(Pi(t)){delete n[Ms(t)];return}const e=t.split(/\.|\[(\d+)\]/).filter(Boolean);let i=n;for(let o=0;o<e.length;o++){if(o===e.length-1){Vs(i,e[o]);break}if(!(e[o]in i)||ir(i[e[o]]))break;i=i[e[o]]}const s=e.map((o,r)=>pe(n,e.slice(0,r).join(".")));for(let o=s.length-1;o>=0;o--)if(Ld(s[o])){if(o===0){Vs(n,e[0]);continue}Vs(s[o-1],e[o-1])}}function Ut(n){return Object.keys(n)}function hr(n,t=0){let e=null,i=[];return function(...s){return e&&clearTimeout(e),e=setTimeout(()=>{const o=n(...s);i.forEach(r=>r(o)),i=[]},t),new Promise(o=>i.push(o))}}function zd(n,t){let e;return async function(...s){const o=n(...s);e=o;const r=await o;return o!==e?r:(e=void 0,t(r,s))}}function fr(n){return Array.isArray(n)?n:n?[n]:[]}function Mi(n,t){const e={};for(const i in n)t.includes(i)||(e[i]=n[i]);return e}function Wd(n){let t=null,e=[];return function(...i){const s=a.nextTick(()=>{if(t!==s)return;const o=n(...i);e.forEach(r=>r(o)),e=[],t=null});return t=s,new Promise(o=>e.push(o))}}function As(n){if(mr(n))return n._value}function mr(n){return"_value"in n}function Hd(n){return n.type==="number"||n.type==="range"?Number.isNaN(n.valueAsNumber)?n.value:n.valueAsNumber:n.value}function pr(n){if(!lr(n))return n;const t=n.target;if($d(t.type)&&mr(t))return As(t);if(t.type==="file"&&t.files){const e=Array.from(t.files);return t.multiple?e:e[0]}if(Id(t))return Array.from(t.options).filter(e=>e.selected&&!e.disabled).map(As);if(ar(t)){const e=Array.from(t.options).find(i=>i.selected);return e?As(e):t.value}return Hd(t)}function Ud(n){const t={};return Object.defineProperty(t,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),n?un(n)&&n._$$isNormalized?n:un(n)?Object.keys(n).reduce((e,i)=>{const s=qd(n[i]);return n[i]!==!1&&(e[i]=gr(s)),e},t):typeof n!="string"?t:n.split("|").reduce((e,i)=>{const s=Yd(i);return s.name&&(e[s.name]=gr(s.params)),e},t):t}function qd(n){return n===!0?[]:Array.isArray(n)||un(n)?n:[n]}function gr(n){const t=e=>typeof e=="string"&&e[0]==="@"?Kd(e.slice(1)):e;return Array.isArray(n)?n.map(t):n instanceof RegExp?[n]:Object.keys(n).reduce((e,i)=>(e[i]=t(n[i]),e),{})}const Yd=n=>{let t=[];const e=n.split(":")[0];return n.includes(":")&&(t=n.split(":").slice(1).join(":").split(",")),{name:e,params:t}};function Kd(n){const t=e=>{var i;return(i=pe(e,n))!==null&&i!==void 0?i:e[n]};return t.__locatorRef=n,t}let Xd=Object.assign({},{generateMessage:({field:n})=>`${n} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const An=()=>Xd;async function Gd(n,t,e={}){const i=e==null?void 0:e.bails,s={name:(e==null?void 0:e.name)||"{field}",rules:t,label:e==null?void 0:e.label,bails:i??!0,formData:(e==null?void 0:e.values)||{}},o=await Qd(s,n);return Object.assign(Object.assign({},o),{valid:!o.errors.length})}async function Qd(n,t){const e=n.rules;if(Te(e)||rr(e))return Zd(t,Object.assign(Object.assign({},n),{rules:e}));if(Qt(e)||Array.isArray(e)){const l={field:n.label||n.name,name:n.name,label:n.label,form:n.formData,value:t},c=Array.isArray(e)?e:[e],d=c.length,u=[];for(let h=0;h<d;h++){const f=c[h],m=await f(t,l);if(!(typeof m!="string"&&!Array.isArray(m)&&m)){if(Array.isArray(m))u.push(...m);else{const g=typeof m=="string"?m:br(l);u.push(g)}if(n.bails)return{errors:u}}}return{errors:u}}const i=Object.assign(Object.assign({},n),{rules:Ud(e)}),s=[],o=Object.keys(i.rules),r=o.length;for(let l=0;l<r;l++){const c=o[l],d=await tu(i,t,{name:c,params:i.rules[c]});if(d.error&&(s.push(d.error),n.bails))return{errors:s}}return{errors:s}}function Jd(n){return!!n&&n.name==="ValidationError"}function yr(n){return{__type:"VVTypedSchema",async parse(e,i){var s;try{return{output:await n.validate(e,{abortEarly:!1,context:(i==null?void 0:i.formData)||{}}),errors:[]}}catch(o){if(!Jd(o))throw o;if(!(!((s=o.inner)===null||s===void 0)&&s.length)&&o.errors.length)return{errors:[{path:o.path,errors:o.errors}]};const r=o.inner.reduce((l,c)=>{const d=c.path||"";return l[d]||(l[d]={errors:[],path:d}),l[d].errors.push(...c.errors),l},{});return{errors:Object.values(r)}}}}}async function Zd(n,t){const i=await(Te(t.rules)?t.rules:yr(t.rules)).parse(n,{formData:t.formData}),s=[];for(const o of i.errors)o.errors.length&&s.push(...o.errors);return{value:i.value,errors:s}}async function tu(n,t,e){const i=Md(e.name);if(!i)throw new Error(`No such validator '${e.name}' exists.`);const s=eu(e.params,n.formData),o={field:n.label||n.name,name:n.name,label:n.label,value:t,form:n.formData,rule:Object.assign(Object.assign({},e),{params:s})},r=await i(t,s,o);return typeof r=="string"?{error:r}:{error:r?void 0:br(o)}}function br(n){const t=An().generateMessage;return t?t(n):"Field is invalid"}function eu(n,t){const e=i=>Fd(i)?i(t):i;return Array.isArray(n)?n.map(e):Object.keys(n).reduce((i,s)=>(i[s]=e(n[s]),i),{})}async function nu(n,t){const i=await(Te(n)?n:yr(n)).parse(ht(t),{formData:ht(t)}),s={},o={};for(const r of i.errors){const l=r.errors,c=(r.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);s[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!i.errors.length,results:s,errors:o,values:i.value,source:"schema"}}async function iu(n,t,e){const s=Ut(n).map(async d=>{var u,h,f;const m=(u=e==null?void 0:e.names)===null||u===void 0?void 0:u[d],p=await Gd(pe(t,d),n[d],{name:(m==null?void 0:m.name)||d,label:m==null?void 0:m.label,values:t,bails:(f=(h=e==null?void 0:e.bailsMap)===null||h===void 0?void 0:h[d])!==null&&f!==void 0?f:!0});return Object.assign(Object.assign({},p),{path:d})});let o=!0;const r=await Promise.all(s),l={},c={};for(const d of r)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c,source:"schema"}}let su=0;const Vi=["bails","fieldsCount","id","multiple","type","validate"];function _r(n){const t={},e=Object.assign({},a.toValue(t)),i=a.unref(void 0);return i&&Te(i)&&Qt(i.cast)?ht(i.cast(e)||{}):ht(e)}function xr(n){var t;const e=su++,i="Form";let s=0;const o=a.ref(!1),r=a.ref(!1),l=a.ref(0),c=[],d=a.reactive(_r()),u=a.ref([]),h=a.ref({}),f=a.ref({}),m=Wd(()=>{f.value=u.value.reduce((N,D)=>(N[Ti(a.toValue(D.path))]=D,N),{})});function p(N,D){const V=I(N);if(!V){typeof N=="string"&&(h.value[Ti(N)]=fr(D));return}if(typeof N=="string"){const z=Ti(N);h.value[z]&&delete h.value[z]}V.errors=fr(D),V.valid=!V.errors.length}function g(N){Ut(N).forEach(D=>{p(D,N[D])})}const y=a.computed(()=>{const N=u.value.reduce((D,V)=>(V.errors.length&&(D[a.toValue(V.path)]=V.errors),D),{});return Object.assign(Object.assign({},h.value),N)}),b=a.computed(()=>Ut(y.value).reduce((N,D)=>{const V=y.value[D];return V!=null&&V.length&&(N[D]=V[0]),N},{})),_=a.computed(()=>u.value.reduce((N,D)=>(N[a.toValue(D.path)]={name:a.toValue(D.path)||"",label:D.label||""},N),{})),w=a.computed(()=>u.value.reduce((N,D)=>{var V;return N[a.toValue(D.path)]=(V=D.bails)!==null&&V!==void 0?V:!0,N},{})),E=Object.assign({},{}),k=(t=void 0)!==null&&t!==void 0?t:!1,{initialValues:C,originalInitialValues:S,setInitialValues:x}=ru(u,d),O=ou(u,d,S,b),M=a.computed(()=>u.value.reduce((N,D)=>{const V=pe(d,a.toValue(D.path));return ge(N,a.toValue(D.path),V),N},{})),v=void 0;function T(N,D){var V,z;const K=a.computed(()=>pe(C.value,a.toValue(N))),tt=f.value[a.toValue(N)],q=(D==null?void 0:D.type)==="checkbox"||(D==null?void 0:D.type)==="radio";if(tt&&q){tt.multiple=!0;const Gt=s++;return Array.isArray(tt.id)?tt.id.push(Gt):tt.id=[tt.id,Gt],tt.fieldsCount++,tt.__flags.pendingUnmount[Gt]=!1,tt}const xt=a.computed(()=>pe(d,a.toValue(N))),Et=a.toValue(N),Vt=P.findIndex(Gt=>Gt===Et);Vt!==-1&&P.splice(Vt,1);const yt=a.computed(()=>{var Gt,vi,Uo,qo;const Yo=a.toValue(v);if(Te(Yo))return(vi=(Gt=Yo.describe)===null||Gt===void 0?void 0:Gt.call(Yo,a.toValue(N)).required)!==null&&vi!==void 0?vi:!1;const Ko=a.toValue(D==null?void 0:D.schema);return Te(Ko)&&(qo=(Uo=Ko.describe)===null||Uo===void 0?void 0:Uo.call(Ko).required)!==null&&qo!==void 0?qo:!1}),At=s++,jt=a.reactive({id:At,path:N,touched:!1,pending:!1,valid:!0,validated:!!(!((V=E[Et])===null||V===void 0)&&V.length),required:yt,initialValue:K,errors:a.shallowRef([]),bails:(z=D==null?void 0:D.bails)!==null&&z!==void 0?z:!1,label:D==null?void 0:D.label,type:(D==null?void 0:D.type)||"default",value:xt,multiple:!1,__flags:{pendingUnmount:{[At]:!1},pendingReset:!1},fieldsCount:1,validate:D==null?void 0:D.validate,dirty:a.computed(()=>!Vn(a.unref(xt),a.unref(K)))});return u.value.push(jt),f.value[Et]=jt,m(),b.value[Et]&&!E[Et]&&a.nextTick(()=>{se(Et,{mode:"silent"})}),a.isRef(N)&&a.watch(N,Gt=>{m();const vi=ht(xt.value);f.value[Gt]=jt,a.nextTick(()=>{ge(d,Gt,vi)})}),jt}const $=hr(Nn,5),U=hr(Nn,5),H=zd(async N=>await(N==="silent"?$():U()),(N,[D])=>{const V=Ut(lt.errorBag.value),K=[...new Set([...Ut(N.results),...u.value.map(tt=>tt.path),...V])].sort().reduce((tt,q)=>{var xt;const Et=q,Vt=I(Et)||B(Et),yt=((xt=N.results[Et])===null||xt===void 0?void 0:xt.errors)||[],At=a.toValue(Vt==null?void 0:Vt.path)||Et,jt=au({errors:yt,valid:!yt.length},tt.results[At]);return tt.results[At]=jt,jt.valid||(tt.errors[At]=jt.errors[0]),Vt&&h.value[At]&&delete h.value[At],Vt?(Vt.valid=jt.valid,D==="silent"||D==="validated-only"&&!Vt.validated||p(Vt,jt.errors),tt):(p(At,yt),tt)},{valid:N.valid,results:{},errors:{},source:N.source});return N.values&&(K.values=N.values,K.source=N.source),Ut(K.results).forEach(tt=>{var q;const xt=I(tt);xt&&D!=="silent"&&(D==="validated-only"&&!xt.validated||p(xt,(q=K.results[tt])===null||q===void 0?void 0:q.errors))}),K});function F(N){u.value.forEach(N)}function I(N){const D=typeof N=="string"?Ti(N):N;return typeof D=="string"?f.value[D]:D}function B(N){return u.value.filter(V=>N.startsWith(a.toValue(V.path))).reduce((V,z)=>V?z.path.length>V.path.length?z:V:z,void 0)}let P=[],R;function W(N){return P.push(N),R||(R=a.nextTick(()=>{[...P].sort().reverse().forEach(V=>{ur(d,V)}),P=[],R=null})),R}function Z(N){return function(V,z){return function(tt){return tt instanceof Event&&(tt.preventDefault(),tt.stopPropagation()),F(q=>q.touched=!0),o.value=!0,l.value++,wt().then(q=>{const xt=ht(d);if(q.valid&&typeof V=="function"){const Et=ht(M.value);let Vt=N?Et:xt;return q.values&&(Vt=q.source==="schema"?q.values:Object.assign({},Vt,q.values)),V(Vt,{evt:tt,controlledValues:Et,setErrors:g,setFieldError:p,setTouched:dt,setFieldTouched:fe,setValues:Xt,setFieldValue:It,resetForm:ut,resetField:ct})}!q.valid&&typeof z=="function"&&z({values:xt,evt:tt,errors:q.errors,results:q.results})}).then(q=>(o.value=!1,q),q=>{throw o.value=!1,q})}}}const Y=Z(!1);Y.withControlled=Z(!0);function X(N,D){const V=u.value.findIndex(K=>K.path===N&&(Array.isArray(K.id)?K.id.includes(D):K.id===D)),z=u.value[V];if(!(V===-1||!z)){if(a.nextTick(()=>{se(N,{mode:"silent",warn:!1})}),z.multiple&&z.fieldsCount&&z.fieldsCount--,Array.isArray(z.id)){const K=z.id.indexOf(D);K>=0&&z.id.splice(K,1),delete z.__flags.pendingUnmount[D]}(!z.multiple||z.fieldsCount<=0)&&(u.value.splice(V,1),Dn(N),m(),delete f.value[N])}}function it(N){Ut(f.value).forEach(D=>{D.startsWith(N)&&delete f.value[D]}),u.value=u.value.filter(D=>!D.path.startsWith(N)),a.nextTick(()=>{m()})}const lt={name:i,formId:e,values:d,controlledValues:M,errorBag:y,errors:b,schema:v,submitCount:l,meta:O,isSubmitting:o,isValidating:r,fieldArrays:c,keepValuesOnUnmount:k,validateSchema:a.unref(v)?H:void 0,validate:wt,setFieldError:p,validateField:se,setFieldValue:It,setValues:Xt,setErrors:g,setFieldTouched:fe,setTouched:dt,resetForm:ut,resetField:ct,handleSubmit:Y,useFieldModel:vs,defineInputBinds:G,defineComponentBinds:cn,defineField:Tn,stageInitialValue:oe,unsetInitialValue:Dn,setFieldInitialValue:ln,createPathState:T,getPathState:I,unsetPathValue:W,removePathState:X,initialValues:C,getAllPathStates:()=>u.value,destroyPath:it,isFieldTouched:j,isFieldDirty:A,isFieldValid:at};function It(N,D,V=!0){const z=ht(D),K=typeof N=="string"?N:N.path;I(K)||T(K),ge(d,K,z),V&&se(K)}function Ue(N,D=!0){Ut(d).forEach(V=>{delete d[V]}),Ut(N).forEach(V=>{It(V,N[V],!1)}),D&&wt()}function Xt(N,D=!0){Mn(d,N),c.forEach(V=>V&&V.reset()),D&&wt()}function De(N,D){const V=I(a.toValue(N))||T(N);return a.computed({get(){return V.value},set(z){var K;const tt=a.toValue(N);It(tt,z,(K=a.toValue(D))!==null&&K!==void 0?K:!1)}})}function fe(N,D){const V=I(N);V&&(V.touched=D)}function j(N){const D=I(N);return D?D.touched:u.value.filter(V=>V.path.startsWith(N)).some(V=>V.touched)}function A(N){const D=I(N);return D?D.dirty:u.value.filter(V=>V.path.startsWith(N)).some(V=>V.dirty)}function at(N){const D=I(N);return D?D.valid:u.value.filter(V=>V.path.startsWith(N)).every(V=>V.valid)}function dt(N){if(typeof N=="boolean"){F(D=>{D.touched=N});return}Ut(N).forEach(D=>{fe(D,!!N[D])})}function ct(N,D){var V;const z=D&&"value"in D?D.value:pe(C.value,N),K=I(N);K&&(K.__flags.pendingReset=!0),ln(N,ht(z),!0),It(N,z,!1),fe(N,(V=D==null?void 0:D.touched)!==null&&V!==void 0?V:!1),p(N,(D==null?void 0:D.errors)||[]),a.nextTick(()=>{K&&(K.__flags.pendingReset=!1)})}function ut(N,D){let V=ht(N!=null&&N.values?N.values:S.value);V=D!=null&&D.force?V:Mn(S.value,V),V=Te(v)&&Qt(v.cast)?v.cast(V):V,x(V,{force:D==null?void 0:D.force}),F(z=>{var K;z.__flags.pendingReset=!0,z.validated=!1,z.touched=((K=N==null?void 0:N.touched)===null||K===void 0?void 0:K[a.toValue(z.path)])||!1,It(a.toValue(z.path),pe(V,a.toValue(z.path)),!1),p(a.toValue(z.path),void 0)}),D!=null&&D.force?Ue(V,!1):Xt(V,!1),g((N==null?void 0:N.errors)||{}),l.value=(N==null?void 0:N.submitCount)||0,a.nextTick(()=>{wt({mode:"silent"}),F(z=>{z.__flags.pendingReset=!1})})}async function wt(N){const D=(N==null?void 0:N.mode)||"force";if(D==="force"&&F(q=>q.validated=!0),lt.validateSchema)return lt.validateSchema(D);r.value=!0;const V=await Promise.all(u.value.map(q=>q.validate?q.validate(N).then(xt=>({key:a.toValue(q.path),valid:xt.valid,errors:xt.errors,value:xt.value})):Promise.resolve({key:a.toValue(q.path),valid:!0,errors:[],value:void 0})));r.value=!1;const z={},K={},tt={};for(const q of V)z[q.key]={valid:q.valid,errors:q.errors},q.value&&ge(tt,q.key,q.value),q.errors.length&&(K[q.key]=q.errors[0]);return{valid:V.every(q=>q.valid),results:z,errors:K,values:tt,source:"fields"}}async function se(N,D){var V;const z=I(N);return z&&(D==null?void 0:D.mode)!=="silent"&&(z.validated=!0),z!=null&&z.validate?z.validate(D):(!z&&(V=D==null?void 0:D.warn),Promise.resolve({errors:[],valid:!0}))}function Dn(N){ur(C.value,N)}function oe(N,D,V=!1){ln(N,D),ge(d,N,D),V&&ge(S.value,N,ht(D))}function ln(N,D,V=!1){ge(C.value,N,ht(D)),V&&ge(S.value,N,ht(D))}async function Nn(){const N=a.unref(v);if(!N)return{valid:!0,results:{},errors:{},source:"none"};r.value=!0;const D=rr(N)||Te(N)?await nu(N,d):await iu(N,d,{names:_.value,bailsMap:w.value});return r.value=!1,D}const Ho=Y((N,{evt:D})=>{jd(D)&&D.target.submit()});a.onMounted(()=>{lt.validateSchema&&lt.validateSchema("silent")}),a.isRef(v)&&a.watch(v,()=>{var N;(N=lt.validateSchema)===null||N===void 0||N.call(lt,"validated-only")}),a.provide(Vd,lt);function Tn(N,D){const V=Qt(D)||D==null?void 0:D.label,z=I(a.toValue(N))||T(N,{label:V}),K=()=>Qt(D)?D(Mi(z,Vi)):D||{};function tt(){var yt;z.touched=!0,((yt=K().validateOnBlur)!==null&&yt!==void 0?yt:An().validateOnBlur)&&se(a.toValue(z.path))}function q(){var yt;((yt=K().validateOnInput)!==null&&yt!==void 0?yt:An().validateOnInput)&&a.nextTick(()=>{se(a.toValue(z.path))})}function xt(){var yt;((yt=K().validateOnChange)!==null&&yt!==void 0?yt:An().validateOnChange)&&a.nextTick(()=>{se(a.toValue(z.path))})}const Et=a.computed(()=>{const yt={onChange:xt,onInput:q,onBlur:tt};return Qt(D)?Object.assign(Object.assign({},yt),D(Mi(z,Vi)).props||{}):D!=null&&D.props?Object.assign(Object.assign({},yt),D.props(Mi(z,Vi))):yt});return[De(N,()=>{var yt,At,jt;return(jt=(yt=K().validateOnModelUpdate)!==null&&yt!==void 0?yt:(At=An())===null||At===void 0?void 0:At.validateOnModelUpdate)!==null&&jt!==void 0?jt:!0}),Et]}function vs(N){return Array.isArray(N)?N.map(D=>De(D,!0)):De(N)}function G(N,D){const[V,z]=Tn(N,D);function K(){z.value.onBlur()}function tt(xt){const Et=pr(xt);It(a.toValue(N),Et,!1),z.value.onInput()}function q(xt){const Et=pr(xt);It(a.toValue(N),Et,!1),z.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},z.value),{onBlur:K,onInput:tt,onChange:q,value:V.value}))}function cn(N,D){const[V,z]=Tn(N,D),K=I(a.toValue(N));function tt(q){V.value=q}return a.computed(()=>{const q=Qt(D)?D(Mi(K,Vi)):D||{};return Object.assign({[q.model||"modelValue"]:V.value,[`onUpdate:${q.model||"modelValue"}`]:tt},z.value)})}const Dt=Object.assign(Object.assign({},lt),{values:a.readonly(d),handleReset:()=>ut(),submitForm:Ho});return a.provide(Ad,Dt),Dt}function ou(n,t,e,i){const s={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!Vn(t,a.unref(e)));function r(){const c=n.value;return Ut(s).reduce((d,u)=>{const h=s[u];return d[u]=c[h](f=>f[u]),d},{})}const l=a.reactive(r());return a.watchEffect(()=>{const c=r();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),a.computed(()=>Object.assign(Object.assign({initialValues:a.unref(e)},l),{valid:l.valid&&!Ut(i.value).length,dirty:o.value}))}function ru(n,t,e){const i=_r(),s=a.ref(i),o=a.ref(ht(i));function r(l,c){c!=null&&c.force?(s.value=ht(l),o.value=ht(l)):(s.value=Mn(ht(s.value)||{},ht(l)),o.value=Mn(ht(o.value)||{},ht(l))),c!=null&&c.updateFields&&n.value.forEach(d=>{if(d.touched)return;const h=pe(s.value,a.toValue(d.path));ge(t,a.toValue(d.path),ht(h))})}return{initialValues:s,originalInitialValues:o,setInitialValues:r}}function au(n,t){return t?{valid:n.valid&&t.valid,errors:[...n.errors,...t.errors]}:n}function lu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bs,kr;function cu(){if(kr)return Bs;kr=1;function n(b){this._maxSize=b,this.clear()}n.prototype.clear=function(){this._size=0,this._values=Object.create(null)},n.prototype.get=function(b){return this._values[b]},n.prototype.set=function(b,_){return this._size>=this._maxSize&&this.clear(),b in this._values||this._size++,this._values[b]=_};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,e=/^\d+$/,i=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,r=512,l=new n(r),c=new n(r),d=new n(r);Bs={Cache:n,split:h,normalizePath:u,setter:function(b){var _=u(b);return c.get(b)||c.set(b,function(E,k){for(var C=0,S=_.length,x=E;C<S-1;){var O=_[C];if(O==="__proto__"||O==="constructor"||O==="prototype")return E;x=x[_[C++]]}x[_[C]]=k})},getter:function(b,_){var w=u(b);return d.get(b)||d.set(b,function(k){for(var C=0,S=w.length;C<S;)if(k!=null||!_)k=k[w[C++]];else return;return k})},join:function(b){return b.reduce(function(_,w){return _+(m(w)||e.test(w)?"["+w+"]":(_?".":"")+w)},"")},forEach:function(b,_,w){f(Array.isArray(b)?b:h(b),_,w)}};function u(b){return l.get(b)||l.set(b,h(b).map(function(_){return _.replace(o,"$2")}))}function h(b){return b.match(t)||[""]}function f(b,_,w){var E=b.length,k,C,S,x;for(C=0;C<E;C++)k=b[C],k&&(y(k)&&(k='"'+k+'"'),x=m(k),S=!x&&/^\d+$/.test(k),_.call(w,k,x,S,C,b))}function m(b){return typeof b=="string"&&b&&["'",'"'].indexOf(b.charAt(0))!==-1}function p(b){return b.match(i)&&!b.match(e)}function g(b){return s.test(b)}function y(b){return!m(b)&&(p(b)||g(b))}return Bs}var Ye=cu(),Fs,Sr;function du(){if(Sr)return Fs;Sr=1;const n=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=u=>u.match(n)||[],e=u=>u[0].toUpperCase()+u.slice(1),i=(u,h)=>t(u).join(h).toLowerCase(),s=u=>t(u).reduce((h,f)=>`${h}${h?f[0].toUpperCase()+f.slice(1).toLowerCase():f.toLowerCase()}`,"");return Fs={words:t,upperFirst:e,camelCase:s,pascalCase:u=>e(s(u)),snakeCase:u=>i(u,"_"),kebabCase:u=>i(u,"-"),sentenceCase:u=>e(i(u," ")),titleCase:u=>t(u).map(e).join(" ")},Fs}var $s=du(),Ai={exports:{}},wr;function uu(){if(wr)return Ai.exports;wr=1,Ai.exports=function(s){return n(t(s),s)},Ai.exports.array=n;function n(s,o){var r=s.length,l=new Array(r),c={},d=r,u=e(o),h=i(s);for(o.forEach(function(m){if(!h.has(m[0])||!h.has(m[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});d--;)c[d]||f(s[d],d,new Set);return l;function f(m,p,g){if(g.has(m)){var y;try{y=", node was:"+JSON.stringify(m)}catch{y=""}throw new Error("Cyclic dependency"+y)}if(!h.has(m))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(m));if(!c[p]){c[p]=!0;var b=u.get(m)||new Set;if(b=Array.from(b),p=b.length){g.add(m);do{var _=b[--p];f(_,h.get(_),g)}while(p);g.delete(m)}l[--r]=m}}}function t(s){for(var o=new Set,r=0,l=s.length;r<l;r++){var c=s[r];o.add(c[0]),o.add(c[1])}return Array.from(o)}function e(s){for(var o=new Map,r=0,l=s.length;r<l;r++){var c=s[r];o.has(c[0])||o.set(c[0],new Set),o.has(c[1])||o.set(c[1],new Set),o.get(c[0]).add(c[1])}return o}function i(s){for(var o=new Map,r=0,l=s.length;r<l;r++)o.set(s[r],r);return o}return Ai.exports}var hu=uu();const fu=lu(hu),mu=Object.prototype.toString,pu=Error.prototype.toString,gu=RegExp.prototype.toString,yu=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",bu=/^Symbol\((.*)\)(.*)$/;function _u(n){return n!=+n?"NaN":n===0&&1/n<0?"-0":""+n}function Er(n,t=!1){if(n==null||n===!0||n===!1)return""+n;const e=typeof n;if(e==="number")return _u(n);if(e==="string")return t?`"${n}"`:n;if(e==="function")return"[Function "+(n.name||"anonymous")+"]";if(e==="symbol")return yu.call(n).replace(bu,"Symbol($1)");const i=mu.call(n).slice(8,-1);return i==="Date"?isNaN(n.getTime())?""+n:n.toISOString(n):i==="Error"||n instanceof Error?"["+pu.call(n)+"]":i==="RegExp"?gu.call(n):null}function Pe(n,t){let e=Er(n,t);return e!==null?e:JSON.stringify(n,function(i,s){let o=Er(this[i],t);return o!==null?o:s},2)}function Cr(n){return n==null?[]:[].concat(n)}let vr,Or,Dr,xu=/\$\{\s*(\w+)\s*\}/g;vr=Symbol.toStringTag;class Nr{constructor(t,e,i,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[vr]="Error",this.name="ValidationError",this.value=e,this.path=i,this.type=s,this.errors=[],this.inner=[],Cr(t).forEach(o=>{if(Ft.isError(o)){this.errors.push(...o.errors);const r=o.inner.length?o.inner:[o];this.inner.push(...r)}else this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Or=Symbol.hasInstance,Dr=Symbol.toStringTag;class Ft extends Error{static formatError(t,e){const i=e.label||e.path||"this";return e=Object.assign({},e,{path:i,originalPath:e.path}),typeof t=="string"?t.replace(xu,(s,o)=>Pe(e[o])):typeof t=="function"?t(e):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,e,i,s,o){const r=new Nr(t,e,i,s);if(o)return r;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Dr]="Error",this.name=r.name,this.message=r.message,this.type=r.type,this.value=r.value,this.path=r.path,this.errors=r.errors,this.inner=r.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Ft)}static[Or](t){return Nr[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let re={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:n,type:t,value:e,originalValue:i})=>{const s=i!=null&&i!==e?` (cast from the value \`${Pe(i,!0)}\`).`:".";return t!=="mixed"?`${n} must be a \`${t}\` type, but the final value was: \`${Pe(e,!0)}\``+s:`${n} must match the configured type. The validated value was: \`${Pe(e,!0)}\``+s}},$t={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},ku={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Rs={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Su={isValue:"${path} field must be ${value}"},Bi={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:re,string:$t,number:ku,date:Rs,object:Bi,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:Su,tuple:{notType:n=>{const{path:t,value:e,spec:i}=n,s=i.types.length;if(Array.isArray(e)){if(e.length<s)return`${t} tuple value has too few items, expected a length of ${s} but got ${e.length} for value: \`${Pe(e,!0)}\``;if(e.length>s)return`${t} tuple value has too many items, expected a length of ${s} but got ${e.length} for value: \`${Pe(e,!0)}\``}return Ft.formatError(re.notType,n)}}});const Ls=n=>n&&n.__isYupSchema__;class Fi{static fromOptions(t,e){if(!e.then&&!e.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:s,otherwise:o}=e,r=typeof i=="function"?i:(...l)=>l.every(c=>c===i);return new Fi(t,(l,c)=>{var d;let u=r(...l)?s:o;return(d=u==null?void 0:u(c))!=null?d:c})}constructor(t,e){this.fn=void 0,this.refs=t,this.refs=t,this.fn=e}resolve(t,e){let i=this.refs.map(o=>o.getValue(e==null?void 0:e.value,e==null?void 0:e.parent,e==null?void 0:e.context)),s=this.fn(i,t,e);if(s===void 0||s===t)return t;if(!Ls(s))throw new TypeError("conditions must return a schema object");return s.resolve(e)}}const $i={context:"$",value:"."};class Ke{constructor(t,e={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===$i.context,this.isValue=this.key[0]===$i.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?$i.context:this.isValue?$i.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&Ye.getter(this.path,!0),this.map=e.map}getValue(t,e,i){let s=this.isContext?i:this.isValue?t:e;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(t,e){return this.getValue(t,e==null?void 0:e.parent,e==null?void 0:e.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Ke.prototype.__isYupRef=!0;const Xe=n=>n==null;function hn(n){function t({value:e,path:i="",options:s,originalValue:o,schema:r},l,c){const{name:d,test:u,params:h,message:f,skipAbsent:m}=n;let{parent:p,context:g,abortEarly:y=r.spec.abortEarly,disableStackTrace:b=r.spec.disableStackTrace}=s;function _(v){return Ke.isRef(v)?v.getValue(e,p,g):v}function w(v={}){const T=Object.assign({value:e,originalValue:o,label:r.spec.label,path:v.path||i,spec:r.spec,disableStackTrace:v.disableStackTrace||b},h,v.params);for(const U of Object.keys(T))T[U]=_(T[U]);const $=new Ft(Ft.formatError(v.message||f,T),e,T.path,v.type||d,T.disableStackTrace);return $.params=T,$}const E=y?l:c;let k={path:i,parent:p,type:d,from:s.from,createError:w,resolve:_,options:s,originalValue:o,schema:r};const C=v=>{Ft.isError(v)?E(v):v?c(null):E(w())},S=v=>{Ft.isError(v)?E(v):l(v)};if(m&&Xe(e))return C(!0);let O;try{var M;if(O=u.call(k,e,k),typeof((M=O)==null?void 0:M.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${k.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(O).then(C,S)}}catch(v){S(v);return}C(O)}return t.OPTIONS=n,t}function wu(n,t,e,i=e){let s,o,r;return t?(Ye.forEach(t,(l,c,d)=>{let u=c?l.slice(1,l.length-1):l;n=n.resolve({context:i,parent:s,value:e});let h=n.type==="tuple",f=d?parseInt(u,10):0;if(n.innerType||h){if(h&&!d)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${r}" must contain an index to the tuple element, e.g. "${r}[0]"`);if(e&&f>=e.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${t}. because there is no value at that index. `);s=e,e=e&&e[f],n=h?n.spec.types[f]:n.innerType}if(!d){if(!n.fields||!n.fields[u])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${r} which is a type: "${n.type}")`);s=e,e=e&&e[u],n=n.fields[u]}o=u,r=c?"["+l+"]":"."+l}),{schema:n,parent:s,parentPath:o}):{parent:s,parentPath:t,schema:n}}class Ri extends Set{describe(){const t=[];for(const e of this.values())t.push(Ke.isRef(e)?e.describe():e);return t}resolveAll(t){let e=[];for(const i of this.values())e.push(t(i));return e}clone(){return new Ri(this.values())}merge(t,e){const i=this.clone();return t.forEach(s=>i.add(s)),e.forEach(s=>i.delete(s)),i}}function fn(n,t=new Map){if(Ls(n)||!n||typeof n!="object")return n;if(t.has(n))return t.get(n);let e;if(n instanceof Date)e=new Date(n.getTime()),t.set(n,e);else if(n instanceof RegExp)e=new RegExp(n),t.set(n,e);else if(Array.isArray(n)){e=new Array(n.length),t.set(n,e);for(let i=0;i<n.length;i++)e[i]=fn(n[i],t)}else if(n instanceof Map){e=new Map,t.set(n,e);for(const[i,s]of n.entries())e.set(i,fn(s,t))}else if(n instanceof Set){e=new Set,t.set(n,e);for(const i of n)e.add(fn(i,t))}else if(n instanceof Object){e={},t.set(n,e);for(const[i,s]of Object.entries(n))e[i]=fn(s,t)}else throw Error(`Unable to clone ${n}`);return e}class ae{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Ri,this._blacklist=new Ri,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(re.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const e=Object.create(Object.getPrototypeOf(this));return e.type=this.type,e._typeCheck=this._typeCheck,e._whitelist=this._whitelist.clone(),e._blacklist=this._blacklist.clone(),e.internalTests=Object.assign({},this.internalTests),e.exclusiveTests=Object.assign({},this.exclusiveTests),e.deps=[...this.deps],e.conditions=[...this.conditions],e.tests=[...this.tests],e.transforms=[...this.transforms],e.spec=fn(Object.assign({},this.spec,t)),e}label(t){let e=this.clone();return e.spec.label=t,e}meta(...t){if(t.length===0)return this.spec.meta;let e=this.clone();return e.spec.meta=Object.assign(e.spec.meta||{},t[0]),e}withMutation(t){let e=this._mutate;this._mutate=!0;let i=t(this);return this._mutate=e,i}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let e=this,i=t.clone();const s=Object.assign({},e.spec,i.spec);return i.spec=s,i.internalTests=Object.assign({},e.internalTests,i.internalTests),i._whitelist=e._whitelist.merge(t._whitelist,t._blacklist),i._blacklist=e._blacklist.merge(t._blacklist,t._whitelist),i.tests=e.tests,i.exclusiveTests=e.exclusiveTests,i.withMutation(o=>{t.tests.forEach(r=>{o.test(r.OPTIONS)})}),i.transforms=[...e.transforms,...i.transforms],i}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let e=this;if(e.conditions.length){let i=e.conditions;e=e.clone(),e.conditions=[],e=i.reduce((s,o)=>o.resolve(s,t),e),e=e.resolve(t)}return e}resolveOptions(t){var e,i,s,o;return Object.assign({},t,{from:t.from||[],strict:(e=t.strict)!=null?e:this.spec.strict,abortEarly:(i=t.abortEarly)!=null?i:this.spec.abortEarly,recursive:(s=t.recursive)!=null?s:this.spec.recursive,disableStackTrace:(o=t.disableStackTrace)!=null?o:this.spec.disableStackTrace})}cast(t,e={}){let i=this.resolve(Object.assign({value:t},e)),s=e.assert==="ignore-optionality",o=i._cast(t,e);if(e.assert!==!1&&!i.isType(o)){if(s&&Xe(o))return o;let r=Pe(t),l=Pe(o);throw new TypeError(`The value of ${e.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}".
9
+ */function ot(n){return typeof n=="function"}function pr(n){return n==null}const Sn=n=>n!==null&&!!n&&typeof n=="object"&&!Array.isArray(n);function Us(n){return Number(n)>=0}function nu(n){return typeof n=="object"&&n!==null}function iu(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}function gr(n){if(!nu(n)||iu(n)!=="[object Object]")return!1;if(Object.getPrototypeOf(n)===null)return!0;let e=n;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e}function Rn(n,e){return Object.keys(e).forEach(t=>{if(gr(e[t])&&gr(n[t])){n[t]||(n[t]={}),Rn(n[t],e[t]);return}n[t]=e[t]}),n}function zi(n){const e=n.split(".");if(!e.length)return"";let t=String(e[0]);for(let i=1;i<e.length;i++){if(Us(e[i])){t+=`[${e[i]}]`;continue}t+=`.${e[i]}`}return t}const su={};function ou(n){return su[n]}function yr(n,e,t){typeof t.value=="object"&&(t.value=be(t.value)),!t.enumerable||t.get||t.set||!t.configurable||!t.writable||e==="__proto__"?Object.defineProperty(n,e,t):n[e]=t.value}function be(n){if(typeof n!="object")return n;var e=0,t,i,s,o=Object.prototype.toString.call(n);if(o==="[object Object]"?s=Object.create(n.__proto__||null):o==="[object Array]"?s=Array(n.length):o==="[object Set]"?(s=new Set,n.forEach(function(a){s.add(be(a))})):o==="[object Map]"?(s=new Map,n.forEach(function(a,l){s.set(be(l),be(a))})):o==="[object Date]"?s=new Date(+n):o==="[object RegExp]"?s=new RegExp(n.source,n.flags):o==="[object DataView]"?s=new n.constructor(be(n.buffer)):o==="[object ArrayBuffer]"?s=n.slice(0):o.slice(-6)==="Array]"&&(s=new n.constructor(n)),s){for(i=Object.getOwnPropertySymbols(n);e<i.length;e++)yr(s,i[e],Object.getOwnPropertyDescriptor(n,i[e]));for(e=0,i=Object.getOwnPropertyNames(n);e<i.length;e++)Object.hasOwnProperty.call(s,t=i[e])&&s[t]===n[t]||yr(s,t,Object.getOwnPropertyDescriptor(n,t))}return s||n}const ru=Symbol("vee-validate-form"),au=Symbol("vee-validate-form-context"),lu=typeof window<"u";function cu(n){return ot(n)&&!!n.__locatorRef}function It(n){return!!n&&ot(n.parse)&&n.__type==="VVTypedSchema"}function br(n){return!!n&&ot(n.validate)}function du(n){return n==="checkbox"||n==="radio"}function uu(n){return Sn(n)||Array.isArray(n)}function fu(n){return Array.isArray(n)?n.length===0:Sn(n)&&Object.keys(n).length===0}function Wi(n){return/^\[.+\]$/i.test(n)}function hu(n){return xr(n)&&n.multiple}function xr(n){return n.tagName==="SELECT"}function mu(n){return _r(n)&&n.target&&"submit"in n.target}function _r(n){return n?!!(typeof Event<"u"&&ot(Event)&&n instanceof Event||n&&n.srcElement):!1}function jn(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;var t,i,s;if(Array.isArray(n)){if(t=n.length,t!=e.length)return!1;for(i=t;i--!==0;)if(!jn(n[i],e[i]))return!1;return!0}if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(i of n.entries())if(!e.has(i[0]))return!1;for(i of n.entries())if(!jn(i[1],e.get(i[0])))return!1;return!0}if(Sr(n)&&Sr(e))return!(n.size!==e.size||n.name!==e.name||n.lastModified!==e.lastModified||n.type!==e.type);if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(i of n.entries())if(!e.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(n)&&ArrayBuffer.isView(e)){if(t=n.length,t!=e.length)return!1;for(i=t;i--!==0;)if(n[i]!==e[i])return!1;return!0}if(n.constructor===RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===e.toString();if(s=Object.keys(n),t=s.length-kr(n,s),t!==Object.keys(e).length-kr(e,Object.keys(e)))return!1;for(i=t;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[i]))return!1;for(i=t;i--!==0;){var o=s[i];if(!jn(n[o],e[o]))return!1}return!0}return n!==n&&e!==e}function kr(n,e){let t=0;for(let s=e.length;s--!==0;){var i=e[s];n[i]===void 0&&t++}return t}function Sr(n){return lu?n instanceof File:!1}function qs(n){return Wi(n)?n.replace(/\[|\]/gi,""):n}function wt(n,e,t){return n?Wi(e)?n[qs(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((s,o)=>uu(s)&&o in s?s[o]:t,n):t}function Et(n,e,t){if(Wi(e)){n[qs(e)]=t;return}const i=e.split(/\.|\[(\d+)\]/).filter(Boolean);let s=n;for(let o=0;o<i.length;o++){if(o===i.length-1){s[i[o]]=t;return}(!(i[o]in s)||pr(s[i[o]]))&&(s[i[o]]=Us(i[o+1])?[]:{}),s=s[i[o]]}}function Ys(n,e){if(Array.isArray(n)&&Us(e)){n.splice(Number(e),1);return}Sn(n)&&delete n[e]}function wr(n,e){if(Wi(e)){delete n[qs(e)];return}const t=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=n;for(let o=0;o<t.length;o++){if(o===t.length-1){Ys(i,t[o]);break}if(!(t[o]in i)||pr(i[t[o]]))break;i=i[t[o]]}const s=t.map((o,a)=>wt(n,t.slice(0,a).join(".")));for(let o=s.length-1;o>=0;o--)if(fu(s[o])){if(o===0){Ys(n,t[0]);continue}Ys(s[o-1],t[o-1])}}function et(n){return Object.keys(n)}function Er(n,e=0){let t=null,i=[];return function(...s){return t&&clearTimeout(t),t=setTimeout(()=>{const o=n(...s);i.forEach(a=>a(o)),i=[]},e),new Promise(o=>i.push(o))}}function pu(n,e){let t;return async function(...s){const o=n(...s);t=o;const a=await o;return o!==t?a:(t=void 0,e(a,s))}}function Cr(n){return Array.isArray(n)?n:n?[n]:[]}function Hi(n,e){const t={};for(const i in n)e.includes(i)||(t[i]=n[i]);return t}function gu(n){let e=null,t=[];return function(...i){const s=r.nextTick(()=>{if(e!==s)return;const o=n(...i);t.forEach(a=>a(o)),t=[],e=null});return e=s,new Promise(o=>t.push(o))}}function Ks(n){if(vr(n))return n._value}function vr(n){return"_value"in n}function yu(n){return n.type==="number"||n.type==="range"?Number.isNaN(n.valueAsNumber)?n.value:n.valueAsNumber:n.value}function Dr(n){if(!_r(n))return n;const e=n.target;if(du(e.type)&&vr(e))return Ks(e);if(e.type==="file"&&e.files){const t=Array.from(e.files);return e.multiple?t:t[0]}if(hu(e))return Array.from(e.options).filter(t=>t.selected&&!t.disabled).map(Ks);if(xr(e)){const t=Array.from(e.options).find(i=>i.selected);return t?Ks(t):e.value}return yu(e)}function bu(n){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),n?Sn(n)&&n._$$isNormalized?n:Sn(n)?Object.keys(n).reduce((t,i)=>{const s=xu(n[i]);return n[i]!==!1&&(t[i]=Or(s)),t},e):typeof n!="string"?e:n.split("|").reduce((t,i)=>{const s=_u(i);return s.name&&(t[s.name]=Or(s.params)),t},e):e}function xu(n){return n===!0?[]:Array.isArray(n)||Sn(n)?n:[n]}function Or(n){const e=t=>typeof t=="string"&&t[0]==="@"?ku(t.slice(1)):t;return Array.isArray(n)?n.map(e):n instanceof RegExp?[n]:Object.keys(n).reduce((t,i)=>(t[i]=e(n[i]),t),{})}const _u=n=>{let e=[];const t=n.split(":")[0];return n.includes(":")&&(e=n.split(":").slice(1).join(":").split(",")),{name:t,params:e}};function ku(n){const e=t=>{var i;return(i=wt(t,n))!==null&&i!==void 0?i:t[n]};return e.__locatorRef=n,e}let Su=Object.assign({},{generateMessage:({field:n})=>`${n} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const zn=()=>Su;async function wu(n,e,t={}){const i=t==null?void 0:t.bails,s={name:(t==null?void 0:t.name)||"{field}",rules:e,label:t==null?void 0:t.label,bails:i??!0,formData:(t==null?void 0:t.values)||{}},o=await Eu(s,n);return Object.assign(Object.assign({},o),{valid:!o.errors.length})}async function Eu(n,e){const t=n.rules;if(It(t)||br(t))return vu(e,Object.assign(Object.assign({},n),{rules:t}));if(ot(t)||Array.isArray(t)){const l={field:n.label||n.name,name:n.name,label:n.label,form:n.formData,value:e},c=Array.isArray(t)?t:[t],d=c.length,u=[];for(let f=0;f<d;f++){const h=c[f],m=await h(e,l);if(!(typeof m!="string"&&!Array.isArray(m)&&m)){if(Array.isArray(m))u.push(...m);else{const g=typeof m=="string"?m:Tr(l);u.push(g)}if(n.bails)return{errors:u}}}return{errors:u}}const i=Object.assign(Object.assign({},n),{rules:bu(t)}),s=[],o=Object.keys(i.rules),a=o.length;for(let l=0;l<a;l++){const c=o[l],d=await Du(i,e,{name:c,params:i.rules[c]});if(d.error&&(s.push(d.error),n.bails))return{errors:s}}return{errors:s}}function Cu(n){return!!n&&n.name==="ValidationError"}function Nr(n){return{__type:"VVTypedSchema",async parse(t,i){var s;try{return{output:await n.validate(t,{abortEarly:!1,context:(i==null?void 0:i.formData)||{}}),errors:[]}}catch(o){if(!Cu(o))throw o;if(!(!((s=o.inner)===null||s===void 0)&&s.length)&&o.errors.length)return{errors:[{path:o.path,errors:o.errors}]};const a=o.inner.reduce((l,c)=>{const d=c.path||"";return l[d]||(l[d]={errors:[],path:d}),l[d].errors.push(...c.errors),l},{});return{errors:Object.values(a)}}}}}async function vu(n,e){const i=await(It(e.rules)?e.rules:Nr(e.rules)).parse(n,{formData:e.formData}),s=[];for(const o of i.errors)o.errors.length&&s.push(...o.errors);return{value:i.value,errors:s}}async function Du(n,e,t){const i=ou(t.name);if(!i)throw new Error(`No such validator '${t.name}' exists.`);const s=Ou(t.params,n.formData),o={field:n.label||n.name,name:n.name,label:n.label,value:e,form:n.formData,rule:Object.assign(Object.assign({},t),{params:s})},a=await i(e,s,o);return typeof a=="string"?{error:a}:{error:a?void 0:Tr(o)}}function Tr(n){const e=zn().generateMessage;return e?e(n):"Field is invalid"}function Ou(n,e){const t=i=>cu(i)?i(e):i;return Array.isArray(n)?n.map(t):Object.keys(n).reduce((i,s)=>(i[s]=t(n[s]),i),{})}async function Nu(n,e){const i=await(It(n)?n:Nr(n)).parse(be(e),{formData:be(e)}),s={},o={};for(const a of i.errors){const l=a.errors,c=(a.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);s[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!i.errors.length,results:s,errors:o,values:i.value,source:"schema"}}async function Tu(n,e,t){const s=et(n).map(async d=>{var u,f,h;const m=(u=t==null?void 0:t.names)===null||u===void 0?void 0:u[d],p=await wu(wt(e,d),n[d],{name:(m==null?void 0:m.name)||d,label:m==null?void 0:m.label,values:e,bails:(h=(f=t==null?void 0:t.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},p),{path:d})});let o=!0;const a=await Promise.all(s),l={},c={};for(const d of a)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c,source:"schema"}}let Pu=0;const Ui=["bails","fieldsCount","id","multiple","type","validate"];function Pr(n){const e={},t=Object.assign({},r.toValue(e)),i=r.unref(void 0);return i&&It(i)&&ot(i.cast)?be(i.cast(t)||{}):be(t)}function Br(n){var e;const t=Pu++,i="Form";let s=0;const o=r.ref(!1),a=r.ref(!1),l=r.ref(0),c=[],d=r.reactive(Pr()),u=r.ref([]),f=r.ref({}),h=r.ref({}),m=gu(()=>{h.value=u.value.reduce((O,N)=>(O[zi(r.toValue(N.path))]=N,O),{})});function p(O,N){const V=R(O);if(!V){typeof O=="string"&&(f.value[zi(O)]=Cr(N));return}if(typeof O=="string"){const U=zi(O);f.value[U]&&delete f.value[U]}V.errors=Cr(N),V.valid=!V.errors.length}function g(O){et(O).forEach(N=>{p(N,O[N])})}const y=r.computed(()=>{const O=u.value.reduce((N,V)=>(V.errors.length&&(N[r.toValue(V.path)]=V.errors),N),{});return Object.assign(Object.assign({},f.value),O)}),b=r.computed(()=>et(y.value).reduce((O,N)=>{const V=y.value[N];return V!=null&&V.length&&(O[N]=V[0]),O},{})),x=r.computed(()=>u.value.reduce((O,N)=>(O[r.toValue(N.path)]={name:r.toValue(N.path)||"",label:N.label||""},O),{})),E=r.computed(()=>u.value.reduce((O,N)=>{var V;return O[r.toValue(N.path)]=(V=N.bails)!==null&&V!==void 0?V:!0,O},{})),C=Object.assign({},{}),k=(e=void 0)!==null&&e!==void 0?e:!1,{initialValues:v,originalInitialValues:S,setInitialValues:_}=Mu(u,d),D=Bu(u,d,S,b),B=r.computed(()=>u.value.reduce((O,N)=>{const V=wt(d,r.toValue(N.path));return Et(O,r.toValue(N.path),V),O},{})),w=void 0;function T(O,N){var V,U;const ee=r.computed(()=>wt(v.value,r.toValue(O))),re=h.value[r.toValue(O)],G=(N==null?void 0:N.type)==="checkbox"||(N==null?void 0:N.type)==="radio";if(re&&G){re.multiple=!0;const ve=s++;return Array.isArray(re.id)?re.id.push(ve):re.id=[re.id,ve],re.fieldsCount++,re.__flags.pendingUnmount[ve]=!1,re}const M=r.computed(()=>wt(d,r.toValue(O))),z=r.toValue(O),K=P.findIndex(ve=>ve===z);K!==-1&&P.splice(K,1);const Y=r.computed(()=>{var ve,Le,Fi,$i;const Ii=r.toValue(w);if(It(Ii))return(Le=(ve=Ii.describe)===null||ve===void 0?void 0:ve.call(Ii,r.toValue(O)).required)!==null&&Le!==void 0?Le:!1;const rr=r.toValue(N==null?void 0:N.schema);return It(rr)&&($i=(Fi=rr.describe)===null||Fi===void 0?void 0:Fi.call(rr).required)!==null&&$i!==void 0?$i:!1}),ne=s++,ye=r.reactive({id:ne,path:O,touched:!1,pending:!1,valid:!0,validated:!!(!((V=C[z])===null||V===void 0)&&V.length),required:Y,initialValue:ee,errors:r.shallowRef([]),bails:(U=N==null?void 0:N.bails)!==null&&U!==void 0?U:!1,label:N==null?void 0:N.label,type:(N==null?void 0:N.type)||"default",value:M,multiple:!1,__flags:{pendingUnmount:{[ne]:!1},pendingReset:!1},fieldsCount:1,validate:N==null?void 0:N.validate,dirty:r.computed(()=>!jn(r.unref(M),r.unref(ee)))});return u.value.push(ye),h.value[z]=ye,m(),b.value[z]&&!C[z]&&r.nextTick(()=>{Ye(z,{mode:"silent"})}),r.isRef(O)&&r.watch(O,ve=>{m();const Le=be(M.value);h.value[ve]=ye,r.nextTick(()=>{Et(d,ve,Le)})}),ye}const I=Er(st,5),X=Er(st,5),q=pu(async O=>await(O==="silent"?I():X()),(O,[N])=>{const V=et(de.errorBag.value),ee=[...new Set([...et(O.results),...u.value.map(re=>re.path),...V])].sort().reduce((re,G)=>{var M;const z=G,K=R(z)||F(z),Y=((M=O.results[z])===null||M===void 0?void 0:M.errors)||[],ne=r.toValue(K==null?void 0:K.path)||z,ye=Vu({errors:Y,valid:!Y.length},re.results[ne]);return re.results[ne]=ye,ye.valid||(re.errors[ne]=ye.errors[0]),K&&f.value[ne]&&delete f.value[ne],K?(K.valid=ye.valid,N==="silent"||N==="validated-only"&&!K.validated||p(K,ye.errors),re):(p(ne,Y),re)},{valid:O.valid,results:{},errors:{},source:O.source});return O.values&&(ee.values=O.values,ee.source=O.source),et(ee.results).forEach(re=>{var G;const M=R(re);M&&N!=="silent"&&(N==="validated-only"&&!M.validated||p(M,(G=ee.results[re])===null||G===void 0?void 0:G.errors))}),ee});function $(O){u.value.forEach(O)}function R(O){const N=typeof O=="string"?zi(O):O;return typeof N=="string"?h.value[N]:N}function F(O){return u.value.filter(V=>O.startsWith(r.toValue(V.path))).reduce((V,U)=>V?U.path.length>V.path.length?U:V:U,void 0)}let P=[],L;function H(O){return P.push(O),L||(L=r.nextTick(()=>{[...P].sort().reverse().forEach(V=>{wr(d,V)}),P=[],L=null})),L}function te(O){return function(V,U){return function(re){return re instanceof Event&&(re.preventDefault(),re.stopPropagation()),$(G=>G.touched=!0),o.value=!0,l.value++,De().then(G=>{const M=be(d);if(G.valid&&typeof V=="function"){const z=be(B.value);let K=O?z:M;return G.values&&(K=G.source==="schema"?G.values:Object.assign({},K,G.values)),V(K,{evt:re,controlledValues:z,setErrors:g,setFieldError:p,setTouched:he,setFieldTouched:it,setValues:ze,setFieldValue:Ce,resetForm:me,resetField:fe})}!G.valid&&typeof U=="function"&&U({values:M,evt:re,errors:G.errors,results:G.results})}).then(G=>(o.value=!1,G),G=>{throw o.value=!1,G})}}}const Q=te(!1);Q.withControlled=te(!0);function J(O,N){const V=u.value.findIndex(ee=>ee.path===O&&(Array.isArray(ee.id)?ee.id.includes(N):ee.id===N)),U=u.value[V];if(!(V===-1||!U)){if(r.nextTick(()=>{Ye(O,{mode:"silent",warn:!1})}),U.multiple&&U.fieldsCount&&U.fieldsCount--,Array.isArray(U.id)){const ee=U.id.indexOf(N);ee>=0&&U.id.splice(ee,1),delete U.__flags.pendingUnmount[N]}(!U.multiple||U.fieldsCount<=0)&&(u.value.splice(V,1),St(O),m(),delete h.value[O])}}function se(O){et(h.value).forEach(N=>{N.startsWith(O)&&delete h.value[N]}),u.value=u.value.filter(N=>!N.path.startsWith(O)),r.nextTick(()=>{m()})}const de={name:i,formId:t,values:d,controlledValues:B,errorBag:y,errors:b,schema:w,submitCount:l,meta:D,isSubmitting:o,isValidating:a,fieldArrays:c,keepValuesOnUnmount:k,validateSchema:r.unref(w)?q:void 0,validate:De,setFieldError:p,validateField:Ye,setFieldValue:Ce,setValues:ze,setErrors:g,setFieldTouched:it,setTouched:he,resetForm:me,resetField:fe,handleSubmit:Q,useFieldModel:_n,defineInputBinds:Z,defineComponentBinds:ht,defineField:nn,stageInitialValue:Ae,unsetInitialValue:St,setFieldInitialValue:Ke,createPathState:T,getPathState:R,unsetPathValue:H,removePathState:J,initialValues:v,getAllPathStates:()=>u.value,destroyPath:se,isFieldTouched:W,isFieldDirty:A,isFieldValid:ue};function Ce(O,N,V=!0){const U=be(N),ee=typeof O=="string"?O:O.path;R(ee)||T(ee),Et(d,ee,U),V&&Ye(ee)}function Qe(O,N=!0){et(d).forEach(V=>{delete d[V]}),et(O).forEach(V=>{Ce(V,O[V],!1)}),N&&De()}function ze(O,N=!0){Rn(d,O),c.forEach(V=>V&&V.reset()),N&&De()}function ft(O,N){const V=R(r.toValue(O))||T(O);return r.computed({get(){return V.value},set(U){var ee;const re=r.toValue(O);Ce(re,U,(ee=r.toValue(N))!==null&&ee!==void 0?ee:!1)}})}function it(O,N){const V=R(O);V&&(V.touched=N)}function W(O){const N=R(O);return N?N.touched:u.value.filter(V=>V.path.startsWith(O)).some(V=>V.touched)}function A(O){const N=R(O);return N?N.dirty:u.value.filter(V=>V.path.startsWith(O)).some(V=>V.dirty)}function ue(O){const N=R(O);return N?N.valid:u.value.filter(V=>V.path.startsWith(O)).every(V=>V.valid)}function he(O){if(typeof O=="boolean"){$(N=>{N.touched=O});return}et(O).forEach(N=>{it(N,!!O[N])})}function fe(O,N){var V;const U=N&&"value"in N?N.value:wt(v.value,O),ee=R(O);ee&&(ee.__flags.pendingReset=!0),Ke(O,be(U),!0),Ce(O,U,!1),it(O,(V=N==null?void 0:N.touched)!==null&&V!==void 0?V:!1),p(O,(N==null?void 0:N.errors)||[]),r.nextTick(()=>{ee&&(ee.__flags.pendingReset=!1)})}function me(O,N){let V=be(O!=null&&O.values?O.values:S.value);V=N!=null&&N.force?V:Rn(S.value,V),V=It(w)&&ot(w.cast)?w.cast(V):V,_(V,{force:N==null?void 0:N.force}),$(U=>{var ee;U.__flags.pendingReset=!0,U.validated=!1,U.touched=((ee=O==null?void 0:O.touched)===null||ee===void 0?void 0:ee[r.toValue(U.path)])||!1,Ce(r.toValue(U.path),wt(V,r.toValue(U.path)),!1),p(r.toValue(U.path),void 0)}),N!=null&&N.force?Qe(V,!1):ze(V,!1),g((O==null?void 0:O.errors)||{}),l.value=(O==null?void 0:O.submitCount)||0,r.nextTick(()=>{De({mode:"silent"}),$(U=>{U.__flags.pendingReset=!1})})}async function De(O){const N=(O==null?void 0:O.mode)||"force";if(N==="force"&&$(G=>G.validated=!0),de.validateSchema)return de.validateSchema(N);a.value=!0;const V=await Promise.all(u.value.map(G=>G.validate?G.validate(O).then(M=>({key:r.toValue(G.path),valid:M.valid,errors:M.errors,value:M.value})):Promise.resolve({key:r.toValue(G.path),valid:!0,errors:[],value:void 0})));a.value=!1;const U={},ee={},re={};for(const G of V)U[G.key]={valid:G.valid,errors:G.errors},G.value&&Et(re,G.key,G.value),G.errors.length&&(ee[G.key]=G.errors[0]);return{valid:V.every(G=>G.valid),results:U,errors:ee,values:re,source:"fields"}}async function Ye(O,N){var V;const U=R(O);return U&&(N==null?void 0:N.mode)!=="silent"&&(U.validated=!0),U!=null&&U.validate?U.validate(N):(!U&&(V=N==null?void 0:N.warn),Promise.resolve({errors:[],valid:!0}))}function St(O){wr(v.value,O)}function Ae(O,N,V=!1){Ke(O,N),Et(d,O,N),V&&Et(S.value,O,be(N))}function Ke(O,N,V=!1){Et(v.value,O,be(N)),V&&Et(S.value,O,be(N))}async function st(){const O=r.unref(w);if(!O)return{valid:!0,results:{},errors:{},source:"none"};a.value=!0;const N=br(O)||It(O)?await Nu(O,d):await Tu(O,d,{names:x.value,bailsMap:E.value});return a.value=!1,N}const tn=Q((O,{evt:N})=>{mu(N)&&N.target.submit()});r.onMounted(()=>{de.validateSchema&&de.validateSchema("silent")}),r.isRef(w)&&r.watch(w,()=>{var O;(O=de.validateSchema)===null||O===void 0||O.call(de,"validated-only")}),r.provide(ru,de);function nn(O,N){const V=ot(N)||N==null?void 0:N.label,U=R(r.toValue(O))||T(O,{label:V}),ee=()=>ot(N)?N(Hi(U,Ui)):N||{};function re(){var Y;U.touched=!0,((Y=ee().validateOnBlur)!==null&&Y!==void 0?Y:zn().validateOnBlur)&&Ye(r.toValue(U.path))}function G(){var Y;((Y=ee().validateOnInput)!==null&&Y!==void 0?Y:zn().validateOnInput)&&r.nextTick(()=>{Ye(r.toValue(U.path))})}function M(){var Y;((Y=ee().validateOnChange)!==null&&Y!==void 0?Y:zn().validateOnChange)&&r.nextTick(()=>{Ye(r.toValue(U.path))})}const z=r.computed(()=>{const Y={onChange:M,onInput:G,onBlur:re};return ot(N)?Object.assign(Object.assign({},Y),N(Hi(U,Ui)).props||{}):N!=null&&N.props?Object.assign(Object.assign({},Y),N.props(Hi(U,Ui))):Y});return[ft(O,()=>{var Y,ne,ye;return(ye=(Y=ee().validateOnModelUpdate)!==null&&Y!==void 0?Y:(ne=zn())===null||ne===void 0?void 0:ne.validateOnModelUpdate)!==null&&ye!==void 0?ye:!0}),z]}function _n(O){return Array.isArray(O)?O.map(N=>ft(N,!0)):ft(O)}function Z(O,N){const[V,U]=nn(O,N);function ee(){U.value.onBlur()}function re(M){const z=Dr(M);Ce(r.toValue(O),z,!1),U.value.onInput()}function G(M){const z=Dr(M);Ce(r.toValue(O),z,!1),U.value.onChange()}return r.computed(()=>Object.assign(Object.assign({},U.value),{onBlur:ee,onInput:re,onChange:G,value:V.value}))}function ht(O,N){const[V,U]=nn(O,N),ee=R(r.toValue(O));function re(G){V.value=G}return r.computed(()=>{const G=ot(N)?N(Hi(ee,Ui)):N||{};return Object.assign({[G.model||"modelValue"]:V.value,[`onUpdate:${G.model||"modelValue"}`]:re},U.value)})}const Ne=Object.assign(Object.assign({},de),{values:r.readonly(d),handleReset:()=>me(),submitForm:tn});return r.provide(au,Ne),Ne}function Bu(n,e,t,i){const s={touched:"some",pending:"some",valid:"every"},o=r.computed(()=>!jn(e,r.unref(t)));function a(){const c=n.value;return et(s).reduce((d,u)=>{const f=s[u];return d[u]=c[f](h=>h[u]),d},{})}const l=r.reactive(a());return r.watchEffect(()=>{const c=a();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),r.computed(()=>Object.assign(Object.assign({initialValues:r.unref(t)},l),{valid:l.valid&&!et(i.value).length,dirty:o.value}))}function Mu(n,e,t){const i=Pr(),s=r.ref(i),o=r.ref(be(i));function a(l,c){c!=null&&c.force?(s.value=be(l),o.value=be(l)):(s.value=Rn(be(s.value)||{},be(l)),o.value=Rn(be(o.value)||{},be(l))),c!=null&&c.updateFields&&n.value.forEach(d=>{if(d.touched)return;const f=wt(s.value,r.toValue(d.path));Et(e,r.toValue(d.path),be(f))})}return{initialValues:s,originalInitialValues:o,setInitialValues:a}}function Vu(n,e){return e?{valid:n.valid&&e.valid,errors:[...n.errors,...e.errors]}:n}function Au(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xs,Mr;function Fu(){if(Mr)return Xs;Mr=1;function n(b){this._maxSize=b,this.clear()}n.prototype.clear=function(){this._size=0,this._values=Object.create(null)},n.prototype.get=function(b){return this._values[b]},n.prototype.set=function(b,x){return this._size>=this._maxSize&&this.clear(),b in this._values||this._size++,this._values[b]=x};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,t=/^\d+$/,i=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,a=512,l=new n(a),c=new n(a),d=new n(a);Xs={Cache:n,split:f,normalizePath:u,setter:function(b){var x=u(b);return c.get(b)||c.set(b,function(C,k){for(var v=0,S=x.length,_=C;v<S-1;){var D=x[v];if(D==="__proto__"||D==="constructor"||D==="prototype")return C;_=_[x[v++]]}_[x[v]]=k})},getter:function(b,x){var E=u(b);return d.get(b)||d.set(b,function(k){for(var v=0,S=E.length;v<S;)if(k!=null||!x)k=k[E[v++]];else return;return k})},join:function(b){return b.reduce(function(x,E){return x+(m(E)||t.test(E)?"["+E+"]":(x?".":"")+E)},"")},forEach:function(b,x,E){h(Array.isArray(b)?b:f(b),x,E)}};function u(b){return l.get(b)||l.set(b,f(b).map(function(x){return x.replace(o,"$2")}))}function f(b){return b.match(e)||[""]}function h(b,x,E){var C=b.length,k,v,S,_;for(v=0;v<C;v++)k=b[v],k&&(y(k)&&(k='"'+k+'"'),_=m(k),S=!_&&/^\d+$/.test(k),x.call(E,k,_,S,v,b))}function m(b){return typeof b=="string"&&b&&["'",'"'].indexOf(b.charAt(0))!==-1}function p(b){return b.match(i)&&!b.match(t)}function g(b){return s.test(b)}function y(b){return!m(b)&&(p(b)||g(b))}return Xs}var on=Fu(),Gs,Vr;function $u(){if(Vr)return Gs;Vr=1;const n=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,e=u=>u.match(n)||[],t=u=>u[0].toUpperCase()+u.slice(1),i=(u,f)=>e(u).join(f).toLowerCase(),s=u=>e(u).reduce((f,h)=>`${f}${f?h[0].toUpperCase()+h.slice(1).toLowerCase():h.toLowerCase()}`,"");return Gs={words:e,upperFirst:t,camelCase:s,pascalCase:u=>t(s(u)),snakeCase:u=>i(u,"_"),kebabCase:u=>i(u,"-"),sentenceCase:u=>t(i(u," ")),titleCase:u=>e(u).map(t).join(" ")},Gs}var Qs=$u(),qi={exports:{}},Ar;function Iu(){if(Ar)return qi.exports;Ar=1,qi.exports=function(s){return n(e(s),s)},qi.exports.array=n;function n(s,o){var a=s.length,l=new Array(a),c={},d=a,u=t(o),f=i(s);for(o.forEach(function(m){if(!f.has(m[0])||!f.has(m[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});d--;)c[d]||h(s[d],d,new Set);return l;function h(m,p,g){if(g.has(m)){var y;try{y=", node was:"+JSON.stringify(m)}catch{y=""}throw new Error("Cyclic dependency"+y)}if(!f.has(m))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(m));if(!c[p]){c[p]=!0;var b=u.get(m)||new Set;if(b=Array.from(b),p=b.length){g.add(m);do{var x=b[--p];h(x,f.get(x),g)}while(p);g.delete(m)}l[--a]=m}}}function e(s){for(var o=new Set,a=0,l=s.length;a<l;a++){var c=s[a];o.add(c[0]),o.add(c[1])}return Array.from(o)}function t(s){for(var o=new Map,a=0,l=s.length;a<l;a++){var c=s[a];o.has(c[0])||o.set(c[0],new Set),o.has(c[1])||o.set(c[1],new Set),o.get(c[0]).add(c[1])}return o}function i(s){for(var o=new Map,a=0,l=s.length;a<l;a++)o.set(s[a],a);return o}return qi.exports}var Lu=Iu();const Ru=Au(Lu),ju=Object.prototype.toString,zu=Error.prototype.toString,Wu=RegExp.prototype.toString,Hu=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Uu=/^Symbol\((.*)\)(.*)$/;function qu(n){return n!=+n?"NaN":n===0&&1/n<0?"-0":""+n}function Fr(n,e=!1){if(n==null||n===!0||n===!1)return""+n;const t=typeof n;if(t==="number")return qu(n);if(t==="string")return e?`"${n}"`:n;if(t==="function")return"[Function "+(n.name||"anonymous")+"]";if(t==="symbol")return Hu.call(n).replace(Uu,"Symbol($1)");const i=ju.call(n).slice(8,-1);return i==="Date"?isNaN(n.getTime())?""+n:n.toISOString(n):i==="Error"||n instanceof Error?"["+zu.call(n)+"]":i==="RegExp"?Wu.call(n):null}function Lt(n,e){let t=Fr(n,e);return t!==null?t:JSON.stringify(n,function(i,s){let o=Fr(this[i],e);return o!==null?o:s},2)}function $r(n){return n==null?[]:[].concat(n)}let Ir,Lr,Rr,Yu=/\$\{\s*(\w+)\s*\}/g;Ir=Symbol.toStringTag;class jr{constructor(e,t,i,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Ir]="Error",this.name="ValidationError",this.value=t,this.path=i,this.type=s,this.errors=[],this.inner=[],$r(e).forEach(o=>{if(We.isError(o)){this.errors.push(...o.errors);const a=o.inner.length?o.inner:[o];this.inner.push(...a)}else this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Lr=Symbol.hasInstance,Rr=Symbol.toStringTag;class We extends Error{static formatError(e,t){const i=t.label||t.path||"this";return t=Object.assign({},t,{path:i,originalPath:t.path}),typeof e=="string"?e.replace(Yu,(s,o)=>Lt(t[o])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,i,s,o){const a=new jr(e,t,i,s);if(o)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Rr]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,We)}static[Lr](e){return jr[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let mt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:n,type:e,value:t,originalValue:i})=>{const s=i!=null&&i!==t?` (cast from the value \`${Lt(i,!0)}\`).`:".";return e!=="mixed"?`${n} must be a \`${e}\` type, but the final value was: \`${Lt(t,!0)}\``+s:`${n} must match the configured type. The validated value was: \`${Lt(t,!0)}\``+s}},He={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ku={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Js={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Xu={isValue:"${path} field must be ${value}"},Yi={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:mt,string:He,number:Ku,date:Js,object:Yi,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:Xu,tuple:{notType:n=>{const{path:e,value:t,spec:i}=n,s=i.types.length;if(Array.isArray(t)){if(t.length<s)return`${e} tuple value has too few items, expected a length of ${s} but got ${t.length} for value: \`${Lt(t,!0)}\``;if(t.length>s)return`${e} tuple value has too many items, expected a length of ${s} but got ${t.length} for value: \`${Lt(t,!0)}\``}return We.formatError(mt.notType,n)}}});const Zs=n=>n&&n.__isYupSchema__;class Ki{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:s,otherwise:o}=t,a=typeof i=="function"?i:(...l)=>l.every(c=>c===i);return new Ki(e,(l,c)=>{var d;let u=a(...l)?s:o;return(d=u==null?void 0:u(c))!=null?d:c})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let i=this.refs.map(o=>o.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),s=this.fn(i,e,t);if(s===void 0||s===e)return e;if(!Zs(s))throw new TypeError("conditions must return a schema object");return s.resolve(t)}}const Xi={context:"$",value:"."};class rn{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Xi.context,this.isValue=this.key[0]===Xi.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?Xi.context:this.isValue?Xi.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&on.getter(this.path,!0),this.map=t.map}getValue(e,t,i){let s=this.isContext?i:this.isValue?e:t;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}rn.prototype.__isYupRef=!0;const an=n=>n==null;function wn(n){function e({value:t,path:i="",options:s,originalValue:o,schema:a},l,c){const{name:d,test:u,params:f,message:h,skipAbsent:m}=n;let{parent:p,context:g,abortEarly:y=a.spec.abortEarly,disableStackTrace:b=a.spec.disableStackTrace}=s;function x(w){return rn.isRef(w)?w.getValue(t,p,g):w}function E(w={}){const T=Object.assign({value:t,originalValue:o,label:a.spec.label,path:w.path||i,spec:a.spec,disableStackTrace:w.disableStackTrace||b},f,w.params);for(const X of Object.keys(T))T[X]=x(T[X]);const I=new We(We.formatError(w.message||h,T),t,T.path,w.type||d,T.disableStackTrace);return I.params=T,I}const C=y?l:c;let k={path:i,parent:p,type:d,from:s.from,createError:E,resolve:x,options:s,originalValue:o,schema:a};const v=w=>{We.isError(w)?C(w):w?c(null):C(E())},S=w=>{We.isError(w)?C(w):l(w)};if(m&&an(t))return v(!0);let D;try{var B;if(D=u.call(k,t,k),typeof((B=D)==null?void 0:B.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${k.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(D).then(v,S)}}catch(w){S(w);return}v(D)}return e.OPTIONS=n,e}function Gu(n,e,t,i=t){let s,o,a;return e?(on.forEach(e,(l,c,d)=>{let u=c?l.slice(1,l.length-1):l;n=n.resolve({context:i,parent:s,value:t});let f=n.type==="tuple",h=d?parseInt(u,10):0;if(n.innerType||f){if(f&&!d)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(t&&h>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);s=t,t=t&&t[h],n=f?n.spec.types[h]:n.innerType}if(!d){if(!n.fields||!n.fields[u])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${a} which is a type: "${n.type}")`);s=t,t=t&&t[u],n=n.fields[u]}o=u,a=c?"["+l+"]":"."+l}),{schema:n,parent:s,parentPath:o}):{parent:s,parentPath:e,schema:n}}class Gi extends Set{describe(){const e=[];for(const t of this.values())e.push(rn.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const i of this.values())t.push(e(i));return t}clone(){return new Gi(this.values())}merge(e,t){const i=this.clone();return e.forEach(s=>i.add(s)),t.forEach(s=>i.delete(s)),i}}function En(n,e=new Map){if(Zs(n)||!n||typeof n!="object")return n;if(e.has(n))return e.get(n);let t;if(n instanceof Date)t=new Date(n.getTime()),e.set(n,t);else if(n instanceof RegExp)t=new RegExp(n),e.set(n,t);else if(Array.isArray(n)){t=new Array(n.length),e.set(n,t);for(let i=0;i<n.length;i++)t[i]=En(n[i],e)}else if(n instanceof Map){t=new Map,e.set(n,t);for(const[i,s]of n.entries())t.set(i,En(s,e))}else if(n instanceof Set){t=new Set,e.set(n,t);for(const i of n)t.add(En(i,e))}else if(n instanceof Object){t={},e.set(n,t);for(const[i,s]of Object.entries(n))t[i]=En(s,e)}else throw Error(`Unable to clone ${n}`);return t}class pt{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Gi,this._blacklist=new Gi,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(mt.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=En(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let i=e(this);return this._mutate=t,i}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,i=e.clone();const s=Object.assign({},t.spec,i.spec);return i.spec=s,i.internalTests=Object.assign({},t.internalTests,i.internalTests),i._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),i._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),i.tests=t.tests,i.exclusiveTests=t.exclusiveTests,i.withMutation(o=>{e.tests.forEach(a=>{o.test(a.OPTIONS)})}),i.transforms=[...t.transforms,...i.transforms],i}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let i=t.conditions;t=t.clone(),t.conditions=[],t=i.reduce((s,o)=>o.resolve(s,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,i,s,o;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(i=e.abortEarly)!=null?i:this.spec.abortEarly,recursive:(s=e.recursive)!=null?s:this.spec.recursive,disableStackTrace:(o=e.disableStackTrace)!=null?o:this.spec.disableStackTrace})}cast(e,t={}){let i=this.resolve(Object.assign({value:e},t)),s=t.assert==="ignore-optionality",o=i._cast(e,t);if(t.assert!==!1&&!i.isType(o)){if(s&&an(o))return o;let a=Lt(e),l=Lt(o);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}".
10
10
 
11
- attempted value: ${r}
12
- `+(l!==r?`result of cast: ${l}`:""))}return o}_cast(t,e){let i=t===void 0?t:this.transforms.reduce((s,o)=>o.call(this,s,t,this),t);return i===void 0&&(i=this.getDefault(e)),i}_validate(t,e={},i,s){let{path:o,originalValue:r=t,strict:l=this.spec.strict}=e,c=t;l||(c=this._cast(c,Object.assign({assert:!1},e)));let d=[];for(let u of Object.values(this.internalTests))u&&d.push(u);this.runTests({path:o,value:c,originalValue:r,options:e,tests:d},i,u=>{if(u.length)return s(u,c);this.runTests({path:o,value:c,originalValue:r,options:e,tests:this.tests},i,s)})}runTests(t,e,i){let s=!1,{tests:o,value:r,originalValue:l,path:c,options:d}=t,u=g=>{s||(s=!0,e(g,r))},h=g=>{s||(s=!0,i(g,r))},f=o.length,m=[];if(!f)return h([]);let p={value:r,originalValue:l,path:c,options:d,schema:this};for(let g=0;g<o.length;g++){const y=o[g];y(p,u,function(_){_&&(Array.isArray(_)?m.push(..._):m.push(_)),--f<=0&&h(m)})}}asNestedTest({key:t,index:e,parent:i,parentPath:s,originalParent:o,options:r}){const l=t??e;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let d=i[l];const u=Object.assign({},r,{strict:!0,parent:i,value:d,originalValue:o[l],key:void 0,[c?"index":"key"]:l,path:c||l.includes(".")?`${s||""}[${c?l:`"${l}"`}]`:(s?`${s}.`:"")+t});return(h,f,m)=>this.resolve(u)._validate(d,u,f,m)}validate(t,e){var i;let s=this.resolve(Object.assign({},e,{value:t})),o=(i=e==null?void 0:e.disableStackTrace)!=null?i:s.spec.disableStackTrace;return new Promise((r,l)=>s._validate(t,e,(c,d)=>{Ft.isError(c)&&(c.value=d),l(c)},(c,d)=>{c.length?l(new Ft(c,d,void 0,void 0,o)):r(d)}))}validateSync(t,e){var i;let s=this.resolve(Object.assign({},e,{value:t})),o,r=(i=e==null?void 0:e.disableStackTrace)!=null?i:s.spec.disableStackTrace;return s._validate(t,Object.assign({},e,{sync:!0}),(l,c)=>{throw Ft.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new Ft(l,t,void 0,void 0,r);o=c}),o}isValid(t,e){return this.validate(t,e).then(()=>!0,i=>{if(Ft.isError(i))return!1;throw i})}isValidSync(t,e){try{return this.validateSync(t,e),!0}catch(i){if(Ft.isError(i))return!1;throw i}}_getDefault(t){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this,t):fn(e)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,e){const i=this.clone({nullable:t});return i.internalTests.nullable=hn({message:e,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),i}optionality(t,e){const i=this.clone({optional:t});return i.internalTests.optionality=hn({message:e,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(t=re.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=re.notNull){return this.nullability(!1,t)}required(t=re.required){return this.clone().withMutation(e=>e.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let e=this.clone();return e.transforms.push(t),e}test(...t){let e;if(t.length===1?typeof t[0]=="function"?e={test:t[0]}:e=t[0]:t.length===2?e={name:t[0],test:t[1]}:e={name:t[0],message:t[1],test:t[2]},e.message===void 0&&(e.message=re.default),typeof e.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),s=hn(e),o=e.exclusive||e.name&&i.exclusiveTests[e.name]===!0;if(e.exclusive&&!e.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return e.name&&(i.exclusiveTests[e.name]=!!e.exclusive),i.tests=i.tests.filter(r=>!(r.OPTIONS.name===e.name&&(o||r.OPTIONS.test===s.OPTIONS.test))),i.tests.push(s),i}when(t,e){!Array.isArray(t)&&typeof t!="string"&&(e=t,t=".");let i=this.clone(),s=Cr(t).map(o=>new Ke(o));return s.forEach(o=>{o.isSibling&&i.deps.push(o.key)}),i.conditions.push(typeof e=="function"?new Fi(s,e):Fi.fromOptions(s,e)),i}typeError(t){let e=this.clone();return e.internalTests.typeError=hn({message:t,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),e}oneOf(t,e=re.oneOf){let i=this.clone();return t.forEach(s=>{i._whitelist.add(s),i._blacklist.delete(s)}),i.internalTests.whiteList=hn({message:e,name:"oneOf",skipAbsent:!0,test(s){let o=this.schema._whitelist,r=o.resolveAll(this.resolve);return r.includes(s)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:r}})}}),i}notOneOf(t,e=re.notOneOf){let i=this.clone();return t.forEach(s=>{i._blacklist.add(s),i._whitelist.delete(s)}),i.internalTests.blacklist=hn({message:e,name:"notOneOf",test(s){let o=this.schema._blacklist,r=o.resolveAll(this.resolve);return r.includes(s)?this.createError({params:{values:Array.from(o).join(", "),resolved:r}}):!0}}),i}strip(t=!0){let e=this.clone();return e.spec.strip=t,e}describe(t){const e=(t?this.resolve(t):this).clone(),{label:i,meta:s,optional:o,nullable:r}=e.spec;return{meta:s,label:i,optional:o,nullable:r,default:e.getDefault(t),type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,d,u)=>u.findIndex(h=>h.name===c.name)===d)}}}ae.prototype.__isYupSchema__=!0;for(const n of["validate","validateSync"])ae.prototype[`${n}At`]=function(t,e,i={}){const{parent:s,parentPath:o,schema:r}=wu(this,t,e,i.context);return r[n](s&&s[o],Object.assign({},i,{parent:s,path:t}))};for(const n of["equals","is"])ae.prototype[n]=ae.prototype.oneOf;for(const n of["not","nope"])ae.prototype[n]=ae.prototype.notOneOf;const Eu=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Cu(n){const t=Is(n);if(!t)return Date.parse?Date.parse(n):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let e=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(e=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(e=0-e)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+e,t.second,t.millisecond)}function Is(n){var t,e;const i=Eu.exec(n);return i?{year:ye(i[1]),month:ye(i[2],1)-1,day:ye(i[3],1),hour:ye(i[4]),minute:ye(i[5]),second:ye(i[6]),millisecond:i[7]?ye(i[7].substring(0,3)):0,precision:(t=(e=i[7])==null?void 0:e.length)!=null?t:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:ye(i[10]),minuteOffset:ye(i[11])}:null}function ye(n,t=0){return Number(n)||t}let vu=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ou=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Du=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Nu="^\\d{4}-\\d{2}-\\d{2}",Tu="\\d{2}:\\d{2}:\\d{2}",Pu="(([+-]\\d{2}(:?\\d{2})?)|Z)",Mu=new RegExp(`${Nu}T${Tu}(\\.\\d+)?${Pu}$`),Vu=n=>Xe(n)||n===n.trim(),Au={}.toString();function js(){return new Tr}class Tr extends ae{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,e,i)=>{if(!i.spec.coerce||i.isType(t)||Array.isArray(t))return t;const s=t!=null&&t.toString?t.toString():t;return s===Au?t:s})})}required(t){return super.required(t).withMutation(e=>e.test({message:t||re.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(e=>e.OPTIONS.name!=="required"),t))}length(t,e=$t.length){return this.test({message:e,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(i){return i.length===this.resolve(t)}})}min(t,e=$t.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i.length>=this.resolve(t)}})}max(t,e=$t.max){return this.test({name:"max",exclusive:!0,message:e,params:{max:t},skipAbsent:!0,test(i){return i.length<=this.resolve(t)}})}matches(t,e){let i=!1,s,o;return e&&(typeof e=="object"?{excludeEmptyString:i=!1,message:s,name:o}=e:s=e),this.test({name:o||"matches",message:s||$t.matches,params:{regex:t},skipAbsent:!0,test:r=>r===""&&i||r.search(t)!==-1})}email(t=$t.email){return this.matches(vu,{name:"email",message:t,excludeEmptyString:!0})}url(t=$t.url){return this.matches(Ou,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=$t.uuid){return this.matches(Du,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let e="",i,s;return t&&(typeof t=="object"?{message:e="",allowOffset:i=!1,precision:s=void 0}=t:e=t),this.matches(Mu,{name:"datetime",message:e||$t.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:e||$t.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:o=>{if(!o||i)return!0;const r=Is(o);return r?!!r.z:!1}}).test({name:"datetime_precision",message:e||$t.datetime_precision,params:{precision:s},skipAbsent:!0,test:o=>{if(!o||s==null)return!0;const r=Is(o);return r?r.precision===s:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=$t.trim){return this.transform(e=>e!=null?e.trim():e).test({message:t,name:"trim",test:Vu})}lowercase(t=$t.lowercase){return this.transform(e=>Xe(e)?e:e.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Xe(e)||e===e.toLowerCase()})}uppercase(t=$t.uppercase){return this.transform(e=>Xe(e)?e:e.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Xe(e)||e===e.toUpperCase()})}}js.prototype=Tr.prototype;let Bu=new Date(""),Fu=n=>Object.prototype.toString.call(n)==="[object Date]";class Li extends ae{constructor(){super({type:"date",check(t){return Fu(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,e,i)=>!i.spec.coerce||i.isType(t)||t===null?t:(t=Cu(t),isNaN(t)?Li.INVALID_DATE:new Date(t)))})}prepareParam(t,e){let i;if(Ke.isRef(t))i=t;else{let s=this.cast(t);if(!this._typeCheck(s))throw new TypeError(`\`${e}\` must be a Date or a value that can be \`cast()\` to a Date`);i=s}return i}min(t,e=Rs.min){let i=this.prepareParam(t,"min");return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s>=this.resolve(i)}})}max(t,e=Rs.max){let i=this.prepareParam(t,"max");return this.test({message:e,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(s){return s<=this.resolve(i)}})}}Li.INVALID_DATE=Bu,Li.prototype;function $u(n,t=[]){let e=[],i=new Set,s=new Set(t.map(([r,l])=>`${r}-${l}`));function o(r,l){let c=Ye.split(r)[0];i.add(c),s.has(`${l}-${c}`)||e.push([l,c])}for(const r of Object.keys(n)){let l=n[r];i.add(r),Ke.isRef(l)&&l.isSibling?o(l.path,r):Ls(l)&&"deps"in l&&l.deps.forEach(c=>o(c,r))}return fu.array(Array.from(i),e).reverse()}function Pr(n,t){let e=1/0;return n.some((i,s)=>{var o;if((o=t.path)!=null&&o.includes(i))return e=s,!0}),e}function Mr(n){return(t,e)=>Pr(n,t)-Pr(n,e)}const Ru=(n,t,e)=>{if(typeof n!="string")return n;let i=n;try{i=JSON.parse(n)}catch{}return e.isType(i)?i:n};function Ii(n){if("fields"in n){const t={};for(const[e,i]of Object.entries(n.fields))t[e]=Ii(i);return n.setFields(t)}if(n.type==="array"){const t=n.optional();return t.innerType&&(t.innerType=Ii(t.innerType)),t}return n.type==="tuple"?n.optional().clone({types:n.spec.types.map(Ii)}):"optional"in n?n.optional():n}const Lu=(n,t)=>{const e=[...Ye.normalizePath(t)];if(e.length===1)return e[0]in n;let i=e.pop(),s=Ye.getter(Ye.join(e),!0)(n);return!!(s&&i in s)};let Vr=n=>Object.prototype.toString.call(n)==="[object Object]";function Ar(n,t){let e=Object.keys(n.fields);return Object.keys(t).filter(i=>e.indexOf(i)===-1)}const Iu=Mr([]);function zs(n){return new Br(n)}class Br extends ae{constructor(t){super({type:"object",check(e){return Vr(e)||typeof e=="function"}}),this.fields=Object.create(null),this._sortErrors=Iu,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,e={}){var i;let s=super._cast(t,e);if(s===void 0)return this.getDefault(e);if(!this._typeCheck(s))return s;let o=this.fields,r=(i=e.stripUnknown)!=null?i:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(s).filter(h=>!this._nodes.includes(h))),c={},d=Object.assign({},e,{parent:c,__validating:e.__validating||!1}),u=!1;for(const h of l){let f=o[h],m=h in s;if(f){let p,g=s[h];d.path=(e.path?`${e.path}.`:"")+h,f=f.resolve({value:g,context:e.context,parent:c});let y=f instanceof ae?f.spec:void 0,b=y==null?void 0:y.strict;if(y!=null&&y.strip){u=u||h in s;continue}p=!e.__validating||!b?f.cast(s[h],d):s[h],p!==void 0&&(c[h]=p)}else m&&!r&&(c[h]=s[h]);(m!==h in c||c[h]!==s[h])&&(u=!0)}return u?c:s}_validate(t,e={},i,s){let{from:o=[],originalValue:r=t,recursive:l=this.spec.recursive}=e;e.from=[{schema:this,value:r},...o],e.__validating=!0,e.originalValue=r,super._validate(t,e,i,(c,d)=>{if(!l||!Vr(d)){s(c,d);return}r=r||d;let u=[];for(let h of this._nodes){let f=this.fields[h];!f||Ke.isRef(f)||u.push(f.asNestedTest({options:e,key:h,parent:d,parentPath:e.path,originalParent:r}))}this.runTests({tests:u,value:d,originalValue:r,options:e},i,h=>{s(h.sort(this._sortErrors).concat(c),d)})})}clone(t){const e=super.clone(t);return e.fields=Object.assign({},this.fields),e._nodes=this._nodes,e._excludedEdges=this._excludedEdges,e._sortErrors=this._sortErrors,e}concat(t){let e=super.concat(t),i=e.fields;for(let[s,o]of Object.entries(this.fields)){const r=i[s];i[s]=r===void 0?o:r}return e.withMutation(s=>s.setFields(i,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let e={};return this._nodes.forEach(i=>{var s;const o=this.fields[i];let r=t;(s=r)!=null&&s.value&&(r=Object.assign({},r,{parent:r.value,value:r.value[i]})),e[i]=o&&"getDefault"in o?o.getDefault(r):void 0}),e}setFields(t,e){let i=this.clone();return i.fields=t,i._nodes=$u(t,e),i._sortErrors=Mr(Object.keys(t)),e&&(i._excludedEdges=e),i}shape(t,e=[]){return this.clone().withMutation(i=>{let s=i._excludedEdges;return e.length&&(Array.isArray(e[0])||(e=[e]),s=[...i._excludedEdges,...e]),i.setFields(Object.assign(i.fields,t),s)})}partial(){const t={};for(const[e,i]of Object.entries(this.fields))t[e]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(t)}deepPartial(){return Ii(this)}pick(t){const e={};for(const i of t)this.fields[i]&&(e[i]=this.fields[i]);return this.setFields(e,this._excludedEdges.filter(([i,s])=>t.includes(i)&&t.includes(s)))}omit(t){const e=[];for(const i of Object.keys(this.fields))t.includes(i)||e.push(i);return this.pick(e)}from(t,e,i){let s=Ye.getter(t,!0);return this.transform(o=>{if(!o)return o;let r=o;return Lu(o,t)&&(r=Object.assign({},o),i||delete r[t],r[e]=s(o)),r})}json(){return this.transform(Ru)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Bi.exact,test(e){if(e==null)return!0;const i=Ar(this.schema,e);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,e=Bi.noUnknown){typeof t!="boolean"&&(e=t,t=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:e,test(s){if(s==null)return!0;const o=Ar(this.schema,s);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return i.spec.noUnknown=t,i}unknown(t=!0,e=Bi.noUnknown){return this.noUnknown(!t,e)}transformKeys(t){return this.transform(e=>{if(!e)return e;const i={};for(const s of Object.keys(e))i[t(s)]=e[s];return i})}camelCase(){return this.transformKeys($s.camelCase)}snakeCase(){return this.transformKeys($s.snakeCase)}constantCase(){return this.transformKeys(t=>$s.snakeCase(t).toUpperCase())}describe(t){const e=(t?this.resolve(t):this).clone(),i=super.describe(t);i.fields={};for(const[o,r]of Object.entries(e.fields)){var s;let l=t;(s=l)!=null&&s.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[o]})),i.fields[o]=r.describe(l)}return i}}zs.prototype=Br.prototype;function Ws(n,t,e){const i=new qe;let s=a.ref({});const o=a.ref({}),r=a.ref({});let l=a.ref([]);const c=a.ref(null),d=a.ref([]);let u=a.ref([]),h=a.ref(!1);const f=a.ref({});let{handleSubmit:m,errors:p,setErrors:g}=xr();const y=async()=>{var B;try{const P=await i.getEntityRecords(n);P&&P.response&&(s.value=P.response,l.value=(B=P.response.entity.entityDefinition)==null?void 0:B.columns,I(),S(),v())}catch(P){toast.add({severity:"error",summary:"Error",detail:P.errorMessage,life:3e3})}finally{}},b=async()=>{var B;try{const P=await i.getRecord(n,t);P&&P.response&&(s.value=P.response,l.value=(B=P.response.entity.entityDefinition)==null?void 0:B.columns,I(),o.value=JSON.parse(JSON.stringify(P.response.result[0])),v())}catch(P){console.error("Error fetching entity:",P.errorMessage)}finally{}},_=async()=>{var B,P;try{const R=await i.getRelatedEntityRecord(n,t);R&&R.response&&(s.value=R.response,l.value=(P=(B=R.response.entity)==null?void 0:B.entityDefinition)==null?void 0:P.columns,I(),o.value=JSON.parse(JSON.stringify(R.response.result[0])),o.value.entityName&&delete o.value.entityName,o.value.linkedEntities&&delete o.value.linkedEntities,u.value=R.response.result[0].linkedEntities,r.value=JSON.parse(JSON.stringify(o.value)),v())}catch(R){console.error("Error fetching entity:",R.errorMessage)}finally{}},w=async B=>{try{let P=await i.addRecord(n,B);P&&P.response&&e("onSaveDialog",{entityName:n,recordId:t})}catch(P){P.validationErrors&&(d.value=JSON.parse(JSON.stringify(P.validationErrors))),console.error("Error fetching entity:",P.errorMessage)}finally{}},E=async(B,P)=>{try{let R=await i.addRecord(n,P);if(R&&R.response){let W=await i.saveRelatedEntityRecord(n,R.response.recordId,B.linkedEntities);W&&W.response&&e("onSaveDialog",{entityName:n,recordId:t})}}catch(R){R.validationErrors&&(d.value=JSON.parse(JSON.stringify(R.validationErrors))),console.error("Error fetching entity:",R.errorMessage)}finally{}},k=async B=>{try{const P=await i.updateRecord(n,t,B);P&&P.response&&(h.value=!1,r.value=JSON.parse(JSON.stringify(o.value)),e("onSaveDialog",{entityName:n,recordId:t}))}catch(P){P.validationErrors&&(d.value=JSON.parse(JSON.stringify(P.errvalidationErrorsors))),console.error("Error fetching entity:",P.errorMessage)}finally{}},C=async(B,P,R)=>{try{let W=await i.saveRelatedEntityRecord(B,P,R);W&&W.response&&e("onSaveDialog",{entityName:n,enityRecordId:P})}catch(W){W.validationErrors&&(d.value=JSON.parse(JSON.stringify(W.validationErrors))),console.error("Error fetching entity:",W.errorMessage)}finally{}},S=()=>{for(let B=0;B<l.value.length;B++){let P=l.value[B];P.autoGenerated||(o.value[P.name]="")}},x=B=>{let P="";for(let R=0;R<l.value.length;R++){let W=l.value[R];if(B==W.name){P=W.type;break}}return P},O=()=>{const B=l.value.filter(R=>R.autoGenerated).map(R=>R.name);return Object.entries(o.value).filter(([R])=>!B.includes(R)).map(([R,W])=>({recordColumnName:R,recordColumnValue:W,columnType:x(R)}))},M=async(B={})=>{try{await c.value.validate(o.value,{abortEarly:!1}),g({})}catch(R){const W=R.inner.reduce((Q,Y)=>(Q[Y.path]||(Q[Y.path]={messages:[]}),Q[Y.path].messages.push(...Y.errors),Q),{}),Z=Object.entries(W).reduce((Q,[Y,X])=>(Q[Y]={messages:X.messages},Q),{});g(Z);return}const P={dataDefinitions:O()};t?await k(P):B.relationType=="MANY_TO_ONE"?await E(B,P):await w(P)},v=()=>{c.value=zs().shape(l.value.reduce((B,P)=>(P.autoGenerated||(B[P.name]=js().nullable(!1).test({name:"custom-validation",test:function(R){const W=[];let Z="";if(P.required&&(!R||R.trim()===""))if(P.validations){Z=T(P.validations,"VALIDATE_REQUIRED"),W.push(Z);let Q=U(P.validations,"VALIDATE_REQUIRED");Q&&(Q="hint:"+Q,W.push(Q))}else Z=P.displayName+" is required.",W.push(Z);else{if(P.maxLength&&R.length>P.maxLength)if(P.validations){Z=T(P.validations,"VALIDATE_MAXLENGTH"),W.push(Z);let Q=U(P.validations,"VALIDATE_MAXLENGTH");Q&&(Q="hint:"+Q,W.push(Q))}else Z=P.displayName+" cannot exceed from "+P.maxLength+" characters",W.push(Z);if(P.regxId&&!new RegExp($(P.validations,"VALIDATE_REGX")).test(R))if(P.validations){Z=T(P.validations,"VALIDATE_REGX"),W.push(Z);let Q=U(P.validations,"VALIDATE_REGX");Q&&(Q="hint:"+Q,W.push(Q))}else Z=P.displayName+" invalid format.",W.push(Z)}return W.length>0?this.createError({message:W}):!0}})),B),{}))},T=(B,P)=>{for(let R=0;R<B.length;R++)if(P==B[R].type)return B[R].message},$=(B,P)=>{for(let R=0;R<B.length;R++)if(P==B[R].type)return B[R].regx},U=(B,P)=>{for(let R=0;R<B.length;R++)if(P==B[R].type)return B[R].hint},H=B=>{g({...p.value,[B]:null}),h.value=!0},F=()=>{h.value=!1;for(let B in o.value)o.value.hasOwnProperty(B)&&g({...p.value,[B]:null});o.value=JSON.parse(JSON.stringify(r.value))},I=()=>{for(let B=0;B<l.value.length;B++){const P=l.value[B];if(P.primaryKey&&P.primaryKey==!0){f.value=P;break}}};return{formData:o,columns:l,errors:p,backendErrors:d,isDataChange:h,linkedEntities:u,primarayKeyColumn:f,clearErrors:H,saveRecord:M,fetchAllRecords:y,fetchRecord:b,getRelatedEntityRecordById:_,cancleRecord:F,saveRelatedEntityRecord:C}}const ju={key:0,class:"surface-card"},zu={class:"info"},Wu={key:0,class:"list-none p-0"},Fr={__name:"EntityFormErrors",props:{errors:Array},setup(n){let t=a.ref(!0);const e=()=>{t.value=!t.value};return(i,s)=>{var r;const o=a.resolveComponent("Message");return((r=n.errors)==null?void 0:r.length)>0?(a.openBlock(),a.createElementBlock("div",ju,[s[1]||(s[1]=a.createElementVNode("h4",{class:"flex-1 font-bold text-red-500"},"Errors",-1)),a.createElementVNode("div",zu,[a.createElementVNode("span",{onClick:s[0]||(s[0]=l=>e()),class:"cursor-pointer underline showHideColor"},a.toDisplayString(a.unref(t)?"Hide":"Show"),1)]),a.unref(t)?(a.openBlock(),a.createElementBlock("ul",Wu,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.errors,(l,c)=>(a.openBlock(),a.createElementBlock("li",{key:c,class:"mb-2"},[a.createVNode(o,{style:{"word-break":"break-all"},closable:!1,severity:"error"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(l.message),1)]),_:2},1024)]))),128))])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)}}},Hu={class:"field flex flex-col"},Uu=["for"],qu={key:0,class:"flex items-center"},Yu={key:1},Ku={class:"flex items-center"},$r={__name:"EntitySelection",props:{modelValue:{required:!0},entityName:{type:String,required:!0},columnName:{type:String,required:!0},relatedEntityColumn:{type:String,required:!0}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=new qe,s=a.ref({});let o=a.ref("");const r=t;a.onMounted(()=>{l()});const l=async()=>{try{const u=await i.getEntityRecords(e.entityName);u&&u.response&&(s.value=u.response,d())}catch{}finally{}},c=()=>{r("update:modelValue",o.value[e.relatedEntityColumn])},d=()=>{for(let u=0;u<s.value.result.length;u++){const h=s.value.result[u];if(h[e.relatedEntityColumn]==e.modelValue){o.value=h;break}}};return(u,h)=>{const f=a.resolveComponent("Select");return a.openBlock(),a.createElementBlock("div",Hu,[a.createElementVNode("label",{for:n.columnName},a.toDisplayString(n.columnName),9,Uu),a.createVNode(f,{modelValue:a.unref(o),"onUpdate:modelValue":[h[0]||(h[0]=m=>a.isRef(o)?o.value=m:o=m),c],"item-value":n.relatedEntityColumn,options:s.value.result,filter:"",optionLabel:n.relatedEntityColumn,placeholder:"Select "+n.relatedEntityColumn,class:"w-full"},{value:a.withCtx(m=>[m.value?(a.openBlock(),a.createElementBlock("div",qu,[a.createElementVNode("div",null,a.toDisplayString(m.value[n.relatedEntityColumn]),1)])):(a.openBlock(),a.createElementBlock("span",Yu,a.toDisplayString(m.placeholder),1))]),option:a.withCtx(m=>[a.createElementVNode("div",Ku,[a.createElementVNode("div",null,a.toDisplayString(m.option[n.relatedEntityColumn]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"])])}}},Xu={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},Gu={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},Qu={__name:"EntityDialog",props:a.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showForm:{},showFormModifiers:{}}),emits:a.mergeModels(["onSaveDialog"],["update:showForm"]),setup(n,{emit:t}){const e=a.useModel(n,"showForm"),i=t,{formData:s,columns:o,errors:r,backendErrors:l,clearErrors:c,saveRecord:d,fetchAllRecords:u,fetchRecord:h}=Ws(n.entityName,n.recordId,i);return a.onMounted(()=>{n.recordId?h():u()}),(f,m)=>{const p=a.resolveComponent("Button"),g=a.resolveComponent("Dialog");return e.value?(a.openBlock(),a.createBlock(g,{key:0,showFooter:!1,visible:e.value,"onUpdate:visible":m[2]||(m[2]=y=>e.value=y),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:a.withCtx(()=>[n.recordId?(a.openBlock(),a.createElementBlock("span",Xu,"Edit "+a.toDisplayString(n.entityName)+" record details",1)):a.createCommentVNode("",!0),n.recordId?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",Gu,"Add "+a.toDisplayString(n.entityName)+" record details",1))]),footer:a.withCtx(()=>[a.createVNode(p,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:m[0]||(m[0]=y=>e.value=!1)}),a.createVNode(p,{type:"button",icon:"",label:"Save",severity:"success",onClick:m[1]||(m[1]=y=>a.unref(d)())})]),default:a.withCtx(()=>{var y;return[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(o),(b,_)=>{var w;return a.openBlock(),a.createElementBlock("div",{key:_},[!b.autoGenerated&&!b.foreignKey?(a.openBlock(),a.createBlock(Ni,{key:0,modelValue:a.unref(s)[b.name],"onUpdate:modelValue":E=>a.unref(s)[b.name]=E,column:b,errors:(w=a.unref(r)[b.name])==null?void 0:w.messages,onInput:a.unref(c)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):a.createCommentVNode("",!0),!b.autoGenerated&&b.foreignKey?(a.openBlock(),a.createBlock($r,{key:1,modelValue:a.unref(s)[b.name],"onUpdate:modelValue":E=>a.unref(s)[b.name]=E,entityName:b.foreignKey.referencedEntityName,columnName:b.name,relatedEntityColumn:b.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):a.createCommentVNode("",!0)])}),128)),((y=a.unref(l))==null?void 0:y.length)>0?(a.openBlock(),a.createBlock(Fr,{key:0,errors:a.unref(l)},null,8,["errors"])):a.createCommentVNode("",!0)]}),_:1},8,["visible"])):a.createCommentVNode("",!0)}}},Ju={__name:"DeleteConfirmationDialog",props:a.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showDeleteDialog:{},showDeleteDialogModifiers:{}}),emits:a.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(n,{emit:t}){const e=new qe,i=a.useModel(n,"showDeleteDialog"),s=t,o=async()=>{try{const r=await e.deleteRecord(n.entityName,n.recordId);r&&r.response&&s("onDeleteItem")}catch(r){console.error("Error deleting record:",r.errorMessage)}finally{}};return(r,l)=>{const c=a.resolveComponent("Button"),d=a.resolveComponent("Dialog");return a.openBlock(),a.createBlock(d,{visible:i.value,"onUpdate:visible":l[1]||(l[1]=u=>i.value=u),style:{width:"450px"},header:"Confirm",modal:!0},{footer:a.withCtx(()=>[a.createVNode(c,{label:"No",icon:"pi pi-times",text:"",onClick:l[0]||(l[0]=u=>i.value=!1)}),a.createVNode(c,{label:"Yes",icon:"pi pi-check",text:"",onClick:o})]),default:a.withCtx(()=>[l[2]||(l[2]=a.createElementVNode("div",{class:"flex items-center justify-center"},[a.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),a.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}};function Hs(n){return n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0}function Rr(n){return!!(n&&n.constructor&&n.call&&n.apply)}function bt(n){return!Hs(n)}function mn(n,t=!0){return n instanceof Object&&n.constructor===Object&&(t||Object.keys(n).length!==0)}function Jt(n,...t){return Rr(n)?n(...t):n}function le(n,t=!0){return typeof n=="string"&&(t||n!=="")}function Me(n){return le(n)?n.replace(/(-|_)/g,"").toLowerCase():n}function Lr(n,t="",e={}){const i=Me(t).split("."),s=i.shift();return s?mn(n)?Lr(Jt(n[Object.keys(n).find(o=>Me(o)===s)||""],e),i.join("."),e):void 0:Jt(n,e)}function Us(n,t=!0){return Array.isArray(n)&&(t||n.length!==0)}function Zu(n){return bt(n)&&!isNaN(n)}function be(n,t){if(t){const e=t.test(n);return t.lastIndex=0,e}return!1}function Bn(n){return n&&n.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":")}function Ir(n){return le(n)?n.replace(/(_)/g,"-").replace(/[A-Z]/g,(t,e)=>e===0?t:"-"+t.toLowerCase()).toLowerCase():n}function jr(n){return le(n)?n.replace(/[A-Z]/g,(t,e)=>e===0?t:"."+t.toLowerCase()).toLowerCase():n}var pn={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},th={AND:"and",OR:"or"};const eh={key:0},nh={key:1},qs={__name:"RecordColumnRenderer",props:{column:Object,value:null},setup(n){const t=a.ref(null),e=Object.assign({"/src/directives/dateFormat.js":()=>Promise.resolve().then(()=>py),"/src/directives/textFormatUpperCase.js":()=>Promise.resolve().then(()=>gy)});async function i(){await a.nextTick();const s=e[`/src/directives/${n.column.displayFormatKey}.js`];s&&t.value&&s().then(o=>{o.default.beforeMount(t.value,{value:n.value,arg:n.column.displayFormat})})}return a.onMounted(()=>{i()}),a.onUpdated(()=>{i()}),(s,o)=>n.column.displayFormatKey?(a.openBlock(),a.createElementBlock("span",eh,[a.createElementVNode("span",{ref_key:"el",ref:t},a.toDisplayString(n.value),513)])):(a.openBlock(),a.createElementBlock("span",nh,a.toDisplayString(n.value),1))}};class ih{constructor(){this.httpService=new nr}async getEntities(){return await this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity`)}getEntity(t){}saveEntity(){}async getAppId(){const t=me();this.appId=t.getAppId()}}const sh=er("entitiesStore",{state:()=>({entities:[],entityService:new ih}),actions:{async fetchEntities(){try{return await this.entityService.getEntities()}catch(n){console.error("Error fetching entities:",n)}finally{}},async getEntities(){if(this.entities.length===0){const n=await this.fetchEntities();return this.setEntities(n.response),this.entities}else return this.entities},setEntities(n){this.entities=n}},getters:{}}),oh={class:"card"},rh={class:"my-2"},ah={class:"flex flex-col md:flex-row md:justify-between md:items-center"},lh={class:"flex flex-row gap-2"},zr={__name:"Grid",props:{entityName:String,showAddButton:Boolean,showClearFilters:Boolean,columnsToShow:Array,editable:Boolean,deleteable:Boolean,showPagination:Boolean},setup(n){const t=me(),e=n;console.log("columnsToShow",e.columnsToShow);const i=Ht.useRoute(),s=a.ref(e.entityName||i.params.entityName),o=a.ref({}),r=a.ref(""),l=a.ref(!1),c=a.ref(!1),{items:d,headers:u,first:h,totalRecords:f,pageSize:m,loading:p,sortBy:g,sortDirection:y,operatorMap:b,filterToSend:_,primarayKeyColumn:w,fullTextSearch:E,listingResponse:k,onFullTextSearch:C,getDatatypeByField:S,getColumnDatatype:x,onSort:O,onPage:M,onFilter:v,fetchEntityFilterData:T,fetchEntityByName:$}=xd(s.value),U=a.ref();let H=a.ref(!1);const F=Y=>{o.value=Y.reduce((X,it)=>{if(!it.filterable)return X;let lt=pn.CONTAINS;switch(it.datatype.toLowerCase()){case"string":case"uuid":lt=pn.STARTS_WITH;break;case"date":lt=pn.DATE_IS;break;case"numeric":case"int":case"integer":lt=pn.EQUALS;break;case"bool":case"boolean":lt=pn.EQUALS;break}return it.datatype=="bool"||it.datatype=="boolean"?X[it.field]={value:null,matchMode:pn.EQUALS}:X[it.field]={operator:th.AND,constraints:[{value:null,matchMode:lt}]},X},{})},I=()=>{F(u.value),_.value=Q(o.value),v()},B=Y=>{_.value=Q(o.value),v()},P=Y=>{Y?r.value=Y[w.value.name]:r.value="",l.value=!l.value},R=()=>{l.value=!1,T(!1)},W=Y=>{r.value=Y[w.value.name],c.value=!0},Z=()=>{c.value=!1,T(!1)},Q=Y=>Object.keys(Y).map(X=>{const it=Y[X];return it.constraints?it.constraints.filter(lt=>lt.value!==null&&lt.value!=="").map(lt=>({columnName:X,operator:b[lt.matchMode]??lt.matchMode,value:lt.value,columnType:S(X)})):it.value!==null&&it.value!==""?{columnName:X,operator:b[it.matchMode]??it.matchMode,value:it.value,columnType:S(X)}:[]}).flat();return a.watch(()=>t.globalConfigs.appId,async Y=>{Y&&$(s.value)},{immediate:!0}),a.watch(()=>u.value,Y=>{!H.value&&Y&&Y.length&&(F(Y),H.value=!0)},{immediate:!0}),(Y,X)=>{const it=a.resolveComponent("Button"),lt=a.resolveComponent("Toolbar"),It=a.resolveComponent("ProgressSpinner"),Ue=a.resolveComponent("InputIcon"),Xt=a.resolveComponent("IconField"),De=a.resolveComponent("Calendar"),fe=a.resolveComponent("InputNumber"),j=a.resolveComponent("Checkbox"),A=a.resolveComponent("Column"),at=a.resolveComponent("DataTable");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",oh,[a.renderSlot(Y.$slots,"header"),n.showClearFilters||n.showAddButton?(a.openBlock(),a.createBlock(lt,{key:0,class:"mb-4 mt-4"},a.createSlots({_:2},[n.showClearFilters?{name:"start",fn:a.withCtx(()=>[a.createElementVNode("div",rh,[a.createVNode(it,{type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warning",onClick:X[0]||(X[0]=dt=>I())})])]),key:"0"}:void 0,n.showAddButton?{name:"end",fn:a.withCtx(()=>[a.createVNode(it,{label:"Add",icon:"pi pi-plus",class:"mr-2",severity:"success",onClick:X[1]||(X[1]=dt=>P())})]),key:"1"}:void 0]),1024)):a.createCommentVNode("",!0),a.createVNode(at,{lazy:"",value:a.unref(d),loading:a.unref(p),ref_key:"dt",ref:U,stripedRows:!0,showGridlines:"",rowHover:!0,paginator:n.showPagination,rows:a.unref(m),rowsPerPageOptions:[10,25,50,100],totalRecords:a.unref(f),first:a.unref(h),sortField:a.unref(g),sortOrder:a.unref(y),filters:o.value,"onUpdate:filters":X[5]||(X[5]=dt=>o.value=dt),filterDisplay:"menu",scrollable:"",scrollHeight:"400px",onSort:a.unref(O),onPage:a.unref(M),onFilter:X[6]||(X[6]=dt=>B()),size:"large",paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},{empty:a.withCtx(()=>X[9]||(X[9]=[a.createTextVNode(" No data found. ")])),loading:a.withCtx(()=>[a.createVNode(It)]),header:a.withCtx(()=>[a.createElementVNode("div",ah,[a.createVNode(Xt,{iconPosition:"left",class:"block mt-2 md:mt-0"},{default:a.withCtx(()=>[a.createVNode(Ue,{class:"pi pi-search",onClick:X[2]||(X[2]=dt=>a.unref(C)())}),a.createVNode(a.unref(Xo.InputText),{class:"w-full sm:w-auto",onKeyup:X[3]||(X[3]=a.withKeys(dt=>a.unref(C)(),["enter"])),modelValue:a.unref(E),"onUpdate:modelValue":X[4]||(X[4]=dt=>a.isRef(E)?E.value=dt:null),placeholder:"Search..."},null,8,["modelValue"])]),_:1})])]),default:a.withCtx(()=>{var dt;return[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(u).filter(ct=>!e.columnsToShow||e.columnsToShow.length===0||e.columnsToShow.includes(ct.field)),ct=>(a.openBlock(),a.createBlock(A,{key:ct.field,dataType:a.unref(x)(ct.datatype),field:ct.field,header:ct.name,sortable:ct.sortable,showAddButton:!1,showFilterOperator:!1,style:{"text-wrap":"nowrap"}},a.createSlots({body:a.withCtx(({data:ut})=>[a.createVNode(qs,{column:ct,value:ut[ct.field]},null,8,["column","value"])]),_:2},[ct.datatype.toLowerCase()==="date"&&ct.filterable?{name:"filter",fn:a.withCtx(({filterModel:ut})=>[a.createVNode(De,{modelValue:ut.value,"onUpdate:modelValue":wt=>ut.value=wt,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])]),key:"0"}:ct.datatype.toLowerCase()==="int"&&ct.filterable?{name:"filter",fn:a.withCtx(({filterModel:ut})=>[a.createVNode(fe,{modelValue:ut.value,"onUpdate:modelValue":wt=>ut.value=wt,placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"1"}:ct.datatype.toLowerCase()==="boolean"&&ct.filterable?{name:"filter",fn:a.withCtx(({filterModel:ut})=>[a.createVNode(j,{modelValue:ut.value,"onUpdate:modelValue":wt=>ut.value=wt,indeterminate:ut.value===null,binary:""},null,8,["modelValue","onUpdate:modelValue","indeterminate"])]),key:"2"}:ct.filterable?{name:"filter",fn:a.withCtx(({filterModel:ut})=>[a.createVNode(a.unref(Xo.InputText),{style:{width:"150px"},type:"text",modelValue:ut.value,"onUpdate:modelValue":wt=>ut.value=wt,class:"p-column-filter",placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"3"}:void 0]),1032,["dataType","field","header","sortable"]))),128)),((dt=a.unref(d))==null?void 0:dt.length)>0&&(n.editable||n.deleteable)?(a.openBlock(),a.createBlock(A,{key:0,header:"Actions"},{body:a.withCtx(({data:ct})=>[a.createElementVNode("div",lh,[n.editable?(a.openBlock(),a.createBlock(it,{key:0,onClick:ut=>P(ct),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"},null,8,["onClick"])):a.createCommentVNode("",!0),n.deleteable?(a.openBlock(),a.createBlock(it,{key:1,onClick:ut=>W(ct),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"},null,8,["onClick"])):a.createCommentVNode("",!0)])]),_:1})):a.createCommentVNode("",!0)]}),_:1},8,["value","loading","paginator","rows","totalRecords","first","sortField","sortOrder","filters","onSort","onPage"]),a.renderSlot(Y.$slots,"footer")]),l.value?(a.openBlock(),a.createBlock(Qu,{key:0,showForm:l.value,"onUpdate:showForm":X[7]||(X[7]=dt=>l.value=dt),entityName:a.unref(k).entityName,recordId:r.value,onOnSaveDialog:R},null,8,["showForm","entityName","recordId"])):a.createCommentVNode("",!0),c.value?(a.openBlock(),a.createBlock(Ju,{key:1,showDeleteDialog:c.value,"onUpdate:showDeleteDialog":X[8]||(X[8]=dt=>c.value=dt),entityName:a.unref(k).entityName,recordId:r.value,onOnDeleteItem:Z},null,8,["showDeleteDialog","entityName","recordId"])):a.createCommentVNode("",!0)],64)}}};function ch(){const n=new Map;return{on(t,e){let i=n.get(t);return i?i.push(e):i=[e],n.set(t,i),this},off(t,e){let i=n.get(t);return i&&i.splice(i.indexOf(e)>>>0,1),this},emit(t,e){let i=n.get(t);i&&i.slice().map(s=>{s(e)})},clear(){n.clear()}}}var dh=Object.defineProperty,uh=Object.defineProperties,hh=Object.getOwnPropertyDescriptors,ji=Object.getOwnPropertySymbols,Wr=Object.prototype.hasOwnProperty,Hr=Object.prototype.propertyIsEnumerable,Ur=(n,t,e)=>t in n?dh(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Zt=(n,t)=>{for(var e in t||(t={}))Wr.call(t,e)&&Ur(n,e,t[e]);if(ji)for(var e of ji(t))Hr.call(t,e)&&Ur(n,e,t[e]);return n},Ys=(n,t)=>uh(n,hh(t)),_e=(n,t)=>{var e={};for(var i in n)Wr.call(n,i)&&t.indexOf(i)<0&&(e[i]=n[i]);if(n!=null&&ji)for(var i of ji(n))t.indexOf(i)<0&&Hr.call(n,i)&&(e[i]=n[i]);return e},fh=ch(),Ve=fh;function qr(n,t){Us(n)?n.push(...t||[]):mn(n)&&Object.assign(n,t)}function mh(n){return mn(n)&&n.hasOwnProperty("value")&&n.hasOwnProperty("type")?n.value:n}function ph(n){return n.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function Ks(n="",t=""){return ph(`${le(n,!1)&&le(t,!1)?`${n}-`:n}${t}`)}function Yr(n="",t=""){return`--${Ks(n,t)}`}function gh(n=""){const t=(n.match(/{/g)||[]).length,e=(n.match(/}/g)||[]).length;return(t+e)%2!==0}function Kr(n,t="",e="",i=[],s){if(le(n)){const o=/{([^}]*)}/g,r=n.trim();if(gh(r))return;if(be(r,o)){const l=r.replaceAll(o,u=>{const f=u.replace(/{|}/g,"").split(".").filter(m=>!i.some(p=>be(m,p)));return`var(${Yr(e,Ir(f.join("-")))}${bt(s)?`, ${s}`:""})`}),c=/(\d+\s+[\+\-\*\/]\s+\d+)/g,d=/var\([^)]+\)/g;return be(l.replace(d,"0"),c)?`calc(${l})`:l}return r}else if(Zu(n))return n}function yh(n,t,e){le(t,!1)&&n.push(`${t}:${e};`)}function gn(n,t){return n?`${n}{${t}}`:""}var Fn=(...n)=>bh(Ct.getTheme(),...n),bh=(n={},t,e,i)=>{if(t){const{variable:s,options:o}=Ct.defaults||{},{prefix:r,transform:l}=(n==null?void 0:n.options)||o||{},d=be(t,/{([^}]*)}/g)?t:`{${t}}`;return i==="value"||Hs(i)&&l==="strict"?Ct.getTokenValue(t):Kr(d,void 0,r,[s.excludedKeyRegex],e)}return""};function _h(n,t={}){const e=Ct.defaults.variable,{prefix:i=e.prefix,selector:s=e.selector,excludedKeyRegex:o=e.excludedKeyRegex}=t,r=(d,u="")=>Object.entries(d).reduce((h,[f,m])=>{const p=be(f,o)?Ks(u):Ks(u,Ir(f)),g=mh(m);if(mn(g)){const{variables:y,tokens:b}=r(g,p);qr(h.tokens,b),qr(h.variables,y)}else h.tokens.push((i?p.replace(`${i}-`,""):p).replaceAll("-",".")),yh(h.variables,Yr(p),Kr(g,p,i,[o]));return h},{variables:[],tokens:[]}),{variables:l,tokens:c}=r(n,i);return{value:l,tokens:c,declarations:l.join(""),css:gn(s,l.join(""))}}var te={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(n){return{type:"class",selector:n,matched:this.pattern.test(n.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(n){return{type:"attr",selector:`:root${n}`,matched:this.pattern.test(n.trim())}}},media:{pattern:/^@media (.*)$/,resolve(n){return{type:"media",selector:`${n}{:root{[CSS]}}`,matched:this.pattern.test(n.trim())}}},system:{pattern:/^system$/,resolve(n){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(n.trim())}}},custom:{resolve(n){return{type:"custom",selector:n,matched:!0}}}},resolve(n){const t=Object.keys(this.rules).filter(e=>e!=="custom").map(e=>this.rules[e]);return[n].flat().map(e=>{var i;return(i=t.map(s=>s.resolve(e)).find(s=>s.matched))!=null?i:this.rules.custom.resolve(e)})}},_toVariables(n,t){return _h(n,{prefix:t==null?void 0:t.prefix})},getCommon({name:n="",theme:t={},params:e,set:i,defaults:s}){var o,r,l,c,d,u,h;const{preset:f,options:m}=t;let p,g,y,b,_,w,E;if(bt(f)&&m.transform!=="strict"){const{primitive:k,semantic:C,extend:S}=f,x=C||{},{colorScheme:O}=x,M=_e(x,["colorScheme"]),v=S||{},{colorScheme:T}=v,$=_e(v,["colorScheme"]),U=O||{},{dark:H}=U,F=_e(U,["dark"]),I=T||{},{dark:B}=I,P=_e(I,["dark"]),R=bt(k)?this._toVariables({primitive:k},m):{},W=bt(M)?this._toVariables({semantic:M},m):{},Z=bt(F)?this._toVariables({light:F},m):{},Q=bt(H)?this._toVariables({dark:H},m):{},Y=bt($)?this._toVariables({semantic:$},m):{},X=bt(P)?this._toVariables({light:P},m):{},it=bt(B)?this._toVariables({dark:B},m):{},[lt,It]=[(o=R.declarations)!=null?o:"",R.tokens],[Ue,Xt]=[(r=W.declarations)!=null?r:"",W.tokens||[]],[De,fe]=[(l=Z.declarations)!=null?l:"",Z.tokens||[]],[j,A]=[(c=Q.declarations)!=null?c:"",Q.tokens||[]],[at,dt]=[(d=Y.declarations)!=null?d:"",Y.tokens||[]],[ct,ut]=[(u=X.declarations)!=null?u:"",X.tokens||[]],[wt,se]=[(h=it.declarations)!=null?h:"",it.tokens||[]];p=this.transformCSS(n,lt,"light","variable",m,i,s),g=It;const Dn=this.transformCSS(n,`${Ue}${De}`,"light","variable",m,i,s),oe=this.transformCSS(n,`${j}`,"dark","variable",m,i,s);y=`${Dn}${oe}`,b=[...new Set([...Xt,...fe,...A])];const ln=this.transformCSS(n,`${at}${ct}color-scheme:light`,"light","variable",m,i,s),Nn=this.transformCSS(n,`${wt}color-scheme:dark`,"dark","variable",m,i,s);_=`${ln}${Nn}`,w=[...new Set([...dt,...ut,...se])],E=Jt(f.css,{dt:Fn})}return{primitive:{css:p,tokens:g},semantic:{css:y,tokens:b},global:{css:_,tokens:w},style:E}},getPreset({name:n="",preset:t={},options:e,params:i,set:s,defaults:o,selector:r}){var l,c,d;let u,h,f;if(bt(t)&&e.transform!=="strict"){const m=n.replace("-directive",""),p=t,{colorScheme:g,extend:y,css:b}=p,_=_e(p,["colorScheme","extend","css"]),w=y||{},{colorScheme:E}=w,k=_e(w,["colorScheme"]),C=g||{},{dark:S}=C,x=_e(C,["dark"]),O=E||{},{dark:M}=O,v=_e(O,["dark"]),T=bt(_)?this._toVariables({[m]:Zt(Zt({},_),k)},e):{},$=bt(x)?this._toVariables({[m]:Zt(Zt({},x),v)},e):{},U=bt(S)?this._toVariables({[m]:Zt(Zt({},S),M)},e):{},[H,F]=[(l=T.declarations)!=null?l:"",T.tokens||[]],[I,B]=[(c=$.declarations)!=null?c:"",$.tokens||[]],[P,R]=[(d=U.declarations)!=null?d:"",U.tokens||[]],W=this.transformCSS(m,`${H}${I}`,"light","variable",e,s,o,r),Z=this.transformCSS(m,P,"dark","variable",e,s,o,r);u=`${W}${Z}`,h=[...new Set([...F,...B,...R])],f=Jt(b,{dt:Fn})}return{css:u,tokens:h,style:f}},getPresetC({name:n="",theme:t={},params:e,set:i,defaults:s}){var o;const{preset:r,options:l}=t,c=(o=r==null?void 0:r.components)==null?void 0:o[n];return this.getPreset({name:n,preset:c,options:l,params:e,set:i,defaults:s})},getPresetD({name:n="",theme:t={},params:e,set:i,defaults:s}){var o;const r=n.replace("-directive",""),{preset:l,options:c}=t,d=(o=l==null?void 0:l.directives)==null?void 0:o[r];return this.getPreset({name:r,preset:d,options:c,params:e,set:i,defaults:s})},applyDarkColorScheme(n){return!(n.darkModeSelector==="none"||n.darkModeSelector===!1)},getColorSchemeOption(n,t){var e;return this.applyDarkColorScheme(n)?this.regex.resolve(n.darkModeSelector===!0?t.options.darkModeSelector:(e=n.darkModeSelector)!=null?e:t.options.darkModeSelector):[]},getLayerOrder(n,t={},e,i){const{cssLayer:s}=t;return s?`@layer ${Jt(s.order||"primeui",e)}`:""},getCommonStyleSheet({name:n="",theme:t={},params:e,props:i={},set:s,defaults:o}){const r=this.getCommon({name:n,theme:t,params:e,set:s,defaults:o}),l=Object.entries(i).reduce((c,[d,u])=>c.push(`${d}="${u}"`)&&c,[]).join(" ");return Object.entries(r||{}).reduce((c,[d,u])=>{if(u!=null&&u.css){const h=Bn(u==null?void 0:u.css),f=`${d}-variables`;c.push(`<style type="text/css" data-primevue-style-id="${f}" ${l}>${h}</style>`)}return c},[]).join("")},getStyleSheet({name:n="",theme:t={},params:e,props:i={},set:s,defaults:o}){var r;const l={name:n,theme:t,params:e,set:s,defaults:o},c=(r=n.includes("-directive")?this.getPresetD(l):this.getPresetC(l))==null?void 0:r.css,d=Object.entries(i).reduce((u,[h,f])=>u.push(`${h}="${f}"`)&&u,[]).join(" ");return c?`<style type="text/css" data-primevue-style-id="${n}-variables" ${d}>${Bn(c)}</style>`:""},createTokens(n={},t,e="",i="",s={}){return Object.entries(n).forEach(([o,r])=>{const l=be(o,t.variable.excludedKeyRegex)?e:e?`${e}.${jr(o)}`:jr(o),c=i?`${i}.${o}`:o;mn(r)?this.createTokens(r,t,l,c,s):(s[l]||(s[l]={paths:[],computed(d,u={}){var h,f;return this.paths.length===1?(h=this.paths[0])==null?void 0:h.computed(this.paths[0].scheme,u.binding):d&&d!=="none"?(f=this.paths.find(m=>m.scheme===d))==null?void 0:f.computed(d,u.binding):this.paths.map(m=>m.computed(m.scheme,u[m.scheme]))}}),s[l].paths.push({path:c,value:r,scheme:c.includes("colorScheme.light")?"light":c.includes("colorScheme.dark")?"dark":"none",computed(d,u={}){const h=/{([^}]*)}/g;let f=r;if(u.name=this.path,u.binding||(u.binding={}),be(r,h)){const p=r.trim().replaceAll(h,b=>{var _;const w=b.replace(/{|}/g,""),E=(_=s[w])==null?void 0:_.computed(d,u);return Us(E)&&E.length===2?`light-dark(${E[0].value},${E[1].value})`:E==null?void 0:E.value}),g=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,y=/var\([^)]+\)/g;f=be(p.replace(y,"0"),g)?`calc(${p})`:p}return Hs(u.binding)&&delete u.binding,{colorScheme:d,path:this.path,paths:u,value:f.includes("undefined")?void 0:f}}}))}),s},getTokenValue(n,t,e){var i;const o=(c=>c.split(".").filter(u=>!be(u.toLowerCase(),e.variable.excludedKeyRegex)).join("."))(t),r=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,l=[(i=n[o])==null?void 0:i.computed(r)].flat().filter(c=>c);return l.length===1?l[0].value:l.reduce((c={},d)=>{const u=d,{colorScheme:h}=u,f=_e(u,["colorScheme"]);return c[h]=f,c},void 0)},getSelectorRule(n,t,e,i){return e==="class"||e==="attr"?gn(bt(t)?`${n}${t},${n} ${t}`:n,i):gn(n,bt(t)?gn(t,i):i)},transformCSS(n,t,e,i,s={},o,r,l){if(bt(t)){const{cssLayer:c}=s;if(i!=="style"){const d=this.getColorSchemeOption(s,r);t=e==="dark"?d.reduce((u,{type:h,selector:f})=>(bt(f)&&(u+=f.includes("[CSS]")?f.replace("[CSS]",t):this.getSelectorRule(f,l,h,t)),u),""):gn(l??":root",t)}if(c){const d={name:"primeui",order:"primeui"};mn(c)&&(d.name=Jt(c.name,{name:n,type:i})),bt(d.name)&&(t=gn(`@layer ${d.name}`,t),o==null||o.layerNames(d.name))}return t}return""}},Ct={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(n={}){const{theme:t}=n;t&&(this._theme=Ys(Zt({},t),{options:Zt(Zt({},this.defaults.options),t.options)}),this._tokens=te.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var n;return((n=this.theme)==null?void 0:n.preset)||{}},get options(){var n;return((n=this.theme)==null?void 0:n.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(n){this.update({theme:n}),Ve.emit("theme:change",n)},getPreset(){return this.preset},setPreset(n){this._theme=Ys(Zt({},this.theme),{preset:n}),this._tokens=te.createTokens(n,this.defaults),this.clearLoadedStyleNames(),Ve.emit("preset:change",n),Ve.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(n){this._theme=Ys(Zt({},this.theme),{options:n}),this.clearLoadedStyleNames(),Ve.emit("options:change",n),Ve.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(n){this._layerNames.add(n)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(n){return this._loadedStyleNames.has(n)},setLoadedStyleName(n){this._loadedStyleNames.add(n)},deleteLoadedStyleName(n){this._loadedStyleNames.delete(n)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(n){return te.getTokenValue(this.tokens,n,this.defaults)},getCommon(n="",t){return te.getCommon({name:n,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(n="",t){const e={name:n,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return te.getPresetC(e)},getDirective(n="",t){const e={name:n,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return te.getPresetD(e)},getCustomPreset(n="",t,e,i){const s={name:n,preset:t,options:this.options,selector:e,params:i,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return te.getPreset(s)},getLayerOrderCSS(n=""){return te.getLayerOrder(n,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(n="",t,e="style",i){return te.transformCSS(n,t,i,e,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(n="",t,e={}){return te.getCommonStyleSheet({name:n,theme:this.theme,params:t,props:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(n,t,e={}){return te.getStyleSheet({name:n,theme:this.theme,params:t,props:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(n){this._loadingStyles.add(n)},onStyleUpdated(n){this._loadingStyles.add(n)},onStyleLoaded(n,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),Ve.emit(`theme:${t}:load`,n),!this._loadingStyles.size&&Ve.emit("theme:load"))}};function Xs(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n!==null&&n.nodeType===1&&typeof n.nodeName=="string"}function Gs(n,t={}){if(Xs(n)){const e=(i,s)=>{var o,r;const l=(o=n==null?void 0:n.$attrs)!=null&&o[i]?[(r=n==null?void 0:n.$attrs)==null?void 0:r[i]]:[];return[s].flat().reduce((c,d)=>{if(d!=null){const u=typeof d;if(u==="string"||u==="number")c.push(d);else if(u==="object"){const h=Array.isArray(d)?e(i,d):Object.entries(d).map(([f,m])=>i==="style"&&(m||m===0)?`${f.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${m}`:m?f:void 0);c=h.length?c.concat(h.filter(f=>!!f)):c}}return c},l)};Object.entries(t).forEach(([i,s])=>{if(s!=null){const o=i.match(/^on(.+)/);o?n.addEventListener(o[1].toLowerCase(),s):i==="p-bind"||i==="pBind"?Gs(n,s):(s=i==="class"?[...new Set(e("class",s))].join(" ").trim():i==="style"?e("style",s).join(";").trim():s,(n.$attrs=n.$attrs||{})&&(n.$attrs[i]=s),n.setAttribute(i,s))}})}}function xh(n,t){return Xs(n)?n.matches(t)?n:n.querySelector(t):null}function kh(n){if(n){let t=n.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function Sh(n){return!!(n!==null&&typeof n<"u"&&n.nodeName&&kh(n))}function Xr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function wh(n,t="",e){Xs(n)&&e!==null&&e!==void 0&&n.setAttribute(t,e)}var zi={};function Eh(n="pui_id_"){return zi.hasOwnProperty(n)||(zi[n]=0),zi[n]++,`${n}${zi[n]}`}var $n={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(t){return this._loadedStyleNames.has(t)},setLoadedStyleName:function(t){this._loadedStyleNames.add(t)},deleteLoadedStyleName:function(t){this._loadedStyleNames.delete(t)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function Rn(n){"@babel/helpers - typeof";return Rn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rn(n)}function Gr(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),e.push.apply(e,i)}return e}function Qr(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Gr(Object(e),!0).forEach(function(i){Ch(n,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):Gr(Object(e)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(e,i))})}return n}function Ch(n,t,e){return(t=vh(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function vh(n){var t=Oh(n,"string");return Rn(t)=="symbol"?t:t+""}function Oh(n,t){if(Rn(n)!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(Rn(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function Dh(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a.getCurrentInstance()?a.onMounted(n):t?n():a.nextTick(n)}var Nh=0;function Th(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=a.ref(!1),i=a.ref(n),s=a.ref(null),o=Xr()?window.document:void 0,r=t.document,l=r===void 0?o:r,c=t.immediate,d=c===void 0?!0:c,u=t.manual,h=u===void 0?!1:u,f=t.name,m=f===void 0?"style_".concat(++Nh):f,p=t.id,g=p===void 0?void 0:p,y=t.media,b=y===void 0?void 0:y,_=t.nonce,w=_===void 0?void 0:_,E=t.first,k=E===void 0?!1:E,C=t.onMounted,S=C===void 0?void 0:C,x=t.onUpdated,O=x===void 0?void 0:x,M=t.onLoad,v=M===void 0?void 0:M,T=t.props,$=T===void 0?{}:T,U=function(){},H=function(B){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l){var R=Qr(Qr({},$),P),W=R.name||m,Z=R.id||g,Q=R.nonce||w;s.value=l.querySelector('style[data-primevue-style-id="'.concat(W,'"]'))||l.getElementById(Z)||l.createElement("style"),s.value.isConnected||(i.value=B||n,Gs(s.value,{type:"text/css",id:Z,media:b,nonce:Q}),k?l.head.prepend(s.value):l.head.appendChild(s.value),wh(s.value,"data-primevue-style-id",W),Gs(s.value,R),s.value.onload=function(Y){return v==null?void 0:v(Y,{name:W})},S==null||S(W)),!e.value&&(U=a.watch(i,function(Y){s.value.textContent=Y,O==null||O(W)},{immediate:!0}),e.value=!0)}},F=function(){!l||!e.value||(U(),Sh(s.value)&&l.head.removeChild(s.value),e.value=!1)};return d&&!h&&Dh(H),{id:g,name:m,el:s,css:i,unload:F,load:H,isLoaded:a.readonly(e)}}function Ln(n){"@babel/helpers - typeof";return Ln=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ln(n)}function Jr(n,t){return Ah(n)||Vh(n,t)||Mh(n,t)||Ph()}function Ph(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
13
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mh(n,t){if(n){if(typeof n=="string")return Zr(n,t);var e={}.toString.call(n).slice(8,-1);return e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set"?Array.from(n):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Zr(n,t):void 0}}function Zr(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=Array(t);e<t;e++)i[e]=n[e];return i}function Vh(n,t){var e=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(e!=null){var i,s,o,r,l=[],c=!0,d=!1;try{if(o=(e=e.call(n)).next,t!==0)for(;!(c=(i=o.call(e)).done)&&(l.push(i.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&e.return!=null&&(r=e.return(),Object(r)!==r))return}finally{if(d)throw s}}return l}}function Ah(n){if(Array.isArray(n))return n}function ta(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),e.push.apply(e,i)}return e}function Qs(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ta(Object(e),!0).forEach(function(i){Bh(n,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):ta(Object(e)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(e,i))})}return n}function Bh(n,t,e){return(t=Fh(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function Fh(n){var t=$h(n,"string");return Ln(t)=="symbol"?t:t+""}function $h(n,t){if(Ln(n)!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(Ln(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var Rh=function(t){var e=t.dt;return`
11
+ attempted value: ${a}
12
+ `+(l!==a?`result of cast: ${l}`:""))}return o}_cast(e,t){let i=e===void 0?e:this.transforms.reduce((s,o)=>o.call(this,s,e,this),e);return i===void 0&&(i=this.getDefault(t)),i}_validate(e,t={},i,s){let{path:o,originalValue:a=e,strict:l=this.spec.strict}=t,c=e;l||(c=this._cast(c,Object.assign({assert:!1},t)));let d=[];for(let u of Object.values(this.internalTests))u&&d.push(u);this.runTests({path:o,value:c,originalValue:a,options:t,tests:d},i,u=>{if(u.length)return s(u,c);this.runTests({path:o,value:c,originalValue:a,options:t,tests:this.tests},i,s)})}runTests(e,t,i){let s=!1,{tests:o,value:a,originalValue:l,path:c,options:d}=e,u=g=>{s||(s=!0,t(g,a))},f=g=>{s||(s=!0,i(g,a))},h=o.length,m=[];if(!h)return f([]);let p={value:a,originalValue:l,path:c,options:d,schema:this};for(let g=0;g<o.length;g++){const y=o[g];y(p,u,function(x){x&&(Array.isArray(x)?m.push(...x):m.push(x)),--h<=0&&f(m)})}}asNestedTest({key:e,index:t,parent:i,parentPath:s,originalParent:o,options:a}){const l=e??t;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let d=i[l];const u=Object.assign({},a,{strict:!0,parent:i,value:d,originalValue:o[l],key:void 0,[c?"index":"key"]:l,path:c||l.includes(".")?`${s||""}[${c?l:`"${l}"`}]`:(s?`${s}.`:"")+e});return(f,h,m)=>this.resolve(u)._validate(d,u,h,m)}validate(e,t){var i;let s=this.resolve(Object.assign({},t,{value:e})),o=(i=t==null?void 0:t.disableStackTrace)!=null?i:s.spec.disableStackTrace;return new Promise((a,l)=>s._validate(e,t,(c,d)=>{We.isError(c)&&(c.value=d),l(c)},(c,d)=>{c.length?l(new We(c,d,void 0,void 0,o)):a(d)}))}validateSync(e,t){var i;let s=this.resolve(Object.assign({},t,{value:e})),o,a=(i=t==null?void 0:t.disableStackTrace)!=null?i:s.spec.disableStackTrace;return s._validate(e,Object.assign({},t,{sync:!0}),(l,c)=>{throw We.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new We(l,e,void 0,void 0,a);o=c}),o}isValid(e,t){return this.validate(e,t).then(()=>!0,i=>{if(We.isError(i))return!1;throw i})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(i){if(We.isError(i))return!1;throw i}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):En(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const i=this.clone({nullable:e});return i.internalTests.nullable=wn({message:t,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),i}optionality(e,t){const i=this.clone({optional:e});return i.internalTests.optionality=wn({message:t,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(e=mt.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=mt.notNull){return this.nullability(!1,e)}required(e=mt.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=mt.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),s=wn(t),o=t.exclusive||t.name&&i.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(i.exclusiveTests[t.name]=!!t.exclusive),i.tests=i.tests.filter(a=>!(a.OPTIONS.name===t.name&&(o||a.OPTIONS.test===s.OPTIONS.test))),i.tests.push(s),i}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let i=this.clone(),s=$r(e).map(o=>new rn(o));return s.forEach(o=>{o.isSibling&&i.deps.push(o.key)}),i.conditions.push(typeof t=="function"?new Ki(s,t):Ki.fromOptions(s,t)),i}typeError(e){let t=this.clone();return t.internalTests.typeError=wn({message:e,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=mt.oneOf){let i=this.clone();return e.forEach(s=>{i._whitelist.add(s),i._blacklist.delete(s)}),i.internalTests.whiteList=wn({message:t,name:"oneOf",skipAbsent:!0,test(s){let o=this.schema._whitelist,a=o.resolveAll(this.resolve);return a.includes(s)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:a}})}}),i}notOneOf(e,t=mt.notOneOf){let i=this.clone();return e.forEach(s=>{i._blacklist.add(s),i._whitelist.delete(s)}),i.internalTests.blacklist=wn({message:t,name:"notOneOf",test(s){let o=this.schema._blacklist,a=o.resolveAll(this.resolve);return a.includes(s)?this.createError({params:{values:Array.from(o).join(", "),resolved:a}}):!0}}),i}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:i,meta:s,optional:o,nullable:a}=t.spec;return{meta:s,label:i,optional:o,nullable:a,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,d,u)=>u.findIndex(f=>f.name===c.name)===d)}}}pt.prototype.__isYupSchema__=!0;for(const n of["validate","validateSync"])pt.prototype[`${n}At`]=function(e,t,i={}){const{parent:s,parentPath:o,schema:a}=Gu(this,e,t,i.context);return a[n](s&&s[o],Object.assign({},i,{parent:s,path:e}))};for(const n of["equals","is"])pt.prototype[n]=pt.prototype.oneOf;for(const n of["not","nope"])pt.prototype[n]=pt.prototype.notOneOf;const Qu=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Ju(n){const e=eo(n);if(!e)return Date.parse?Date.parse(n):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let t=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(t=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(t=0-t)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+t,e.second,e.millisecond)}function eo(n){var e,t;const i=Qu.exec(n);return i?{year:Ct(i[1]),month:Ct(i[2],1)-1,day:Ct(i[3],1),hour:Ct(i[4]),minute:Ct(i[5]),second:Ct(i[6]),millisecond:i[7]?Ct(i[7].substring(0,3)):0,precision:(e=(t=i[7])==null?void 0:t.length)!=null?e:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:Ct(i[10]),minuteOffset:Ct(i[11])}:null}function Ct(n,e=0){return Number(n)||e}let Zu=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ef=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,tf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,nf="^\\d{4}-\\d{2}-\\d{2}",sf="\\d{2}:\\d{2}:\\d{2}",of="(([+-]\\d{2}(:?\\d{2})?)|Z)",rf=new RegExp(`${nf}T${sf}(\\.\\d+)?${of}$`),af=n=>an(n)||n===n.trim(),lf={}.toString();function to(){return new zr}class zr extends pt{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t,i)=>{if(!i.spec.coerce||i.isType(e)||Array.isArray(e))return e;const s=e!=null&&e.toString?e.toString():e;return s===lf?e:s})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||mt.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=He.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(i){return i.length===this.resolve(e)}})}min(e,t=He.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i.length>=this.resolve(e)}})}max(e,t=He.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(i){return i.length<=this.resolve(e)}})}matches(e,t){let i=!1,s,o;return t&&(typeof t=="object"?{excludeEmptyString:i=!1,message:s,name:o}=t:s=t),this.test({name:o||"matches",message:s||He.matches,params:{regex:e},skipAbsent:!0,test:a=>a===""&&i||a.search(e)!==-1})}email(e=He.email){return this.matches(Zu,{name:"email",message:e,excludeEmptyString:!0})}url(e=He.url){return this.matches(ef,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=He.uuid){return this.matches(tf,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",i,s;return e&&(typeof e=="object"?{message:t="",allowOffset:i=!1,precision:s=void 0}=e:t=e),this.matches(rf,{name:"datetime",message:t||He.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||He.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:o=>{if(!o||i)return!0;const a=eo(o);return a?!!a.z:!1}}).test({name:"datetime_precision",message:t||He.datetime_precision,params:{precision:s},skipAbsent:!0,test:o=>{if(!o||s==null)return!0;const a=eo(o);return a?a.precision===s:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=He.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:af})}lowercase(e=He.lowercase){return this.transform(t=>an(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>an(t)||t===t.toLowerCase()})}uppercase(e=He.uppercase){return this.transform(t=>an(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>an(t)||t===t.toUpperCase()})}}to.prototype=zr.prototype;let cf=new Date(""),df=n=>Object.prototype.toString.call(n)==="[object Date]";class Qi extends pt{constructor(){super({type:"date",check(e){return df(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t,i)=>!i.spec.coerce||i.isType(e)||e===null?e:(e=Ju(e),isNaN(e)?Qi.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let i;if(rn.isRef(e))i=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);i=s}return i}min(e,t=Js.min){let i=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(i)}})}max(e,t=Js.max){let i=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(i)}})}}Qi.INVALID_DATE=cf,Qi.prototype;function uf(n,e=[]){let t=[],i=new Set,s=new Set(e.map(([a,l])=>`${a}-${l}`));function o(a,l){let c=on.split(a)[0];i.add(c),s.has(`${l}-${c}`)||t.push([l,c])}for(const a of Object.keys(n)){let l=n[a];i.add(a),rn.isRef(l)&&l.isSibling?o(l.path,a):Zs(l)&&"deps"in l&&l.deps.forEach(c=>o(c,a))}return Ru.array(Array.from(i),t).reverse()}function Wr(n,e){let t=1/0;return n.some((i,s)=>{var o;if((o=e.path)!=null&&o.includes(i))return t=s,!0}),t}function Hr(n){return(e,t)=>Wr(n,e)-Wr(n,t)}const ff=(n,e,t)=>{if(typeof n!="string")return n;let i=n;try{i=JSON.parse(n)}catch{}return t.isType(i)?i:n};function Ji(n){if("fields"in n){const e={};for(const[t,i]of Object.entries(n.fields))e[t]=Ji(i);return n.setFields(e)}if(n.type==="array"){const e=n.optional();return e.innerType&&(e.innerType=Ji(e.innerType)),e}return n.type==="tuple"?n.optional().clone({types:n.spec.types.map(Ji)}):"optional"in n?n.optional():n}const hf=(n,e)=>{const t=[...on.normalizePath(e)];if(t.length===1)return t[0]in n;let i=t.pop(),s=on.getter(on.join(t),!0)(n);return!!(s&&i in s)};let Ur=n=>Object.prototype.toString.call(n)==="[object Object]";function qr(n,e){let t=Object.keys(n.fields);return Object.keys(e).filter(i=>t.indexOf(i)===-1)}const mf=Hr([]);function no(n){return new Yr(n)}class Yr extends pt{constructor(e){super({type:"object",check(t){return Ur(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=mf,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var i;let s=super._cast(e,t);if(s===void 0)return this.getDefault(t);if(!this._typeCheck(s))return s;let o=this.fields,a=(i=t.stripUnknown)!=null?i:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(s).filter(f=>!this._nodes.includes(f))),c={},d=Object.assign({},t,{parent:c,__validating:t.__validating||!1}),u=!1;for(const f of l){let h=o[f],m=f in s;if(h){let p,g=s[f];d.path=(t.path?`${t.path}.`:"")+f,h=h.resolve({value:g,context:t.context,parent:c});let y=h instanceof pt?h.spec:void 0,b=y==null?void 0:y.strict;if(y!=null&&y.strip){u=u||f in s;continue}p=!t.__validating||!b?h.cast(s[f],d):s[f],p!==void 0&&(c[f]=p)}else m&&!a&&(c[f]=s[f]);(m!==f in c||c[f]!==s[f])&&(u=!0)}return u?c:s}_validate(e,t={},i,s){let{from:o=[],originalValue:a=e,recursive:l=this.spec.recursive}=t;t.from=[{schema:this,value:a},...o],t.__validating=!0,t.originalValue=a,super._validate(e,t,i,(c,d)=>{if(!l||!Ur(d)){s(c,d);return}a=a||d;let u=[];for(let f of this._nodes){let h=this.fields[f];!h||rn.isRef(h)||u.push(h.asNestedTest({options:t,key:f,parent:d,parentPath:t.path,originalParent:a}))}this.runTests({tests:u,value:d,originalValue:a,options:t},i,f=>{s(f.sort(this._sortErrors).concat(c),d)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),i=t.fields;for(let[s,o]of Object.entries(this.fields)){const a=i[s];i[s]=a===void 0?o:a}return t.withMutation(s=>s.setFields(i,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(i=>{var s;const o=this.fields[i];let a=e;(s=a)!=null&&s.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),t[i]=o&&"getDefault"in o?o.getDefault(a):void 0}),t}setFields(e,t){let i=this.clone();return i.fields=e,i._nodes=uf(e,t),i._sortErrors=Hr(Object.keys(e)),t&&(i._excludedEdges=t),i}shape(e,t=[]){return this.clone().withMutation(i=>{let s=i._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),s=[...i._excludedEdges,...t]),i.setFields(Object.assign(i.fields,e),s)})}partial(){const e={};for(const[t,i]of Object.entries(this.fields))e[t]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(e)}deepPartial(){return Ji(this)}pick(e){const t={};for(const i of e)this.fields[i]&&(t[i]=this.fields[i]);return this.setFields(t,this._excludedEdges.filter(([i,s])=>e.includes(i)&&e.includes(s)))}omit(e){const t=[];for(const i of Object.keys(this.fields))e.includes(i)||t.push(i);return this.pick(t)}from(e,t,i){let s=on.getter(e,!0);return this.transform(o=>{if(!o)return o;let a=o;return hf(o,e)&&(a=Object.assign({},o),i||delete a[e],a[t]=s(o)),a})}json(){return this.transform(ff)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Yi.exact,test(t){if(t==null)return!0;const i=qr(this.schema,t);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=Yi.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:t,test(s){if(s==null)return!0;const o=qr(this.schema,s);return!e||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return i.spec.noUnknown=e,i}unknown(e=!0,t=Yi.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const i={};for(const s of Object.keys(t))i[e(s)]=t[s];return i})}camelCase(){return this.transformKeys(Qs.camelCase)}snakeCase(){return this.transformKeys(Qs.snakeCase)}constantCase(){return this.transformKeys(e=>Qs.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),i=super.describe(e);i.fields={};for(const[o,a]of Object.entries(t.fields)){var s;let l=e;(s=l)!=null&&s.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[o]})),i.fields[o]=a.describe(l)}return i}}no.prototype=Yr.prototype;function io(n,e,t){const i=new sn;let s=r.ref({});const o=r.ref({}),a=r.ref({});let l=r.ref([]);const c=r.ref(null),d=r.ref([]);let u=r.ref([]),f=r.ref(!1);const h=r.ref({});let{handleSubmit:m,errors:p,setErrors:g}=Br();const y=async()=>{var F;try{const P=await i.getEntityRecords(n);P&&P.response&&(s.value=P.response,l.value=(F=P.response.entity.entityDefinition)==null?void 0:F.columns,R(),S(),w())}catch(P){toast.add({severity:"error",summary:"Error",detail:P.errorMessage,life:3e3})}finally{}},b=async()=>{var F;try{const P=await i.getRecord(n,e);P&&P.response&&(s.value=P.response,l.value=(F=P.response.entity.entityDefinition)==null?void 0:F.columns,R(),o.value=JSON.parse(JSON.stringify(P.response.result[0])),w())}catch(P){console.error("Error fetching entity:",P.errorMessage)}finally{}},x=async()=>{var F,P;try{const L=await i.getRelatedEntityRecord(n,e);L&&L.response&&(s.value=L.response,l.value=(P=(F=L.response.entity)==null?void 0:F.entityDefinition)==null?void 0:P.columns,R(),o.value=JSON.parse(JSON.stringify(L.response.result[0])),o.value.entityName&&delete o.value.entityName,o.value.linkedEntities&&delete o.value.linkedEntities,u.value=L.response.result[0].linkedEntities,a.value=JSON.parse(JSON.stringify(o.value)),w())}catch(L){console.error("Error fetching entity:",L.errorMessage)}finally{}},E=async F=>{try{let P=await i.addRecord(n,F);P&&P.response&&t("onSaveDialog",{entityName:n,recordId:e})}catch(P){P.validationErrors&&(d.value=JSON.parse(JSON.stringify(P.validationErrors))),console.error("Error fetching entity:",P.errorMessage)}finally{}},C=async(F,P)=>{try{let L=await i.addRecord(n,P);if(L&&L.response){let H=await i.saveRelatedEntityRecord(n,L.response.recordId,F.linkedEntities);H&&H.response&&t("onSaveDialog",{entityName:n,recordId:e})}}catch(L){L.validationErrors&&(d.value=JSON.parse(JSON.stringify(L.validationErrors))),console.error("Error fetching entity:",L.errorMessage)}finally{}},k=async F=>{try{const P=await i.updateRecord(n,e,F);P&&P.response&&(f.value=!1,a.value=JSON.parse(JSON.stringify(o.value)),t("onSaveDialog",{entityName:n,recordId:e}))}catch(P){P.validationErrors&&(d.value=JSON.parse(JSON.stringify(P.errvalidationErrorsors))),console.error("Error fetching entity:",P.errorMessage)}finally{}},v=async(F,P,L)=>{try{let H=await i.saveRelatedEntityRecord(F,P,L);H&&H.response&&t("onSaveDialog",{entityName:n,enityRecordId:P})}catch(H){H.validationErrors&&(d.value=JSON.parse(JSON.stringify(H.validationErrors))),console.error("Error fetching entity:",H.errorMessage)}finally{}},S=()=>{for(let F=0;F<l.value.length;F++){let P=l.value[F];P.autoGenerated||(o.value[P.name]="")}},_=F=>{let P="";for(let L=0;L<l.value.length;L++){let H=l.value[L];if(F==H.name){P=H.type;break}}return P},D=()=>{const F=l.value.filter(L=>L.autoGenerated).map(L=>L.name);return Object.entries(o.value).filter(([L])=>!F.includes(L)).map(([L,H])=>({recordColumnName:L,recordColumnValue:H,columnType:_(L)}))},B=async(F={})=>{try{await c.value.validate(o.value,{abortEarly:!1}),g({})}catch(L){const H=L.inner.reduce((ie,Q)=>(ie[Q.path]||(ie[Q.path]={messages:[]}),ie[Q.path].messages.push(...Q.errors),ie),{}),te=Object.entries(H).reduce((ie,[Q,J])=>(ie[Q]={messages:J.messages},ie),{});g(te);return}const P={dataDefinitions:D()};e?await k(P):F.relationType=="MANY_TO_ONE"?await C(F,P):await E(P)},w=()=>{c.value=no().shape(l.value.reduce((F,P)=>(P.autoGenerated||(F[P.name]=to().nullable(!1).test({name:"custom-validation",test:function(L){const H=[];let te="";if(P.required&&(!L||L.trim()===""))if(P.validations){te=T(P.validations,"VALIDATE_REQUIRED"),H.push(te);let ie=X(P.validations,"VALIDATE_REQUIRED");ie&&(ie="hint:"+ie,H.push(ie))}else te=P.displayName+" is required.",H.push(te);else{if(P.maxLength&&L.length>P.maxLength)if(P.validations){te=T(P.validations,"VALIDATE_MAXLENGTH"),H.push(te);let ie=X(P.validations,"VALIDATE_MAXLENGTH");ie&&(ie="hint:"+ie,H.push(ie))}else te=P.displayName+" cannot exceed from "+P.maxLength+" characters",H.push(te);if(P.regxId&&!new RegExp(I(P.validations,"VALIDATE_REGX")).test(L))if(P.validations){te=T(P.validations,"VALIDATE_REGX"),H.push(te);let ie=X(P.validations,"VALIDATE_REGX");ie&&(ie="hint:"+ie,H.push(ie))}else te=P.displayName+" invalid format.",H.push(te)}return H.length>0?this.createError({message:H}):!0}})),F),{}))},T=(F,P)=>{for(let L=0;L<F.length;L++)if(P==F[L].type)return F[L].message},I=(F,P)=>{for(let L=0;L<F.length;L++)if(P==F[L].type)return F[L].regx},X=(F,P)=>{for(let L=0;L<F.length;L++)if(P==F[L].type)return F[L].hint},q=F=>{g({...p.value,[F]:null}),f.value=!0},$=()=>{f.value=!1;for(let F in o.value)o.value.hasOwnProperty(F)&&g({...p.value,[F]:null});o.value=JSON.parse(JSON.stringify(a.value))},R=()=>{for(let F=0;F<l.value.length;F++){const P=l.value[F];if(P.primaryKey&&P.primaryKey==!0){h.value=P;break}}};return{formData:o,columns:l,errors:p,backendErrors:d,isDataChange:f,linkedEntities:u,primarayKeyColumn:h,clearErrors:q,saveRecord:B,fetchAllRecords:y,fetchRecord:b,getRelatedEntityRecordById:x,cancleRecord:$,saveRelatedEntityRecord:v}}const pf={key:0,class:"surface-card"},gf={class:"info"},yf={key:0,class:"list-none p-0"},Kr={__name:"EntityFormErrors",props:{errors:Array},setup(n){let e=r.ref(!0);const t=()=>{e.value=!e.value};return(i,s)=>{var a;const o=r.resolveComponent("Message");return((a=n.errors)==null?void 0:a.length)>0?(r.openBlock(),r.createElementBlock("div",pf,[s[1]||(s[1]=r.createElementVNode("h4",{class:"flex-1 font-bold text-red-500"},"Errors",-1)),r.createElementVNode("div",gf,[r.createElementVNode("span",{onClick:s[0]||(s[0]=l=>t()),class:"cursor-pointer underline showHideColor"},r.toDisplayString(r.unref(e)?"Hide":"Show"),1)]),r.unref(e)?(r.openBlock(),r.createElementBlock("ul",yf,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.errors,(l,c)=>(r.openBlock(),r.createElementBlock("li",{key:c,class:"mb-2"},[r.createVNode(o,{style:{"word-break":"break-all"},closable:!1,severity:"error"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(l.message),1)]),_:2},1024)]))),128))])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)}}},bf={class:"field flex flex-col"},xf=["for"],_f={key:0,class:"flex items-center"},kf={key:1},Sf={class:"flex items-center"},Xr={__name:"EntitySelection",props:{modelValue:{required:!0},entityName:{type:String,required:!0},columnName:{type:String,required:!0},relatedEntityColumn:{type:String,required:!0}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=new sn,s=r.ref({});let o=r.ref("");const a=e;r.onMounted(()=>{l()});const l=async()=>{try{const u=await i.getEntityRecords(t.entityName);u&&u.response&&(s.value=u.response,d())}catch{}finally{}},c=()=>{a("update:modelValue",o.value[t.relatedEntityColumn])},d=()=>{for(let u=0;u<s.value.result.length;u++){const f=s.value.result[u];if(f[t.relatedEntityColumn]==t.modelValue){o.value=f;break}}};return(u,f)=>{const h=r.resolveComponent("Select");return r.openBlock(),r.createElementBlock("div",bf,[r.createElementVNode("label",{for:n.columnName},r.toDisplayString(n.columnName),9,xf),r.createVNode(h,{modelValue:r.unref(o),"onUpdate:modelValue":[f[0]||(f[0]=m=>r.isRef(o)?o.value=m:o=m),c],"item-value":n.relatedEntityColumn,options:s.value.result,filter:"",optionLabel:n.relatedEntityColumn,placeholder:"Select "+n.relatedEntityColumn,class:"w-full"},{value:r.withCtx(m=>[m.value?(r.openBlock(),r.createElementBlock("div",_f,[r.createElementVNode("div",null,r.toDisplayString(m.value[n.relatedEntityColumn]),1)])):(r.openBlock(),r.createElementBlock("span",kf,r.toDisplayString(m.placeholder),1))]),option:r.withCtx(m=>[r.createElementVNode("div",Sf,[r.createElementVNode("div",null,r.toDisplayString(m.option[n.relatedEntityColumn]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"])])}}},wf={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},Ef={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},Cf={__name:"EntityDialog",props:r.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showForm:{},showFormModifiers:{}}),emits:r.mergeModels(["onSaveDialog"],["update:showForm"]),setup(n,{emit:e}){const t=r.useModel(n,"showForm"),i=e,{formData:s,columns:o,errors:a,backendErrors:l,clearErrors:c,saveRecord:d,fetchAllRecords:u,fetchRecord:f}=io(n.entityName,n.recordId,i);return r.onMounted(()=>{n.recordId?f():u()}),(h,m)=>{const p=r.resolveComponent("Button"),g=r.resolveComponent("Dialog");return t.value?(r.openBlock(),r.createBlock(g,{key:0,showFooter:!1,visible:t.value,"onUpdate:visible":m[2]||(m[2]=y=>t.value=y),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:r.withCtx(()=>[n.recordId?(r.openBlock(),r.createElementBlock("span",wf,"Edit "+r.toDisplayString(n.entityName)+" record details",1)):r.createCommentVNode("",!0),n.recordId?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Ef,"Add "+r.toDisplayString(n.entityName)+" record details",1))]),footer:r.withCtx(()=>[r.createVNode(p,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:m[0]||(m[0]=y=>t.value=!1)}),r.createVNode(p,{type:"button",icon:"",label:"Save",severity:"success",onClick:m[1]||(m[1]=y=>r.unref(d)())})]),default:r.withCtx(()=>{var y;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(o),(b,x)=>{var E;return r.openBlock(),r.createElementBlock("div",{key:x},[!b.autoGenerated&&!b.foreignKey?(r.openBlock(),r.createBlock(ji,{key:0,modelValue:r.unref(s)[b.name],"onUpdate:modelValue":C=>r.unref(s)[b.name]=C,column:b,errors:(E=r.unref(a)[b.name])==null?void 0:E.messages,onInput:r.unref(c)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):r.createCommentVNode("",!0),!b.autoGenerated&&b.foreignKey?(r.openBlock(),r.createBlock(Xr,{key:1,modelValue:r.unref(s)[b.name],"onUpdate:modelValue":C=>r.unref(s)[b.name]=C,entityName:b.foreignKey.referencedEntityName,columnName:b.name,relatedEntityColumn:b.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):r.createCommentVNode("",!0)])}),128)),((y=r.unref(l))==null?void 0:y.length)>0?(r.openBlock(),r.createBlock(Kr,{key:0,errors:r.unref(l)},null,8,["errors"])):r.createCommentVNode("",!0)]}),_:1},8,["visible"])):r.createCommentVNode("",!0)}}},vf={__name:"DeleteConfirmationDialog",props:r.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showDeleteDialog:{},showDeleteDialogModifiers:{}}),emits:r.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(n,{emit:e}){const t=new sn,i=r.useModel(n,"showDeleteDialog"),s=e,o=async()=>{try{const a=await t.deleteRecord(n.entityName,n.recordId);a&&a.response&&s("onDeleteItem")}catch(a){console.error("Error deleting record:",a.errorMessage)}finally{}};return(a,l)=>{const c=r.resolveComponent("Button"),d=r.resolveComponent("Dialog");return r.openBlock(),r.createBlock(d,{visible:i.value,"onUpdate:visible":l[1]||(l[1]=u=>i.value=u),style:{width:"450px"},header:"Confirm",modal:!0},{footer:r.withCtx(()=>[r.createVNode(c,{label:"No",icon:"pi pi-times",text:"",onClick:l[0]||(l[0]=u=>i.value=!1)}),r.createVNode(c,{label:"Yes",icon:"pi pi-check",text:"",onClick:o})]),default:r.withCtx(()=>[l[2]||(l[2]=r.createElementVNode("div",{class:"flex items-center justify-center"},[r.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),r.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}};function so(n){return n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0}function Gr(n){return!!(n&&n.constructor&&n.call&&n.apply)}function we(n){return!so(n)}function Cn(n,e=!0){return n instanceof Object&&n.constructor===Object&&(e||Object.keys(n).length!==0)}function rt(n,...e){return Gr(n)?n(...e):n}function gt(n,e=!0){return typeof n=="string"&&(e||n!=="")}function Rt(n){return gt(n)?n.replace(/(-|_)/g,"").toLowerCase():n}function Qr(n,e="",t={}){const i=Rt(e).split("."),s=i.shift();return s?Cn(n)?Qr(rt(n[Object.keys(n).find(o=>Rt(o)===s)||""],t),i.join("."),t):void 0:rt(n,t)}function oo(n,e=!0){return Array.isArray(n)&&(e||n.length!==0)}function Df(n){return we(n)&&!isNaN(n)}function vt(n,e){if(e){const t=e.test(n);return e.lastIndex=0,t}return!1}function Wn(n){return n&&n.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":")}function Jr(n){return gt(n)?n.replace(/(_)/g,"-").replace(/[A-Z]/g,(e,t)=>t===0?e:"-"+e.toLowerCase()).toLowerCase():n}function Zr(n){return gt(n)?n.replace(/[A-Z]/g,(e,t)=>t===0?e:"."+e.toLowerCase()).toLowerCase():n}var vn={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},Of={AND:"and",OR:"or"};const Nf={key:0},Tf={key:1},ro={__name:"RecordColumnRenderer",props:{column:Object,value:null},setup(n){const e=r.ref(null),t=Object.assign({"/src/directives/dateFormat.js":()=>Promise.resolve().then(()=>Bb),"/src/directives/textFormatUpperCase.js":()=>Promise.resolve().then(()=>Mb)});async function i(){await r.nextTick();const s=t[`/src/directives/${n.column.displayFormatKey}.js`];s&&e.value&&s().then(o=>{o.default.beforeMount(e.value,{value:n.value,arg:n.column.displayFormat})})}return r.onMounted(()=>{i()}),r.onUpdated(()=>{i()}),(s,o)=>n.column.displayFormatKey?(r.openBlock(),r.createElementBlock("span",Nf,[r.createElementVNode("span",{ref_key:"el",ref:e},r.toDisplayString(n.value),513)])):(r.openBlock(),r.createElementBlock("span",Tf,r.toDisplayString(n.value),1))}};class Pf{constructor(){this.httpService=new mr}async getEntities(){return await this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity`)}getEntity(e){}saveEntity(){}async getAppId(){const e=Ze();this.appId=e.getAppId()}}const ea=hr("entitiesStore",{state:()=>({entities:[],entityService:new Pf}),actions:{async fetchEntities(){try{return await this.entityService.getEntities()}catch(n){console.error("Error fetching entities:",n)}finally{}},async getEntities(){if(this.entities.length===0){const n=await this.fetchEntities();return this.setEntities(n.response),this.entities}else return this.entities},setEntities(n){this.entities=n}},getters:{}}),Bf={class:"field flex flex-col w-full"},Mf={key:0,class:"flex items-center"},Vf={key:1},Af={class:"flex items-center"},ta={__name:"EntityExplorer",props:{entityName:String,onEntityChangeCallback:Function},setup(n){const e=Ze(),t=r.ref(""),i=ea(),s=r.ref([]),o=async()=>{s.value=await i.getEntities(),a()},a=()=>{for(let c=0;c<s.value.length;c++){const d=s.value[c];d.name.toLowerCase()==n.entityName.toLowerCase()&&(t.value=d)}},l=()=>{n.onEntityChangeCallback(t.value.name)};return r.watch(()=>e.globalConfigs.appId,async c=>{c&&await o()},{immediate:!0}),(c,d)=>{const u=r.resolveComponent("Select");return r.openBlock(),r.createElementBlock("div",Bf,[r.createVNode(u,{modelValue:t.value,"onUpdate:modelValue":[d[0]||(d[0]=f=>t.value=f),l],options:s.value,filter:"",optionLabel:"name",placeholder:"Select entity",class:"w-full"},{value:r.withCtx(f=>[f.value?(r.openBlock(),r.createElementBlock("div",Mf,[r.createElementVNode("div",null,r.toDisplayString(f.value.name),1)])):(r.openBlock(),r.createElementBlock("span",Vf,r.toDisplayString(f.placeholder),1))]),option:r.withCtx(f=>[r.createElementVNode("div",Af,[r.createElementVNode("div",null,r.toDisplayString(f.option.name),1)])]),_:1},8,["modelValue","options"])])}}},Ff={class:"card"},$f={class:"my-2"},If={class:"flex flex-col md:flex-row md:justify-between md:items-center"},Lf={class:"flex flex-row gap-2"},na={__name:"Grid",props:{entityName:String,showAddButton:Boolean,showClearFilters:Boolean,columnsToShow:Array,editable:Boolean,deleteable:Boolean,showPagination:Boolean},setup(n){const e=Ze(),t=n;console.log("columnsToShow",t.columnsToShow);const i=Je.useRoute(),s=r.ref(t.entityName||i.params.entityName),o=r.ref({}),a=r.ref(""),l=r.ref(!1),c=r.ref(!1),{items:d,headers:u,first:f,totalRecords:h,pageSize:m,loading:p,sortBy:g,sortDirection:y,operatorMap:b,filterToSend:x,primarayKeyColumn:E,fullTextSearch:C,listingResponse:k,onFullTextSearch:v,getDatatypeByField:S,getColumnDatatype:_,onSort:D,onPage:B,onFilter:w,fetchEntityFilterData:T,fetchEntityByName:I}=Yd(s.value),X=r.ref();let q=r.ref(!1);const $=Q=>{o.value=Q.reduce((J,se)=>{if(!se.filterable)return J;let de=vn.CONTAINS;switch(se.datatype.toLowerCase()){case"string":case"uuid":de=vn.STARTS_WITH;break;case"date":de=vn.DATE_IS;break;case"numeric":case"int":case"integer":de=vn.EQUALS;break;case"bool":case"boolean":de=vn.EQUALS;break}return se.datatype=="bool"||se.datatype=="boolean"?J[se.field]={value:null,matchMode:vn.EQUALS}:J[se.field]={operator:Of.AND,constraints:[{value:null,matchMode:de}]},J},{})},R=()=>{$(u.value),x.value=ie(o.value),w()},F=Q=>{x.value=ie(o.value),w()},P=Q=>{Q?a.value=Q[E.value.name]:a.value="",l.value=!l.value},L=()=>{l.value=!1,T(!1)},H=Q=>{a.value=Q[E.value.name],c.value=!0},te=()=>{c.value=!1,T(!1)},ie=Q=>Object.keys(Q).map(J=>{const se=Q[J];return se.constraints?se.constraints.filter(de=>de.value!==null&&de.value!=="").map(de=>({columnName:J,operator:b[de.matchMode]??de.matchMode,value:de.value,columnType:S(J)})):se.value!==null&&se.value!==""?{columnName:J,operator:b[se.matchMode]??se.matchMode,value:se.value,columnType:S(J)}:[]}).flat();return r.watch(()=>e.globalConfigs.appId,async Q=>{Q&&I(s.value)},{immediate:!0}),r.watch(()=>u.value,Q=>{!q.value&&Q&&Q.length&&($(Q),q.value=!0)},{immediate:!0}),(Q,J)=>{const se=r.resolveComponent("Button"),de=r.resolveComponent("Toolbar"),Ce=r.resolveComponent("ProgressSpinner"),Qe=r.resolveComponent("InputIcon"),ze=r.resolveComponent("IconField"),ft=r.resolveComponent("Calendar"),it=r.resolveComponent("InputNumber"),W=r.resolveComponent("Checkbox"),A=r.resolveComponent("Column"),ue=r.resolveComponent("DataTable");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Ff,[r.renderSlot(Q.$slots,"header"),n.showClearFilters||n.showAddButton?(r.openBlock(),r.createBlock(de,{key:0,class:"mb-4 mt-4"},r.createSlots({_:2},[n.showClearFilters?{name:"start",fn:r.withCtx(()=>[r.createElementVNode("div",$f,[r.createVNode(se,{type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warning",onClick:J[0]||(J[0]=he=>R())})])]),key:"0"}:void 0,n.showAddButton?{name:"end",fn:r.withCtx(()=>[r.createVNode(se,{label:"Add",icon:"pi pi-plus",class:"mr-2",severity:"success",onClick:J[1]||(J[1]=he=>P())})]),key:"1"}:void 0]),1024)):r.createCommentVNode("",!0),r.createVNode(ue,{lazy:"",value:r.unref(d),loading:r.unref(p),ref_key:"dt",ref:X,stripedRows:!0,showGridlines:"",rowHover:!0,paginator:n.showPagination,rows:r.unref(m),rowsPerPageOptions:[10,25,50,100],totalRecords:r.unref(h),first:r.unref(f),sortField:r.unref(g),sortOrder:r.unref(y),filters:o.value,"onUpdate:filters":J[5]||(J[5]=he=>o.value=he),filterDisplay:"menu",scrollable:"",scrollHeight:"400px",onSort:r.unref(D),onPage:r.unref(B),onFilter:J[6]||(J[6]=he=>F()),size:"large",paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},{empty:r.withCtx(()=>J[9]||(J[9]=[r.createTextVNode(" No data found. ")])),loading:r.withCtx(()=>[r.createVNode(Ce)]),header:r.withCtx(()=>[r.createElementVNode("div",If,[r.createVNode(ze,{iconPosition:"left",class:"block mt-2 md:mt-0"},{default:r.withCtx(()=>[r.createVNode(Qe,{class:"pi pi-search",onClick:J[2]||(J[2]=he=>r.unref(v)())}),r.createVNode(r.unref(ar.InputText),{class:"w-full sm:w-auto",onKeyup:J[3]||(J[3]=r.withKeys(he=>r.unref(v)(),["enter"])),modelValue:r.unref(C),"onUpdate:modelValue":J[4]||(J[4]=he=>r.isRef(C)?C.value=he:null),placeholder:"Search..."},null,8,["modelValue"])]),_:1})])]),default:r.withCtx(()=>{var he;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(u).filter(fe=>!t.columnsToShow||t.columnsToShow.length===0||t.columnsToShow.includes(fe.field)),fe=>(r.openBlock(),r.createBlock(A,{key:fe.field,dataType:r.unref(_)(fe.datatype),field:fe.field,header:fe.name,sortable:fe.sortable,showAddButton:!1,showFilterOperator:!1,style:{"text-wrap":"nowrap"}},r.createSlots({body:r.withCtx(({data:me})=>[r.createVNode(ro,{column:fe,value:me[fe.field]},null,8,["column","value"])]),_:2},[fe.datatype.toLowerCase()==="date"&&fe.filterable?{name:"filter",fn:r.withCtx(({filterModel:me})=>[r.createVNode(ft,{modelValue:me.value,"onUpdate:modelValue":De=>me.value=De,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])]),key:"0"}:fe.datatype.toLowerCase()==="int"&&fe.filterable?{name:"filter",fn:r.withCtx(({filterModel:me})=>[r.createVNode(it,{modelValue:me.value,"onUpdate:modelValue":De=>me.value=De,placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"1"}:fe.datatype.toLowerCase()==="boolean"&&fe.filterable?{name:"filter",fn:r.withCtx(({filterModel:me})=>[r.createVNode(W,{modelValue:me.value,"onUpdate:modelValue":De=>me.value=De,indeterminate:me.value===null,binary:""},null,8,["modelValue","onUpdate:modelValue","indeterminate"])]),key:"2"}:fe.filterable?{name:"filter",fn:r.withCtx(({filterModel:me})=>[r.createVNode(r.unref(ar.InputText),{style:{width:"150px"},type:"text",modelValue:me.value,"onUpdate:modelValue":De=>me.value=De,class:"p-column-filter",placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"3"}:void 0]),1032,["dataType","field","header","sortable"]))),128)),((he=r.unref(d))==null?void 0:he.length)>0&&(n.editable||n.deleteable)?(r.openBlock(),r.createBlock(A,{key:0,header:"Actions"},{body:r.withCtx(({data:fe})=>[r.createElementVNode("div",Lf,[n.editable?(r.openBlock(),r.createBlock(se,{key:0,onClick:me=>P(fe),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"},null,8,["onClick"])):r.createCommentVNode("",!0),n.deleteable?(r.openBlock(),r.createBlock(se,{key:1,onClick:me=>H(fe),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"},null,8,["onClick"])):r.createCommentVNode("",!0)])]),_:1})):r.createCommentVNode("",!0)]}),_:1},8,["value","loading","paginator","rows","totalRecords","first","sortField","sortOrder","filters","onSort","onPage"]),r.renderSlot(Q.$slots,"footer")]),l.value?(r.openBlock(),r.createBlock(Cf,{key:0,showForm:l.value,"onUpdate:showForm":J[7]||(J[7]=he=>l.value=he),entityName:r.unref(k).entityName,recordId:a.value,onOnSaveDialog:L},null,8,["showForm","entityName","recordId"])):r.createCommentVNode("",!0),c.value?(r.openBlock(),r.createBlock(vf,{key:1,showDeleteDialog:c.value,"onUpdate:showDeleteDialog":J[8]||(J[8]=he=>c.value=he),entityName:r.unref(k).entityName,recordId:a.value,onOnDeleteItem:te},null,8,["showDeleteDialog","entityName","recordId"])):r.createCommentVNode("",!0)],64)}}};function Rf(){const n=new Map;return{on(e,t){let i=n.get(e);return i?i.push(t):i=[t],n.set(e,i),this},off(e,t){let i=n.get(e);return i&&i.splice(i.indexOf(t)>>>0,1),this},emit(e,t){let i=n.get(e);i&&i.slice().map(s=>{s(t)})},clear(){n.clear()}}}var jf=Object.defineProperty,zf=Object.defineProperties,Wf=Object.getOwnPropertyDescriptors,Zi=Object.getOwnPropertySymbols,ia=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,oa=(n,e,t)=>e in n?jf(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,at=(n,e)=>{for(var t in e||(e={}))ia.call(e,t)&&oa(n,t,e[t]);if(Zi)for(var t of Zi(e))sa.call(e,t)&&oa(n,t,e[t]);return n},ao=(n,e)=>zf(n,Wf(e)),Dt=(n,e)=>{var t={};for(var i in n)ia.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&Zi)for(var i of Zi(n))e.indexOf(i)<0&&sa.call(n,i)&&(t[i]=n[i]);return t},Hf=Rf(),jt=Hf;function ra(n,e){oo(n)?n.push(...e||[]):Cn(n)&&Object.assign(n,e)}function Uf(n){return Cn(n)&&n.hasOwnProperty("value")&&n.hasOwnProperty("type")?n.value:n}function qf(n){return n.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function lo(n="",e=""){return qf(`${gt(n,!1)&&gt(e,!1)?`${n}-`:n}${e}`)}function aa(n="",e=""){return`--${lo(n,e)}`}function Yf(n=""){const e=(n.match(/{/g)||[]).length,t=(n.match(/}/g)||[]).length;return(e+t)%2!==0}function la(n,e="",t="",i=[],s){if(gt(n)){const o=/{([^}]*)}/g,a=n.trim();if(Yf(a))return;if(vt(a,o)){const l=a.replaceAll(o,u=>{const h=u.replace(/{|}/g,"").split(".").filter(m=>!i.some(p=>vt(m,p)));return`var(${aa(t,Jr(h.join("-")))}${we(s)?`, ${s}`:""})`}),c=/(\d+\s+[\+\-\*\/]\s+\d+)/g,d=/var\([^)]+\)/g;return vt(l.replace(d,"0"),c)?`calc(${l})`:l}return a}else if(Df(n))return n}function Kf(n,e,t){gt(e,!1)&&n.push(`${e}:${t};`)}function Dn(n,e){return n?`${n}{${e}}`:""}var Hn=(...n)=>Xf(Me.getTheme(),...n),Xf=(n={},e,t,i)=>{if(e){const{variable:s,options:o}=Me.defaults||{},{prefix:a,transform:l}=(n==null?void 0:n.options)||o||{},d=vt(e,/{([^}]*)}/g)?e:`{${e}}`;return i==="value"||so(i)&&l==="strict"?Me.getTokenValue(e):la(d,void 0,a,[s.excludedKeyRegex],t)}return""};function Gf(n,e={}){const t=Me.defaults.variable,{prefix:i=t.prefix,selector:s=t.selector,excludedKeyRegex:o=t.excludedKeyRegex}=e,a=(d,u="")=>Object.entries(d).reduce((f,[h,m])=>{const p=vt(h,o)?lo(u):lo(u,Jr(h)),g=Uf(m);if(Cn(g)){const{variables:y,tokens:b}=a(g,p);ra(f.tokens,b),ra(f.variables,y)}else f.tokens.push((i?p.replace(`${i}-`,""):p).replaceAll("-",".")),Kf(f.variables,aa(p),la(g,p,i,[o]));return f},{variables:[],tokens:[]}),{variables:l,tokens:c}=a(n,i);return{value:l,tokens:c,declarations:l.join(""),css:Dn(s,l.join(""))}}var lt={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(n){return{type:"class",selector:n,matched:this.pattern.test(n.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(n){return{type:"attr",selector:`:root${n}`,matched:this.pattern.test(n.trim())}}},media:{pattern:/^@media (.*)$/,resolve(n){return{type:"media",selector:`${n}{:root{[CSS]}}`,matched:this.pattern.test(n.trim())}}},system:{pattern:/^system$/,resolve(n){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(n.trim())}}},custom:{resolve(n){return{type:"custom",selector:n,matched:!0}}}},resolve(n){const e=Object.keys(this.rules).filter(t=>t!=="custom").map(t=>this.rules[t]);return[n].flat().map(t=>{var i;return(i=e.map(s=>s.resolve(t)).find(s=>s.matched))!=null?i:this.rules.custom.resolve(t)})}},_toVariables(n,e){return Gf(n,{prefix:e==null?void 0:e.prefix})},getCommon({name:n="",theme:e={},params:t,set:i,defaults:s}){var o,a,l,c,d,u,f;const{preset:h,options:m}=e;let p,g,y,b,x,E,C;if(we(h)&&m.transform!=="strict"){const{primitive:k,semantic:v,extend:S}=h,_=v||{},{colorScheme:D}=_,B=Dt(_,["colorScheme"]),w=S||{},{colorScheme:T}=w,I=Dt(w,["colorScheme"]),X=D||{},{dark:q}=X,$=Dt(X,["dark"]),R=T||{},{dark:F}=R,P=Dt(R,["dark"]),L=we(k)?this._toVariables({primitive:k},m):{},H=we(B)?this._toVariables({semantic:B},m):{},te=we($)?this._toVariables({light:$},m):{},ie=we(q)?this._toVariables({dark:q},m):{},Q=we(I)?this._toVariables({semantic:I},m):{},J=we(P)?this._toVariables({light:P},m):{},se=we(F)?this._toVariables({dark:F},m):{},[de,Ce]=[(o=L.declarations)!=null?o:"",L.tokens],[Qe,ze]=[(a=H.declarations)!=null?a:"",H.tokens||[]],[ft,it]=[(l=te.declarations)!=null?l:"",te.tokens||[]],[W,A]=[(c=ie.declarations)!=null?c:"",ie.tokens||[]],[ue,he]=[(d=Q.declarations)!=null?d:"",Q.tokens||[]],[fe,me]=[(u=J.declarations)!=null?u:"",J.tokens||[]],[De,Ye]=[(f=se.declarations)!=null?f:"",se.tokens||[]];p=this.transformCSS(n,de,"light","variable",m,i,s),g=Ce;const St=this.transformCSS(n,`${Qe}${ft}`,"light","variable",m,i,s),Ae=this.transformCSS(n,`${W}`,"dark","variable",m,i,s);y=`${St}${Ae}`,b=[...new Set([...ze,...it,...A])];const Ke=this.transformCSS(n,`${ue}${fe}color-scheme:light`,"light","variable",m,i,s),st=this.transformCSS(n,`${De}color-scheme:dark`,"dark","variable",m,i,s);x=`${Ke}${st}`,E=[...new Set([...he,...me,...Ye])],C=rt(h.css,{dt:Hn})}return{primitive:{css:p,tokens:g},semantic:{css:y,tokens:b},global:{css:x,tokens:E},style:C}},getPreset({name:n="",preset:e={},options:t,params:i,set:s,defaults:o,selector:a}){var l,c,d;let u,f,h;if(we(e)&&t.transform!=="strict"){const m=n.replace("-directive",""),p=e,{colorScheme:g,extend:y,css:b}=p,x=Dt(p,["colorScheme","extend","css"]),E=y||{},{colorScheme:C}=E,k=Dt(E,["colorScheme"]),v=g||{},{dark:S}=v,_=Dt(v,["dark"]),D=C||{},{dark:B}=D,w=Dt(D,["dark"]),T=we(x)?this._toVariables({[m]:at(at({},x),k)},t):{},I=we(_)?this._toVariables({[m]:at(at({},_),w)},t):{},X=we(S)?this._toVariables({[m]:at(at({},S),B)},t):{},[q,$]=[(l=T.declarations)!=null?l:"",T.tokens||[]],[R,F]=[(c=I.declarations)!=null?c:"",I.tokens||[]],[P,L]=[(d=X.declarations)!=null?d:"",X.tokens||[]],H=this.transformCSS(m,`${q}${R}`,"light","variable",t,s,o,a),te=this.transformCSS(m,P,"dark","variable",t,s,o,a);u=`${H}${te}`,f=[...new Set([...$,...F,...L])],h=rt(b,{dt:Hn})}return{css:u,tokens:f,style:h}},getPresetC({name:n="",theme:e={},params:t,set:i,defaults:s}){var o;const{preset:a,options:l}=e,c=(o=a==null?void 0:a.components)==null?void 0:o[n];return this.getPreset({name:n,preset:c,options:l,params:t,set:i,defaults:s})},getPresetD({name:n="",theme:e={},params:t,set:i,defaults:s}){var o;const a=n.replace("-directive",""),{preset:l,options:c}=e,d=(o=l==null?void 0:l.directives)==null?void 0:o[a];return this.getPreset({name:a,preset:d,options:c,params:t,set:i,defaults:s})},applyDarkColorScheme(n){return!(n.darkModeSelector==="none"||n.darkModeSelector===!1)},getColorSchemeOption(n,e){var t;return this.applyDarkColorScheme(n)?this.regex.resolve(n.darkModeSelector===!0?e.options.darkModeSelector:(t=n.darkModeSelector)!=null?t:e.options.darkModeSelector):[]},getLayerOrder(n,e={},t,i){const{cssLayer:s}=e;return s?`@layer ${rt(s.order||"primeui",t)}`:""},getCommonStyleSheet({name:n="",theme:e={},params:t,props:i={},set:s,defaults:o}){const a=this.getCommon({name:n,theme:e,params:t,set:s,defaults:o}),l=Object.entries(i).reduce((c,[d,u])=>c.push(`${d}="${u}"`)&&c,[]).join(" ");return Object.entries(a||{}).reduce((c,[d,u])=>{if(u!=null&&u.css){const f=Wn(u==null?void 0:u.css),h=`${d}-variables`;c.push(`<style type="text/css" data-primevue-style-id="${h}" ${l}>${f}</style>`)}return c},[]).join("")},getStyleSheet({name:n="",theme:e={},params:t,props:i={},set:s,defaults:o}){var a;const l={name:n,theme:e,params:t,set:s,defaults:o},c=(a=n.includes("-directive")?this.getPresetD(l):this.getPresetC(l))==null?void 0:a.css,d=Object.entries(i).reduce((u,[f,h])=>u.push(`${f}="${h}"`)&&u,[]).join(" ");return c?`<style type="text/css" data-primevue-style-id="${n}-variables" ${d}>${Wn(c)}</style>`:""},createTokens(n={},e,t="",i="",s={}){return Object.entries(n).forEach(([o,a])=>{const l=vt(o,e.variable.excludedKeyRegex)?t:t?`${t}.${Zr(o)}`:Zr(o),c=i?`${i}.${o}`:o;Cn(a)?this.createTokens(a,e,l,c,s):(s[l]||(s[l]={paths:[],computed(d,u={}){var f,h;return this.paths.length===1?(f=this.paths[0])==null?void 0:f.computed(this.paths[0].scheme,u.binding):d&&d!=="none"?(h=this.paths.find(m=>m.scheme===d))==null?void 0:h.computed(d,u.binding):this.paths.map(m=>m.computed(m.scheme,u[m.scheme]))}}),s[l].paths.push({path:c,value:a,scheme:c.includes("colorScheme.light")?"light":c.includes("colorScheme.dark")?"dark":"none",computed(d,u={}){const f=/{([^}]*)}/g;let h=a;if(u.name=this.path,u.binding||(u.binding={}),vt(a,f)){const p=a.trim().replaceAll(f,b=>{var x;const E=b.replace(/{|}/g,""),C=(x=s[E])==null?void 0:x.computed(d,u);return oo(C)&&C.length===2?`light-dark(${C[0].value},${C[1].value})`:C==null?void 0:C.value}),g=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,y=/var\([^)]+\)/g;h=vt(p.replace(y,"0"),g)?`calc(${p})`:p}return so(u.binding)&&delete u.binding,{colorScheme:d,path:this.path,paths:u,value:h.includes("undefined")?void 0:h}}}))}),s},getTokenValue(n,e,t){var i;const o=(c=>c.split(".").filter(u=>!vt(u.toLowerCase(),t.variable.excludedKeyRegex)).join("."))(e),a=e.includes("colorScheme.light")?"light":e.includes("colorScheme.dark")?"dark":void 0,l=[(i=n[o])==null?void 0:i.computed(a)].flat().filter(c=>c);return l.length===1?l[0].value:l.reduce((c={},d)=>{const u=d,{colorScheme:f}=u,h=Dt(u,["colorScheme"]);return c[f]=h,c},void 0)},getSelectorRule(n,e,t,i){return t==="class"||t==="attr"?Dn(we(e)?`${n}${e},${n} ${e}`:n,i):Dn(n,we(e)?Dn(e,i):i)},transformCSS(n,e,t,i,s={},o,a,l){if(we(e)){const{cssLayer:c}=s;if(i!=="style"){const d=this.getColorSchemeOption(s,a);e=t==="dark"?d.reduce((u,{type:f,selector:h})=>(we(h)&&(u+=h.includes("[CSS]")?h.replace("[CSS]",e):this.getSelectorRule(h,l,f,e)),u),""):Dn(l??":root",e)}if(c){const d={name:"primeui",order:"primeui"};Cn(c)&&(d.name=rt(c.name,{name:n,type:i})),we(d.name)&&(e=Dn(`@layer ${d.name}`,e),o==null||o.layerNames(d.name))}return e}return""}},Me={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(n={}){const{theme:e}=n;e&&(this._theme=ao(at({},e),{options:at(at({},this.defaults.options),e.options)}),this._tokens=lt.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var n;return((n=this.theme)==null?void 0:n.preset)||{}},get options(){var n;return((n=this.theme)==null?void 0:n.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(n){this.update({theme:n}),jt.emit("theme:change",n)},getPreset(){return this.preset},setPreset(n){this._theme=ao(at({},this.theme),{preset:n}),this._tokens=lt.createTokens(n,this.defaults),this.clearLoadedStyleNames(),jt.emit("preset:change",n),jt.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(n){this._theme=ao(at({},this.theme),{options:n}),this.clearLoadedStyleNames(),jt.emit("options:change",n),jt.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(n){this._layerNames.add(n)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(n){return this._loadedStyleNames.has(n)},setLoadedStyleName(n){this._loadedStyleNames.add(n)},deleteLoadedStyleName(n){this._loadedStyleNames.delete(n)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(n){return lt.getTokenValue(this.tokens,n,this.defaults)},getCommon(n="",e){return lt.getCommon({name:n,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(n="",e){const t={name:n,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return lt.getPresetC(t)},getDirective(n="",e){const t={name:n,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return lt.getPresetD(t)},getCustomPreset(n="",e,t,i){const s={name:n,preset:e,options:this.options,selector:t,params:i,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return lt.getPreset(s)},getLayerOrderCSS(n=""){return lt.getLayerOrder(n,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(n="",e,t="style",i){return lt.transformCSS(n,e,i,t,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(n="",e,t={}){return lt.getCommonStyleSheet({name:n,theme:this.theme,params:e,props:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(n,e,t={}){return lt.getStyleSheet({name:n,theme:this.theme,params:e,props:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(n){this._loadingStyles.add(n)},onStyleUpdated(n){this._loadingStyles.add(n)},onStyleLoaded(n,{name:e}){this._loadingStyles.size&&(this._loadingStyles.delete(e),jt.emit(`theme:${e}:load`,n),!this._loadingStyles.size&&jt.emit("theme:load"))}};function co(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n!==null&&n.nodeType===1&&typeof n.nodeName=="string"}function uo(n,e={}){if(co(n)){const t=(i,s)=>{var o,a;const l=(o=n==null?void 0:n.$attrs)!=null&&o[i]?[(a=n==null?void 0:n.$attrs)==null?void 0:a[i]]:[];return[s].flat().reduce((c,d)=>{if(d!=null){const u=typeof d;if(u==="string"||u==="number")c.push(d);else if(u==="object"){const f=Array.isArray(d)?t(i,d):Object.entries(d).map(([h,m])=>i==="style"&&(m||m===0)?`${h.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${m}`:m?h:void 0);c=f.length?c.concat(f.filter(h=>!!h)):c}}return c},l)};Object.entries(e).forEach(([i,s])=>{if(s!=null){const o=i.match(/^on(.+)/);o?n.addEventListener(o[1].toLowerCase(),s):i==="p-bind"||i==="pBind"?uo(n,s):(s=i==="class"?[...new Set(t("class",s))].join(" ").trim():i==="style"?t("style",s).join(";").trim():s,(n.$attrs=n.$attrs||{})&&(n.$attrs[i]=s),n.setAttribute(i,s))}})}}function Qf(n,e){return co(n)?n.matches(e)?n:n.querySelector(e):null}function Jf(n){if(n){let e=n.parentNode;return e&&e instanceof ShadowRoot&&e.host&&(e=e.host),e}return null}function Zf(n){return!!(n!==null&&typeof n<"u"&&n.nodeName&&Jf(n))}function ca(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function eh(n,e="",t){co(n)&&t!==null&&t!==void 0&&n.setAttribute(e,t)}var es={};function th(n="pui_id_"){return es.hasOwnProperty(n)||(es[n]=0),es[n]++,`${n}${es[n]}`}var Un={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(e){return this._loadedStyleNames.has(e)},setLoadedStyleName:function(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName:function(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function qn(n){"@babel/helpers - typeof";return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qn(n)}function da(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,i)}return t}function ua(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?da(Object(t),!0).forEach(function(i){nh(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):da(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function nh(n,e,t){return(e=ih(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ih(n){var e=sh(n,"string");return qn(e)=="symbol"?e:e+""}function sh(n,e){if(qn(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(qn(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function oh(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;r.getCurrentInstance()?r.onMounted(n):e?n():r.nextTick(n)}var rh=0;function ah(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.ref(!1),i=r.ref(n),s=r.ref(null),o=ca()?window.document:void 0,a=e.document,l=a===void 0?o:a,c=e.immediate,d=c===void 0?!0:c,u=e.manual,f=u===void 0?!1:u,h=e.name,m=h===void 0?"style_".concat(++rh):h,p=e.id,g=p===void 0?void 0:p,y=e.media,b=y===void 0?void 0:y,x=e.nonce,E=x===void 0?void 0:x,C=e.first,k=C===void 0?!1:C,v=e.onMounted,S=v===void 0?void 0:v,_=e.onUpdated,D=_===void 0?void 0:_,B=e.onLoad,w=B===void 0?void 0:B,T=e.props,I=T===void 0?{}:T,X=function(){},q=function(F){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l){var L=ua(ua({},I),P),H=L.name||m,te=L.id||g,ie=L.nonce||E;s.value=l.querySelector('style[data-primevue-style-id="'.concat(H,'"]'))||l.getElementById(te)||l.createElement("style"),s.value.isConnected||(i.value=F||n,uo(s.value,{type:"text/css",id:te,media:b,nonce:ie}),k?l.head.prepend(s.value):l.head.appendChild(s.value),eh(s.value,"data-primevue-style-id",H),uo(s.value,L),s.value.onload=function(Q){return w==null?void 0:w(Q,{name:H})},S==null||S(H)),!t.value&&(X=r.watch(i,function(Q){s.value.textContent=Q,D==null||D(H)},{immediate:!0}),t.value=!0)}},$=function(){!l||!t.value||(X(),Zf(s.value)&&l.head.removeChild(s.value),t.value=!1)};return d&&!f&&oh(q),{id:g,name:m,el:s,css:i,unload:$,load:q,isLoaded:r.readonly(t)}}function Yn(n){"@babel/helpers - typeof";return Yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yn(n)}function fa(n,e){return uh(n)||dh(n,e)||ch(n,e)||lh()}function lh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
13
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ch(n,e){if(n){if(typeof n=="string")return ha(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ha(n,e):void 0}}function ha(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=Array(e);t<e;t++)i[t]=n[t];return i}function dh(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i,s,o,a,l=[],c=!0,d=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(c=(i=o.call(t)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(d)throw s}}return l}}function uh(n){if(Array.isArray(n))return n}function ma(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,i)}return t}function fo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ma(Object(t),!0).forEach(function(i){fh(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ma(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function fh(n,e,t){return(e=hh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hh(n){var e=mh(n,"string");return Yn(e)=="symbol"?e:e+""}function mh(n,e){if(Yn(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(Yn(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ph=function(e){var t=e.dt;return`
14
14
  *,
15
15
  ::before,
16
16
  ::after {
@@ -85,21 +85,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
85
85
 
86
86
  .p-disabled,
87
87
  .p-component:disabled {
88
- opacity: `.concat(e("disabled.opacity"),`;
88
+ opacity: `.concat(t("disabled.opacity"),`;
89
89
  }
90
90
 
91
91
  .pi {
92
- font-size: `).concat(e("icon.size"),`;
92
+ font-size: `).concat(t("icon.size"),`;
93
93
  }
94
94
 
95
95
  .p-icon {
96
- width: `).concat(e("icon.size"),`;
97
- height: `).concat(e("icon.size"),`;
96
+ width: `).concat(t("icon.size"),`;
97
+ height: `).concat(t("icon.size"),`;
98
98
  }
99
99
 
100
100
  .p-overlay-mask {
101
- background: `).concat(e("mask.background"),`;
102
- color: `).concat(e("mask.color"),`;
101
+ background: `).concat(t("mask.background"),`;
102
+ color: `).concat(t("mask.color"),`;
103
103
  position: fixed;
104
104
  top: 0;
105
105
  left: 0;
@@ -108,11 +108,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
108
108
  }
109
109
 
110
110
  .p-overlay-mask-enter {
111
- animation: p-overlay-mask-enter-animation `).concat(e("mask.transition.duration"),` forwards;
111
+ animation: p-overlay-mask-enter-animation `).concat(t("mask.transition.duration"),` forwards;
112
112
  }
113
113
 
114
114
  .p-overlay-mask-leave {
115
- animation: p-overlay-mask-leave-animation `).concat(e("mask.transition.duration"),` forwards;
115
+ animation: p-overlay-mask-leave-animation `).concat(t("mask.transition.duration"),` forwards;
116
116
  }
117
117
 
118
118
  @keyframes p-overlay-mask-enter-animation {
@@ -120,18 +120,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
120
120
  background: transparent;
121
121
  }
122
122
  to {
123
- background: `).concat(e("mask.background"),`;
123
+ background: `).concat(t("mask.background"),`;
124
124
  }
125
125
  }
126
126
  @keyframes p-overlay-mask-leave-animation {
127
127
  from {
128
- background: `).concat(e("mask.background"),`;
128
+ background: `).concat(t("mask.background"),`;
129
129
  }
130
130
  to {
131
131
  background: transparent;
132
132
  }
133
133
  }
134
- `)},Lh=function(t){var e=t.dt;return`
134
+ `)},gh=function(e){var t=e.dt;return`
135
135
  .p-hidden-accessible {
136
136
  border: 0;
137
137
  clip: rect(0 0 0 0);
@@ -150,24 +150,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
150
150
 
151
151
  .p-overflow-hidden {
152
152
  overflow: hidden;
153
- padding-right: `.concat(e("scrollbar.width"),`;
153
+ padding-right: `.concat(t("scrollbar.width"),`;
154
154
  }
155
- `)},Ih={},jh={},xe={name:"base",css:Lh,theme:Rh,classes:Ih,inlineStyles:jh,load:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(o){return o},s=i(Jt(t,{dt:Fn}));return bt(s)?Th(Bn(s),Qs({name:this.name},e)):{}},loadCSS:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.load(this.css,t)},loadTheme:function(){var t=this,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return this.load(this.theme,e,function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return Ct.transformCSS(e.name||t.name,"".concat(s).concat(i))})},getCommonTheme:function(t){return Ct.getCommon(this.name,t)},getComponentTheme:function(t){return Ct.getComponent(this.name,t)},getDirectiveTheme:function(t){return Ct.getDirective(this.name,t)},getPresetTheme:function(t,e,i){return Ct.getCustomPreset(this.name,t,e,i)},getLayerOrderThemeCSS:function(){return Ct.getLayerOrderCSS(this.name)},getStyleSheet:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.css){var i=Jt(this.css,{dt:Fn})||"",s=Bn("".concat(i).concat(t)),o=Object.entries(e).reduce(function(r,l){var c=Jr(l,2),d=c[0],u=c[1];return r.push("".concat(d,'="').concat(u,'"'))&&r},[]).join(" ");return bt(s)?'<style type="text/css" data-primevue-style-id="'.concat(this.name,'" ').concat(o,">").concat(s,"</style>"):""}return""},getCommonThemeStyleSheet:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ct.getCommonStyleSheet(this.name,t,e)},getThemeStyleSheet:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=[Ct.getStyleSheet(this.name,t,e)];if(this.theme){var s=this.name==="base"?"global-style":"".concat(this.name,"-style"),o=Jt(this.theme,{dt:Fn}),r=Bn(Ct.transformCSS(s,o)),l=Object.entries(e).reduce(function(c,d){var u=Jr(d,2),h=u[0],f=u[1];return c.push("".concat(h,'="').concat(f,'"'))&&c},[]).join(" ");bt(r)&&i.push('<style type="text/css" data-primevue-style-id="'.concat(s,'" ').concat(l,">").concat(r,"</style>"))}return i.join("")},extend:function(t){return Qs(Qs({},this),{},{css:void 0,theme:void 0},t)}},ea=xe.extend({name:"common"});function In(n){"@babel/helpers - typeof";return In=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},In(n)}function zh(n){return oa(n)||Wh(n)||ia(n)||na()}function Wh(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function jn(n,t){return oa(n)||Hh(n,t)||ia(n,t)||na()}function na(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
156
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ia(n,t){if(n){if(typeof n=="string")return sa(n,t);var e={}.toString.call(n).slice(8,-1);return e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set"?Array.from(n):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?sa(n,t):void 0}}function sa(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=Array(t);e<t;e++)i[e]=n[e];return i}function Hh(n,t){var e=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(e!=null){var i,s,o,r,l=[],c=!0,d=!1;try{if(o=(e=e.call(n)).next,t===0){if(Object(e)!==e)return;c=!1}else for(;!(c=(i=o.call(e)).done)&&(l.push(i.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&e.return!=null&&(r=e.return(),Object(r)!==r))return}finally{if(d)throw s}}return l}}function oa(n){if(Array.isArray(n))return n}function ra(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),e.push.apply(e,i)}return e}function et(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ra(Object(e),!0).forEach(function(i){zn(n,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):ra(Object(e)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(e,i))})}return n}function zn(n,t,e){return(t=Uh(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function Uh(n){var t=qh(n,"string");return In(t)=="symbol"?t:t+""}function qh(n,t){if(In(n)!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(In(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var Yh={name:"BaseComponent",props:{pt:{type:Object,default:void 0},ptOptions:{type:Object,default:void 0},unstyled:{type:Boolean,default:void 0},dt:{type:Object,default:void 0}},inject:{$parentInstance:{default:void 0}},watch:{isUnstyled:{immediate:!0,handler:function(t){t||(this._loadCoreStyles(),this._themeChangeListener(this._loadCoreStyles))}},dt:{immediate:!0,handler:function(t){var e=this;t?(this._loadScopedThemeStyles(t),this._themeChangeListener(function(){return e._loadScopedThemeStyles(t)})):this._unloadScopedThemeStyles()}}},scopedStyleEl:void 0,rootEl:void 0,$attrSelector:void 0,beforeCreate:function(){var t,e,i,s,o,r,l,c,d,u,h,f=(t=this.pt)===null||t===void 0?void 0:t._usept,m=f?(e=this.pt)===null||e===void 0||(e=e.originalValue)===null||e===void 0?void 0:e[this.$.type.name]:void 0,p=f?(i=this.pt)===null||i===void 0||(i=i.value)===null||i===void 0?void 0:i[this.$.type.name]:this.pt;(s=p||m)===null||s===void 0||(s=s.hooks)===null||s===void 0||(o=s.onBeforeCreate)===null||o===void 0||o.call(s);var g=(r=this.$primevueConfig)===null||r===void 0||(r=r.pt)===null||r===void 0?void 0:r._usept,y=g?(l=this.$primevue)===null||l===void 0||(l=l.config)===null||l===void 0||(l=l.pt)===null||l===void 0?void 0:l.originalValue:void 0,b=g?(c=this.$primevue)===null||c===void 0||(c=c.config)===null||c===void 0||(c=c.pt)===null||c===void 0?void 0:c.value:(d=this.$primevue)===null||d===void 0||(d=d.config)===null||d===void 0?void 0:d.pt;(u=b||y)===null||u===void 0||(u=u[this.$.type.name])===null||u===void 0||(u=u.hooks)===null||u===void 0||(h=u.onBeforeCreate)===null||h===void 0||h.call(u),this.$attrSelector=Eh("pc")},created:function(){this._hook("onCreated")},beforeMount:function(){this.rootEl=xh(this.$el,'[data-pc-name="'.concat(Me(this.$.type.name),'"]')),this.rootEl&&(this.$attrSelector&&!this.rootEl.hasAttribute(this.$attrSelector)&&this.rootEl.setAttribute(this.$attrSelector,""),this.rootEl.$pc=et({name:this.$.type.name,attrSelector:this.$attrSelector},this.$params)),this._loadStyles(),this._hook("onBeforeMount")},mounted:function(){this._hook("onMounted")},beforeUpdate:function(){this._hook("onBeforeUpdate")},updated:function(){this._hook("onUpdated")},beforeUnmount:function(){this._hook("onBeforeUnmount")},unmounted:function(){this._unloadScopedThemeStyles(),this._hook("onUnmounted")},methods:{_hook:function(t){if(!this.$options.hostName){var e=this._usePT(this._getPT(this.pt,this.$.type.name),this._getOptionValue,"hooks.".concat(t)),i=this._useDefaultPT(this._getOptionValue,"hooks.".concat(t));e==null||e(),i==null||i()}},_mergeProps:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];return Rr(t)?t.apply(void 0,i):a.mergeProps.apply(void 0,i)},_loadStyles:function(){var t=this,e=function(){$n.isStyleNameLoaded("base")||(xe.loadCSS(t.$styleOptions),t._loadGlobalStyles(),$n.setLoadedStyleName("base")),t._loadThemeStyles()};e(),this._themeChangeListener(e)},_loadCoreStyles:function(){var t,e;!$n.isStyleNameLoaded((t=this.$style)===null||t===void 0?void 0:t.name)&&(e=this.$style)!==null&&e!==void 0&&e.name&&(ea.loadCSS(this.$styleOptions),this.$options.style&&this.$style.loadCSS(this.$styleOptions),$n.setLoadedStyleName(this.$style.name))},_loadGlobalStyles:function(){var t=this._useGlobalPT(this._getOptionValue,"global.css",this.$params);bt(t)&&xe.load(t,et({name:"global"},this.$styleOptions))},_loadThemeStyles:function(){var t,e;if(!(this.isUnstyled||this.$theme==="none")){if(!Ct.isStyleNameLoaded("common")){var i,s,o=((i=this.$style)===null||i===void 0||(s=i.getCommonTheme)===null||s===void 0?void 0:s.call(i))||{},r=o.primitive,l=o.semantic,c=o.global,d=o.style;xe.load(r==null?void 0:r.css,et({name:"primitive-variables"},this.$styleOptions)),xe.load(l==null?void 0:l.css,et({name:"semantic-variables"},this.$styleOptions)),xe.load(c==null?void 0:c.css,et({name:"global-variables"},this.$styleOptions)),xe.loadTheme(et({name:"global-style"},this.$styleOptions),d),Ct.setLoadedStyleName("common")}if(!Ct.isStyleNameLoaded((t=this.$style)===null||t===void 0?void 0:t.name)&&(e=this.$style)!==null&&e!==void 0&&e.name){var u,h,f,m,p=((u=this.$style)===null||u===void 0||(h=u.getComponentTheme)===null||h===void 0?void 0:h.call(u))||{},g=p.css,y=p.style;(f=this.$style)===null||f===void 0||f.load(g,et({name:"".concat(this.$style.name,"-variables")},this.$styleOptions)),(m=this.$style)===null||m===void 0||m.loadTheme(et({name:"".concat(this.$style.name,"-style")},this.$styleOptions),y),Ct.setLoadedStyleName(this.$style.name)}if(!Ct.isStyleNameLoaded("layer-order")){var b,_,w=(b=this.$style)===null||b===void 0||(_=b.getLayerOrderThemeCSS)===null||_===void 0?void 0:_.call(b);xe.load(w,et({name:"layer-order",first:!0},this.$styleOptions)),Ct.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(t){var e,i,s,o=((e=this.$style)===null||e===void 0||(i=e.getPresetTheme)===null||i===void 0?void 0:i.call(e,t,"[".concat(this.$attrSelector,"]")))||{},r=o.css,l=(s=this.$style)===null||s===void 0?void 0:s.load(r,et({name:"".concat(this.$attrSelector,"-").concat(this.$style.name)},this.$styleOptions));this.scopedStyleEl=l.el},_unloadScopedThemeStyles:function(){var t;(t=this.scopedStyleEl)===null||t===void 0||(t=t.value)===null||t===void 0||t.remove()},_themeChangeListener:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};$n.clearLoadedStyleNames(),Ve.on("theme:change",t)},_getHostInstance:function(t){return t?this.$options.hostName?t.$.type.name===this.$options.hostName?t:this._getHostInstance(t.$parentInstance):t.$parentInstance:void 0},_getPropValue:function(t){var e;return this[t]||((e=this._getHostInstance(this))===null||e===void 0?void 0:e[t])},_getOptionValue:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Lr(t,e,i)},_getPTValue:function(){var t,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,r=/./g.test(i)&&!!s[i.split(".")[0]],l=this._getPropValue("ptOptions")||((t=this.$primevueConfig)===null||t===void 0?void 0:t.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,h=u===void 0?!1:u,f=o?r?this._useGlobalPT(this._getPTClassValue,i,s):this._useDefaultPT(this._getPTClassValue,i,s):void 0,m=r?void 0:this._getPTSelf(e,this._getPTClassValue,i,et(et({},s),{},{global:f||{}})),p=this._getPTDatasets(i);return d||!d&&m?h?this._mergeProps(h,f,m,p):et(et(et({},f),m),p):et(et({},m),p)},_getPTSelf:function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];return a.mergeProps(this._usePT.apply(this,[this._getPT(t,this.$name)].concat(i)),this._usePT.apply(this,[this.$_attrsPT].concat(i)))},_getPTDatasets:function(){var t,e,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",s="data-pc-",o=i==="root"&&bt((t=this.pt)===null||t===void 0?void 0:t["data-pc-section"]);return i!=="transition"&&et(et({},i==="root"&&et(et(zn({},"".concat(s,"name"),Me(o?(e=this.pt)===null||e===void 0?void 0:e["data-pc-section"]:this.$.type.name)),o&&zn({},"".concat(s,"extend"),Me(this.$.type.name))),Xr()&&zn({},"".concat(this.$attrSelector),""))),{},zn({},"".concat(s,"section"),Me(i)))},_getPTClassValue:function(){var t=this._getOptionValue.apply(this,arguments);return le(t)||Us(t)?{class:t}:t},_getPT:function(t){var e=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2?arguments[2]:void 0,o=function(l){var c,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,u=s?s(l):l,h=Me(i),f=Me(e.$name);return(c=d?h!==f?u==null?void 0:u[h]:void 0:u==null?void 0:u[h])!==null&&c!==void 0?c:u};return t!=null&&t.hasOwnProperty("_usept")?{_usept:t._usept,originalValue:o(t.originalValue),value:o(t.value)}:o(t,!0)},_usePT:function(t,e,i,s){var o=function(g){return e(g,i,s)};if(t!=null&&t.hasOwnProperty("_usept")){var r,l=t._usept||((r=this.$primevueConfig)===null||r===void 0?void 0:r.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,h=u===void 0?!1:u,f=o(t.originalValue),m=o(t.value);return f===void 0&&m===void 0?void 0:le(m)?m:le(f)?f:d||!d&&m?h?this._mergeProps(h,f,m):et(et({},f),m):m}return o(t)},_useGlobalPT:function(t,e,i){return this._usePT(this.globalPT,t,e,i)},_useDefaultPT:function(t,e,i){return this._usePT(this.defaultPT,t,e,i)},ptm:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._getPTValue(this.pt,t,et(et({},this.$params),e))},ptmi:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.mergeProps(this.$_attrsWithoutPT,this.ptm(t,e))},ptmo:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._getPTValue(t,e,et({instance:this},i),!1)},cx:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,t,et(et({},this.$params),e))},sx:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(e){var s=this._getOptionValue(this.$style.inlineStyles,t,et(et({},this.$params),i)),o=this._getOptionValue(ea.inlineStyles,t,et(et({},this.$params),i));return[o,s]}}},computed:{globalPT:function(){var t,e=this;return this._getPT((t=this.$primevueConfig)===null||t===void 0?void 0:t.pt,void 0,function(i){return Jt(i,{instance:e})})},defaultPT:function(){var t,e=this;return this._getPT((t=this.$primevueConfig)===null||t===void 0?void 0:t.pt,void 0,function(i){return e._getOptionValue(i,e.$name,et({},e.$params))||Jt(i,et({},e.$params))})},isUnstyled:function(){var t;return this.unstyled!==void 0?this.unstyled:(t=this.$primevueConfig)===null||t===void 0?void 0:t.unstyled},$inProps:function(){var t,e=Object.keys(((t=this.$.vnode)===null||t===void 0?void 0:t.props)||{});return Object.fromEntries(Object.entries(this.$props).filter(function(i){var s=jn(i,1),o=s[0];return e==null?void 0:e.includes(o)}))},$theme:function(){var t;return(t=this.$primevueConfig)===null||t===void 0?void 0:t.theme},$style:function(){return et(et({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var t;return{nonce:(t=this.$primevueConfig)===null||t===void 0||(t=t.csp)===null||t===void 0?void 0:t.nonce}},$primevueConfig:function(){var t;return(t=this.$primevue)===null||t===void 0?void 0:t.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var t=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:t,props:t==null?void 0:t.$props,state:t==null?void 0:t.$data,attrs:t==null?void 0:t.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter(function(t){var e=jn(t,1),i=e[0];return i==null?void 0:i.startsWith("pt:")}).reduce(function(t,e){var i=jn(e,2),s=i[0],o=i[1],r=s.split(":"),l=zh(r),c=l.slice(1);return c==null||c.reduce(function(d,u,h,f){return!d[u]&&(d[u]=h===f.length-1?o:{}),d[u]},t),t},{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter(function(t){var e=jn(t,1),i=e[0];return!(i!=null&&i.startsWith("pt:"))}).reduce(function(t,e){var i=jn(e,2),s=i[0],o=i[1];return t[s]=o,t},{})}}},Kh={root:{position:"relative"}},Xh={root:"p-chart"},Gh=xe.extend({name:"chart",classes:Xh,inlineStyles:Kh}),Qh={name:"BaseChart",extends:Yh,props:{type:String,data:null,options:null,plugins:null,width:{type:Number,default:300},height:{type:Number,default:150},canvasProps:{type:null,default:null}},style:Gh,provide:function(){return{$pcChart:this,$parentInstance:this}}},aa={name:"Chart",extends:Qh,inheritAttrs:!1,emits:["select","loaded"],chart:null,watch:{data:{handler:function(){this.reinit()},deep:!0},type:function(){this.reinit()},options:function(){this.reinit()}},mounted:function(){this.initChart()},beforeUnmount:function(){this.chart&&(this.chart.destroy(),this.chart=null)},methods:{initChart:function(){var t=this;Promise.resolve().then(()=>ok).then(function(e){t.chart&&(t.chart.destroy(),t.chart=null),e&&e.default&&(t.chart=new e.default(t.$refs.canvas,{type:t.type,data:t.data,options:t.options,plugins:t.plugins})),t.$emit("loaded",t.chart)})},getCanvas:function(){return this.$canvas},getChart:function(){return this.chart},getBase64Image:function(){return this.chart.toBase64Image()},refresh:function(){this.chart&&this.chart.update()},reinit:function(){this.initChart()},onCanvasClick:function(t){if(this.chart){var e=this.chart.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1),i=this.chart.getElementsAtEventForMode(t,"dataset",{intersect:!0},!1);e&&e[0]&&i&&this.$emit("select",{originalEvent:t,element:e[0],dataset:i})}},generateLegend:function(){if(this.chart)return this.chart.generateLegend()}}};function Wn(n){"@babel/helpers - typeof";return Wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(n)}function la(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),e.push.apply(e,i)}return e}function ca(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?la(Object(e),!0).forEach(function(i){Jh(n,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):la(Object(e)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(e,i))})}return n}function Jh(n,t,e){return(t=Zh(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function Zh(n){var t=tf(n,"string");return Wn(t)=="symbol"?t:t+""}function tf(n,t){if(Wn(n)!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(Wn(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var ef=["width","height"];function nf(n,t,e,i,s,o){return a.openBlock(),a.createElementBlock("div",a.mergeProps({class:n.cx("root"),style:n.sx("root")},n.ptmi("root")),[a.createElementVNode("canvas",a.mergeProps({ref:"canvas",width:n.width,height:n.height,onClick:t[0]||(t[0]=function(r){return o.onCanvasClick(r)})},ca(ca({},n.canvasProps),n.ptm("canvas"))),null,16,ef)],16)}aa.render=nf;function sf(){const n={primary:"#0efcf1",primaryBorder:"#388E3C",secondary:"#0ec6fc",secondaryBorder:"#FBC02D",tertiary:"#f1fc0e",tertiaryBorder:"#FFA000"},t=["linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInBounce","easeOutBounce","easeInOutBounce","easeInOutElastic"],e=a.ref("easeInOutElastic"),i=a.computed(()=>({responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"top",labels:{font:{size:16}}},tooltip:{enabled:!0,titleFont:{size:14},bodyFont:{size:12}},zoom:{zoom:{wheel:{enabled:!0},drag:{enabled:!0},mode:"xy"},pan:{enabled:!0,mode:"xy"}}},scales:{x:{grid:{display:!1},ticks:{font:{size:14}}},y:{grid:{display:!0,color:"#e0e0e0"},ticks:{font:{size:14}}}},animation:{duration:2e3,easing:e.value,delay:500,loop:!1,animateRotate:!0,animateScale:!0},elements:{point:{radius:6,hoverRadius:10,backgroundColor:n.secondary},line:{tension:.4,borderWidth:2},bar:{borderWidth:2,borderRadius:4}}}));return{colorConfig:n,animationOptions:t,selectedAnimation:e,defaultChartOptions:i}}const of={components:{Chart:aa},props:{type:{type:String,required:!0},chartData:{type:Object,required:!0},chartOptions:{type:Object,default:()=>({})}},setup(n){const{colorConfig:t,defaultChartOptions:e}=sf(),i=a.computed(()=>{const o=n.chartData.datasets.map((r,l)=>{const c=Object.values(t);return{...r,backgroundColor:c[l%c.length],borderColor:c[l%c.length+1]}});return{...n.chartData,datasets:o}}),s=a.computed(()=>({...e.value,maintainAspectRatio:!0,...n.chartOptions}));return{computedChartData:i,computedChartOptions:s}}},rf={class:"chart-container"},af={key:0},lf={key:1};function cf(n,t,e,i,s,o){const r=a.resolveComponent("Chart",!0);return a.openBlock(),a.createElementBlock("div",rf,[e.chartData?(a.openBlock(),a.createElementBlock("div",af,[a.createVNode(r,{type:e.type,data:i.computedChartData,options:i.computedChartOptions},null,8,["type","data","options"])])):(a.openBlock(),a.createElementBlock("div",lf,t[0]||(t[0]=[a.createElementVNode("p",null,"No data available for the chart.",-1)])))])}const Hn=Bt(of,[["render",cf],["__scopeId","data-v-8e3e786b"]]);function Un(){const n=a.ref(null),t=a.ref(!1),e=a.ref(null);return{chartData:n,fetchChartData:async({entityName:s,xaxis:o=null,yaxis:r=null})=>{t.value=!0,e.value=null;const l="https://mocki.io/v1/1ab17035-c115-4049-8ebf-a1e1b92d739a";try{const d=await(await fetch(l)).json();if(!d||!d.response||!d.response.result)throw new Error("Invalid data structure from API.");const u=d.response.result;if(!o&&!r){const h=Object.keys(u[0]);o=h[1],r=h.slice(4);const f=u.reduce((g,y)=>(r.forEach(b=>{g[b]||(g[b]=0),g[b]+=y[b]||0}),g),{}),m=Object.keys(f),p=Object.values(f);n.value={labels:m,datasets:[{label:"Default Data",data:p,borderWidth:1}]}}else{const h=u.map(p=>p[o]),m=(Array.isArray(r)?r:[r]).map(p=>({label:p,data:u.map(g=>g[p]||0),borderWidth:1}));n.value={labels:h,datasets:m}}}catch(c){e.value=c.message,n.value=null}finally{t.value=!1}},loading:t,error:e}}const df={components:{chart:Hn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(n){const{chartData:t,fetchChartData:e,loading:i,error:s}=Un(),o=a.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),r=async()=>{if(!n.yaxis||!n.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await e({entityName:n.entityName,yaxis:n.yaxis,xaxis:n.xaxis})};return a.onMounted(()=>{console.log("Fetching data for yAxis:",n.yaxis),console.log("Fetching data for xAxis:",n.xaxis),r()}),{chartData:t,chartOptions:o,loading:i,error:s}}},uf={key:0,class:"chart-container"},hf={key:1},ff={key:0},mf={key:1},pf={key:2};function gf(n,t,e,i,s,o){const r=a.resolveComponent("chart");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("h2",null,"Entity name: "+a.toDisplayString(e.entityName),1)]),i.chartData?(a.openBlock(),a.createElementBlock("div",uf,[a.createElementVNode("h3",null,a.toDisplayString(e.title)+" , x-axis : "+a.toDisplayString(e.xaxis)+" , y-axis : "+a.toDisplayString(e.yaxis),1),a.createVNode(r,{type:"bar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(a.openBlock(),a.createElementBlock("div",hf,[i.loading?(a.openBlock(),a.createElementBlock("p",ff,"Loading chart data...")):i.error?(a.openBlock(),a.createElementBlock("p",mf,a.toDisplayString(i.error),1)):(a.openBlock(),a.createElementBlock("p",pf,"No data available for the chart."))]))])}const da=Bt(df,[["render",gf],["__scopeId","data-v-67577a46"]]),yf={components:{chart:Hn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(n){const{chartData:t,fetchChartData:e,loading:i,error:s}=Un(),o=a.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),r=async()=>{if(!n.yaxis||!n.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await e({entityName:n.entityName,yaxis:n.yaxis,xaxis:n.xaxis})};return a.onMounted(()=>{console.log("Fetching data for yAxis:",n.yaxis),console.log("Fetching data for xAxis:",n.xaxis),r()}),{chartData:t,chartOptions:o,loading:i,error:s}}},bf={key:0,class:"chart-container"},_f={key:1},xf={key:0},kf={key:1},Sf={key:2};function wf(n,t,e,i,s,o){const r=a.resolveComponent("chart");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("h2",null,"Entity name: "+a.toDisplayString(e.entityName),1)]),i.chartData?(a.openBlock(),a.createElementBlock("div",bf,[a.createElementVNode("h3",null,a.toDisplayString(e.title)+" , x-axis : "+a.toDisplayString(e.xaxis)+" , y-axis : "+a.toDisplayString(e.yaxis),1),a.createVNode(r,{type:"line",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(a.openBlock(),a.createElementBlock("div",_f,[i.loading?(a.openBlock(),a.createElementBlock("p",xf,"Loading chart data...")):i.error?(a.openBlock(),a.createElementBlock("p",kf,a.toDisplayString(i.error),1)):(a.openBlock(),a.createElementBlock("p",Sf,"No data available for the chart."))]))])}const ua=Bt(yf,[["render",wf],["__scopeId","data-v-2cfe3d4d"]]),Ef={components:{chart:Hn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(n){const{chartData:t,fetchChartData:e,loading:i,error:s}=Un(),o=a.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),r=async()=>{await e({entityName:n.entityName,xaxis:n.xaxis,yaxis:n.yaxis})};return a.onMounted(()=>{r()}),{chartData:t,chartOptions:o,loading:i,error:s}}},Cf={key:0,class:"chart-container"},vf={key:1},Of={key:0},Df={key:1},Nf={key:2};function Tf(n,t,e,i,s,o){const r=a.resolveComponent("chart");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("h2",null,"Entity name: "+a.toDisplayString(e.entityName),1)]),i.chartData?(a.openBlock(),a.createElementBlock("div",Cf,[a.createElementVNode("h3",null,a.toDisplayString(e.title),1),a.createVNode(r,{type:"pie",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(a.openBlock(),a.createElementBlock("div",vf,[i.loading?(a.openBlock(),a.createElementBlock("p",Of,"Loading chart data...")):i.error?(a.openBlock(),a.createElementBlock("p",Df,a.toDisplayString(i.error),1)):(a.openBlock(),a.createElementBlock("p",Nf,"No data available for the chart."))]))])}const ha=Bt(Ef,[["render",Tf],["__scopeId","data-v-27f5ea01"]]),Pf={components:{chart:Hn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(n){const{chartData:t,fetchChartData:e,loading:i,error:s}=Un(),o=a.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),r=async()=>{await e({entityName:n.entityName,xaxis:n.xaxis,yaxis:n.yaxis})};return a.onMounted(()=>{r()}),{chartData:t,chartOptions:o,loading:i,error:s}}},Mf={key:0,class:"chart-container"},Vf={key:1},Af={key:0},Bf={key:1},Ff={key:2};function $f(n,t,e,i,s,o){const r=a.resolveComponent("chart");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("h2",null,"Entity name: "+a.toDisplayString(e.entityName),1)]),i.chartData?(a.openBlock(),a.createElementBlock("div",Mf,[a.createElementVNode("h3",null,a.toDisplayString(e.title),1),a.createVNode(r,{type:"polarArea",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(a.openBlock(),a.createElementBlock("div",Vf,[i.loading?(a.openBlock(),a.createElementBlock("p",Af,"Loading chart data...")):i.error?(a.openBlock(),a.createElementBlock("p",Bf,a.toDisplayString(i.error),1)):(a.openBlock(),a.createElementBlock("p",Ff,"No data available for the chart."))]))])}const fa=Bt(Pf,[["render",$f],["__scopeId","data-v-941f0d0a"]]),Rf={components:{chart:Hn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(n){const{chartData:t,fetchChartData:e,loading:i,error:s}=Un(),o=a.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),r=async()=>{if(!n.yaxis||!n.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await e({entityName:n.entityName,yaxis:n.yaxis,xaxis:n.xaxis})};return a.onMounted(()=>{console.log("Fetching data for yAxis:",n.yaxis),console.log("Fetching data for xAxis:",n.xaxis),r()}),{chartData:t,chartOptions:o,loading:i,error:s}}},Lf={key:0,class:"chart-container"},If={key:1},jf={key:0},zf={key:1},Wf={key:2};function Hf(n,t,e,i,s,o){const r=a.resolveComponent("chart");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("h2",null,"Entity name: "+a.toDisplayString(e.entityName),1)]),i.chartData?(a.openBlock(),a.createElementBlock("div",Lf,[a.createElementVNode("h3",null,a.toDisplayString(e.title)+" , x-axis : "+a.toDisplayString(e.xaxis)+" , y-axis : "+a.toDisplayString(e.yaxis),1),a.createVNode(r,{type:"radar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(a.openBlock(),a.createElementBlock("div",If,[i.loading?(a.openBlock(),a.createElementBlock("p",jf,"Loading chart data...")):i.error?(a.openBlock(),a.createElementBlock("p",zf,a.toDisplayString(i.error),1)):(a.openBlock(),a.createElementBlock("p",Wf,"No data available for the chart."))]))])}const ma=Bt(Rf,[["render",Hf],["__scopeId","data-v-80750171"]]),Uf={class:"flex flex-col p-3"},qf={class:"flex justify-center flex-row mb-2 cursor-pointer"},Yf={style:{"word-break":"break-all"}},Kf={__name:"LinkEntityContent",props:{linkEntityListItem:{type:Object,required:!0}},setup(n){Ht.useRoute();const t=me(),e=a.ref("");t.getAppId()!=null&&t.getAppId()!=""&&(e.value=t.getAppId());const i=a.ref(),s=a.ref(!1),o=a.ref(!1),r=a.ref({}),l=a.ref([{label:"Remove association",icon:"",command:h=>{c()}}]),c=()=>{console.log(r.value),console.log("Function is calling")},d=(h,f)=>{r.value=f,i.value.show(h),o.value=!0},u=()=>{r.value={},o.value=!1};return(h,f)=>{const m=a.resolveComponent("Button"),p=a.resolveComponent("ContextMenu"),g=a.resolveComponent("router-link");return a.openBlock(),a.createElementBlock("div",{onMouseenter:f[4]||(f[4]=a.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:f[5]||(f[5]=a.withModifiers(y=>s.value=!1,["prevent"])),class:"flex relative m-3",style:{border:"1px solid var(--surface-border)","border-radius":"5px"}},[a.withDirectives(a.createVNode(m,{onClick:f[0]||(f[0]=y=>d(y,n.linkEntityListItem)),class:"!absolute right-0",size:"small",style:{width:"55px",height:"25px","border-radius":"5px","font-size":"12px"}},{default:a.withCtx(()=>f[6]||(f[6]=[a.createTextVNode(" More")])),_:1},512),[[a.vShow,s.value||o.value]]),a.createVNode(p,{ref_key:"menu",ref:i,model:l.value,onMouseenter:f[1]||(f[1]=a.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:f[2]||(f[2]=a.withModifiers(y=>s.value=!1,["prevent"])),onHide:f[3]||(f[3]=y=>u())},null,8,["model"]),a.createElementVNode("div",Uf,[a.createElementVNode("div",qf,[a.createElementVNode("div",Yf,a.toDisplayString(n.linkEntityListItem.entityName),1),a.createVNode(g,{to:{name:"entity360view",params:{entityName:n.linkEntityListItem.entityName,id:n.linkEntityListItem.id,appId:e.value}},target:"_blank"},{default:a.withCtx(()=>f[7]||(f[7]=[a.createElementVNode("div",{class:"pi pi-external-link ml-3"},null,-1)])),_:1},8,["to"])]),a.createElementVNode("div",null,"Id: "+a.toDisplayString(n.linkEntityListItem.id),1)])],32)}}},Xf={class:"flex flex-col mt-3"},Gf={class:"flex flex-row items-center"},Qf={class:"flex items-center justify-center mt-5"},Jf={key:0,class:"pi pi-caret-right"},Zf={key:1,class:"pi pi-caret-down"},tm={key:0},em={class:"flex flex-col mt-5"},nm={class:"col-12"},im={class:"flex flex-col mt-5"},sm={class:"col-12 font-bold"},om={key:0},rm={class:"flex flex-col mt-5"},am={class:"col-12"},lm={class:"flex flex-col mt-5"},cm={class:"col-12"},dm={class:"flex flex-col mt-5"},um={class:"col-12"},hm={class:"flex flex-row justify-between items-center mt-5"},fm={key:1,class:"mt-2"},mm={class:"flex flex-row justify-between items-center"},pm={key:1,class:"text-red-500"},gm={class:"flex flex-col mt-5"},ym={class:"flex flex-row justify-between items-center mt-2"},bm={class:"flex flex-row items-center mt-5 mb-5"},_m={class:"font-bold"},xm={class:"font-bold ml-2 flex-1"},km={class:"flex flex-row justify-center items-center mb-2"},Sm={class:"ml-2 flex-1"},wm={key:0,class:"pi pi-exclamation-circle"},Em={class:"flex flex-col justify-center"},Cm={class:"flex flex-row justify-between items-center"},vm={class:"justify-start"},Om={class:"justify-start"},Dm=Bt({__name:"EntityLookup",props:a.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{required:!0},saveExistingRelatedEntityRecord:{type:Function,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){Ht.useRoute();const t=n,e=a.useModel(n,"modelValue"),i=new qe,s=a.ref({}),o=a.ref([]),r=a.ref({}),l=a.ref([]),c=a.ref([]),d=a.ref({}),u=a.ref("id"),h=a.ref(1),f=a.ref([]),m=a.ref(25),p=a.ref(0),g=a.ref(0),y=a.ref(0);let b=a.ref([]);const _=a.ref(!1),w={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"},E={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"};a.onMounted(()=>{C()});const k=j=>t.linkedEntity.list.some(A=>A[d.value.name]===j),C=async()=>{try{const j={sortBy:[u.value],sortDirection:h.value===1?"ASC":"DESC",pageSize:m.value,currentPage:p.value,columnList:null,filter:b.value,fullTextSearch:""},A=await i.searchEntityRecords(t.linkedEntity.entityName,j);A&&A.response&&(s.value=A.response,l.value=A.response.entity.entityDefinition.columns,c.value=It(A.response.entity.entityDefinition.columns),g.value=A.response.totalRecords,await S(),await x(),O())}catch{}finally{}},S=async()=>{for(let j=0;j<l.value.length;j++){const A=l.value[j];!A.autoGeneerated&&A.foreignKey&&A.foreignKey.referencedEntityName.toLowerCase()==t.entity360Name.toLowerCase()&&(r.value=A)}},x=async()=>{for(let j=0;j<l.value.length;j++){const A=l.value[j];if(A.primaryKey&&A.primaryKey==!0){d.value=A;break}}},O=()=>{for(let j=0;j<t.linkedEntity.list.length;j++){const A=t.linkedEntity.list[j];A.is_deleted==!1&&A[r.value.name]==t.entity360Id&&o.value.push(A[d.value.name])}},M=()=>{let j=JSON.parse(JSON.stringify(o.value));j=j.filter(at=>!k(at));let A={linkEntityName:s.value.entityName,linkRecordIdList:[]};for(let at=0;at<j.length;at++){const dt=j[at];A.linkRecordIdList.push(dt)}t.saveExistingRelatedEntityRecord(A)},v=()=>{_.value=!_.value},T=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],$=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],U=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],H=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],F=[{label:"ASC",value:1},{label:"DESC",value:-1}];let I=[];const B=a.computed(()=>c.value.filter(j=>j.sortable)),P=a.computed(()=>c.value.filter(j=>j.filterable)),R=j=>c.value.filter(A=>{var at;return A.filterable?((at=f.value[j])==null?void 0:at.columnName)===A.name?!0:!f.value.some((dt,ct)=>ct!==j&&dt.columnName===A.name):!1}).map(A=>({label:A.name,value:A.field})),W=j=>{let A="";switch(Xt(j.columnName).toLowerCase()){case"string":case"uuid":A="startsWith";break;case"date":A="dateIs";break;case"numeric":case"int":case"integer":A="equals";break;case"bool":case"boolean":A="equals";break}j.operator=A,j.value=""},Z=j=>{const A=Xt(j.columnName);switch(A&&A.toLowerCase()){case"integer":case"int":case"numeric":I=$;break;case"date":I=H;break;case"bool":case"boolean":I=U;break;default:I=T}return I},Q=j=>{if(j&&j.columnName){const A=Xt(j.columnName);return De(A)}else return""},Y=()=>{for(let j=0;j<f.value.length;j++){const A=f.value[j];A.editing=!1}f.value.push({columnName:"",value:"",operator:"",editing:!0})},X=j=>{f.value.splice(j,1)},it=j=>{j.editing=!j.editing},lt=()=>{let j=JSON.parse(JSON.stringify(f.value));b.value=[];for(let A=0;A<j.length;A++){const at=j[A];delete at.editing,at.columnName&&at.operator&&at.value&&(at.columnType=Xt(at.columnName),at.operator=w[at.operator],b.value.push(at))}C()},It=j=>j.map(A=>({field:A.name,name:A.displayName?A.displayName:A.name,filterable:A.filterable,datatype:A.type,sortable:!0,displayFormatKey:A.displayFormatKey,displayFormat:A.displayFormat})),Ue=()=>{C()},Xt=j=>{const A=c.value.find(at=>at.field===j);return A?A.datatype:null},De=j=>{switch(j.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},fe=j=>{m.value=j.rows,p.value=j.page,y.value=j.first,C()};return(j,A)=>{var Tn,vs;const at=a.resolveComponent("InputIcon"),dt=a.resolveComponent("InputText"),ct=a.resolveComponent("IconField"),ut=a.resolveComponent("Select"),wt=a.resolveComponent("Divider"),se=a.resolveComponent("InputNumber"),Dn=a.resolveComponent("Calendar"),oe=a.resolveComponent("Button"),ln=a.resolveComponent("Checkbox"),Nn=a.resolveComponent("Paginator"),Ho=a.resolveDirective("tooltip");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",Xf,[a.createElementVNode("div",Gf,[a.createVNode(ct,{class:"block mt-2 md:mt-0 w-full"},{default:a.withCtx(()=>[a.createVNode(at,{onClick:A[0]||(A[0]=()=>{}),class:"pi pi-search"}),a.createVNode(dt,{class:"w-full",onKeyup:A[1]||(A[1]=a.withKeys(()=>{},["enter"])),placeholder:`Search ${s.value.entityName}`},null,8,["placeholder"])]),_:1})]),a.createElementVNode("div",Qf,[a.createElementVNode("div",{class:"flex items-center cursor-pointer sorting-filter-section flex-1 line-height-4",onClick:A[2]||(A[2]=G=>v())},[_.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Jf)),_.value?(a.openBlock(),a.createElementBlock("div",Zf)):a.createCommentVNode("",!0),A[9]||(A[9]=a.createElementVNode("div",{class:"ml-3 font-bold"}," Sorting & Filters ",-1))])]),_.value?(a.openBlock(),a.createElementBlock("div",tm,[a.createElementVNode("div",em,[A[10]||(A[10]=a.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),a.createElementVNode("div",nm,[a.createVNode(ut,{modelValue:u.value,"onUpdate:modelValue":A[3]||(A[3]=G=>u.value=G),options:B.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:A[4]||(A[4]=G=>Ue(j.event))},null,8,["modelValue","options"])])]),a.createElementVNode("div",im,[A[11]||(A[11]=a.createElementVNode("div",{class:"col-12 font-bold"},[a.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),a.createElementVNode("div",sm,[a.createVNode(ut,{modelValue:h.value,"onUpdate:modelValue":A[5]||(A[5]=G=>h.value=G),options:F,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:A[6]||(A[6]=G=>Ue(j.event))},null,8,["modelValue"])])]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(f.value,(G,cn)=>(a.openBlock(),a.createElementBlock("div",{key:cn},[G.editing?(a.openBlock(),a.createElementBlock("div",om,[a.createVNode(wt,{class:"mt-5"}),a.createElementVNode("div",rm,[A[12]||(A[12]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),a.createElementVNode("div",am,[a.createVNode(ut,{modelValue:G.columnName,"onUpdate:modelValue":Dt=>G.columnName=Dt,options:R(cn),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:Dt=>W(G)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),a.createElementVNode("div",lm,[A[13]||(A[13]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),a.createElementVNode("div",cm,[a.createVNode(ut,{modelValue:G.operator,"onUpdate:modelValue":Dt=>G.operator=Dt,options:Z(G),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),a.createElementVNode("div",dm,[A[14]||(A[14]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),a.createElementVNode("div",um,[Q(G)=="numeric"?(a.openBlock(),a.createBlock(se,{key:0,format:!1,class:"w-full",modelValue:G.value,"onUpdate:modelValue":Dt=>G.value=Dt,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):Q(G)=="date"?(a.openBlock(),a.createBlock(Dn,{key:1,class:"w-full",modelValue:G.value,"onUpdate:modelValue":Dt=>G.value=Dt,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(a.openBlock(),a.createBlock(dt,{key:2,modelValue:G.value,"onUpdate:modelValue":Dt=>G.value=Dt,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),a.createElementVNode("div",hm,[a.createVNode(oe,{style:{width:"100px"},label:"Hide",icon:"",severity:"warning",onClick:Dt=>it(G)},null,8,["onClick"]),a.createVNode(oe,{style:{width:"100px"},label:"Delete",icon:"",severity:"danger",onClick:Dt=>X(cn)},null,8,["onClick"])])])):a.createCommentVNode("",!0),G.editing?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",fm,[a.createVNode(wt),a.createElementVNode("div",mm,[a.createElementVNode("span",null,[G.columnName||G.operator||G.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!G.columnName})},a.toDisplayString(G.columnName?" "+G.columnName:" column"),3),a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!E[G.operator]})},a.toDisplayString(G.operator?" "+E[G.operator]:" operator"),3),a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!G.value})},a.toDisplayString(G.value?" "+G.value:" value"),3)],64)):(a.openBlock(),a.createElementBlock("span",pm,"Filter is empty"))]),a.createVNode(oe,{style:{width:"100px"},label:"Edit",icon:"",severity:"info",onClick:Dt=>it(G)},null,8,["onClick"])])]))]))),128)),a.createElementVNode("div",gm,[a.createVNode(wt),a.createElementVNode("div",ym,[a.createVNode(oe,{style:{width:"100px"},label:"Add",disabled:P.value.length===f.value.length,icon:"",severity:"success",onClick:Y},null,8,["disabled"]),a.createVNode(oe,{style:{width:"100px"},label:"Apply",severity:"info",onClick:lt})])])])):a.createCommentVNode("",!0),a.createElementVNode("div",bm,[a.createElementVNode("div",_m,a.toDisplayString((Tn=s.value)==null?void 0:Tn.totalRecords),1),a.createElementVNode("div",xm,a.toDisplayString((vs=s.value)==null?void 0:vs.entityName),1)]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value.result,(G,cn)=>(a.openBlock(),a.createElementBlock("div",{key:cn},[a.createElementVNode("div",km,[a.createVNode(ln,{disabled:k(G[d.value.name]),modelValue:o.value,"onUpdate:modelValue":A[7]||(A[7]=Dt=>o.value=Dt),value:G[d.value.name]},null,8,["disabled","modelValue","value"]),a.createElementVNode("div",Sm,[a.createTextVNode(a.toDisplayString(n.linkedEntity.entityName)+" ",1),a.createElementVNode("span",null,a.toDisplayString(G[d.value.name]),1)]),k(G[d.value.name])?a.withDirectives((a.openBlock(),a.createElementBlock("div",wm,null,512)),[[Ho,"This record is already associated.",void 0,{left:!0}]]):a.createCommentVNode("",!0)])]))),128)),a.createVNode(Nn,{rows:m.value,totalRecords:g.value,rowsPerPageOptions:[10,25,50,100],onPage:fe,template:"FirstPageLink PageLinks LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:""},null,8,["rows","totalRecords"])]),a.createElementVNode("div",Em,[a.createVNode(wt,{class:"mt-5"}),a.createElementVNode("div",Cm,[a.createElementVNode("div",vm,[a.createVNode(oe,{label:"Cancel",icon:"",severity:"secondary",onClick:A[8]||(A[8]=G=>e.value=!1)})]),a.createElementVNode("div",Om,[a.createVNode(oe,{label:"Save",severity:"success",onClick:M})])])])],64)}}},[["__scopeId","data-v-7fd52649"]]),Nm={class:"field flex flex-col"},Tm={key:0,class:"flex items-center"},Pm={key:1},Mm={class:"flex items-center"},Vm={class:"flex flex-col justify-center"},Am={class:"flex flex-row justify-between items-center"},Bm={class:"justify-start"},Fm={class:"justify-start"},$m={__name:"EntityLookupObject",props:a.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{type:[String,Number]},saveExistingEntityObject:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){Ht.useRoute();const t=n,e=a.useModel(n,"modelValue"),i=new qe,s=a.ref({}),o=a.ref({});let r=a.ref("");const l=a.ref({}),c=a.ref({});a.onMounted(async()=>{console.log("linkedEntity"),console.log(t.linkedEntity),console.log("entity360Name"),console.log(t.entity360Name),console.log("entity360Id"),console.log(t.entity360Id),await u(),await d()});const d=async()=>{try{const g=await i.getEntityRecords(t.linkedEntity.entityName);g&&g.response&&(s.value=g.response,await h(g.response.entity.entityDefinition.columns),await m(),console.log(s.value))}catch{}finally{}},u=async()=>{try{const g=await i.getRecord(t.entity360Name,t.entity360Id);g&&g.response&&(o.value=g.response,await f(g.response.entity.entityDefinition.columns),console.log(o.value))}catch{}finally{}},h=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(b.primaryKey&&b.primaryKey==!0){l.value=b;break}}},f=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(!b.autoGeneerated&&b.foreignKey&&b.foreignKey.referencedEntityName.toLowerCase()==t.linkedEntity.entityName.toLowerCase()){c.value=b;break}}},m=async()=>{for(let g=0;g<s.value.result.length;g++){const y=s.value.result[g];if(y[l.value.name]==o.value.result[0][c.value.name]){r.value=y;break}}},p=()=>{const g={linkedEntityRecordId:r.value[l.value.name],linkedEntityName:t.linkedEntity.entityName,relationType:"ManyToOne"};t.saveExistingEntityObject(g)};return(g,y)=>{const b=a.resolveComponent("Select"),_=a.resolveComponent("Divider"),w=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock("div",Nm,[a.createVNode(b,{modelValue:a.unref(r),"onUpdate:modelValue":y[0]||(y[0]=E=>a.isRef(r)?r.value=E:r=E),"item-value":l.value.name,options:s.value.result,filter:"",optionLabel:l.value.name,placeholder:"Select "+l.value.name,class:"w-full"},{value:a.withCtx(E=>[E.value?(a.openBlock(),a.createElementBlock("div",Tm,[a.createElementVNode("div",null,a.toDisplayString(E.value[l.value.name]),1)])):(a.openBlock(),a.createElementBlock("span",Pm,a.toDisplayString(E.placeholder),1))]),option:a.withCtx(E=>[a.createElementVNode("div",Mm,[a.createElementVNode("div",null,a.toDisplayString(E.option[l.value.name]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"]),a.createElementVNode("div",Vm,[a.createVNode(_),a.createElementVNode("div",Am,[a.createElementVNode("div",Bm,[a.createVNode(w,{label:"Cancel",icon:"",severity:"secondary",onClick:y[1]||(y[1]=E=>e.value=!1)})]),a.createElementVNode("div",Fm,[a.createVNode(w,{label:"Save",severity:"success",onClick:p})])])])])}}},Rm={style:{"font-weight":"700","font-size":"1.25rem"}},Lm={class:"flex flex-col"},Im={class:"flex flex-row justify-between items-center"},jm={class:"justify-start"},zm={class:"justify-start"},Wm="",Hm={__name:"CreateRelatedentity",props:a.mergeModels({entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0}},{showCreateRelatedEntityForm:{},showCreateRelatedEntityFormModifiers:{}}),emits:a.mergeModels(["onSaveDialog"],["update:showCreateRelatedEntityForm"]),setup(n,{emit:t}){const e=a.useModel(n,"showCreateRelatedEntityForm");Ht.useRoute();const i=n,s=i.linkedEntity.entityName,o=t,r=a.ref("Add existing");a.onMounted(()=>{m()});const{formData:l,columns:c,errors:d,backendErrors:u,clearErrors:h,saveRecord:f,fetchAllRecords:m,saveRelatedEntityRecord:p}=Ws(s,Wm,o),g=()=>{for(let w=0;w<c.value.length;w++){const E=c.value[w];!E.autoGenerated&&E.foreignKey&&(l.value[E.name]=i.entity360Id)}const _={relationType:i.linkedEntity.relationType,linkedEntities:{entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]}};f(_)},y=_=>{var w;if(((w=_==null?void 0:_.linkRecordIdList)==null?void 0:w.length)>0){const E={entityLinkage:[{linkEntityName:_.linkEntityName,linkRecordIdList:_.linkRecordIdList}]};p(i.entity360Name,i.entity360Id,E)}},b=_=>{const w={entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]};p(_.linkedEntityName,_.linkedEntityRecordId,w)};return(_,w)=>{const E=a.resolveComponent("Tab"),k=a.resolveComponent("TabList"),C=a.resolveComponent("Divider"),S=a.resolveComponent("Button"),x=a.resolveComponent("TabPanel"),O=a.resolveComponent("TabPanels"),M=a.resolveComponent("Tabs"),v=a.resolveComponent("Drawer");return a.openBlock(),a.createBlock(v,{visible:e.value,"onUpdate:visible":w[3]||(w[3]=T=>e.value=T),blockScroll:!0,position:"right",class:"p-fluid layout-profile-sidebar",style:{width:"40%"},pt:{closeButton:"ml-auto"}},{header:a.withCtx(()=>[a.createElementVNode("span",Rm,a.toDisplayString(r.value)+" "+a.toDisplayString(n.linkedEntity.entityName),1)]),default:a.withCtx(()=>[a.createVNode(M,{value:"1"},{default:a.withCtx(()=>[a.createVNode(k,null,{default:a.withCtx(()=>[a.createVNode(E,{value:"0"},{default:a.withCtx(()=>w[4]||(w[4]=[a.createTextVNode("Create new")])),_:1}),a.createVNode(E,{value:"1"},{default:a.withCtx(()=>w[5]||(w[5]=[a.createTextVNode("Add existing")])),_:1})]),_:1}),a.createVNode(O,null,{default:a.withCtx(()=>[a.createVNode(x,{value:"0"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(c),(T,$)=>{var U;return a.openBlock(),a.createElementBlock("div",{key:$,class:"mt-3"},[!T.autoGenerated&&!T.foreignKey?(a.openBlock(),a.createBlock(Ni,{key:0,modelValue:a.unref(l)[T.name],"onUpdate:modelValue":H=>a.unref(l)[T.name]=H,column:T,errors:(U=a.unref(d)[T.name])==null?void 0:U.messages,onInput:a.unref(h)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):a.createCommentVNode("",!0)])}),128)),a.createElementVNode("div",Lm,[a.createVNode(C),a.createElementVNode("div",Im,[a.createElementVNode("div",jm,[a.createVNode(S,{label:"Cancel",icon:"",severity:"secondary",onClick:w[0]||(w[0]=T=>e.value=!1)})]),a.createElementVNode("div",zm,[a.createVNode(S,{label:"Save",severity:"success",onClick:g})])])])]),_:1}),a.createVNode(x,{value:"1"},{default:a.withCtx(()=>[n.linkedEntity.relationType=="ONE_TO_MANY"?(a.openBlock(),a.createBlock(Dm,{key:0,modelValue:e.value,"onUpdate:modelValue":w[1]||(w[1]=T=>e.value=T),linkedEntity:n.linkedEntity,entity360Name:n.entity360Name,entity360Id:n.entity360Id,saveExistingRelatedEntityRecord:y},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):a.createCommentVNode("",!0),n.linkedEntity.relationType=="MANY_TO_ONE"?(a.openBlock(),a.createBlock($m,{key:1,modelValue:e.value,"onUpdate:modelValue":w[2]||(w[2]=T=>e.value=T),linkedEntity:n.linkedEntity,entity360Name:n.entity360Name,entity360Id:n.entity360Id,saveExistingEntityObject:b},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):a.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["visible"])}}},Um={class:"flex flex-col border-bottom-section pb-3 pt-3"},qm={class:"flex items-center pl-3 pr-3 justify-between"},Ym={key:0,class:"pi pi-caret-right"},Km={key:1,class:"pi pi-caret-down"},Xm={class:"ml-3 font-bold"},Gm={class:"ml-1"},Qm={class:"text-right"},Jm={key:0},Zm=Bt({__name:"LinkEntitySection",props:{entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0},entity360Name:{type:[String,Number]},onSaveRelatedEnttity:{type:Function}},setup(n){Ht.useRoute();const t=n,e=a.ref(!1),i=a.ref(!1),s=()=>{e.value=!e.value},o=()=>{i.value=!i.value},r=()=>{i.value=!1,t.onSaveRelatedEnttity()},l=a.computed(()=>t.linkedEntity.list.filter(c=>!c.is_deleted).length);return(c,d)=>{const u=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",Um,[a.createElementVNode("div",qm,[a.createElementVNode("div",{class:"flex cursor-pointer items-center linked-entity-section grow line-height-4",onClick:d[0]||(d[0]=h=>s())},[e.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Ym)),e.value?(a.openBlock(),a.createElementBlock("div",Km)):a.createCommentVNode("",!0),a.createElementVNode("div",Xm,a.toDisplayString(n.linkedEntity.entityName),1),a.createElementVNode("div",Gm," ("+a.toDisplayString(l.value)+") ",1)]),a.createElementVNode("div",Qm,[a.createVNode(u,{label:"Add",icon:"pi pi-plus",size:"small",onClick:d[1]||(d[1]=h=>o())})])]),e.value?(a.openBlock(),a.createElementBlock("div",Jm,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.linkedEntity.list,(h,f)=>(a.openBlock(),a.createElementBlock("div",{class:"flex flex-col",key:f},[h.is_deleted?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(Kf,{key:0,linkEntityListItem:h},null,8,["linkEntityListItem"]))]))),128))])):a.createCommentVNode("",!0)]),i.value?(a.openBlock(),a.createBlock(Hm,{key:0,showCreateRelatedEntityForm:i.value,"onUpdate:showCreateRelatedEntityForm":d[2]||(d[2]=h=>i.value=h),linkedEntity:n.linkedEntity,entity360Name:n.entity360Name,entity360Id:n.entity360Id,onOnSaveDialog:r},null,8,["showCreateRelatedEntityForm","linkedEntity","entity360Name","entity360Id"])):a.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-412eec44"]]),tp={class:"flex"},ep={class:"p-3 mt-3 flex-col items-center"},np={key:0,class:"pi pi-caret-right"},ip={key:1,class:"pi pi-caret-down"},sp={class:"font-bold ml-2"},op={key:0,class:"flex flex-col mt-4"},rp={class:"flex flex-col mt-2"},ap={class:"flex flex-row flex-wrap justify-between pl-5"},lp={class:"flex flex-col"},cp={class:"font-bold"},dp={class:"mt-2"},up={key:0,class:"flex flex-col",style:{position:"relative","max-width":"400px","background-color":"var(--surface-card)"}},hp={key:2,style:{width:"350px"},class:"flex flex-col justify-center"},fp={key:0,class:"custom-sidebar"},mp={class:"custom-sidebar-content"},pp={class:"custom-sidebar-button"},gp={class:"custom-sidebar-text"},pa=Bt({__name:"Entity360",props:{entityName:{type:String},recordId:{type:String}},emits:["onSaveDialog"],setup(n,{emit:t}){var x,O;const e=me(),i=Ht.useRoute(),s=n,o=a.ref(!0),r=a.ref(!1);let l=(x=i==null?void 0:i.params)==null?void 0:x.entityName,c=(O=i==null?void 0:i.params)==null?void 0:O.id;s.entityName&&(l=s.entityName),s.recordId&&(c=s.recordId);const d=t,{formData:u,columns:h,errors:f,backendErrors:m,isDataChange:p,linkedEntities:g,primarayColumn:y,clearErrors:b,saveRecord:_,getRelatedEntityRecordById:w,cancleRecord:E}=Ws(l,c,d);a.watch(()=>e.globalConfigs.appId,async M=>{M&&w()},{immediate:!0});const k=()=>{o.value=!o.value},C=()=>{r.value=!r.value},S=()=>{w()};return(M,v)=>{var R;const T=a.resolveComponent("SplitterPanel"),$=a.resolveComponent("Tab"),U=a.resolveComponent("TabList"),H=a.resolveComponent("TabPanel"),F=a.resolveComponent("TabPanels"),I=a.resolveComponent("Tabs"),B=a.resolveComponent("Splitter"),P=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",tp,[a.createVNode(B,{class:"flex-1",layout:"horizontal",gutterSize:8,size:100},{default:a.withCtx(()=>[a.createVNode(T,{size:20,minSize:10,maxSize:20},{default:a.withCtx(()=>[a.createElementVNode("div",ep,[a.createElementVNode("div",{onClick:v[0]||(v[0]=W=>k()),class:"section-heading cursor-pointer"},[o.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("i",np)),o.value?(a.openBlock(),a.createElementBlock("i",ip)):a.createCommentVNode("",!0),a.createElementVNode("span",sp," About this "+a.toDisplayString(a.unref(l)),1)]),o.value?(a.openBlock(),a.createElementBlock("div",op,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(h),(W,Z)=>{var Q;return a.openBlock(),a.createElementBlock("div",{key:Z},[W.autoGenerated?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(Ni,{key:0,modelValue:a.unref(u)[W.name],"onUpdate:modelValue":Y=>a.unref(u)[W.name]=Y,column:W,errors:(Q=a.unref(f)[W.name])==null?void 0:Q.messages,onInput:a.unref(b)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"]))])}),128))])):a.createCommentVNode("",!0)])]),_:1}),a.createVNode(T,{size:55,minSize:35,style:{height:"100%"}},{default:a.withCtx(()=>[a.createVNode(I,{value:"0"},{default:a.withCtx(()=>[a.createVNode(U,null,{default:a.withCtx(()=>[a.createVNode($,{value:"0"},{default:a.withCtx(()=>v[3]||(v[3]=[a.createTextVNode("Overview")])),_:1}),a.createVNode($,{value:"1"},{default:a.withCtx(()=>v[4]||(v[4]=[a.createTextVNode("Activity")])),_:1})]),_:1}),a.createVNode(F,null,{default:a.withCtx(()=>[a.createVNode(H,{value:"0"},{default:a.withCtx(()=>[a.createElementVNode("div",rp,[v[5]||(v[5]=a.createElementVNode("h3",{class:"mt-2 text-xl font-semibold"},"Data highlights",-1)),a.createElementVNode("div",ap,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(h).filter(W=>W.autoGenerated),(W,Z)=>(a.openBlock(),a.createElementBlock("div",{key:Z,class:"column-item"},[a.createElementVNode("div",lp,[a.createElementVNode("div",cp,a.toDisplayString(W.name),1),a.createElementVNode("div",dp,[a.createVNode(qs,{column:W,value:a.unref(u)[W.name]},null,8,["column","value"])])])]))),128))])])]),_:1}),a.createVNode(H,{value:"1"})]),_:1})]),_:1})]),_:1})]),_:1}),((R=a.unref(g))==null?void 0:R.length)>0?(a.openBlock(),a.createElementBlock("div",up,[r.value?(a.openBlock(),a.createBlock(P,{key:0,icon:"pi pi-caret-right",rounded:"",onClick:C,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})):a.createCommentVNode("",!0),r.value?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(P,{key:1,icon:"pi pi-caret-left",rounded:"",onClick:C,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})),r.value?(a.openBlock(),a.createElementBlock("div",hp,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(g),(W,Z)=>(a.openBlock(),a.createElementBlock("div",{key:Z},[a.createVNode(Zm,{entity360Name:a.unref(l),entity360Id:a.unref(c),linkedEntity:W,onSaveRelatedEnttity:S},null,8,["entity360Name","entity360Id","linkedEntity"])]))),128))])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)]),a.unref(p)?(a.openBlock(),a.createElementBlock("div",fp,[a.createElementVNode("div",mp,[a.createElementVNode("div",pp,[a.createVNode(P,{severity:"primary",onClick:v[1]||(v[1]=W=>a.unref(_)())},{default:a.withCtx(()=>v[6]||(v[6]=[a.createTextVNode("Save")])),_:1}),a.createVNode(P,{style:{"margin-left":"10px"},severity:"secondary",onClick:v[2]||(v[2]=W=>a.unref(E)())},{default:a.withCtx(()=>v[7]||(v[7]=[a.createTextVNode("Cancel")])),_:1})]),a.createElementVNode("div",gp," You've changed property in the "+a.toDisplayString(a.unref(l))+". ",1)])])):a.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-8d31dd1c"]]);function ga(){const n=new qe;let{errors:t,setErrors:e}=xr(),i=a.reactive({data:null});const s=C=>{i.data=C},o=async C=>{try{const S=await n.getEntityRecords(C);if(S&&S.response)return S}catch(S){return console.error("Error fetching entity:",S.errorMessage),S}finally{}},r=async(C,S)=>{try{let x=await n.addRecord(C.entityName,S);if(x)return x}catch(x){return x}finally{}},l=async(C,S,x)=>{try{const O=await n.updateRecord(C.entityName,S,x);if(O&&O.response)return O}catch(O){return O}finally{}},c=async(C,S)=>{try{S.filter==null&&(S.filter={}),Object.keys(S.filter).length===0&&(S.filter=[]);const x=await n.searchEntityRecords(C.entityName,S);if(x)return x.response.sortBy=S.sortBy,x.response.filters=S.filter,x.response.sortDirection=S.sortDirection,x.response.fullTextSearch=S.fullTextSearch,x}catch(x){return x}finally{}},d=async(C,S)=>{try{const x=await n.deleteRecord(C.entityName,S);if(x)return x}catch(x){console.error("Error on deleting record:",x.errorMessage)}finally{}},u=C=>C.result,h=C=>C.entity.entityDefinition.columns,f=C=>{const S=C.entity.entityDefinition.columns;let x={};for(let O=0;O<S.length;O++){const M=S[O];if(M.primaryKey&&M.primaryKey==!0){x=M;break}}return x},m=C=>{const S=C.entity.entityDefinition.columns;let x={};for(let O=0;O<S.length;O++){let M=S[O];M.autoGenerated||(x[M.name]="")}return x},p=(C,S)=>{let x="";const O=C.entity.entityDefinition.columns;for(let M=0;M<O.length;M++){let v=O[M];if(S==v.name){x=v.type;break}}return x},g=(C,S)=>{const O=C.entity.entityDefinition.columns.filter(v=>v.autoGenerated).map(v=>v.name);return Object.entries(S).filter(([v])=>!O.includes(v)).map(([v,T])=>({recordColumnName:v,recordColumnValue:T,columnType:p(i.data,v)}))},y=()=>{const C=i.data.entity.entityDefinition.columns;return zs().shape(C.reduce((x,O)=>(O.autoGenerated||(x[O.name]=js().nullable(!1).test({name:"custom-validation",test:function(M){const v=[];let T="";if(O.required&&(!M||M.trim()===""))if(O.validations){T=b(O.validations,"VALIDATE_REQUIRED"),v.push(T);let $=w(O.validations,"VALIDATE_REQUIRED");$&&($="hint:"+$,v.push($))}else T=O.displayName+" is required.",v.push(T);else{if(O.maxLength&&M.length>O.maxLength)if(O.validations){T=b(O.validations,"VALIDATE_MAXLENGTH"),v.push(T);let $=w(O.validations,"VALIDATE_MAXLENGTH");$&&($="hint:"+$,v.push($))}else T=O.displayName+" cannot exceed from "+O.maxLength+" characters",v.push(T);if(O.regxId&&!new RegExp(_(O.validations,"VALIDATE_REGX")).test(M))if(O.validations){T=b(O.validations,"VALIDATE_REGX"),v.push(T);let $=w(O.validations,"VALIDATE_REGX");$&&($="hint:"+$,v.push($))}else T=O.displayName+" invalid format.",v.push(T)}return v.length>0?this.createError({message:v}):!0}})),x),{}))},b=(C,S)=>{for(let x=0;x<C.length;x++)if(S==C[x].type)return C[x].message},_=(C,S)=>{for(let x=0;x<C.length;x++)if(S==C[x].type)return C[x].regx},w=(C,S)=>{for(let x=0;x<C.length;x++)if(S==C[x].type)return C[x].hint};return{state:i,setEntity:s,getEntity:o,addRecord:r,updateRecord:l,searchRecord:c,entityRecordDelete:d,getEntityItems:u,getEntityColumns:h,getPrimaryKeyColumn:f,getFormData:m,createDataToSave:g,createValidationSchema:y,clearErrors:C=>(e({...t.value,[C]:null}),t.value),validateData:async(C,S)=>{try{return await C.validate(S,{abortEarly:!1}),e({}),{validate:!0}}catch(x){const O=x.inner.reduce((T,$)=>(T[$.path]||(T[$.path]={messages:[]}),T[$.path].messages.push(...$.errors),T),{}),M=Object.entries(O).reduce((T,[$,U])=>(T[$]={messages:U.messages},T),{});return e(M),{validate:!1,errors:t.value}}}}}const ya={__name:"ConfirmDeleteDialog",props:{showDeleteDialog:{},showDeleteDialogModifiers:{}},emits:a.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(n,{emit:t}){const e=a.useModel(n,"showDeleteDialog"),i=t,s=o=>{i("onDeleteItem",{remove:o})};return(o,r)=>{const l=a.resolveComponent("Button"),c=a.resolveComponent("Dialog");return a.openBlock(),a.createBlock(c,{visible:e.value,"onUpdate:visible":r[2]||(r[2]=d=>e.value=d),style:{width:"450px"},header:"Confirm",modal:!0},{footer:a.withCtx(()=>[a.createVNode(l,{label:"No",icon:"pi pi-times",text:"",onClick:r[0]||(r[0]=d=>s(!1))}),a.createVNode(l,{label:"Yes",icon:"pi pi-check",text:"",onClick:r[1]||(r[1]=d=>s(!0))})]),default:a.withCtx(()=>[r[3]||(r[3]=a.createElementVNode("div",{class:"flex items-center justify-center"},[a.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),a.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}},yp={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},bp={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},Js={__name:"EntityFormDialog",props:a.mergeModels({item:Object},{showEntityForm:{},showEntityFormModifiers:{}}),emits:["update:showEntityForm"],setup(n){const t=a.useModel(n,"showEntityForm"),e=a.inject("entityObject"),i=n;let s=a.ref([]),o=a.ref({}),r=a.ref([]),l=a.ref(null),c=a.ref({});a.onMounted(()=>{s.value=e.getEntityColumns(e.state.data),i.item?o.value=JSON.parse(JSON.stringify(i.item)):o.value=e.getFormData(e.state.data),l.value=e.createValidationSchema()});const d=async()=>{const m=await e.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p=e.getPrimaryKeyColumn(e.state.data),g=i.item[p.name],y={dataDefinitions:e.createDataToSave(e.state.data,o.value)},b=await e.updateRecord(e.state.data,g,y);if(b&&b.success){t.value=!1;const _={sortBy:e.state.data.sortBy,sortDirection:e.state.data.sortDirection,pageSize:e.state.data.pageSize,currentPage:e.state.data.currentPage,columnList:null,filter:e.state.data.filters,fullTextSearch:e.state.data.fullTextSearch},w=await e.searchRecord(e.state.data,_);if(w!=null&&w.response){let E=w==null?void 0:w.response;e.setEntity(E)}}else b.validationErrors&&(r.value=JSON.parse(JSON.stringify(b.errvalidationErrorsors)))},u=async()=>{const m=await e.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p={dataDefinitions:e.createDataToSave(e.state.data,o.value)},g=await e.addRecord(e.state.data,p);g&&g.success?(t.value=!1,e.state.data=await e.getEntity(e.state.data.entityName)):g.validationErrors&&(r.value=JSON.parse(JSON.stringify(g.errvalidationErrorsors)))},h=async()=>{i.item?d():u()},f=m=>{c.value=e.clearErrors(m)};return(m,p)=>{const g=a.resolveComponent("Button"),y=a.resolveComponent("Dialog");return t.value?(a.openBlock(),a.createBlock(y,{key:0,showFooter:!1,visible:t.value,"onUpdate:visible":p[2]||(p[2]=b=>t.value=b),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:a.withCtx(()=>[n.item?(a.openBlock(),a.createElementBlock("span",yp,"Edit "+a.toDisplayString(a.unref(e).state.data.entityName)+" record details",1)):a.createCommentVNode("",!0),n.item?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",bp,"Add "+a.toDisplayString(a.unref(e).state.data.entityName)+" record details",1))]),footer:a.withCtx(()=>[a.createVNode(g,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:p[0]||(p[0]=b=>t.value=!1)}),a.createVNode(g,{type:"button",icon:"",label:"Save",severity:"success",onClick:p[1]||(p[1]=b=>h())})]),default:a.withCtx(()=>{var b;return[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(s),(_,w)=>{var E;return a.openBlock(),a.createElementBlock("div",{key:w},[!_.autoGenerated&&!_.foreignKey?(a.openBlock(),a.createBlock(Ni,{key:0,modelValue:a.unref(o)[_.name],"onUpdate:modelValue":k=>a.unref(o)[_.name]=k,column:_,errors:(E=a.unref(c)[_.name])==null?void 0:E.messages,onInput:f},null,8,["modelValue","onUpdate:modelValue","column","errors"])):a.createCommentVNode("",!0),!_.autoGenerated&&_.foreignKey?(a.openBlock(),a.createBlock($r,{key:1,modelValue:a.unref(o)[_.name],"onUpdate:modelValue":k=>a.unref(o)[_.name]=k,entityName:_.foreignKey.referencedEntityName,columnName:_.name,relatedEntityColumn:_.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):a.createCommentVNode("",!0)])}),128)),((b=a.unref(r))==null?void 0:b.length)>0?(a.openBlock(),a.createBlock(Fr,{key:0,errors:a.unref(r)},null,8,["errors"])):a.createCommentVNode("",!0)]}),_:1},8,["visible"])):a.createCommentVNode("",!0)}}},_p={class:"flex justify-between items-start"},xp={class:"flex-grow-1"},kp={class:"tile-grid"},Sp={class:"font-bold text-lg text-700"},wp={class:"flex flex-col gap-2"},Ep=Bt({__name:"EntityListSingleRecord",props:{item:Object},setup(n){const t=n,e=a.inject("entityObject"),i=a.ref([]),s=a.ref(!1),o=a.ref(!1);a.onMounted(()=>{i.value=e.getEntityColumns(e.state.data)});const r=()=>{s.value=!0},l=()=>{o.value=!0},c=u=>{u.remove==!0?d():s.value=!1},d=async()=>{const u=e.getPrimaryKeyColumn(e.state.data),h=t.item[u.name],f=await e.entityRecordDelete(e.state.data,h);if(f!=null&&f.success){s.value=!1;const m={sortBy:e.state.data.sortBy,sortDirection:e.state.data.sortDirection,pageSize:e.state.data.pageSize,currentPage:e.state.data.currentPage,columnList:null,filter:e.state.data.filters,fullTextSearch:e.state.data.fullTextSearch},p=await e.searchRecord(e.state.data,m);if(p!=null&&p.response){let g=p==null?void 0:p.response;e.setEntity(g)}console.log(f)}};return(u,h)=>{const f=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",_p,[a.createElementVNode("div",xp,[a.createElementVNode("div",kp,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(m,p)=>(a.openBlock(),a.createElementBlock("div",{key:p},[a.createElementVNode("span",Sp,a.toDisplayString(m.name)+" : ",1),a.createVNode(qs,{column:m,value:n.item[m.name]},null,8,["column","value"])]))),128))])]),a.createElementVNode("div",wp,[a.createVNode(f,{onClick:h[0]||(h[0]=m=>l()),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"}),a.createVNode(f,{onClick:h[1]||(h[1]=m=>r()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})])]),o.value?(a.openBlock(),a.createBlock(Js,{key:0,showEntityForm:o.value,"onUpdate:showEntityForm":h[2]||(h[2]=m=>o.value=m),item:n.item},null,8,["showEntityForm","item"])):a.createCommentVNode("",!0),s.value?(a.openBlock(),a.createBlock(ya,{key:1,showDeleteDialog:s.value,"onUpdate:showDeleteDialog":h[3]||(h[3]=m=>s.value=m),onOnDeleteItem:c},null,8,["showDeleteDialog"])):a.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-ea3b758f"]]),Cp=Bt({__name:"EntityListRecordParent",props:{listItemDisplay:String},setup(n){const t=a.inject("entityObject"),e=a.ref([]);return a.watch(()=>t.state.data,i=>{i&&(e.value=i.result,console.log("Entity state updated in child:",t))},{immediate:!0}),(i,s)=>(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.value,(o,r)=>(a.openBlock(),a.createElementBlock("div",{key:r,class:"card rounded-md p-5 my-2 shadow-lg relative tile"},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.listItemDisplay!=null&&n.listItemDisplay!=""?n.listItemDisplay:Ep),a.mergeProps({ref_for:!0},{item:o}),null,16))]))),128))}},[["__scopeId","data-v-b13f837f"]]),vp={};function Op(n,t){return null}const Dp=Bt(vp,[["render",Op]]),Np={class:"my-2"},Tp={class:"m-0"},Pp={__name:"EntityListHeaderSlot",setup(n){const t=a.inject("entityObject");let e=a.ref("");return a.watch(()=>t.state.data,i=>{i&&(e.value=i.entityName)},{immediate:!0}),(i,s)=>{const o=a.resolveComponent("Toolbar");return a.openBlock(),a.createBlock(o,{class:"p-2 my-2"},{start:a.withCtx(()=>[a.createElementVNode("div",Np,[a.createElementVNode("h2",Tp,"EntityName: "+a.toDisplayString(a.unref(e)),1)])]),end:a.withCtx(()=>s[0]||(s[0]=[])),_:1})}}},Mp={class:"flex flex-col mb-5"},Vp={class:"col-12"},Ap={class:"flex flex-col mb-5"},Bp={class:"col-12"},Fp={key:0},$p={class:"flex flex-col mb-5"},Rp={class:"col-12"},Lp={class:"flex flex-col mb-5"},Ip={class:"col-12"},jp={class:"flex flex-col mb-5"},zp={class:"col-12"},Wp={class:"flex flex-row justify-between items-center"},Hp={key:1},Up={class:"flex flex-row justify-between items-center"},qp={key:1,class:"text-red-500"},Yp={class:"flex flex-col"},Kp={class:"flex flex-row justify-between items-center"},Xp={__name:"FilterSortSidebar",props:a.mergeModels({headers:Array,operatorMap:Object,sortCallback:Function,filterCallback:Function,getColumnDatatype:Function,getDatatypeByField:Function},{sortBy:{},sortByModifiers:{},sortDirection:{},sortDirectionModifiers:{},showFilter:{},showFilterModifiers:{},filters:{},filtersModifiers:{}}),emits:["update:sortBy","update:sortDirection","update:showFilter","update:filters"],setup(n){const t=a.useModel(n,"sortBy"),e=a.useModel(n,"sortDirection"),i=a.useModel(n,"showFilter"),s=a.useModel(n,"filters"),o={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"},r=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],l=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],c=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],d=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],u=[{label:"ASC",value:1},{label:"DESC",value:-1}];let h=[];const f=a.computed(()=>n.headers.filter(S=>S.sortable)),m=a.computed(()=>n.headers.filter(S=>S.filterable)),p=S=>n.headers.filter(x=>{var O;return x.filterable?((O=s.value[S])==null?void 0:O.columnName)===x.name?!0:!s.value.some((M,v)=>v!==S&&M.columnName===x.name):!1}).map(x=>({label:x.name,value:x.field})),g=S=>{let x="";switch(n.getDatatypeByField(S.columnName).toLowerCase()){case"string":case"uuid":x="startsWith";break;case"date":x="dateIs";break;case"numeric":case"int":case"integer":x="equals";break;case"bool":case"boolean":x="equals";break}S.operator=x,S.value=""},y=S=>{const x=n.getDatatypeByField(S.columnName);switch(x&&x.toLowerCase()){case"integer":case"int":case"numeric":h=l;break;case"date":h=d;break;case"bool":case"boolean":h=c;break;default:h=r}return h},b=S=>{if(S&&S.columnName){const x=n.getDatatypeByField(S.columnName);return n.getColumnDatatype(x)}else return""},_=()=>{for(let S=0;S<s.value.length;S++){const x=s.value[S];x.editing=!1}s.value.push({columnName:"",value:"",operator:"",editing:!0})},w=S=>{s.value.splice(S,1)},E=S=>{S.editing=!S.editing},k=()=>{let S=[],x=JSON.parse(JSON.stringify(s.value));for(let O=0;O<x.length;O++){const M=x[O];delete M.editing,M.columnName&&M.operator&&M.value&&(M.columnType=n.getDatatypeByField(M.columnName),M.operator=n.operatorMap[M.operator],S.push(M))}n.filterCallback(S)},C=()=>{n.sortCallback()};return(S,x)=>{const O=a.resolveComponent("Select"),M=a.resolveComponent("Divider"),v=a.resolveComponent("InputNumber"),T=a.resolveComponent("Calendar"),$=a.resolveComponent("InputText"),U=a.resolveComponent("Button"),H=a.resolveComponent("Drawer");return a.openBlock(),a.createBlock(H,{visible:i.value,"onUpdate:visible":x[4]||(x[4]=F=>i.value=F),header:"Sorting and Filter",blockScroll:!0,position:"right",class:"layout-profile-sidebar !w-full md:!w-80 lg:!w-[30rem]",pt:{closeButton:"ml-auto"}},{default:a.withCtx(()=>[a.createElementVNode("div",Mp,[x[5]||(x[5]=a.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),a.createElementVNode("div",Vp,[a.createVNode(O,{modelValue:t.value,"onUpdate:modelValue":x[0]||(x[0]=F=>t.value=F),options:f.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:x[1]||(x[1]=F=>C(S.event))},null,8,["modelValue","options"])])]),a.createElementVNode("div",Ap,[x[6]||(x[6]=a.createElementVNode("div",{class:"col-12 font-bold"},[a.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),a.createElementVNode("div",Bp,[a.createVNode(O,{modelValue:e.value,"onUpdate:modelValue":x[2]||(x[2]=F=>e.value=F),options:u,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:x[3]||(x[3]=F=>C(S.event))},null,8,["modelValue"])])]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,(F,I)=>(a.openBlock(),a.createElementBlock("div",{key:I},[F.editing?(a.openBlock(),a.createElementBlock("div",Fp,[a.createVNode(M),a.createElementVNode("div",$p,[x[7]||(x[7]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),a.createElementVNode("div",Rp,[a.createVNode(O,{modelValue:F.columnName,"onUpdate:modelValue":B=>F.columnName=B,options:p(I),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:B=>g(F)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),a.createElementVNode("div",Lp,[x[8]||(x[8]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),a.createElementVNode("div",Ip,[a.createVNode(O,{modelValue:F.operator,"onUpdate:modelValue":B=>F.operator=B,options:y(F),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),a.createElementVNode("div",jp,[x[9]||(x[9]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),a.createElementVNode("div",zp,[b(F)=="numeric"?(a.openBlock(),a.createBlock(v,{key:0,format:!1,class:"w-full",modelValue:F.value,"onUpdate:modelValue":B=>F.value=B,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):b(F)=="date"?(a.openBlock(),a.createBlock(T,{key:1,class:"w-full",modelValue:F.value,"onUpdate:modelValue":B=>F.value=B,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(a.openBlock(),a.createBlock($,{key:2,modelValue:F.value,"onUpdate:modelValue":B=>F.value=B,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),a.createElementVNode("div",Wp,[a.createVNode(U,{label:"Hide",icon:"",severity:"warn",onClick:B=>E(F)},null,8,["onClick"]),a.createVNode(U,{label:"Delete",icon:"",severity:"danger",onClick:B=>w(I)},null,8,["onClick"])])])):a.createCommentVNode("",!0),F.editing?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Hp,[a.createVNode(M),a.createElementVNode("div",Up,[a.createElementVNode("span",null,[F.columnName||F.operator||F.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!F.columnName})},a.toDisplayString(F.columnName?" "+F.columnName:" column"),3),a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!o[F.operator]})},a.toDisplayString(F.operator?" "+o[F.operator]:" operator"),3),a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!F.value})},a.toDisplayString(F.value?" "+F.value:" value"),3)],64)):(a.openBlock(),a.createElementBlock("span",qp,"Filter is empty"))]),a.createVNode(U,{label:"Edit",icon:"",severity:"info",onClick:B=>E(F)},null,8,["onClick"])])]))]))),128)),a.createElementVNode("div",Yp,[a.createVNode(M),a.createElementVNode("div",Kp,[a.createVNode(U,{label:"Add",disabled:m.value.length===s.value.length,icon:"",severity:"success",onClick:_},null,8,["disabled"]),a.createVNode(U,{label:"Apply",severity:"info",onClick:k})])])]),_:1},8,["visible"])}}},Gp={class:"my-2"},Wi={__name:"EntityListFilters",setup(n){const t=a.inject("entityObject"),e=a.ref(!1),i=a.ref([]),s=a.ref([]),o=a.ref(""),r=a.ref(1);let l=a.ref("");const c=a.ref([]),d=a.ref([]),u={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};a.watch(()=>t.state.data,E=>{if(E&&(c.value=t.getEntityColumns(E),d.value=b(c.value),o.value=="")){const k=t.getPrimaryKeyColumn(E);o.value=k.name}},{immediate:!0});const h=()=>{e.value=!e.value},f=E=>{s.value=E,m()},m=async()=>{const E={sortBy:[o.value],sortDirection:r.value===1?"ASC":"DESC",pageSize:t.state.data.pageSize,currentPage:t.state.data.currentPage,columnList:null,filter:s.value,fullTextSearch:l.value},k=await t.searchRecord(t.state.data,E);if(k!=null&&k.success){let C=k==null?void 0:k.response;t.setEntity(C)}},p=()=>{m()},g=()=>{i.value=[],s.value=[],m()},y=()=>{m()},b=E=>E.map(k=>({field:k.name,name:k.displayName?k.displayName:k.name,filterable:k.filterable,datatype:k.type,sortable:k.indexColumn,displayFormatKey:k.displayFormatKey,displayFormat:k.displayFormat})),_=E=>{switch(E.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},w=E=>{const k=c.value.find(C=>C.name===E);return k?k.type:null};return(E,k)=>{const C=a.resolveComponent("Button"),S=a.resolveComponent("InputIcon"),x=a.resolveComponent("InputText"),O=a.resolveComponent("IconField"),M=a.resolveComponent("Toolbar");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(M,{class:"p-2 my-2"},{start:a.withCtx(()=>[a.createElementVNode("div",Gp,[a.createVNode(C,{type:"button",size:"medium",icon:"pi pi-filter",label:"Filter",severity:"info",onClick:k[0]||(k[0]=v=>h())})]),a.createVNode(C,{class:"ml-3",size:"medium",type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warn",onClick:k[1]||(k[1]=v=>g())})]),end:a.withCtx(()=>[a.createVNode(O,{iconPosition:"right",class:"block mt-2 md:mt-0"},{default:a.withCtx(()=>[a.createVNode(S,{onClick:k[2]||(k[2]=v=>y()),class:"pi pi-search"}),a.createVNode(x,{class:"w-full sm:w-auto",onKeyup:k[3]||(k[3]=a.withKeys(v=>y(),["enter"])),modelValue:a.unref(l),"onUpdate:modelValue":k[4]||(k[4]=v=>a.isRef(l)?l.value=v:l=v),placeholder:"Search..."},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(Xp,{sortBy:o.value,"onUpdate:sortBy":k[5]||(k[5]=v=>o.value=v),sortDirection:r.value,"onUpdate:sortDirection":k[6]||(k[6]=v=>r.value=v),showFilter:e.value,"onUpdate:showFilter":k[7]||(k[7]=v=>e.value=v),filters:i.value,"onUpdate:filters":k[8]||(k[8]=v=>i.value=v),headers:d.value,operatorMap:u,sortCallback:p,filterCallback:f,getColumnDatatype:_,getDatatypeByField:w},null,8,["sortBy","sortDirection","showFilter","filters","headers"])],64)}}},ba={__name:"EntityListPagination",setup(n){const t=a.ref(25),e=a.ref(0),i=a.ref(0),s=a.ref(0);let o=a.inject("entityObject");const r=async l=>{t.value=l.rows,e.value=l.page,s.value=l.first;const c={sortBy:o.state.data.sortBy,sortDirection:o.state.data.sortDirection,columnList:null,filter:o.state.data.filters,fullTextSearch:o.state.data.fullTextSearch,pageSize:t.value,currentPage:e.value},d=await o.searchRecord(o.state.data,c);if(d!=null&&d.success){let u=d==null?void 0:d.response;o.setEntity(u),i.value=d.response.totalRecords,s.value=e.value*t.value}};return a.watch(()=>{var l,c;return(c=(l=o==null?void 0:o.state)==null?void 0:l.data)==null?void 0:c.totalRecords},l=>{i&&(i.value=l)},{immediate:!0}),(l,c)=>{const d=a.resolveComponent("Paginator");return a.openBlock(),a.createBlock(d,{class:"my-4",rows:t.value,totalRecords:i.value,rowsPerPageOptions:[10,25,50,100],onPage:r,template:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},null,8,["rows","totalRecords"])}}},Qp={class:"flex flex-row justify-end p-2 my-2"},Hi={__name:"EntityListAddButton",setup(n){const t=a.ref(!1),e=()=>{t.value=!0};return(i,s)=>{const o=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",Qp,[a.createVNode(o,{label:"Add",size:"medium",icon:"pi pi-plus",onClick:s[0]||(s[0]=r=>e())})]),t.value?(a.openBlock(),a.createBlock(Js,{key:0,showEntityForm:t.value,"onUpdate:showEntityForm":s[1]||(s[1]=r=>t.value=r)},null,8,["showEntityForm"])):a.createCommentVNode("",!0)],64)}}},_a={__name:"EntityList",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,listFilerSlot:Boolean,className:{type:String,default:"default-class"}},setup(n,{expose:t}){const e=ga(),i=me();a.provide("entityObject",e);const s=n;return t({props:s,reload:()=>{console.log("reload data")}}),a.watch(()=>i.globalConfigs.appId,async r=>{if(r){const l=await e.getEntity(s.entityName);l.success?e.setEntity(l.response):e.setEntity({result:[]})}},{immediate:!0}),(r,l)=>{var c,d,u;return r.$slots["list-item-display"]?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[n.showAddButton?(a.openBlock(),a.createBlock(Hi,{key:0})):a.createCommentVNode("",!0),n.listFilerSlot?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.listFilter||Wi),{key:1})):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(((u=(d=(c=a.unref(e))==null?void 0:c.state)==null?void 0:d.data)==null?void 0:u.result)||[],h=>a.renderSlot(r.$slots,"list-item-display",{item:h})),256))],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.listHeader||Pp))),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.listFilter||Wi))),n.showAddButton?(a.openBlock(),a.createBlock(Hi,{key:0})):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.listDisplay||Cp),a.normalizeProps(a.guardReactiveProps({listItemDisplay:n.listItemDisplay})),null,16)),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.listPagination||ba))),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.listFooter||Dp)))],64))}}},Jp={key:0},Zp=["href"],tg={key:1},eg={class:"action-buttons"},ng=Bt({__name:"EntityListingSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,displayField:String,baseUrl:String,hrefKey:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(n){const t=n,e=a.inject("entityObject"),i=a.ref([]),s=a.ref(null),o=a.ref(null),r=a.ref(!1),l=a.ref(!1);a.onMounted(()=>{i.value=e.getEntityColumns(e.state.data),s.value=i.value.find(f=>f.name===t.displayField)||null,s.value&&(o.value=t.item[s.value.name])});const c=()=>{r.value=!0},d=()=>{l.value=!0},u=async f=>{f.remove?h():r.value=!1},h=async()=>{const f=e.getPrimaryKeyColumn(e.state.data),m=t.item[f.name],p=await e.entityRecordDelete(e.state.data,m);if(p!=null&&p.success){r.value=!1;const g=await e.searchRecord(e.state.data,{sortBy:e.state.data.sortBy,sortDirection:e.state.data.sortDirection,pageSize:e.state.data.pageSize,currentPage:e.state.data.currentPage,columnList:null,filter:e.state.data.filters,fullTextSearch:e.state.data.fullTextSearch});g!=null&&g.response&&e.setEntity(g.response)}};return(f,m)=>{const p=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("ul",{class:a.normalizeClass(t.className)},[s.value?(a.openBlock(),a.createElementBlock("li",Jp,[a.createElementVNode("a",{href:`${n.baseUrl}/${n.item[n.hrefKey]}`,target:"_blank",class:"hover:underline"},a.toDisplayString(o.value),9,Zp)])):(a.openBlock(),a.createElementBlock("li",tg,[a.createElementVNode("span",null,"No matching field found for '"+a.toDisplayString(o.value)+"'.",1)])),a.createElementVNode("li",eg,[n.editable?(a.openBlock(),a.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):a.createCommentVNode("",!0),n.deletable?(a.openBlock(),a.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):a.createCommentVNode("",!0)])],2),l.value?(a.openBlock(),a.createBlock(Js,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:n.item},null,8,["showEntityForm","item"])):a.createCommentVNode("",!0),r.value?(a.openBlock(),a.createBlock(ya,{key:1,showDeleteDialog:r.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>r.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):a.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-45d1d6a4"]]),ig={key:0,class:"error-message"},sg={class:"text-red-500 font-bold"},og={key:0},rg={key:1},ag={key:2},lg={key:3},cg={key:1},xa=Bt({__name:"EntityListing",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},displayField:String,baseUrl:String,hrefKey:String,editable:Boolean,deletable:Boolean},setup(n,{expose:t}){const e=ga(),i=me();a.provide("entityObject",e);const s=n;console.log("classname",s.className);const o=a.ref([]);return a.watch(()=>e.state.data,c=>{c&&(o.value=c.result)},{immediate:!0}),t({props:s,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),a.watch(()=>i.globalConfigs.appId,async c=>{if(c){const d=await e.getEntity(s.entityName);e.setEntity(d.success?d.response:{result:[]})}},{immediate:!0}),(c,d)=>{var u,h,f;return c.$slots["list-item-display-unOrdered"]?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(c.$slots,"header",{},void 0,!0),n.showAddButton?(a.openBlock(),a.createBlock(Hi,{key:0})):a.createCommentVNode("",!0),n.showFilters?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.listFilter||Wi),{key:1})):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(((f=(h=(u=a.unref(e))==null?void 0:u.state)==null?void 0:h.data)==null?void 0:f.result)||[],m=>a.renderSlot(c.$slots,"list-item-display-unOrdered",{item:m},void 0,!0)),256)),a.renderSlot(c.$slots,"footer",{},void 0,!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.renderSlot(c.$slots,"header",{},void 0,!0),!n.displayField||!n.baseUrl||!n.hrefKey||!n.entityName?(a.openBlock(),a.createElementBlock("div",ig,[a.createElementVNode("p",sg,[d[0]||(d[0]=a.createTextVNode(" Error: Missing required props - ")),n.entityName?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",og,"Entity Name")),n.displayField?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",rg,"Display Field")),n.baseUrl?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",ag,"Base Url")),n.hrefKey?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",lg,"Href Key"))])])):(a.openBlock(),a.createElementBlock("div",cg,[n.showFilters?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.listFilter||Wi),{key:0})):a.createCommentVNode("",!0),n.showAddButton?(a.openBlock(),a.createBlock(Hi,{key:1})):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,(m,p)=>(a.openBlock(),a.createElementBlock("div",{key:p},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.listItemDisplay!=null&&n.listItemDisplay!=""?n.listItemDisplay:ng),a.mergeProps({ref_for:!0},{item:m,...s}),null,16))]))),128)),n.showPagination?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.listPagination||ba),{key:2})):a.createCommentVNode("",!0)])),a.renderSlot(c.$slots,"footer",{},void 0,!0)],64))}}},[["__scopeId","data-v-2cc6f4ac"]]),dg={install(n,t){n.component("CSEntityGrid",zr),n.component("csentitygrid",zr),n.component("CSEntityList",_a),n.component("csentitylist",_a),n.component("CSEntityBarChart",da),n.component("csentitybarchart",da),n.component("CSEntityLineChart",ua),n.component("csentitylinechart",ua),n.component("CSEntityPieChart",ha),n.component("csentitypiechart",ha),n.component("CSEntityPolarChart",fa),n.component("csentitypolarchart",fa),n.component("CSEntityRadarChart",ma),n.component("csentityradarchart",ma),n.component("CSEntity360View",pa),n.component("csentity360view",pa),n.component("CSEntityListing",xa),n.component("csentitylisting",xa)}},ka=6048e5,ug=864e5,Sa=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Sa in n?n[Sa](t):n instanceof Date?new n.constructor(t):new Date(t)}function ee(n,t){return Ae(t||n,n)}let hg={};function Ui(){return hg}function qn(n,t){var l,c,d,u;const e=Ui(),i=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??e.weekStartsOn??((u=(d=e.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=ee(n,t==null?void 0:t.in),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function qi(n,t){return qn(n,{...t,weekStartsOn:1})}function wa(n,t){const e=ee(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=qi(s),r=Ae(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const l=qi(r);return e.getTime()>=o.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function Ea(n){const t=ee(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function fg(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ca(n,t){const e=ee(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function mg(n,t,e){const[i,s]=fg(e==null?void 0:e.in,n,t),o=Ca(i),r=Ca(s),l=+o-Ea(o),c=+r-Ea(r);return Math.round((l-c)/ug)}function pg(n,t){const e=wa(n,t),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),qi(i)}function gg(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function yg(n){return!(!gg(n)&&typeof n!="number"||isNaN(+ee(n)))}function bg(n,t){const e=ee(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const _g={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},xg=(n,t,e)=>{let i;const s=_g[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Zs(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const kg={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sg={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wg={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Eg={date:Zs({formats:kg,defaultWidth:"full"}),time:Zs({formats:Sg,defaultWidth:"full"}),dateTime:Zs({formats:wg,defaultWidth:"full"})},Cg={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vg=(n,t,e,i)=>Cg[n];function Yn(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const r=n.defaultFormattingWidth||n.defaultWidth,l=e!=null&&e.width?String(e.width):r;s=n.formattingValues[l]||n.formattingValues[r]}else{const r=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[l]||n.values[r]}const o=n.argumentCallback?n.argumentCallback(t):t;return s[o]}}const Og={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Dg={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ng={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Tg={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Pg={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mg={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Vg={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Yn({values:Og,defaultWidth:"wide"}),quarter:Yn({values:Dg,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Yn({values:Ng,defaultWidth:"wide"}),day:Yn({values:Tg,defaultWidth:"wide"}),dayPeriod:Yn({values:Pg,defaultWidth:"wide",formattingValues:Mg,defaultFormattingWidth:"wide"})};function Kn(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],o=t.match(s);if(!o)return null;const r=o[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(l)?Bg(l,h=>h.test(r)):Ag(l,h=>h.test(r));let d;d=n.valueCallback?n.valueCallback(c):c,d=e.valueCallback?e.valueCallback(d):d;const u=t.slice(r.length);return{value:d,rest:u}}}function Ag(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Bg(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Fg(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],o=t.match(n.parsePattern);if(!o)return null;let r=n.valueCallback?n.valueCallback(o[0]):o[0];r=e.valueCallback?e.valueCallback(r):r;const l=t.slice(s.length);return{value:r,rest:l}}}const $g=/^(\d+)(th|st|nd|rd)?/i,Rg=/\d+/i,Lg={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ig={any:[/^b/i,/^(a|c)/i]},jg={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zg={any:[/1/i,/2/i,/3/i,/4/i]},Wg={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Hg={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ug={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},qg={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Yg={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Kg={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Xg={ordinalNumber:Fg({matchPattern:$g,parsePattern:Rg,valueCallback:n=>parseInt(n,10)}),era:Kn({matchPatterns:Lg,defaultMatchWidth:"wide",parsePatterns:Ig,defaultParseWidth:"any"}),quarter:Kn({matchPatterns:jg,defaultMatchWidth:"wide",parsePatterns:zg,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Kn({matchPatterns:Wg,defaultMatchWidth:"wide",parsePatterns:Hg,defaultParseWidth:"any"}),day:Kn({matchPatterns:Ug,defaultMatchWidth:"wide",parsePatterns:qg,defaultParseWidth:"any"}),dayPeriod:Kn({matchPatterns:Yg,defaultMatchWidth:"any",parsePatterns:Kg,defaultParseWidth:"any"})},Gg={code:"en-US",formatDistance:xg,formatLong:Eg,formatRelative:vg,localize:Vg,match:Xg,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Qg(n,t){const e=ee(n,t==null?void 0:t.in);return mg(e,bg(e))+1}function Jg(n,t){const e=ee(n,t==null?void 0:t.in),i=+qi(e)-+pg(e);return Math.round(i/ka)+1}function va(n,t){var u,h,f,m;const e=ee(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ui(),o=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(f=s.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,r=Ae((t==null?void 0:t.in)||n,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const l=qn(r,t),c=Ae((t==null?void 0:t.in)||n,0);c.setFullYear(i,0,o),c.setHours(0,0,0,0);const d=qn(c,t);return+e>=+l?i+1:+e>=+d?i:i-1}function Zg(n,t){var l,c,d,u;const e=Ui(),i=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(d=e.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=va(n,t),o=Ae((t==null?void 0:t.in)||n,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),qn(o,t)}function ty(n,t){const e=ee(n,t==null?void 0:t.in),i=+qn(e,t)-+Zg(e,t);return Math.round(i/ka)+1}function ot(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Be={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return ot(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):ot(e+1,2)},d(n,t){return ot(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return ot(n.getHours()%12||12,t.length)},H(n,t){return ot(n.getHours(),t.length)},m(n,t){return ot(n.getMinutes(),t.length)},s(n,t){return ot(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return ot(s,t.length)}},yn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Oa={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Be.y(n,t)},Y:function(n,t,e,i){const s=va(n,i),o=s>0?s:1-s;if(t==="YY"){const r=o%100;return ot(r,2)}return t==="Yo"?e.ordinalNumber(o,{unit:"year"}):ot(o,t.length)},R:function(n,t){const e=wa(n);return ot(e,t.length)},u:function(n,t){const e=n.getFullYear();return ot(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ot(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ot(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Be.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return ot(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=ty(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):ot(s,t.length)},I:function(n,t,e){const i=Jg(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ot(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Be.d(n,t)},D:function(n,t,e){const i=Qg(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ot(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ot(o,2);case"eo":return e.ordinalNumber(o,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ot(o,t.length);case"co":return e.ordinalNumber(o,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return ot(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=yn.noon:i===0?s=yn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=yn.evening:i>=12?s=yn.afternoon:i>=4?s=yn.morning:s=yn.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Be.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Be.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ot(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ot(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Be.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Be.s(n,t)},S:function(n,t){return Be.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Na(i);case"XXXX":case"XX":return Ge(i);case"XXXXX":case"XXX":default:return Ge(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Na(i);case"xxxx":case"xx":return Ge(i);case"xxxxx":case"xxx":default:return Ge(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Da(i,":");case"OOOO":default:return"GMT"+Ge(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Da(i,":");case"zzzz":default:return"GMT"+Ge(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return ot(i,t.length)},T:function(n,t,e){return ot(+n,t.length)}};function Da(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),o=i%60;return o===0?e+String(s):e+String(s)+t+ot(o,2)}function Na(n,t){return n%60===0?(n>0?"-":"+")+ot(Math.abs(n)/60,2):Ge(n,t)}function Ge(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=ot(Math.trunc(i/60),2),o=ot(i%60,2);return e+s+t+o}const Ta=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Pa=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ey={p:Pa,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Ta(n,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Ta(i,t)).replace("{{time}}",Pa(s,t))}},ny=/^D+$/,iy=/^Y+$/,sy=["D","DD","YY","YYYY"];function oy(n){return ny.test(n)}function ry(n){return iy.test(n)}function ay(n,t,e){const i=ly(n,t,e);if(console.warn(i),sy.includes(n))throw new RangeError(i)}function ly(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const cy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uy=/^'([^]*?)'?$/,hy=/''/g,fy=/[a-zA-Z]/;function Ma(n,t,e){var u,h,f,m;const i=Ui(),s=i.locale??Gg,o=i.firstWeekContainsDate??((h=(u=i.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,r=i.weekStartsOn??((m=(f=i.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??0,l=ee(n,e==null?void 0:e.in);if(!yg(l))throw new RangeError("Invalid time value");let c=t.match(dy).map(p=>{const g=p[0];if(g==="p"||g==="P"){const y=ey[g];return y(p,s.formatLong)}return p}).join("").match(cy).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:my(p)};if(Oa[g])return{isToken:!0,value:p};if(g.match(fy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return c.map(p=>{if(!p.isToken)return p.value;const g=p.value;(ry(g)||oy(g))&&ay(g,t,String(n));const y=Oa[g[0]];return y(l,g,s.localize,d)}).join("")}function my(n){const t=n.match(uy);return t?t[1].replace(hy,"'"):n}const py=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(n,t){const{value:e,arg:i}=t;if(n&&e){const s=Ma(new Date(e),i||"yyyy-MM-dd");n.textContent=s}},updated(n,t){const{value:e,arg:i}=t;if(n&&e){const s=Ma(new Date(e),i||"yyyy-MM-dd");n.textContent=s}}}},Symbol.toStringTag,{value:"Module"})),gy=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(n,t){const{value:e,arg:i}=t;e&&(n.textContent=n.textContent.toUpperCase())},updated(n,t){const{value:e,arg:i}=t;e&&(n.textContent=n.textContent.toUpperCase())}}},Symbol.toStringTag,{value:"Module"}));/*!
155
+ `)},yh={},bh={},Ot={name:"base",css:gh,theme:ph,classes:yh,inlineStyles:bh,load:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(o){return o},s=i(rt(e,{dt:Hn}));return we(s)?ah(Wn(s),fo({name:this.name},t)):{}},loadCSS:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.load(this.css,e)},loadTheme:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return this.load(this.theme,t,function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return Me.transformCSS(t.name||e.name,"".concat(s).concat(i))})},getCommonTheme:function(e){return Me.getCommon(this.name,e)},getComponentTheme:function(e){return Me.getComponent(this.name,e)},getDirectiveTheme:function(e){return Me.getDirective(this.name,e)},getPresetTheme:function(e,t,i){return Me.getCustomPreset(this.name,e,t,i)},getLayerOrderThemeCSS:function(){return Me.getLayerOrderCSS(this.name)},getStyleSheet:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.css){var i=rt(this.css,{dt:Hn})||"",s=Wn("".concat(i).concat(e)),o=Object.entries(t).reduce(function(a,l){var c=fa(l,2),d=c[0],u=c[1];return a.push("".concat(d,'="').concat(u,'"'))&&a},[]).join(" ");return we(s)?'<style type="text/css" data-primevue-style-id="'.concat(this.name,'" ').concat(o,">").concat(s,"</style>"):""}return""},getCommonThemeStyleSheet:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Me.getCommonStyleSheet(this.name,e,t)},getThemeStyleSheet:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=[Me.getStyleSheet(this.name,e,t)];if(this.theme){var s=this.name==="base"?"global-style":"".concat(this.name,"-style"),o=rt(this.theme,{dt:Hn}),a=Wn(Me.transformCSS(s,o)),l=Object.entries(t).reduce(function(c,d){var u=fa(d,2),f=u[0],h=u[1];return c.push("".concat(f,'="').concat(h,'"'))&&c},[]).join(" ");we(a)&&i.push('<style type="text/css" data-primevue-style-id="'.concat(s,'" ').concat(l,">").concat(a,"</style>"))}return i.join("")},extend:function(e){return fo(fo({},this),{},{css:void 0,theme:void 0},e)}},pa=Ot.extend({name:"common"});function Kn(n){"@babel/helpers - typeof";return Kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kn(n)}function xh(n){return xa(n)||_h(n)||ya(n)||ga()}function _h(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Xn(n,e){return xa(n)||kh(n,e)||ya(n,e)||ga()}function ga(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
156
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ya(n,e){if(n){if(typeof n=="string")return ba(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ba(n,e):void 0}}function ba(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=Array(e);t<e;t++)i[t]=n[t];return i}function kh(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i,s,o,a,l=[],c=!0,d=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;c=!1}else for(;!(c=(i=o.call(t)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(d)throw s}}return l}}function xa(n){if(Array.isArray(n))return n}function _a(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,i)}return t}function ae(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_a(Object(t),!0).forEach(function(i){Gn(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_a(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Gn(n,e,t){return(e=Sh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sh(n){var e=wh(n,"string");return Kn(e)=="symbol"?e:e+""}function wh(n,e){if(Kn(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(Kn(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Eh={name:"BaseComponent",props:{pt:{type:Object,default:void 0},ptOptions:{type:Object,default:void 0},unstyled:{type:Boolean,default:void 0},dt:{type:Object,default:void 0}},inject:{$parentInstance:{default:void 0}},watch:{isUnstyled:{immediate:!0,handler:function(e){e||(this._loadCoreStyles(),this._themeChangeListener(this._loadCoreStyles))}},dt:{immediate:!0,handler:function(e){var t=this;e?(this._loadScopedThemeStyles(e),this._themeChangeListener(function(){return t._loadScopedThemeStyles(e)})):this._unloadScopedThemeStyles()}}},scopedStyleEl:void 0,rootEl:void 0,$attrSelector:void 0,beforeCreate:function(){var e,t,i,s,o,a,l,c,d,u,f,h=(e=this.pt)===null||e===void 0?void 0:e._usept,m=h?(t=this.pt)===null||t===void 0||(t=t.originalValue)===null||t===void 0?void 0:t[this.$.type.name]:void 0,p=h?(i=this.pt)===null||i===void 0||(i=i.value)===null||i===void 0?void 0:i[this.$.type.name]:this.pt;(s=p||m)===null||s===void 0||(s=s.hooks)===null||s===void 0||(o=s.onBeforeCreate)===null||o===void 0||o.call(s);var g=(a=this.$primevueConfig)===null||a===void 0||(a=a.pt)===null||a===void 0?void 0:a._usept,y=g?(l=this.$primevue)===null||l===void 0||(l=l.config)===null||l===void 0||(l=l.pt)===null||l===void 0?void 0:l.originalValue:void 0,b=g?(c=this.$primevue)===null||c===void 0||(c=c.config)===null||c===void 0||(c=c.pt)===null||c===void 0?void 0:c.value:(d=this.$primevue)===null||d===void 0||(d=d.config)===null||d===void 0?void 0:d.pt;(u=b||y)===null||u===void 0||(u=u[this.$.type.name])===null||u===void 0||(u=u.hooks)===null||u===void 0||(f=u.onBeforeCreate)===null||f===void 0||f.call(u),this.$attrSelector=th("pc")},created:function(){this._hook("onCreated")},beforeMount:function(){this.rootEl=Qf(this.$el,'[data-pc-name="'.concat(Rt(this.$.type.name),'"]')),this.rootEl&&(this.$attrSelector&&!this.rootEl.hasAttribute(this.$attrSelector)&&this.rootEl.setAttribute(this.$attrSelector,""),this.rootEl.$pc=ae({name:this.$.type.name,attrSelector:this.$attrSelector},this.$params)),this._loadStyles(),this._hook("onBeforeMount")},mounted:function(){this._hook("onMounted")},beforeUpdate:function(){this._hook("onBeforeUpdate")},updated:function(){this._hook("onUpdated")},beforeUnmount:function(){this._hook("onBeforeUnmount")},unmounted:function(){this._unloadScopedThemeStyles(),this._hook("onUnmounted")},methods:{_hook:function(e){if(!this.$options.hostName){var t=this._usePT(this._getPT(this.pt,this.$.type.name),this._getOptionValue,"hooks.".concat(e)),i=this._useDefaultPT(this._getOptionValue,"hooks.".concat(e));t==null||t(),i==null||i()}},_mergeProps:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return Gr(e)?e.apply(void 0,i):r.mergeProps.apply(void 0,i)},_loadStyles:function(){var e=this,t=function(){Un.isStyleNameLoaded("base")||(Ot.loadCSS(e.$styleOptions),e._loadGlobalStyles(),Un.setLoadedStyleName("base")),e._loadThemeStyles()};t(),this._themeChangeListener(t)},_loadCoreStyles:function(){var e,t;!Un.isStyleNameLoaded((e=this.$style)===null||e===void 0?void 0:e.name)&&(t=this.$style)!==null&&t!==void 0&&t.name&&(pa.loadCSS(this.$styleOptions),this.$options.style&&this.$style.loadCSS(this.$styleOptions),Un.setLoadedStyleName(this.$style.name))},_loadGlobalStyles:function(){var e=this._useGlobalPT(this._getOptionValue,"global.css",this.$params);we(e)&&Ot.load(e,ae({name:"global"},this.$styleOptions))},_loadThemeStyles:function(){var e,t;if(!(this.isUnstyled||this.$theme==="none")){if(!Me.isStyleNameLoaded("common")){var i,s,o=((i=this.$style)===null||i===void 0||(s=i.getCommonTheme)===null||s===void 0?void 0:s.call(i))||{},a=o.primitive,l=o.semantic,c=o.global,d=o.style;Ot.load(a==null?void 0:a.css,ae({name:"primitive-variables"},this.$styleOptions)),Ot.load(l==null?void 0:l.css,ae({name:"semantic-variables"},this.$styleOptions)),Ot.load(c==null?void 0:c.css,ae({name:"global-variables"},this.$styleOptions)),Ot.loadTheme(ae({name:"global-style"},this.$styleOptions),d),Me.setLoadedStyleName("common")}if(!Me.isStyleNameLoaded((e=this.$style)===null||e===void 0?void 0:e.name)&&(t=this.$style)!==null&&t!==void 0&&t.name){var u,f,h,m,p=((u=this.$style)===null||u===void 0||(f=u.getComponentTheme)===null||f===void 0?void 0:f.call(u))||{},g=p.css,y=p.style;(h=this.$style)===null||h===void 0||h.load(g,ae({name:"".concat(this.$style.name,"-variables")},this.$styleOptions)),(m=this.$style)===null||m===void 0||m.loadTheme(ae({name:"".concat(this.$style.name,"-style")},this.$styleOptions),y),Me.setLoadedStyleName(this.$style.name)}if(!Me.isStyleNameLoaded("layer-order")){var b,x,E=(b=this.$style)===null||b===void 0||(x=b.getLayerOrderThemeCSS)===null||x===void 0?void 0:x.call(b);Ot.load(E,ae({name:"layer-order",first:!0},this.$styleOptions)),Me.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(e){var t,i,s,o=((t=this.$style)===null||t===void 0||(i=t.getPresetTheme)===null||i===void 0?void 0:i.call(t,e,"[".concat(this.$attrSelector,"]")))||{},a=o.css,l=(s=this.$style)===null||s===void 0?void 0:s.load(a,ae({name:"".concat(this.$attrSelector,"-").concat(this.$style.name)},this.$styleOptions));this.scopedStyleEl=l.el},_unloadScopedThemeStyles:function(){var e;(e=this.scopedStyleEl)===null||e===void 0||(e=e.value)===null||e===void 0||e.remove()},_themeChangeListener:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};Un.clearLoadedStyleNames(),jt.on("theme:change",e)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){var t;return this[e]||((t=this._getHostInstance(this))===null||t===void 0?void 0:t[e])},_getOptionValue:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Qr(e,t,i)},_getPTValue:function(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=/./g.test(i)&&!!s[i.split(".")[0]],l=this._getPropValue("ptOptions")||((e=this.$primevueConfig)===null||e===void 0?void 0:e.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,f=u===void 0?!1:u,h=o?a?this._useGlobalPT(this._getPTClassValue,i,s):this._useDefaultPT(this._getPTClassValue,i,s):void 0,m=a?void 0:this._getPTSelf(t,this._getPTClassValue,i,ae(ae({},s),{},{global:h||{}})),p=this._getPTDatasets(i);return d||!d&&m?f?this._mergeProps(f,h,m,p):ae(ae(ae({},h),m),p):ae(ae({},m),p)},_getPTSelf:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return r.mergeProps(this._usePT.apply(this,[this._getPT(e,this.$name)].concat(i)),this._usePT.apply(this,[this.$_attrsPT].concat(i)))},_getPTDatasets:function(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",s="data-pc-",o=i==="root"&&we((e=this.pt)===null||e===void 0?void 0:e["data-pc-section"]);return i!=="transition"&&ae(ae({},i==="root"&&ae(ae(Gn({},"".concat(s,"name"),Rt(o?(t=this.pt)===null||t===void 0?void 0:t["data-pc-section"]:this.$.type.name)),o&&Gn({},"".concat(s,"extend"),Rt(this.$.type.name))),ca()&&Gn({},"".concat(this.$attrSelector),""))),{},Gn({},"".concat(s,"section"),Rt(i)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return gt(e)||oo(e)?{class:e}:e},_getPT:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2?arguments[2]:void 0,o=function(l){var c,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,u=s?s(l):l,f=Rt(i),h=Rt(t.$name);return(c=d?f!==h?u==null?void 0:u[f]:void 0:u==null?void 0:u[f])!==null&&c!==void 0?c:u};return e!=null&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:o(e.originalValue),value:o(e.value)}:o(e,!0)},_usePT:function(e,t,i,s){var o=function(g){return t(g,i,s)};if(e!=null&&e.hasOwnProperty("_usept")){var a,l=e._usept||((a=this.$primevueConfig)===null||a===void 0?void 0:a.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,f=u===void 0?!1:u,h=o(e.originalValue),m=o(e.value);return h===void 0&&m===void 0?void 0:gt(m)?m:gt(h)?h:d||!d&&m?f?this._mergeProps(f,h,m):ae(ae({},h),m):m}return o(e)},_useGlobalPT:function(e,t,i){return this._usePT(this.globalPT,e,t,i)},_useDefaultPT:function(e,t,i){return this._usePT(this.defaultPT,e,t,i)},ptm:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._getPTValue(this.pt,e,ae(ae({},this.$params),t))},ptmi:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r.mergeProps(this.$_attrsWithoutPT,this.ptm(e,t))},ptmo:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._getPTValue(e,t,ae({instance:this},i),!1)},cx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,ae(ae({},this.$params),t))},sx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t){var s=this._getOptionValue(this.$style.inlineStyles,e,ae(ae({},this.$params),i)),o=this._getOptionValue(pa.inlineStyles,e,ae(ae({},this.$params),i));return[o,s]}}},computed:{globalPT:function(){var e,t=this;return this._getPT((e=this.$primevueConfig)===null||e===void 0?void 0:e.pt,void 0,function(i){return rt(i,{instance:t})})},defaultPT:function(){var e,t=this;return this._getPT((e=this.$primevueConfig)===null||e===void 0?void 0:e.pt,void 0,function(i){return t._getOptionValue(i,t.$name,ae({},t.$params))||rt(i,ae({},t.$params))})},isUnstyled:function(){var e;return this.unstyled!==void 0?this.unstyled:(e=this.$primevueConfig)===null||e===void 0?void 0:e.unstyled},$inProps:function(){var e,t=Object.keys(((e=this.$.vnode)===null||e===void 0?void 0:e.props)||{});return Object.fromEntries(Object.entries(this.$props).filter(function(i){var s=Xn(i,1),o=s[0];return t==null?void 0:t.includes(o)}))},$theme:function(){var e;return(e=this.$primevueConfig)===null||e===void 0?void 0:e.theme},$style:function(){return ae(ae({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:(e=this.$primevueConfig)===null||e===void 0||(e=e.csp)===null||e===void 0?void 0:e.nonce}},$primevueConfig:function(){var e;return(e=this.$primevue)===null||e===void 0?void 0:e.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:e==null?void 0:e.$props,state:e==null?void 0:e.$data,attrs:e==null?void 0:e.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var t=Xn(e,1),i=t[0];return i==null?void 0:i.startsWith("pt:")}).reduce(function(e,t){var i=Xn(t,2),s=i[0],o=i[1],a=s.split(":"),l=xh(a),c=l.slice(1);return c==null||c.reduce(function(d,u,f,h){return!d[u]&&(d[u]=f===h.length-1?o:{}),d[u]},e),e},{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var t=Xn(e,1),i=t[0];return!(i!=null&&i.startsWith("pt:"))}).reduce(function(e,t){var i=Xn(t,2),s=i[0],o=i[1];return e[s]=o,e},{})}}},Ch={root:{position:"relative"}},vh={root:"p-chart"},Dh=Ot.extend({name:"chart",classes:vh,inlineStyles:Ch}),Oh={name:"BaseChart",extends:Eh,props:{type:String,data:null,options:null,plugins:null,width:{type:Number,default:300},height:{type:Number,default:150},canvasProps:{type:null,default:null}},style:Dh,provide:function(){return{$pcChart:this,$parentInstance:this}}},ka={name:"Chart",extends:Oh,inheritAttrs:!1,emits:["select","loaded"],chart:null,watch:{data:{handler:function(){this.reinit()},deep:!0},type:function(){this.reinit()},options:function(){this.reinit()}},mounted:function(){this.initChart()},beforeUnmount:function(){this.chart&&(this.chart.destroy(),this.chart=null)},methods:{initChart:function(){var e=this;Promise.resolve().then(()=>SS).then(function(t){e.chart&&(e.chart.destroy(),e.chart=null),t&&t.default&&(e.chart=new t.default(e.$refs.canvas,{type:e.type,data:e.data,options:e.options,plugins:e.plugins})),e.$emit("loaded",e.chart)})},getCanvas:function(){return this.$canvas},getChart:function(){return this.chart},getBase64Image:function(){return this.chart.toBase64Image()},refresh:function(){this.chart&&this.chart.update()},reinit:function(){this.initChart()},onCanvasClick:function(e){if(this.chart){var t=this.chart.getElementsAtEventForMode(e,"nearest",{intersect:!0},!1),i=this.chart.getElementsAtEventForMode(e,"dataset",{intersect:!0},!1);t&&t[0]&&i&&this.$emit("select",{originalEvent:e,element:t[0],dataset:i})}},generateLegend:function(){if(this.chart)return this.chart.generateLegend()}}};function Qn(n){"@babel/helpers - typeof";return Qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qn(n)}function Sa(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,i)}return t}function wa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sa(Object(t),!0).forEach(function(i){Nh(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Sa(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Nh(n,e,t){return(e=Th(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Th(n){var e=Ph(n,"string");return Qn(e)=="symbol"?e:e+""}function Ph(n,e){if(Qn(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(Qn(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Bh=["width","height"];function Mh(n,e,t,i,s,o){return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:n.cx("root"),style:n.sx("root")},n.ptmi("root")),[r.createElementVNode("canvas",r.mergeProps({ref:"canvas",width:n.width,height:n.height,onClick:e[0]||(e[0]=function(a){return o.onCanvasClick(a)})},wa(wa({},n.canvasProps),n.ptm("canvas"))),null,16,Bh)],16)}ka.render=Mh;function Vh(){const n={primary:"#0efcf1",primaryBorder:"#388E3C",secondary:"#0ec6fc",secondaryBorder:"#FBC02D",tertiary:"#f1fc0e",tertiaryBorder:"#FFA000"},e=["linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInBounce","easeOutBounce","easeInOutBounce","easeInOutElastic"],t=r.ref("easeInOutElastic"),i=r.computed(()=>({responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"top",labels:{font:{size:16}}},tooltip:{enabled:!0,titleFont:{size:14},bodyFont:{size:12}},zoom:{zoom:{wheel:{enabled:!0},drag:{enabled:!0},mode:"xy"},pan:{enabled:!0,mode:"xy"}}},scales:{x:{grid:{display:!1},ticks:{font:{size:14}}},y:{grid:{display:!0,color:"#e0e0e0"},ticks:{font:{size:14}}}},animation:{duration:2e3,easing:t.value,delay:500,loop:!1,animateRotate:!0,animateScale:!0},elements:{point:{radius:6,hoverRadius:10,backgroundColor:n.secondary},line:{tension:.4,borderWidth:2},bar:{borderWidth:2,borderRadius:4}}}));return{colorConfig:n,animationOptions:e,selectedAnimation:t,defaultChartOptions:i}}const Ah={components:{Chart:ka},props:{type:{type:String,required:!0},chartData:{type:Object,required:!0},chartOptions:{type:Object,default:()=>({})}},setup(n){const{colorConfig:e,defaultChartOptions:t}=Vh(),i=r.computed(()=>{const o=n.chartData.datasets.map((a,l)=>{const c=Object.values(e);return{...a,backgroundColor:c[l%c.length],borderColor:c[l%c.length+1]}});return{...n.chartData,datasets:o}}),s=r.computed(()=>({...t.value,maintainAspectRatio:!0,...n.chartOptions}));return{computedChartData:i,computedChartOptions:s}}},Fh={class:"chart-container"},$h={key:0},Ih={key:1};function Lh(n,e,t,i,s,o){const a=r.resolveComponent("Chart",!0);return r.openBlock(),r.createElementBlock("div",Fh,[t.chartData?(r.openBlock(),r.createElementBlock("div",$h,[r.createVNode(a,{type:t.type,data:i.computedChartData,options:i.computedChartOptions},null,8,["type","data","options"])])):(r.openBlock(),r.createElementBlock("div",Ih,e[0]||(e[0]=[r.createElementVNode("p",null,"No data available for the chart.",-1)])))])}const Jn=Be(Ah,[["render",Lh],["__scopeId","data-v-8e3e786b"]]);function Zn(){const n=r.ref(null),e=r.ref(!1),t=r.ref(null);return{chartData:n,fetchChartData:async({entityName:s,xaxis:o=null,yaxis:a=null})=>{e.value=!0,t.value=null;const l="https://mocki.io/v1/1ab17035-c115-4049-8ebf-a1e1b92d739a";try{const d=await(await fetch(l)).json();if(!d||!d.response||!d.response.result)throw new Error("Invalid data structure from API.");const u=d.response.result;if(!o&&!a){const f=Object.keys(u[0]);o=f[1],a=f.slice(4);const h=u.reduce((g,y)=>(a.forEach(b=>{g[b]||(g[b]=0),g[b]+=y[b]||0}),g),{}),m=Object.keys(h),p=Object.values(h);n.value={labels:m,datasets:[{label:"Default Data",data:p,borderWidth:1}]}}else{const f=u.map(p=>p[o]),m=(Array.isArray(a)?a:[a]).map(p=>({label:p,data:u.map(g=>g[p]||0),borderWidth:1}));n.value={labels:f,datasets:m}}}catch(c){t.value=c.message,n.value=null}finally{e.value=!1}},loading:e,error:t}}const Rh={components:{chart:Jn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(n){const{chartData:e,fetchChartData:t,loading:i,error:s}=Zn(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!n.yaxis||!n.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await t({entityName:n.entityName,yaxis:n.yaxis,xaxis:n.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",n.yaxis),console.log("Fetching data for xAxis:",n.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},jh={key:0,class:"chart-container"},zh={key:1},Wh={key:0},Hh={key:1},Uh={key:2};function qh(n,e,t,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(t.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",jh,[r.createElementVNode("h3",null,r.toDisplayString(t.title)+" , x-axis : "+r.toDisplayString(t.xaxis)+" , y-axis : "+r.toDisplayString(t.yaxis),1),r.createVNode(a,{type:"bar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",zh,[i.loading?(r.openBlock(),r.createElementBlock("p",Wh,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",Hh,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Uh,"No data available for the chart."))]))])}const Ea=Be(Rh,[["render",qh],["__scopeId","data-v-67577a46"]]),Yh={components:{chart:Jn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(n){const{chartData:e,fetchChartData:t,loading:i,error:s}=Zn(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!n.yaxis||!n.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await t({entityName:n.entityName,yaxis:n.yaxis,xaxis:n.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",n.yaxis),console.log("Fetching data for xAxis:",n.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},Kh={key:0,class:"chart-container"},Xh={key:1},Gh={key:0},Qh={key:1},Jh={key:2};function Zh(n,e,t,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(t.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",Kh,[r.createElementVNode("h3",null,r.toDisplayString(t.title)+" , x-axis : "+r.toDisplayString(t.xaxis)+" , y-axis : "+r.toDisplayString(t.yaxis),1),r.createVNode(a,{type:"line",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",Xh,[i.loading?(r.openBlock(),r.createElementBlock("p",Gh,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",Qh,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Jh,"No data available for the chart."))]))])}const Ca=Be(Yh,[["render",Zh],["__scopeId","data-v-2cfe3d4d"]]),em={components:{chart:Jn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(n){const{chartData:e,fetchChartData:t,loading:i,error:s}=Zn(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),a=async()=>{await t({entityName:n.entityName,xaxis:n.xaxis,yaxis:n.yaxis})};return r.onMounted(()=>{a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},tm={key:0,class:"chart-container"},nm={key:1},im={key:0},sm={key:1},om={key:2};function rm(n,e,t,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(t.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",tm,[r.createElementVNode("h3",null,r.toDisplayString(t.title),1),r.createVNode(a,{type:"pie",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",nm,[i.loading?(r.openBlock(),r.createElementBlock("p",im,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",sm,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",om,"No data available for the chart."))]))])}const va=Be(em,[["render",rm],["__scopeId","data-v-27f5ea01"]]),am={components:{chart:Jn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(n){const{chartData:e,fetchChartData:t,loading:i,error:s}=Zn(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),a=async()=>{await t({entityName:n.entityName,xaxis:n.xaxis,yaxis:n.yaxis})};return r.onMounted(()=>{a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},lm={key:0,class:"chart-container"},cm={key:1},dm={key:0},um={key:1},fm={key:2};function hm(n,e,t,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(t.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",lm,[r.createElementVNode("h3",null,r.toDisplayString(t.title),1),r.createVNode(a,{type:"polarArea",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",cm,[i.loading?(r.openBlock(),r.createElementBlock("p",dm,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",um,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",fm,"No data available for the chart."))]))])}const Da=Be(am,[["render",hm],["__scopeId","data-v-941f0d0a"]]),mm={components:{chart:Jn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(n){const{chartData:e,fetchChartData:t,loading:i,error:s}=Zn(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!n.yaxis||!n.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await t({entityName:n.entityName,yaxis:n.yaxis,xaxis:n.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",n.yaxis),console.log("Fetching data for xAxis:",n.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},pm={key:0,class:"chart-container"},gm={key:1},ym={key:0},bm={key:1},xm={key:2};function _m(n,e,t,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(t.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",pm,[r.createElementVNode("h3",null,r.toDisplayString(t.title)+" , x-axis : "+r.toDisplayString(t.xaxis)+" , y-axis : "+r.toDisplayString(t.yaxis),1),r.createVNode(a,{type:"radar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",gm,[i.loading?(r.openBlock(),r.createElementBlock("p",ym,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",bm,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",xm,"No data available for the chart."))]))])}const Oa=Be(mm,[["render",_m],["__scopeId","data-v-80750171"]]),km={class:"flex flex-col p-3"},Sm={class:"flex justify-center flex-row mb-2 cursor-pointer"},wm={style:{"word-break":"break-all"}},Em={__name:"LinkEntityContent",props:{linkEntityListItem:{type:Object,required:!0}},setup(n){Je.useRoute();const e=Ze(),t=r.ref("");e.getAppId()!=null&&e.getAppId()!=""&&(t.value=e.getAppId());const i=r.ref(),s=r.ref(!1),o=r.ref(!1),a=r.ref({}),l=r.ref([{label:"Remove association",icon:"",command:f=>{c()}}]),c=()=>{console.log(a.value),console.log("Function is calling")},d=(f,h)=>{a.value=h,i.value.show(f),o.value=!0},u=()=>{a.value={},o.value=!1};return(f,h)=>{const m=r.resolveComponent("Button"),p=r.resolveComponent("ContextMenu"),g=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("div",{onMouseenter:h[4]||(h[4]=r.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:h[5]||(h[5]=r.withModifiers(y=>s.value=!1,["prevent"])),class:"flex relative m-3",style:{border:"1px solid var(--surface-border)","border-radius":"5px"}},[r.withDirectives(r.createVNode(m,{onClick:h[0]||(h[0]=y=>d(y,n.linkEntityListItem)),class:"!absolute right-0",size:"small",style:{width:"55px",height:"25px","border-radius":"5px","font-size":"12px"}},{default:r.withCtx(()=>h[6]||(h[6]=[r.createTextVNode(" More")])),_:1},512),[[r.vShow,s.value||o.value]]),r.createVNode(p,{ref_key:"menu",ref:i,model:l.value,onMouseenter:h[1]||(h[1]=r.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:h[2]||(h[2]=r.withModifiers(y=>s.value=!1,["prevent"])),onHide:h[3]||(h[3]=y=>u())},null,8,["model"]),r.createElementVNode("div",km,[r.createElementVNode("div",Sm,[r.createElementVNode("div",wm,r.toDisplayString(n.linkEntityListItem.entityName),1),r.createVNode(g,{to:{name:"entity360view",params:{entityName:n.linkEntityListItem.entityName,id:n.linkEntityListItem.id,appId:t.value}},target:"_blank"},{default:r.withCtx(()=>h[7]||(h[7]=[r.createElementVNode("div",{class:"pi pi-external-link ml-3"},null,-1)])),_:1},8,["to"])]),r.createElementVNode("div",null,"Id: "+r.toDisplayString(n.linkEntityListItem.id),1)])],32)}}},Cm={class:"flex flex-col mt-3"},vm={class:"flex flex-row items-center"},Dm={class:"flex items-center justify-center mt-5"},Om={key:0,class:"pi pi-caret-right"},Nm={key:1,class:"pi pi-caret-down"},Tm={key:0},Pm={class:"flex flex-col mt-5"},Bm={class:"col-12"},Mm={class:"flex flex-col mt-5"},Vm={class:"col-12 font-bold"},Am={key:0},Fm={class:"flex flex-col mt-5"},$m={class:"col-12"},Im={class:"flex flex-col mt-5"},Lm={class:"col-12"},Rm={class:"flex flex-col mt-5"},jm={class:"col-12"},zm={class:"flex flex-row justify-between items-center mt-5"},Wm={key:1,class:"mt-2"},Hm={class:"flex flex-row justify-between items-center"},Um={key:1,class:"text-red-500"},qm={class:"flex flex-col mt-5"},Ym={class:"flex flex-row justify-between items-center mt-2"},Km={class:"flex flex-row items-center mt-5 mb-5"},Xm={class:"font-bold"},Gm={class:"font-bold ml-2 flex-1"},Qm={class:"flex flex-row justify-center items-center mb-2"},Jm={class:"ml-2 flex-1"},Zm={key:0,class:"pi pi-exclamation-circle"},ep={class:"flex flex-col justify-center"},tp={class:"flex flex-row justify-between items-center"},np={class:"justify-start"},ip={class:"justify-start"},sp=Be({__name:"EntityLookup",props:r.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{required:!0},saveExistingRelatedEntityRecord:{type:Function,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){Je.useRoute();const e=n,t=r.useModel(n,"modelValue"),i=new sn,s=r.ref({}),o=r.ref([]),a=r.ref({}),l=r.ref([]),c=r.ref([]),d=r.ref({}),u=r.ref("id"),f=r.ref(1),h=r.ref([]),m=r.ref(25),p=r.ref(0),g=r.ref(0),y=r.ref(0);let b=r.ref([]);const x=r.ref(!1),E={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"},C={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"};r.onMounted(()=>{v()});const k=W=>e.linkedEntity.list.some(A=>A[d.value.name]===W),v=async()=>{try{const W={sortBy:[u.value],sortDirection:f.value===1?"ASC":"DESC",pageSize:m.value,currentPage:p.value,columnList:null,filter:b.value,fullTextSearch:""},A=await i.searchEntityRecords(e.linkedEntity.entityName,W);A&&A.response&&(s.value=A.response,l.value=A.response.entity.entityDefinition.columns,c.value=Ce(A.response.entity.entityDefinition.columns),g.value=A.response.totalRecords,await S(),await _(),D())}catch{}finally{}},S=async()=>{for(let W=0;W<l.value.length;W++){const A=l.value[W];!A.autoGeneerated&&A.foreignKey&&A.foreignKey.referencedEntityName.toLowerCase()==e.entity360Name.toLowerCase()&&(a.value=A)}},_=async()=>{for(let W=0;W<l.value.length;W++){const A=l.value[W];if(A.primaryKey&&A.primaryKey==!0){d.value=A;break}}},D=()=>{for(let W=0;W<e.linkedEntity.list.length;W++){const A=e.linkedEntity.list[W];A.is_deleted==!1&&A[a.value.name]==e.entity360Id&&o.value.push(A[d.value.name])}},B=()=>{let W=JSON.parse(JSON.stringify(o.value));W=W.filter(ue=>!k(ue));let A={linkEntityName:s.value.entityName,linkRecordIdList:[]};for(let ue=0;ue<W.length;ue++){const he=W[ue];A.linkRecordIdList.push(he)}e.saveExistingRelatedEntityRecord(A)},w=()=>{x.value=!x.value},T=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],I=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],X=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],q=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],$=[{label:"ASC",value:1},{label:"DESC",value:-1}];let R=[];const F=r.computed(()=>c.value.filter(W=>W.sortable)),P=r.computed(()=>c.value.filter(W=>W.filterable)),L=W=>c.value.filter(A=>{var ue;return A.filterable?((ue=h.value[W])==null?void 0:ue.columnName)===A.name?!0:!h.value.some((he,fe)=>fe!==W&&he.columnName===A.name):!1}).map(A=>({label:A.name,value:A.field})),H=W=>{let A="";switch(ze(W.columnName).toLowerCase()){case"string":case"uuid":A="startsWith";break;case"date":A="dateIs";break;case"numeric":case"int":case"integer":A="equals";break;case"bool":case"boolean":A="equals";break}W.operator=A,W.value=""},te=W=>{const A=ze(W.columnName);switch(A&&A.toLowerCase()){case"integer":case"int":case"numeric":R=I;break;case"date":R=q;break;case"bool":case"boolean":R=X;break;default:R=T}return R},ie=W=>{if(W&&W.columnName){const A=ze(W.columnName);return ft(A)}else return""},Q=()=>{for(let W=0;W<h.value.length;W++){const A=h.value[W];A.editing=!1}h.value.push({columnName:"",value:"",operator:"",editing:!0})},J=W=>{h.value.splice(W,1)},se=W=>{W.editing=!W.editing},de=()=>{let W=JSON.parse(JSON.stringify(h.value));b.value=[];for(let A=0;A<W.length;A++){const ue=W[A];delete ue.editing,ue.columnName&&ue.operator&&ue.value&&(ue.columnType=ze(ue.columnName),ue.operator=E[ue.operator],b.value.push(ue))}v()},Ce=W=>W.map(A=>({field:A.name,name:A.displayName?A.displayName:A.name,filterable:A.filterable,datatype:A.type,sortable:!0,displayFormatKey:A.displayFormatKey,displayFormat:A.displayFormat})),Qe=()=>{v()},ze=W=>{const A=c.value.find(ue=>ue.field===W);return A?A.datatype:null},ft=W=>{switch(W.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},it=W=>{m.value=W.rows,p.value=W.page,y.value=W.first,v()};return(W,A)=>{var nn,_n;const ue=r.resolveComponent("InputIcon"),he=r.resolveComponent("InputText"),fe=r.resolveComponent("IconField"),me=r.resolveComponent("Select"),De=r.resolveComponent("Divider"),Ye=r.resolveComponent("InputNumber"),St=r.resolveComponent("Calendar"),Ae=r.resolveComponent("Button"),Ke=r.resolveComponent("Checkbox"),st=r.resolveComponent("Paginator"),tn=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Cm,[r.createElementVNode("div",vm,[r.createVNode(fe,{class:"block mt-2 md:mt-0 w-full"},{default:r.withCtx(()=>[r.createVNode(ue,{onClick:A[0]||(A[0]=()=>{}),class:"pi pi-search"}),r.createVNode(he,{class:"w-full",onKeyup:A[1]||(A[1]=r.withKeys(()=>{},["enter"])),placeholder:`Search ${s.value.entityName}`},null,8,["placeholder"])]),_:1})]),r.createElementVNode("div",Dm,[r.createElementVNode("div",{class:"flex items-center cursor-pointer sorting-filter-section flex-1 line-height-4",onClick:A[2]||(A[2]=Z=>w())},[x.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Om)),x.value?(r.openBlock(),r.createElementBlock("div",Nm)):r.createCommentVNode("",!0),A[9]||(A[9]=r.createElementVNode("div",{class:"ml-3 font-bold"}," Sorting & Filters ",-1))])]),x.value?(r.openBlock(),r.createElementBlock("div",Tm,[r.createElementVNode("div",Pm,[A[10]||(A[10]=r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),r.createElementVNode("div",Bm,[r.createVNode(me,{modelValue:u.value,"onUpdate:modelValue":A[3]||(A[3]=Z=>u.value=Z),options:F.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:A[4]||(A[4]=Z=>Qe(W.event))},null,8,["modelValue","options"])])]),r.createElementVNode("div",Mm,[A[11]||(A[11]=r.createElementVNode("div",{class:"col-12 font-bold"},[r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),r.createElementVNode("div",Vm,[r.createVNode(me,{modelValue:f.value,"onUpdate:modelValue":A[5]||(A[5]=Z=>f.value=Z),options:$,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:A[6]||(A[6]=Z=>Qe(W.event))},null,8,["modelValue"])])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.value,(Z,ht)=>(r.openBlock(),r.createElementBlock("div",{key:ht},[Z.editing?(r.openBlock(),r.createElementBlock("div",Am,[r.createVNode(De,{class:"mt-5"}),r.createElementVNode("div",Fm,[A[12]||(A[12]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),r.createElementVNode("div",$m,[r.createVNode(me,{modelValue:Z.columnName,"onUpdate:modelValue":Ne=>Z.columnName=Ne,options:L(ht),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:Ne=>H(Z)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),r.createElementVNode("div",Im,[A[13]||(A[13]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),r.createElementVNode("div",Lm,[r.createVNode(me,{modelValue:Z.operator,"onUpdate:modelValue":Ne=>Z.operator=Ne,options:te(Z),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),r.createElementVNode("div",Rm,[A[14]||(A[14]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),r.createElementVNode("div",jm,[ie(Z)=="numeric"?(r.openBlock(),r.createBlock(Ye,{key:0,format:!1,class:"w-full",modelValue:Z.value,"onUpdate:modelValue":Ne=>Z.value=Ne,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):ie(Z)=="date"?(r.openBlock(),r.createBlock(St,{key:1,class:"w-full",modelValue:Z.value,"onUpdate:modelValue":Ne=>Z.value=Ne,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(r.openBlock(),r.createBlock(he,{key:2,modelValue:Z.value,"onUpdate:modelValue":Ne=>Z.value=Ne,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),r.createElementVNode("div",zm,[r.createVNode(Ae,{style:{width:"100px"},label:"Hide",icon:"",severity:"warning",onClick:Ne=>se(Z)},null,8,["onClick"]),r.createVNode(Ae,{style:{width:"100px"},label:"Delete",icon:"",severity:"danger",onClick:Ne=>J(ht)},null,8,["onClick"])])])):r.createCommentVNode("",!0),Z.editing?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Wm,[r.createVNode(De),r.createElementVNode("div",Hm,[r.createElementVNode("span",null,[Z.columnName||Z.operator||Z.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!Z.columnName})},r.toDisplayString(Z.columnName?" "+Z.columnName:" column"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!C[Z.operator]})},r.toDisplayString(Z.operator?" "+C[Z.operator]:" operator"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!Z.value})},r.toDisplayString(Z.value?" "+Z.value:" value"),3)],64)):(r.openBlock(),r.createElementBlock("span",Um,"Filter is empty"))]),r.createVNode(Ae,{style:{width:"100px"},label:"Edit",icon:"",severity:"info",onClick:Ne=>se(Z)},null,8,["onClick"])])]))]))),128)),r.createElementVNode("div",qm,[r.createVNode(De),r.createElementVNode("div",Ym,[r.createVNode(Ae,{style:{width:"100px"},label:"Add",disabled:P.value.length===h.value.length,icon:"",severity:"success",onClick:Q},null,8,["disabled"]),r.createVNode(Ae,{style:{width:"100px"},label:"Apply",severity:"info",onClick:de})])])])):r.createCommentVNode("",!0),r.createElementVNode("div",Km,[r.createElementVNode("div",Xm,r.toDisplayString((nn=s.value)==null?void 0:nn.totalRecords),1),r.createElementVNode("div",Gm,r.toDisplayString((_n=s.value)==null?void 0:_n.entityName),1)]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value.result,(Z,ht)=>(r.openBlock(),r.createElementBlock("div",{key:ht},[r.createElementVNode("div",Qm,[r.createVNode(Ke,{disabled:k(Z[d.value.name]),modelValue:o.value,"onUpdate:modelValue":A[7]||(A[7]=Ne=>o.value=Ne),value:Z[d.value.name]},null,8,["disabled","modelValue","value"]),r.createElementVNode("div",Jm,[r.createTextVNode(r.toDisplayString(n.linkedEntity.entityName)+" ",1),r.createElementVNode("span",null,r.toDisplayString(Z[d.value.name]),1)]),k(Z[d.value.name])?r.withDirectives((r.openBlock(),r.createElementBlock("div",Zm,null,512)),[[tn,"This record is already associated.",void 0,{left:!0}]]):r.createCommentVNode("",!0)])]))),128)),r.createVNode(st,{rows:m.value,totalRecords:g.value,rowsPerPageOptions:[10,25,50,100],onPage:it,template:"FirstPageLink PageLinks LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:""},null,8,["rows","totalRecords"])]),r.createElementVNode("div",ep,[r.createVNode(De,{class:"mt-5"}),r.createElementVNode("div",tp,[r.createElementVNode("div",np,[r.createVNode(Ae,{label:"Cancel",icon:"",severity:"secondary",onClick:A[8]||(A[8]=Z=>t.value=!1)})]),r.createElementVNode("div",ip,[r.createVNode(Ae,{label:"Save",severity:"success",onClick:B})])])])],64)}}},[["__scopeId","data-v-7fd52649"]]),op={class:"field flex flex-col"},rp={key:0,class:"flex items-center"},ap={key:1},lp={class:"flex items-center"},cp={class:"flex flex-col justify-center"},dp={class:"flex flex-row justify-between items-center"},up={class:"justify-start"},fp={class:"justify-start"},hp={__name:"EntityLookupObject",props:r.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{type:[String,Number]},saveExistingEntityObject:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){Je.useRoute();const e=n,t=r.useModel(n,"modelValue"),i=new sn,s=r.ref({}),o=r.ref({});let a=r.ref("");const l=r.ref({}),c=r.ref({});r.onMounted(async()=>{console.log("linkedEntity"),console.log(e.linkedEntity),console.log("entity360Name"),console.log(e.entity360Name),console.log("entity360Id"),console.log(e.entity360Id),await u(),await d()});const d=async()=>{try{const g=await i.getEntityRecords(e.linkedEntity.entityName);g&&g.response&&(s.value=g.response,await f(g.response.entity.entityDefinition.columns),await m(),console.log(s.value))}catch{}finally{}},u=async()=>{try{const g=await i.getRecord(e.entity360Name,e.entity360Id);g&&g.response&&(o.value=g.response,await h(g.response.entity.entityDefinition.columns),console.log(o.value))}catch{}finally{}},f=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(b.primaryKey&&b.primaryKey==!0){l.value=b;break}}},h=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(!b.autoGeneerated&&b.foreignKey&&b.foreignKey.referencedEntityName.toLowerCase()==e.linkedEntity.entityName.toLowerCase()){c.value=b;break}}},m=async()=>{for(let g=0;g<s.value.result.length;g++){const y=s.value.result[g];if(y[l.value.name]==o.value.result[0][c.value.name]){a.value=y;break}}},p=()=>{const g={linkedEntityRecordId:a.value[l.value.name],linkedEntityName:e.linkedEntity.entityName,relationType:"ManyToOne"};e.saveExistingEntityObject(g)};return(g,y)=>{const b=r.resolveComponent("Select"),x=r.resolveComponent("Divider"),E=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock("div",op,[r.createVNode(b,{modelValue:r.unref(a),"onUpdate:modelValue":y[0]||(y[0]=C=>r.isRef(a)?a.value=C:a=C),"item-value":l.value.name,options:s.value.result,filter:"",optionLabel:l.value.name,placeholder:"Select "+l.value.name,class:"w-full"},{value:r.withCtx(C=>[C.value?(r.openBlock(),r.createElementBlock("div",rp,[r.createElementVNode("div",null,r.toDisplayString(C.value[l.value.name]),1)])):(r.openBlock(),r.createElementBlock("span",ap,r.toDisplayString(C.placeholder),1))]),option:r.withCtx(C=>[r.createElementVNode("div",lp,[r.createElementVNode("div",null,r.toDisplayString(C.option[l.value.name]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"]),r.createElementVNode("div",cp,[r.createVNode(x),r.createElementVNode("div",dp,[r.createElementVNode("div",up,[r.createVNode(E,{label:"Cancel",icon:"",severity:"secondary",onClick:y[1]||(y[1]=C=>t.value=!1)})]),r.createElementVNode("div",fp,[r.createVNode(E,{label:"Save",severity:"success",onClick:p})])])])])}}},mp={style:{"font-weight":"700","font-size":"1.25rem"}},pp={class:"flex flex-col"},gp={class:"flex flex-row justify-between items-center"},yp={class:"justify-start"},bp={class:"justify-start"},xp="",_p={__name:"CreateRelatedentity",props:r.mergeModels({entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0}},{showCreateRelatedEntityForm:{},showCreateRelatedEntityFormModifiers:{}}),emits:r.mergeModels(["onSaveDialog"],["update:showCreateRelatedEntityForm"]),setup(n,{emit:e}){const t=r.useModel(n,"showCreateRelatedEntityForm");Je.useRoute();const i=n,s=i.linkedEntity.entityName,o=e,a=r.ref("Add existing");r.onMounted(()=>{m()});const{formData:l,columns:c,errors:d,backendErrors:u,clearErrors:f,saveRecord:h,fetchAllRecords:m,saveRelatedEntityRecord:p}=io(s,xp,o),g=()=>{for(let E=0;E<c.value.length;E++){const C=c.value[E];!C.autoGenerated&&C.foreignKey&&(l.value[C.name]=i.entity360Id)}const x={relationType:i.linkedEntity.relationType,linkedEntities:{entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]}};h(x)},y=x=>{var E;if(((E=x==null?void 0:x.linkRecordIdList)==null?void 0:E.length)>0){const C={entityLinkage:[{linkEntityName:x.linkEntityName,linkRecordIdList:x.linkRecordIdList}]};p(i.entity360Name,i.entity360Id,C)}},b=x=>{const E={entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]};p(x.linkedEntityName,x.linkedEntityRecordId,E)};return(x,E)=>{const C=r.resolveComponent("Tab"),k=r.resolveComponent("TabList"),v=r.resolveComponent("Divider"),S=r.resolveComponent("Button"),_=r.resolveComponent("TabPanel"),D=r.resolveComponent("TabPanels"),B=r.resolveComponent("Tabs"),w=r.resolveComponent("Drawer");return r.openBlock(),r.createBlock(w,{visible:t.value,"onUpdate:visible":E[3]||(E[3]=T=>t.value=T),blockScroll:!0,position:"right",class:"p-fluid layout-profile-sidebar",style:{width:"40%"},pt:{closeButton:"ml-auto"}},{header:r.withCtx(()=>[r.createElementVNode("span",mp,r.toDisplayString(a.value)+" "+r.toDisplayString(n.linkedEntity.entityName),1)]),default:r.withCtx(()=>[r.createVNode(B,{value:"1"},{default:r.withCtx(()=>[r.createVNode(k,null,{default:r.withCtx(()=>[r.createVNode(C,{value:"0"},{default:r.withCtx(()=>E[4]||(E[4]=[r.createTextVNode("Create new")])),_:1}),r.createVNode(C,{value:"1"},{default:r.withCtx(()=>E[5]||(E[5]=[r.createTextVNode("Add existing")])),_:1})]),_:1}),r.createVNode(D,null,{default:r.withCtx(()=>[r.createVNode(_,{value:"0"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(c),(T,I)=>{var X;return r.openBlock(),r.createElementBlock("div",{key:I,class:"mt-3"},[!T.autoGenerated&&!T.foreignKey?(r.openBlock(),r.createBlock(ji,{key:0,modelValue:r.unref(l)[T.name],"onUpdate:modelValue":q=>r.unref(l)[T.name]=q,column:T,errors:(X=r.unref(d)[T.name])==null?void 0:X.messages,onInput:r.unref(f)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):r.createCommentVNode("",!0)])}),128)),r.createElementVNode("div",pp,[r.createVNode(v),r.createElementVNode("div",gp,[r.createElementVNode("div",yp,[r.createVNode(S,{label:"Cancel",icon:"",severity:"secondary",onClick:E[0]||(E[0]=T=>t.value=!1)})]),r.createElementVNode("div",bp,[r.createVNode(S,{label:"Save",severity:"success",onClick:g})])])])]),_:1}),r.createVNode(_,{value:"1"},{default:r.withCtx(()=>[n.linkedEntity.relationType=="ONE_TO_MANY"?(r.openBlock(),r.createBlock(sp,{key:0,modelValue:t.value,"onUpdate:modelValue":E[1]||(E[1]=T=>t.value=T),linkedEntity:n.linkedEntity,entity360Name:n.entity360Name,entity360Id:n.entity360Id,saveExistingRelatedEntityRecord:y},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0),n.linkedEntity.relationType=="MANY_TO_ONE"?(r.openBlock(),r.createBlock(hp,{key:1,modelValue:t.value,"onUpdate:modelValue":E[2]||(E[2]=T=>t.value=T),linkedEntity:n.linkedEntity,entity360Name:n.entity360Name,entity360Id:n.entity360Id,saveExistingEntityObject:b},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["visible"])}}},kp={class:"flex flex-col border-bottom-section pb-3 pt-3"},Sp={class:"flex items-center pl-3 pr-3 justify-between"},wp={key:0,class:"pi pi-caret-right"},Ep={key:1,class:"pi pi-caret-down"},Cp={class:"ml-3 font-bold"},vp={class:"ml-1"},Dp={class:"text-right"},Op={key:0},Np=Be({__name:"LinkEntitySection",props:{entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0},entity360Name:{type:[String,Number]},onSaveRelatedEnttity:{type:Function}},setup(n){Je.useRoute();const e=n,t=r.ref(!1),i=r.ref(!1),s=()=>{t.value=!t.value},o=()=>{i.value=!i.value},a=()=>{i.value=!1,e.onSaveRelatedEnttity()},l=r.computed(()=>e.linkedEntity.list.filter(c=>!c.is_deleted).length);return(c,d)=>{const u=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",kp,[r.createElementVNode("div",Sp,[r.createElementVNode("div",{class:"flex cursor-pointer items-center linked-entity-section grow line-height-4",onClick:d[0]||(d[0]=f=>s())},[t.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",wp)),t.value?(r.openBlock(),r.createElementBlock("div",Ep)):r.createCommentVNode("",!0),r.createElementVNode("div",Cp,r.toDisplayString(n.linkedEntity.entityName),1),r.createElementVNode("div",vp," ("+r.toDisplayString(l.value)+") ",1)]),r.createElementVNode("div",Dp,[r.createVNode(u,{label:"Add",icon:"pi pi-plus",size:"small",onClick:d[1]||(d[1]=f=>o())})])]),t.value?(r.openBlock(),r.createElementBlock("div",Op,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.linkedEntity.list,(f,h)=>(r.openBlock(),r.createElementBlock("div",{class:"flex flex-col",key:h},[f.is_deleted?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(Em,{key:0,linkEntityListItem:f},null,8,["linkEntityListItem"]))]))),128))])):r.createCommentVNode("",!0)]),i.value?(r.openBlock(),r.createBlock(_p,{key:0,showCreateRelatedEntityForm:i.value,"onUpdate:showCreateRelatedEntityForm":d[2]||(d[2]=f=>i.value=f),linkedEntity:n.linkedEntity,entity360Name:n.entity360Name,entity360Id:n.entity360Id,onOnSaveDialog:a},null,8,["showCreateRelatedEntityForm","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-412eec44"]]),Tp={class:"flex"},Pp={class:"p-3 mt-3 flex-col items-center"},Bp={key:0,class:"pi pi-caret-right"},Mp={key:1,class:"pi pi-caret-down"},Vp={class:"font-bold ml-2"},Ap={key:0,class:"flex flex-col mt-4"},Fp={class:"flex flex-col mt-2"},$p={class:"flex flex-row flex-wrap justify-between pl-5"},Ip={class:"flex flex-col"},Lp={class:"font-bold"},Rp={class:"mt-2"},jp={key:0,class:"flex flex-col",style:{position:"relative","max-width":"400px","background-color":"var(--surface-card)"}},zp={key:2,style:{width:"350px"},class:"flex flex-col justify-center"},Wp={key:0,class:"custom-sidebar"},Hp={class:"custom-sidebar-content"},Up={class:"custom-sidebar-button"},qp={class:"custom-sidebar-text"},Na=Be({__name:"Entity360",props:{entityName:{type:String},recordId:{type:String}},emits:["onSaveDialog"],setup(n,{emit:e}){var _,D;const t=Ze(),i=Je.useRoute(),s=n,o=r.ref(!0),a=r.ref(!1);let l=(_=i==null?void 0:i.params)==null?void 0:_.entityName,c=(D=i==null?void 0:i.params)==null?void 0:D.id;s.entityName&&(l=s.entityName),s.recordId&&(c=s.recordId);const d=e,{formData:u,columns:f,errors:h,backendErrors:m,isDataChange:p,linkedEntities:g,primarayColumn:y,clearErrors:b,saveRecord:x,getRelatedEntityRecordById:E,cancleRecord:C}=io(l,c,d);r.watch(()=>t.globalConfigs.appId,async B=>{B&&E()},{immediate:!0});const k=()=>{o.value=!o.value},v=()=>{a.value=!a.value},S=()=>{E()};return(B,w)=>{var L;const T=r.resolveComponent("SplitterPanel"),I=r.resolveComponent("Tab"),X=r.resolveComponent("TabList"),q=r.resolveComponent("TabPanel"),$=r.resolveComponent("TabPanels"),R=r.resolveComponent("Tabs"),F=r.resolveComponent("Splitter"),P=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Tp,[r.createVNode(F,{class:"flex-1",layout:"horizontal",gutterSize:8,size:100},{default:r.withCtx(()=>[r.createVNode(T,{size:20,minSize:10,maxSize:20},{default:r.withCtx(()=>[r.createElementVNode("div",Pp,[r.createElementVNode("div",{onClick:w[0]||(w[0]=H=>k()),class:"section-heading cursor-pointer"},[o.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("i",Bp)),o.value?(r.openBlock(),r.createElementBlock("i",Mp)):r.createCommentVNode("",!0),r.createElementVNode("span",Vp," About this "+r.toDisplayString(r.unref(l)),1)]),o.value?(r.openBlock(),r.createElementBlock("div",Ap,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(H,te)=>{var ie;return r.openBlock(),r.createElementBlock("div",{key:te},[H.autoGenerated?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(ji,{key:0,modelValue:r.unref(u)[H.name],"onUpdate:modelValue":Q=>r.unref(u)[H.name]=Q,column:H,errors:(ie=r.unref(h)[H.name])==null?void 0:ie.messages,onInput:r.unref(b)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"]))])}),128))])):r.createCommentVNode("",!0)])]),_:1}),r.createVNode(T,{size:55,minSize:35,style:{height:"100%"}},{default:r.withCtx(()=>[r.createVNode(R,{value:"0"},{default:r.withCtx(()=>[r.createVNode(X,null,{default:r.withCtx(()=>[r.createVNode(I,{value:"0"},{default:r.withCtx(()=>w[3]||(w[3]=[r.createTextVNode("Overview")])),_:1}),r.createVNode(I,{value:"1"},{default:r.withCtx(()=>w[4]||(w[4]=[r.createTextVNode("Activity")])),_:1})]),_:1}),r.createVNode($,null,{default:r.withCtx(()=>[r.createVNode(q,{value:"0"},{default:r.withCtx(()=>[r.createElementVNode("div",Fp,[w[5]||(w[5]=r.createElementVNode("h3",{class:"mt-2 text-xl font-semibold"},"Data highlights",-1)),r.createElementVNode("div",$p,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f).filter(H=>H.autoGenerated),(H,te)=>(r.openBlock(),r.createElementBlock("div",{key:te,class:"column-item"},[r.createElementVNode("div",Ip,[r.createElementVNode("div",Lp,r.toDisplayString(H.name),1),r.createElementVNode("div",Rp,[r.createVNode(ro,{column:H,value:r.unref(u)[H.name]},null,8,["column","value"])])])]))),128))])])]),_:1}),r.createVNode(q,{value:"1"})]),_:1})]),_:1})]),_:1})]),_:1}),((L=r.unref(g))==null?void 0:L.length)>0?(r.openBlock(),r.createElementBlock("div",jp,[a.value?(r.openBlock(),r.createBlock(P,{key:0,icon:"pi pi-caret-right",rounded:"",onClick:v,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})):r.createCommentVNode("",!0),a.value?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(P,{key:1,icon:"pi pi-caret-left",rounded:"",onClick:v,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})),a.value?(r.openBlock(),r.createElementBlock("div",zp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(g),(H,te)=>(r.openBlock(),r.createElementBlock("div",{key:te},[r.createVNode(Np,{entity360Name:r.unref(l),entity360Id:r.unref(c),linkedEntity:H,onSaveRelatedEnttity:S},null,8,["entity360Name","entity360Id","linkedEntity"])]))),128))])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),r.unref(p)?(r.openBlock(),r.createElementBlock("div",Wp,[r.createElementVNode("div",Hp,[r.createElementVNode("div",Up,[r.createVNode(P,{severity:"primary",onClick:w[1]||(w[1]=H=>r.unref(x)())},{default:r.withCtx(()=>w[6]||(w[6]=[r.createTextVNode("Save")])),_:1}),r.createVNode(P,{style:{"margin-left":"10px"},severity:"secondary",onClick:w[2]||(w[2]=H=>r.unref(C)())},{default:r.withCtx(()=>w[7]||(w[7]=[r.createTextVNode("Cancel")])),_:1})]),r.createElementVNode("div",qp," You've changed property in the "+r.toDisplayString(r.unref(l))+". ",1)])])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-8d31dd1c"]]);function ts(){const n=new sn;let{errors:e,setErrors:t}=Br(),i=r.reactive({data:null});const s=v=>{i.data=v},o=async v=>{try{const S=await n.getEntityRecords(v);if(S&&S.response)return S}catch(S){return console.error("Error fetching entity:",S.errorMessage),S}finally{}},a=async(v,S)=>{try{let _=await n.addRecord(v.entityName,S);if(_)return _}catch(_){return _}finally{}},l=async(v,S,_)=>{try{const D=await n.updateRecord(v.entityName,S,_);if(D&&D.response)return D}catch(D){return D}finally{}},c=async(v,S)=>{try{S.filter==null&&(S.filter={}),Object.keys(S.filter).length===0&&(S.filter=[]);const _=await n.searchEntityRecords(v.entityName,S);if(_)return _.response.sortBy=S.sortBy,_.response.filters=S.filter,_.response.sortDirection=S.sortDirection,_.response.fullTextSearch=S.fullTextSearch,_}catch(_){return _}finally{}},d=async(v,S)=>{try{const _=await n.deleteRecord(v.entityName,S);if(_)return _}catch(_){console.error("Error on deleting record:",_.errorMessage)}finally{}},u=v=>v.result,f=v=>v.entity.entityDefinition.columns,h=v=>{const S=v.entity.entityDefinition.columns;let _={};for(let D=0;D<S.length;D++){const B=S[D];if(B.primaryKey&&B.primaryKey==!0){_=B;break}}return _},m=v=>{const S=v.entity.entityDefinition.columns;let _={};for(let D=0;D<S.length;D++){let B=S[D];B.autoGenerated||(_[B.name]="")}return _},p=(v,S)=>{let _="";const D=v.entity.entityDefinition.columns;for(let B=0;B<D.length;B++){let w=D[B];if(S==w.name){_=w.type;break}}return _},g=(v,S)=>{const D=v.entity.entityDefinition.columns.filter(w=>w.autoGenerated).map(w=>w.name);return Object.entries(S).filter(([w])=>!D.includes(w)).map(([w,T])=>({recordColumnName:w,recordColumnValue:T,columnType:p(i.data,w)}))},y=()=>{const v=i.data.entity.entityDefinition.columns;return no().shape(v.reduce((_,D)=>(D.autoGenerated||(_[D.name]=to().nullable(!1).test({name:"custom-validation",test:function(B){const w=[];let T="";if(D.required&&(!B||B.trim()===""))if(D.validations){T=b(D.validations,"VALIDATE_REQUIRED"),w.push(T);let I=E(D.validations,"VALIDATE_REQUIRED");I&&(I="hint:"+I,w.push(I))}else T=D.displayName+" is required.",w.push(T);else{if(D.maxLength&&B.length>D.maxLength)if(D.validations){T=b(D.validations,"VALIDATE_MAXLENGTH"),w.push(T);let I=E(D.validations,"VALIDATE_MAXLENGTH");I&&(I="hint:"+I,w.push(I))}else T=D.displayName+" cannot exceed from "+D.maxLength+" characters",w.push(T);if(D.regxId&&!new RegExp(x(D.validations,"VALIDATE_REGX")).test(B))if(D.validations){T=b(D.validations,"VALIDATE_REGX"),w.push(T);let I=E(D.validations,"VALIDATE_REGX");I&&(I="hint:"+I,w.push(I))}else T=D.displayName+" invalid format.",w.push(T)}return w.length>0?this.createError({message:w}):!0}})),_),{}))},b=(v,S)=>{for(let _=0;_<v.length;_++)if(S==v[_].type)return v[_].message},x=(v,S)=>{for(let _=0;_<v.length;_++)if(S==v[_].type)return v[_].regx},E=(v,S)=>{for(let _=0;_<v.length;_++)if(S==v[_].type)return v[_].hint};return{state:i,setEntity:s,getEntity:o,addRecord:a,updateRecord:l,searchRecord:c,entityRecordDelete:d,getEntityItems:u,getEntityColumns:f,getPrimaryKeyColumn:h,getFormData:m,createDataToSave:g,createValidationSchema:y,clearErrors:v=>(t({...e.value,[v]:null}),e.value),validateData:async(v,S)=>{try{return await v.validate(S,{abortEarly:!1}),t({}),{validate:!0}}catch(_){const D=_.inner.reduce((T,I)=>(T[I.path]||(T[I.path]={messages:[]}),T[I.path].messages.push(...I.errors),T),{}),B=Object.entries(D).reduce((T,[I,X])=>(T[I]={messages:X.messages},T),{});return t(B),{validate:!1,errors:e.value}}}}}const ns={__name:"ConfirmDeleteDialog",props:{showDeleteDialog:{},showDeleteDialogModifiers:{}},emits:r.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(n,{emit:e}){const t=r.useModel(n,"showDeleteDialog"),i=e,s=o=>{i("onDeleteItem",{remove:o})};return(o,a)=>{const l=r.resolveComponent("Button"),c=r.resolveComponent("Dialog");return r.openBlock(),r.createBlock(c,{visible:t.value,"onUpdate:visible":a[2]||(a[2]=d=>t.value=d),style:{width:"450px"},header:"Confirm",modal:!0},{footer:r.withCtx(()=>[r.createVNode(l,{label:"No",icon:"pi pi-times",text:"",onClick:a[0]||(a[0]=d=>s(!1))}),r.createVNode(l,{label:"Yes",icon:"pi pi-check",text:"",onClick:a[1]||(a[1]=d=>s(!0))})]),default:r.withCtx(()=>[a[3]||(a[3]=r.createElementVNode("div",{class:"flex items-center justify-center"},[r.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),r.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}},Yp={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},Kp={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},ei={__name:"EntityFormDialog",props:r.mergeModels({item:Object},{showEntityForm:{},showEntityFormModifiers:{}}),emits:["update:showEntityForm"],setup(n){const e=r.useModel(n,"showEntityForm"),t=r.inject("entityObject"),i=n;let s=r.ref([]),o=r.ref({}),a=r.ref([]),l=r.ref(null),c=r.ref({});r.onMounted(()=>{s.value=t.getEntityColumns(t.state.data),i.item?o.value=JSON.parse(JSON.stringify(i.item)):o.value=t.getFormData(t.state.data),l.value=t.createValidationSchema()});const d=async()=>{const m=await t.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p=t.getPrimaryKeyColumn(t.state.data),g=i.item[p.name],y={dataDefinitions:t.createDataToSave(t.state.data,o.value)},b=await t.updateRecord(t.state.data,g,y);if(b&&b.success){e.value=!1;const x={sortBy:t.state.data.sortBy,sortDirection:t.state.data.sortDirection,pageSize:t.state.data.pageSize,currentPage:t.state.data.currentPage,columnList:null,filter:t.state.data.filters,fullTextSearch:t.state.data.fullTextSearch},E=await t.searchRecord(t.state.data,x);if(E!=null&&E.response){let C=E==null?void 0:E.response;t.setEntity(C)}}else b.validationErrors&&(a.value=JSON.parse(JSON.stringify(b.errvalidationErrorsors)))},u=async()=>{const m=await t.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p={dataDefinitions:t.createDataToSave(t.state.data,o.value)},g=await t.addRecord(t.state.data,p);g&&g.success?(e.value=!1,t.state.data=await t.getEntity(t.state.data.entityName)):g.validationErrors&&(a.value=JSON.parse(JSON.stringify(g.errvalidationErrorsors)))},f=async()=>{i.item?d():u()},h=m=>{c.value=t.clearErrors(m)};return(m,p)=>{const g=r.resolveComponent("Button"),y=r.resolveComponent("Dialog");return e.value?(r.openBlock(),r.createBlock(y,{key:0,showFooter:!1,visible:e.value,"onUpdate:visible":p[2]||(p[2]=b=>e.value=b),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:r.withCtx(()=>[n.item?(r.openBlock(),r.createElementBlock("span",Yp,"Edit "+r.toDisplayString(r.unref(t).state.data.entityName)+" record details",1)):r.createCommentVNode("",!0),n.item?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Kp,"Add "+r.toDisplayString(r.unref(t).state.data.entityName)+" record details",1))]),footer:r.withCtx(()=>[r.createVNode(g,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:p[0]||(p[0]=b=>e.value=!1)}),r.createVNode(g,{type:"button",icon:"",label:"Save",severity:"success",onClick:p[1]||(p[1]=b=>f())})]),default:r.withCtx(()=>{var b;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),(x,E)=>{var C;return r.openBlock(),r.createElementBlock("div",{key:E},[!x.autoGenerated&&!x.foreignKey?(r.openBlock(),r.createBlock(ji,{key:0,modelValue:r.unref(o)[x.name],"onUpdate:modelValue":k=>r.unref(o)[x.name]=k,column:x,errors:(C=r.unref(c)[x.name])==null?void 0:C.messages,onInput:h},null,8,["modelValue","onUpdate:modelValue","column","errors"])):r.createCommentVNode("",!0),!x.autoGenerated&&x.foreignKey?(r.openBlock(),r.createBlock(Xr,{key:1,modelValue:r.unref(o)[x.name],"onUpdate:modelValue":k=>r.unref(o)[x.name]=k,entityName:x.foreignKey.referencedEntityName,columnName:x.name,relatedEntityColumn:x.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):r.createCommentVNode("",!0)])}),128)),((b=r.unref(a))==null?void 0:b.length)>0?(r.openBlock(),r.createBlock(Kr,{key:0,errors:r.unref(a)},null,8,["errors"])):r.createCommentVNode("",!0)]}),_:1},8,["visible"])):r.createCommentVNode("",!0)}}},Xp={class:"flex justify-between items-start"},Gp={class:"flex-grow-1"},Qp={class:"tile-grid"},Jp={class:"font-bold text-lg text-700"},Zp={class:"flex flex-col gap-2"},eg=Be({__name:"EntityListSingleRecord",props:{item:Object},setup(n){const e=n,t=r.inject("entityObject"),i=r.ref([]),s=r.ref(!1),o=r.ref(!1);r.onMounted(()=>{i.value=t.getEntityColumns(t.state.data)});const a=()=>{s.value=!0},l=()=>{o.value=!0},c=u=>{u.remove==!0?d():s.value=!1},d=async()=>{const u=t.getPrimaryKeyColumn(t.state.data),f=e.item[u.name],h=await t.entityRecordDelete(t.state.data,f);if(h!=null&&h.success){s.value=!1;const m={sortBy:t.state.data.sortBy,sortDirection:t.state.data.sortDirection,pageSize:t.state.data.pageSize,currentPage:t.state.data.currentPage,columnList:null,filter:t.state.data.filters,fullTextSearch:t.state.data.fullTextSearch},p=await t.searchRecord(t.state.data,m);if(p!=null&&p.response){let g=p==null?void 0:p.response;t.setEntity(g)}console.log(h)}};return(u,f)=>{const h=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Xp,[r.createElementVNode("div",Gp,[r.createElementVNode("div",Qp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(m,p)=>(r.openBlock(),r.createElementBlock("div",{key:p},[r.createElementVNode("span",Jp,r.toDisplayString(m.name)+" : ",1),r.createVNode(ro,{column:m,value:n.item[m.name]},null,8,["column","value"])]))),128))])]),r.createElementVNode("div",Zp,[r.createVNode(h,{onClick:f[0]||(f[0]=m=>l()),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"}),r.createVNode(h,{onClick:f[1]||(f[1]=m=>a()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})])]),o.value?(r.openBlock(),r.createBlock(ei,{key:0,showEntityForm:o.value,"onUpdate:showEntityForm":f[2]||(f[2]=m=>o.value=m),item:n.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createBlock(ns,{key:1,showDeleteDialog:s.value,"onUpdate:showDeleteDialog":f[3]||(f[3]=m=>s.value=m),onOnDeleteItem:c},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-ea3b758f"]]),tg=Be({__name:"EntityListRecordParent",props:{listItemDisplay:String},setup(n){const e=r.inject("entityObject"),t=r.ref([]);return r.watch(()=>e.state.data,i=>{i&&(t.value=i.result,console.log("Entity state updated in child:",e))},{immediate:!0}),(i,s)=>(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.value,(o,a)=>(r.openBlock(),r.createElementBlock("div",{key:a,class:"card rounded-md p-5 my-2 shadow-lg relative tile"},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listItemDisplay!=null&&n.listItemDisplay!=""?n.listItemDisplay:eg),r.mergeProps({ref_for:!0},{item:o}),null,16))]))),128))}},[["__scopeId","data-v-b13f837f"]]),ng={};function ig(n,e){return null}const sg=Be(ng,[["render",ig]]),og={class:"my-2"},rg={class:"m-0"},ag={__name:"EntityListHeaderSlot",setup(n){const e=r.inject("entityObject");let t=r.ref("");return r.watch(()=>e.state.data,i=>{i&&(t.value=i.entityName)},{immediate:!0}),(i,s)=>{const o=r.resolveComponent("Toolbar");return r.openBlock(),r.createBlock(o,{class:"p-2 my-2"},{start:r.withCtx(()=>[r.createElementVNode("div",og,[r.createElementVNode("h2",rg,"EntityName: "+r.toDisplayString(r.unref(t)),1)])]),end:r.withCtx(()=>s[0]||(s[0]=[])),_:1})}}},lg={class:"flex flex-col mb-5"},cg={class:"col-12"},dg={class:"flex flex-col mb-5"},ug={class:"col-12"},fg={key:0},hg={class:"flex flex-col mb-5"},mg={class:"col-12"},pg={class:"flex flex-col mb-5"},gg={class:"col-12"},yg={class:"flex flex-col mb-5"},bg={class:"col-12"},xg={class:"flex flex-row justify-between items-center"},_g={key:1},kg={class:"flex flex-row justify-between items-center"},Sg={key:1,class:"text-red-500"},wg={class:"flex flex-col"},Eg={class:"flex flex-row justify-between items-center"},Cg={__name:"FilterSortSidebar",props:r.mergeModels({headers:Array,operatorMap:Object,sortCallback:Function,filterCallback:Function,getColumnDatatype:Function,getDatatypeByField:Function},{sortBy:{},sortByModifiers:{},sortDirection:{},sortDirectionModifiers:{},showFilter:{},showFilterModifiers:{},filters:{},filtersModifiers:{}}),emits:["update:sortBy","update:sortDirection","update:showFilter","update:filters"],setup(n){const e=r.useModel(n,"sortBy"),t=r.useModel(n,"sortDirection"),i=r.useModel(n,"showFilter"),s=r.useModel(n,"filters"),o={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"},a=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],l=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],c=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],d=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],u=[{label:"ASC",value:1},{label:"DESC",value:-1}];let f=[];const h=r.computed(()=>n.headers.filter(S=>S.sortable)),m=r.computed(()=>n.headers.filter(S=>S.filterable)),p=S=>n.headers.filter(_=>{var D;return _.filterable?((D=s.value[S])==null?void 0:D.columnName)===_.name?!0:!s.value.some((B,w)=>w!==S&&B.columnName===_.name):!1}).map(_=>({label:_.name,value:_.field})),g=S=>{let _="";switch(n.getDatatypeByField(S.columnName).toLowerCase()){case"string":case"uuid":_="startsWith";break;case"date":_="dateIs";break;case"numeric":case"int":case"integer":_="equals";break;case"bool":case"boolean":_="equals";break}S.operator=_,S.value=""},y=S=>{const _=n.getDatatypeByField(S.columnName);switch(_&&_.toLowerCase()){case"integer":case"int":case"numeric":f=l;break;case"date":f=d;break;case"bool":case"boolean":f=c;break;default:f=a}return f},b=S=>{if(S&&S.columnName){const _=n.getDatatypeByField(S.columnName);return n.getColumnDatatype(_)}else return""},x=()=>{for(let S=0;S<s.value.length;S++){const _=s.value[S];_.editing=!1}s.value.push({columnName:"",value:"",operator:"",editing:!0})},E=S=>{s.value.splice(S,1)},C=S=>{S.editing=!S.editing},k=()=>{let S=[],_=JSON.parse(JSON.stringify(s.value));for(let D=0;D<_.length;D++){const B=_[D];delete B.editing,B.columnName&&B.operator&&B.value&&(B.columnType=n.getDatatypeByField(B.columnName),B.operator=n.operatorMap[B.operator],S.push(B))}n.filterCallback(S)},v=()=>{n.sortCallback()};return(S,_)=>{const D=r.resolveComponent("Select"),B=r.resolveComponent("Divider"),w=r.resolveComponent("InputNumber"),T=r.resolveComponent("Calendar"),I=r.resolveComponent("InputText"),X=r.resolveComponent("Button"),q=r.resolveComponent("Drawer");return r.openBlock(),r.createBlock(q,{visible:i.value,"onUpdate:visible":_[4]||(_[4]=$=>i.value=$),header:"Sorting and Filter",blockScroll:!0,position:"right",class:"layout-profile-sidebar !w-full md:!w-80 lg:!w-[30rem]",pt:{closeButton:"ml-auto"}},{default:r.withCtx(()=>[r.createElementVNode("div",lg,[_[5]||(_[5]=r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),r.createElementVNode("div",cg,[r.createVNode(D,{modelValue:e.value,"onUpdate:modelValue":_[0]||(_[0]=$=>e.value=$),options:h.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:_[1]||(_[1]=$=>v(S.event))},null,8,["modelValue","options"])])]),r.createElementVNode("div",dg,[_[6]||(_[6]=r.createElementVNode("div",{class:"col-12 font-bold"},[r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),r.createElementVNode("div",ug,[r.createVNode(D,{modelValue:t.value,"onUpdate:modelValue":_[2]||(_[2]=$=>t.value=$),options:u,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:_[3]||(_[3]=$=>v(S.event))},null,8,["modelValue"])])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,($,R)=>(r.openBlock(),r.createElementBlock("div",{key:R},[$.editing?(r.openBlock(),r.createElementBlock("div",fg,[r.createVNode(B),r.createElementVNode("div",hg,[_[7]||(_[7]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),r.createElementVNode("div",mg,[r.createVNode(D,{modelValue:$.columnName,"onUpdate:modelValue":F=>$.columnName=F,options:p(R),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:F=>g($)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),r.createElementVNode("div",pg,[_[8]||(_[8]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),r.createElementVNode("div",gg,[r.createVNode(D,{modelValue:$.operator,"onUpdate:modelValue":F=>$.operator=F,options:y($),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),r.createElementVNode("div",yg,[_[9]||(_[9]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),r.createElementVNode("div",bg,[b($)=="numeric"?(r.openBlock(),r.createBlock(w,{key:0,format:!1,class:"w-full",modelValue:$.value,"onUpdate:modelValue":F=>$.value=F,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):b($)=="date"?(r.openBlock(),r.createBlock(T,{key:1,class:"w-full",modelValue:$.value,"onUpdate:modelValue":F=>$.value=F,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(r.openBlock(),r.createBlock(I,{key:2,modelValue:$.value,"onUpdate:modelValue":F=>$.value=F,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),r.createElementVNode("div",xg,[r.createVNode(X,{label:"Hide",icon:"",severity:"warn",onClick:F=>C($)},null,8,["onClick"]),r.createVNode(X,{label:"Delete",icon:"",severity:"danger",onClick:F=>E(R)},null,8,["onClick"])])])):r.createCommentVNode("",!0),$.editing?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",_g,[r.createVNode(B),r.createElementVNode("div",kg,[r.createElementVNode("span",null,[$.columnName||$.operator||$.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!$.columnName})},r.toDisplayString($.columnName?" "+$.columnName:" column"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!o[$.operator]})},r.toDisplayString($.operator?" "+o[$.operator]:" operator"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!$.value})},r.toDisplayString($.value?" "+$.value:" value"),3)],64)):(r.openBlock(),r.createElementBlock("span",Sg,"Filter is empty"))]),r.createVNode(X,{label:"Edit",icon:"",severity:"info",onClick:F=>C($)},null,8,["onClick"])])]))]))),128)),r.createElementVNode("div",wg,[r.createVNode(B),r.createElementVNode("div",Eg,[r.createVNode(X,{label:"Add",disabled:m.value.length===s.value.length,icon:"",severity:"success",onClick:x},null,8,["disabled"]),r.createVNode(X,{label:"Apply",severity:"info",onClick:k})])])]),_:1},8,["visible"])}}},vg={class:"my-2"},zt={__name:"EntityListFilters",setup(n){const e=r.inject("entityObject"),t=r.ref(!1),i=r.ref([]),s=r.ref([]),o=r.ref(""),a=r.ref(1);let l=r.ref("");const c=r.ref([]),d=r.ref([]),u={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};r.watch(()=>e.state.data,C=>{if(C&&(c.value=e.getEntityColumns(C),d.value=b(c.value),o.value=="")){const k=e.getPrimaryKeyColumn(C);o.value=k.name}},{immediate:!0});const f=()=>{t.value=!t.value},h=C=>{s.value=C,m()},m=async()=>{const C={sortBy:[o.value],sortDirection:a.value===1?"ASC":"DESC",pageSize:e.state.data.pageSize,currentPage:e.state.data.currentPage,columnList:null,filter:s.value,fullTextSearch:l.value},k=await e.searchRecord(e.state.data,C);if(k!=null&&k.success){let v=k==null?void 0:k.response;e.setEntity(v)}},p=()=>{m()},g=()=>{i.value=[],s.value=[],m()},y=()=>{m()},b=C=>C.map(k=>({field:k.name,name:k.displayName?k.displayName:k.name,filterable:k.filterable,datatype:k.type,sortable:k.indexColumn,displayFormatKey:k.displayFormatKey,displayFormat:k.displayFormat})),x=C=>{switch(C.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},E=C=>{const k=c.value.find(v=>v.name===C);return k?k.type:null};return(C,k)=>{const v=r.resolveComponent("Button"),S=r.resolveComponent("InputIcon"),_=r.resolveComponent("InputText"),D=r.resolveComponent("IconField"),B=r.resolveComponent("Toolbar");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(B,{class:"p-2 my-2"},{start:r.withCtx(()=>[r.createElementVNode("div",vg,[r.createVNode(v,{type:"button",size:"medium",icon:"pi pi-filter",label:"Filter",severity:"info",onClick:k[0]||(k[0]=w=>f())})]),r.createVNode(v,{class:"ml-3",size:"medium",type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warn",onClick:k[1]||(k[1]=w=>g())})]),end:r.withCtx(()=>[r.createVNode(D,{iconPosition:"right",class:"block mt-2 md:mt-0"},{default:r.withCtx(()=>[r.createVNode(S,{onClick:k[2]||(k[2]=w=>y()),class:"pi pi-search"}),r.createVNode(_,{class:"w-full sm:w-auto",onKeyup:k[3]||(k[3]=r.withKeys(w=>y(),["enter"])),modelValue:r.unref(l),"onUpdate:modelValue":k[4]||(k[4]=w=>r.isRef(l)?l.value=w:l=w),placeholder:"Search..."},null,8,["modelValue"])]),_:1})]),_:1}),r.createVNode(Cg,{sortBy:o.value,"onUpdate:sortBy":k[5]||(k[5]=w=>o.value=w),sortDirection:a.value,"onUpdate:sortDirection":k[6]||(k[6]=w=>a.value=w),showFilter:t.value,"onUpdate:showFilter":k[7]||(k[7]=w=>t.value=w),filters:i.value,"onUpdate:filters":k[8]||(k[8]=w=>i.value=w),headers:d.value,operatorMap:u,sortCallback:p,filterCallback:h,getColumnDatatype:x,getDatatypeByField:E},null,8,["sortBy","sortDirection","showFilter","filters","headers"])],64)}}},is={__name:"EntityListPagination",setup(n){const e=r.ref(25),t=r.ref(0),i=r.ref(0),s=r.ref(0);let o=r.inject("entityObject");const a=async l=>{e.value=l.rows,t.value=l.page,s.value=l.first;const c={sortBy:o.state.data.sortBy,sortDirection:o.state.data.sortDirection,columnList:null,filter:o.state.data.filters,fullTextSearch:o.state.data.fullTextSearch,pageSize:e.value,currentPage:t.value},d=await o.searchRecord(o.state.data,c);if(d!=null&&d.success){let u=d==null?void 0:d.response;o.setEntity(u),i.value=d.response.totalRecords,s.value=t.value*e.value}};return r.watch(()=>{var l,c;return(c=(l=o==null?void 0:o.state)==null?void 0:l.data)==null?void 0:c.totalRecords},l=>{i&&(i.value=l)},{immediate:!0}),(l,c)=>{const d=r.resolveComponent("Paginator");return r.openBlock(),r.createBlock(d,{class:"my-4",rows:e.value,totalRecords:i.value,rowsPerPageOptions:[10,25,50,100],onPage:a,template:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},null,8,["rows","totalRecords"])}}},Dg={class:"flex flex-row justify-end p-2 my-2"},Wt={__name:"EntityListAddButton",setup(n){const e=r.ref(!1),t=()=>{e.value=!0};return(i,s)=>{const o=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Dg,[r.createVNode(o,{label:"Add",size:"medium",icon:"pi pi-plus",onClick:s[0]||(s[0]=a=>t())})]),e.value?(r.openBlock(),r.createBlock(ei,{key:0,showEntityForm:e.value,"onUpdate:showEntityForm":s[1]||(s[1]=a=>e.value=a)},null,8,["showEntityForm"])):r.createCommentVNode("",!0)],64)}}},Ta={__name:"EntityList",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,listFilerSlot:Boolean,className:{type:String,default:"default-class"}},setup(n,{expose:e}){const t=ts(),i=Ze();r.provide("entityObject",t);const s=n;return e({props:s,reload:()=>{console.log("reload data")}}),r.watch(()=>i.globalConfigs.appId,async a=>{if(a){const l=await t.getEntity(s.entityName);l.success?t.setEntity(l.response):t.setEntity({result:[]})}},{immediate:!0}),(a,l)=>{var c,d,u;return a.$slots["list-item-display"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:0})):r.createCommentVNode("",!0),n.listFilerSlot?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(((u=(d=(c=r.unref(t))==null?void 0:c.state)==null?void 0:d.data)==null?void 0:u.result)||[],f=>r.renderSlot(a.$slots,"list-item-display",{item:f})),256))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listHeader||ag))),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt))),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:0})):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listDisplay||tg),r.normalizeProps(r.guardReactiveProps({listItemDisplay:n.listItemDisplay})),null,16)),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listPagination||is))),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFooter||sg)))],64))}}},Og={key:0},Ng=["href"],Tg={key:1},Pg={class:"action-buttons"},Bg=Be({__name:"EntityListingSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,displayField:String,baseUrl:String,hrefKey:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(n){const e=n,t=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{i.value=t.getEntityColumns(t.state.data),s.value=i.value.find(h=>h.name===e.displayField)||null,s.value&&(o.value=e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=t.getPrimaryKeyColumn(t.state.data),m=e.item[h.name],p=await t.entityRecordDelete(t.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await t.searchRecord(t.state.data,{sortBy:t.state.data.sortBy,sortDirection:t.state.data.sortDirection,pageSize:t.state.data.pageSize,currentPage:t.state.data.currentPage,columnList:null,filter:t.state.data.filters,fullTextSearch:t.state.data.fullTextSearch});g!=null&&g.response&&t.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("ul",{class:r.normalizeClass(e.className)},[s.value?(r.openBlock(),r.createElementBlock("li",Og,[r.createElementVNode("a",{href:`${n.baseUrl}/${n.item[n.hrefKey]}`,target:"_blank",class:"hover:underline"},r.toDisplayString(o.value),9,Ng)])):(r.openBlock(),r.createElementBlock("li",Tg,[r.createElementVNode("span",null,"No matching field found for '"+r.toDisplayString(o.value)+"'.",1)])),r.createElementVNode("li",Pg,[n.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),n.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])],2),l.value?(r.openBlock(),r.createBlock(ei,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:n.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(ns,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-45d1d6a4"]]),Mg={key:0,class:"error-message"},Vg={class:"text-red-500 font-bold"},Ag={key:0},Fg={key:1},$g={key:2},Ig={key:3},Lg={key:1},Pa=Be({__name:"EntityListing",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},displayField:String,baseUrl:String,hrefKey:String,editable:Boolean,deletable:Boolean},setup(n,{expose:e}){const t=ts(),i=Ze();r.provide("entityObject",t);const s=n,o=r.ref([]);return r.watch(()=>t.state.data,c=>{c&&(o.value=c.result)},{immediate:!0}),e({props:s,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),r.watch(()=>i.globalConfigs.appId,async c=>{if(c){const d=await t.getEntity(s.entityName);t.setEntity(d.success?d.response:{result:[]})}},{immediate:!0}),(c,d)=>{var u,f,h;return c.$slots["list-item-display"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.renderSlot(c.$slots,"header",{},void 0,!0),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:0})):r.createCommentVNode("",!0),n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(((h=(f=(u=r.unref(t))==null?void 0:u.state)==null?void 0:f.data)==null?void 0:h.result)||[],m=>r.renderSlot(c.$slots,"list-item-display",{item:m},void 0,!0)),256)),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.renderSlot(c.$slots,"header",{},void 0,!0),!n.displayField||!n.baseUrl||!n.hrefKey||!n.entityName?(r.openBlock(),r.createElementBlock("div",Mg,[r.createElementVNode("p",Vg,[d[0]||(d[0]=r.createTextVNode(" Error: Missing required props - ")),n.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Ag,"Entity Name")),n.displayField?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Fg,"Display Field")),n.baseUrl?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",$g,"Base Url")),n.hrefKey?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Ig,"Href Key"))])])):(r.openBlock(),r.createElementBlock("div",Lg,[n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:0})):r.createCommentVNode("",!0),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(m,p)=>(r.openBlock(),r.createElementBlock("div",{key:p},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listItemDisplay!=null&&n.listItemDisplay!=""?n.listItemDisplay:Bg),r.mergeProps({ref_for:!0},{item:m,...s}),null,16))]))),128)),n.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listPagination||is),{key:2})):r.createCommentVNode("",!0)])),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64))}}},[["__scopeId","data-v-703991fe"]]),Rg={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col"},jg={class:"flex justify-between items-start gap-4"},zg={class:"flex-grow"},Wg={class:"flex flex-col gap-2"},Hg={class:"font-bold text-gray-700"},Ug={class:"text-gray-600"},qg={class:"flex flex-col gap-2"},Yg=Be({__name:"EntityListingTileSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(n){const e=n,t=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{i.value=t.getEntityColumns(t.state.data),s.value=i.value.find(h=>h.name===e.displayField)||null,s.value&&(o.value=e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=t.getPrimaryKeyColumn(t.state.data),m=e.item[h.name],p=await t.entityRecordDelete(t.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await t.searchRecord(t.state.data,{sortBy:t.state.data.sortBy,sortDirection:t.state.data.sortDirection,pageSize:t.state.data.pageSize,currentPage:t.state.data.currentPage,columnList:null,filter:t.state.data.filters,fullTextSearch:t.state.data.fullTextSearch});g!=null&&g.response&&t.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Rg,[r.createElementVNode("div",jg,[r.createElementVNode("div",zg,[r.createElementVNode("div",Wg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(g,y)=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"flex flex-col"},[r.createElementVNode("span",Hg,r.toDisplayString(g.displayName||g.name)+":",1),r.createElementVNode("span",Ug,r.toDisplayString(n.item[g.name]),1)]))),128))])]),r.createElementVNode("div",qg,[n.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),n.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])])]),l.value?(r.openBlock(),r.createBlock(ei,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:n.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(ns,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-6ec4735d"]]),Kg={class:"flex flex-wrap gap-4 p-2"},Xg={key:0,class:"error-message"},Gg={class:"text-red-500 font-bold"},Qg={key:0},Jg={key:1},Zg={class:"flex flex-wrap gap-4 p-4"},Ba=Be({__name:"EntityListingTile",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(n,{expose:e}){const t=ts(),i=Ze();r.provide("entityObject",t);const s=n,o=r.ref([]);return r.watch(()=>t.state.data,c=>{c&&(o.value=c.result)},{immediate:!0}),e({props:s,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),r.watch(()=>i.globalConfigs.appId,async c=>{if(c){const d=await t.getEntity(s.entityName);t.setEntity(d.success?d.response:{result:[]})}},{immediate:!0}),(c,d)=>{var u,f,h;return c.$slots["list-item-display-tile"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.renderSlot(c.$slots,"header",{},void 0,!0),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:0})):r.createCommentVNode("",!0),n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",Kg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(((h=(f=(u=r.unref(t))==null?void 0:u.state)==null?void 0:f.data)==null?void 0:h.result)||[],(m,p)=>(r.openBlock(),r.createElementBlock("div",{key:p,class:"flex flex-col p-6 border border-gray-300 shadow-md rounded-lg bg-white w-full sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/5 2xl:w-1/8"},[r.renderSlot(c.$slots,"list-item-display-tile",{item:m},void 0,!0)]))),128))]),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.renderSlot(c.$slots,"header",{},void 0,!0),n.entityName?(r.openBlock(),r.createElementBlock("div",Jg,[n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:0})):r.createCommentVNode("",!0),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",Zg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(m,p)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listItemDisplay!=null&&n.listItemDisplay!=""?n.listItemDisplay:Yg),r.mergeProps({key:p,ref_for:!0},{item:m,...s}),null,16))),128))]),n.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listPagination||is),{key:2})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",Xg,[r.createElementVNode("p",Gg,[d[0]||(d[0]=r.createTextVNode(" Error: Missing required props - ")),n.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Qg,"Entity Name"))])])),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64))}}},[["__scopeId","data-v-9078f877"]]),ey={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col"},ty={class:"flex justify-between items-start gap-4"},ny={class:"flex-grow"},iy={class:"flex flex-col gap-2"},sy={class:"font-bold text-gray-700"},oy={class:"text-gray-600"},ry={class:"flex flex-col gap-2"},ay=Be({__name:"EntityListingCarouselSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(n){const e=n,t=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{i.value=t.getEntityColumns(t.state.data),s.value=i.value.find(h=>h.name===e.displayField)||null,s.value&&(o.value=e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=t.getPrimaryKeyColumn(t.state.data),m=e.item[h.name],p=await t.entityRecordDelete(t.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await t.searchRecord(t.state.data,{sortBy:t.state.data.sortBy,sortDirection:t.state.data.sortDirection,pageSize:t.state.data.pageSize,currentPage:t.state.data.currentPage,columnList:null,filter:t.state.data.filters,fullTextSearch:t.state.data.fullTextSearch});g!=null&&g.response&&t.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",ey,[r.createElementVNode("div",ty,[r.createElementVNode("div",ny,[r.createElementVNode("div",iy,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(g,y)=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"flex flex-col"},[r.createElementVNode("span",sy,r.toDisplayString(g.displayName||g.name)+":",1),r.createElementVNode("span",oy,r.toDisplayString(n.item[g.name]),1)]))),128))])]),r.createElementVNode("div",ry,[n.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),n.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])])]),l.value?(r.openBlock(),r.createBlock(ei,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:n.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(ns,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-2c441a6d"]]);/**
157
+ * Vue 3 Carousel 0.13.0
158
+ * (c) 2025
159
+ * @license MIT
160
+ */const Ma=["viewport","carousel"],ti={"bottom-to-top":"btt","left-to-right":"ltr","right-to-left":"rtl","top-to-bottom":"ttb"},Va=["ltr","left-to-right","rtl","right-to-left","ttb","top-to-bottom","btt","bottom-to-top"],ly={ariaGallery:"Gallery",ariaNavigateToPage:"Navigate to page {slideNumber}",ariaNavigateToSlide:"Navigate to slide {slideNumber}",ariaNextSlide:"Navigate to next slide",ariaPreviousSlide:"Navigate to previous slide",iconArrowDown:"Arrow pointing downwards",iconArrowLeft:"Arrow pointing to the left",iconArrowRight:"Arrow pointing to the right",iconArrowUp:"Arrow pointing upwards",itemXofY:"Item {currentSlide} of {slidesCount}"};Object.values(ti);const Aa=["slide","fade"],Fa=["center","start","end","center-even","center-odd"],Pe={autoplay:0,breakpointMode:Ma[0],breakpoints:void 0,dir:Va[0],enabled:!0,gap:0,height:"auto",i18n:ly,ignoreAnimations:!1,itemsToScroll:1,itemsToShow:1,modelValue:0,mouseDrag:!0,pauseAutoplayOnHover:!1,preventExcessiveDragging:!1,slideEffect:Aa[0],snapAlign:Fa[0],touchDrag:!0,transition:300,wrapAround:!1},ln=Symbol("carousel"),cy=n=>{const e=r.shallowReactive([]),t=i=>{i!==void 0?e.slice(i).forEach((s,o)=>{var a;(a=s.exposed)===null||a===void 0||a.setIndex(i+o)}):e.forEach((s,o)=>{var a;(a=s.exposed)===null||a===void 0||a.setIndex(o)})};return{cleanup:()=>{e.splice(0,e.length)},getSlides:()=>e,registerSlide:(i,s)=>{if(!i||i.props.isClone)return;const o=s??e.length;e.splice(o,0,i),t(o),n("slide-registered",{slide:i,index:o})},unregisterSlide:i=>{const s=e.indexOf(i);s!==-1&&(n("slide-unregistered",{slide:i,index:s}),e.splice(s,1),t(s))}}};function dy(n){return n.length===0?0:n.reduce((t,i)=>t+i,0)/n.length}function $a({slides:n,position:e,toShow:t}){const i=[],s=e==="before",o=s?-t:0,a=s?0:t;if(n.length<=0)return i;for(let l=o;l<a;l++){const d={index:s?l:l+n.length,isClone:!0,position:e,id:void 0,key:`clone-${e}-${l}`},u=n[(l%n.length+n.length)%n.length].vnode,f=r.cloneVNode(u,d);f.el=null,i.push(f)}return i}const uy='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])';function Ia(n){if(!n.el||!(n.el instanceof Element))return;const e=n.el.querySelectorAll(uy);for(const t of e)t instanceof HTMLElement&&!t.hasAttribute("disabled")&&t.getAttribute("aria-hidden")!=="true"&&t.setAttribute("tabindex","-1")}function fy(n,e){return Object.keys(n).filter(t=>!e.includes(t)).reduce((t,i)=>(t[i]=n[i],t),{})}function hy(n){const{isVertical:e,isReversed:t,dragged:i,effectiveSlideSize:s}=n,o=e?i.y:i.x;if(o===0)return 0;const a=Math.round(o/s);return t?a:-a}function Nt({val:n,max:e,min:t}){return e<t?n:Math.min(Math.max(n,isNaN(t)?n:t),isNaN(e)?n:e)}function my(n){const{transform:e}=window.getComputedStyle(n);return e.split(/[(,)]/).slice(1,-1).map(t=>parseFloat(t))}function py(n){let e=1,t=1;return n.forEach(i=>{const s=my(i);s.length===6&&(e/=s[0],t/=s[3])}),{widthMultiplier:e,heightMultiplier:t}}function gy(n,e){switch(n){case"start":return 0;case"center":case"center-odd":return(e-1)/2;case"center-even":return(e-2)/2;case"end":return e-1;default:return 0}}function yy(n,e,t){switch(n){case"start":return 0;case"center":case"center-odd":return(t-e)/2;case"center-even":return t/2-e;case"end":return t-e;default:return 0}}function ho({slideSize:n,viewportSize:e,align:t,itemsToShow:i}){return i!==void 0?gy(t,i):n!==void 0&&e!==void 0?yy(t,n,e):0}function La(n="",e={}){return Object.entries(e).reduce((t,[i,s])=>t.replace(`{${i}}`,String(s)),n)}function Ra({val:n,max:e,min:t=0}){const i=e-t+1;return((n-t)%i+i)%i+t}function mo(n,e=0){let t=!1,i=0,s=null;function o(...a){if(t)return;t=!0;const l=()=>{s=requestAnimationFrame(c=>{c-i>e?(i=c,n(...a),t=!1):l()})};l()}return o.cancel=()=>{s&&(cancelAnimationFrame(s),s=null,t=!1)},o}function ss(n,e="px"){if(!(n==null||n===""))return typeof n=="number"||parseFloat(n).toString()===n?`${n}${e}`:n}const by=r.defineComponent({name:"CarouselAria",setup(){const n=r.inject(ln);return n?()=>r.h("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},La(n.config.i18n.itemXofY,{currentSlide:n.currentSlide+1,slidesCount:n.slidesCount})):()=>""}}),xy={autoplay:{default:Pe.autoplay,type:Number},breakpoints:{default:Pe.breakpoints,type:Object},breakpointMode:{default:Pe.breakpointMode,validator(n){return Ma.includes(n)}},enabled:{default:Pe.enabled,type:Boolean},gap:{default:Pe.gap,type:Number},height:{default:Pe.height,type:[Number,String]},ignoreAnimations:{default:!1,type:[Array,Boolean,String]},itemsToScroll:{default:Pe.itemsToScroll,type:Number},itemsToShow:{default:Pe.itemsToShow,type:[Number,String]},i18n:{default:Pe.i18n,type:Object},modelValue:{default:void 0,type:Number},mouseDrag:{default:Pe.mouseDrag,type:Boolean},touchDrag:{default:Pe.touchDrag,type:Boolean},pauseAutoplayOnHover:{default:Pe.pauseAutoplayOnHover,type:Boolean},preventExcessiveDragging:{default:!1,type:Boolean,validator(n,e){return n&&e.wrapAround&&console.warn('[vue3-carousel warn]: "preventExcessiveDragging" cannot be used with wrapAround. The setting will be ignored.'),!0}},snapAlign:{default:Pe.snapAlign,validator(n){return Fa.includes(n)}},slideEffect:{type:String,default:Pe.slideEffect,validator(n){return Aa.includes(n)}},transition:{default:Pe.transition,type:Number},dir:{type:String,default:Pe.dir,validator(n,e){if(!Va.includes(n))return!1;const t=n in ti?ti[n]:n;return["ttb","btt"].includes(t)&&(!e.height||e.height==="auto")&&console.warn(`[vue3-carousel warn]: The dir "${n}" is not supported with height "auto".`),!0}},wrapAround:{default:Pe.wrapAround,type:Boolean}},ja=r.defineComponent({name:"VueCarousel",props:xy,emits:["before-init","drag","init","loop","slide-end","slide-registered","slide-start","slide-unregistered","update:modelValue"],setup(n,{slots:e,emit:t,expose:i}){var s;const o=cy(t),a=o.getSlides(),l=r.computed(()=>a.length),c=r.ref(null),d=r.ref(null),u=r.ref(0),f=r.computed(()=>Object.assign(Object.assign(Object.assign({},Pe),fy(n,["breakpoints","modelValue"])),{i18n:Object.assign(Object.assign({},Pe.i18n),n.i18n)})),h=r.shallowReactive(Object.assign({},f.value)),m=r.ref((s=n.modelValue)!==null&&s!==void 0?s:0),p=r.ref(m.value);r.watch(m,M=>p.value=M);const g=r.ref(0),y=r.computed(()=>Math.ceil((l.value-1)/2)),b=r.computed(()=>l.value-1),x=r.computed(()=>0);let E=null,C=null,k=null;const v=r.computed(()=>u.value+h.gap),S=r.computed(()=>{const M=h.dir||"ltr";return M in ti?ti[M]:M}),_=r.computed(()=>["rtl","btt"].includes(S.value)),D=r.computed(()=>["ttb","btt"].includes(S.value)),B=r.computed(()=>h.itemsToShow==="auto"),w=r.computed(()=>D.value?"height":"width");function T(){var M;if(!J.value)return;const z=(f.value.breakpointMode==="carousel"?(M=c.value)===null||M===void 0?void 0:M.getBoundingClientRect().width:typeof window<"u"?window.innerWidth:0)||0,K=Object.keys(n.breakpoints||{}).map(ne=>Number(ne)).sort((ne,ye)=>+ye-+ne),Y={};K.some(ne=>z>=ne?(Object.assign(Y,n.breakpoints[ne]),Y.i18n&&Object.assign(Y.i18n,f.value.i18n,n.breakpoints[ne].i18n),!0):!1),Object.assign(h,f.value,Y)}const I=mo(()=>{T(),L(),P()}),X=r.shallowReactive(new Set),q=r.ref([]);function $({widthMultiplier:M,heightMultiplier:z}){q.value=a.map(K=>{var Y;const ne=(Y=K.exposed)===null||Y===void 0?void 0:Y.getBoundingRect();return{width:ne.width*M,height:ne.height*z}})}const R=r.ref({width:0,height:0});function F({widthMultiplier:M,heightMultiplier:z}){var K;const Y=((K=d.value)===null||K===void 0?void 0:K.getBoundingClientRect())||{width:0,height:0};R.value={width:Y.width*M,height:Y.height*z}}function P(){if(!d.value)return;const M=py(X);if(F(M),$(M),B.value)u.value=dy(q.value.map(z=>z[w.value]));else{const z=Number(h.itemsToShow),K=(z-1)*h.gap;u.value=(R.value[w.value]-K)/z}}function L(){!h.wrapAround&&l.value>0&&(m.value=Nt({val:m.value,max:b.value,min:x.value})),B.value||(h.itemsToShow=Nt({val:Number(h.itemsToShow),max:l.value,min:1}))}const H=r.computed(()=>typeof n.ignoreAnimations=="string"?n.ignoreAnimations.split(","):Array.isArray(n.ignoreAnimations)?n.ignoreAnimations:n.ignoreAnimations?!1:[]);r.watchEffect(()=>L()),r.watchEffect(()=>{P()});let te;const ie=M=>{const z=M.target;if(!(!(z!=null&&z.contains(c.value))||Array.isArray(H.value)&&H.value.includes(M.animationName))&&(X.add(z),!te)){const K=()=>{te=requestAnimationFrame(()=>{P(),K()})};K()}},Q=M=>{const z=M.target;z&&X.delete(z),te&&X.size===0&&(cancelAnimationFrame(te),P())},J=r.ref(!1);typeof document<"u"&&r.watchEffect(()=>{J.value&&H.value!==!1?(document.addEventListener("animationstart",ie),document.addEventListener("animationend",Q)):(document.removeEventListener("animationstart",ie),document.removeEventListener("animationend",Q))}),r.onMounted(()=>{J.value=!0,T(),De(),c.value&&(k=new ResizeObserver(I),k.observe(c.value)),t("init")}),r.onBeforeUnmount(()=>{J.value=!1,o.cleanup(),C&&clearTimeout(C),te&&cancelAnimationFrame(te),E&&clearInterval(E),k&&(k.disconnect(),k=null),typeof document<"u"&&ue(),c.value&&(c.value.removeEventListener("transitionend",P),c.value.removeEventListener("animationiteration",P))});let se=!1;const de={x:0,y:0},Ce=r.reactive({x:0,y:0}),Qe=r.ref(!1),ze=r.ref(!1),ft=()=>{Qe.value=!0},it=()=>{Qe.value=!1},W=mo(M=>{if(!M.ctrlKey)switch(M.key){case"ArrowLeft":case"ArrowUp":D.value===M.key.endsWith("Up")&&(_.value?st(!0):tn(!0));break;case"ArrowRight":case"ArrowDown":D.value===M.key.endsWith("Down")&&(_.value?tn(!0):st(!0));break}},200),A=()=>{document.addEventListener("keydown",W)},ue=()=>{document.removeEventListener("keydown",W)};function he(M){const z=M.target.tagName;if(["INPUT","TEXTAREA","SELECT"].includes(z)||Ae.value||(se=M.type==="touchstart",!se&&(M.preventDefault(),M.button!==0)))return;de.x="touches"in M?M.touches[0].clientX:M.clientX,de.y="touches"in M?M.touches[0].clientY:M.clientY;const K=se?"touchmove":"mousemove",Y=se?"touchend":"mouseup";document.addEventListener(K,fe,{passive:!1}),document.addEventListener(Y,me,{passive:!0})}const fe=mo(M=>{ze.value=!0;const z="touches"in M?M.touches[0].clientX:M.clientX,K="touches"in M?M.touches[0].clientY:M.clientY;Ce.x=z-de.x,Ce.y=K-de.y;const Y=hy({isVertical:D.value,isReversed:_.value,dragged:Ce,effectiveSlideSize:v.value});p.value=h.wrapAround?m.value+Y:Nt({val:m.value+Y,max:b.value,min:x.value}),t("drag",{deltaX:Ce.x,deltaY:Ce.y})});function me(){if(fe.cancel(),p.value!==m.value&&!se){const K=Y=>{Y.preventDefault(),window.removeEventListener("click",K)};window.addEventListener("click",K)}Ke(p.value),Ce.x=0,Ce.y=0,ze.value=!1;const M=se?"touchmove":"mousemove",z=se?"touchend":"mouseup";document.removeEventListener(M,fe),document.removeEventListener(z,me)}function De(){!h.autoplay||h.autoplay<=0||(E=setInterval(()=>{h.pauseAutoplayOnHover&&Qe.value||st()},h.autoplay))}function Ye(){E&&(clearInterval(E),E=null)}function St(){Ye(),De()}const Ae=r.ref(!1);function Ke(M,z=!1){if(!z&&Ae.value)return;let K=M,Y=M;g.value=m.value,h.wrapAround?Y=Ra({val:K,max:b.value,min:x.value}):K=Nt({val:K,max:b.value,min:x.value}),t("slide-start",{slidingToIndex:M,currentSlideIndex:m.value,prevSlideIndex:g.value,slidesCount:l.value}),Ye(),Ae.value=!0,m.value=K,Y!==K&&_n.pause(),t("update:modelValue",Y),C=setTimeout(()=>{h.wrapAround&&Y!==K&&(_n.resume(),m.value=Y,t("loop",{currentSlideIndex:m.value,slidingToIndex:M})),t("slide-end",{currentSlideIndex:m.value,prevSlideIndex:g.value,slidesCount:l.value}),Ae.value=!1,St()},h.transition)}function st(M=!1){Ke(m.value+h.itemsToScroll,M)}function tn(M=!1){Ke(m.value-h.itemsToScroll,M)}function nn(){T(),L(),P(),St()}r.watch(()=>[f.value,n.breakpoints],()=>T(),{deep:!0}),r.watch(()=>n.autoplay,()=>St());const _n=r.watch(()=>n.modelValue,M=>{M!==m.value&&Ke(Number(M),!0)});t("before-init");const Z=r.computed(()=>{if(!h.wrapAround)return{before:0,after:0};if(B.value)return{before:a.length,after:a.length};const M=Number(h.itemsToShow),z=Math.ceil(M+(h.itemsToScroll-1)),K=z-p.value,Y=z-(l.value-(p.value+1));return{before:Math.max(0,K),after:Math.max(0,Y)}}),ht=r.computed(()=>Z.value.before?B.value?q.value.slice(-1*Z.value.before).reduce((M,z)=>M+z[w.value]+h.gap,0)*-1:Z.value.before*v.value*-1:0),Ne=r.computed(()=>{var M;if(B.value){const z=(m.value%a.length+a.length)%a.length;return ho({slideSize:(M=q.value[z])===null||M===void 0?void 0:M[w.value],viewportSize:R.value[w.value],align:h.snapAlign})}return ho({align:h.snapAlign,itemsToShow:+h.itemsToShow})}),O=r.computed(()=>{let M=0;if(B.value){if(m.value<0?M=q.value.slice(m.value).reduce((z,K)=>z+K[w.value]+h.gap,0)*-1:M=q.value.slice(0,m.value).reduce((z,K)=>z+K[w.value]+h.gap,0),M-=Ne.value,!h.wrapAround){const z=q.value.reduce((K,Y)=>K+Y[w.value]+h.gap,0)-R.value[w.value]-h.gap;M=Nt({val:M,max:z,min:0})}}else{let z=m.value-Ne.value;h.wrapAround||(z=Nt({val:z,max:l.value-+h.itemsToShow,min:0})),M=z*v.value}return M*(_.value?1:-1)}),N=r.computed(()=>{var M,z;if(!B.value){const ne=m.value-Ne.value;return h.wrapAround?{min:Math.floor(ne),max:Math.ceil(ne+Number(h.itemsToShow)-1)}:{min:Math.floor(Nt({val:ne,max:l.value-Number(h.itemsToShow),min:0})),max:Math.ceil(Nt({val:ne+Number(h.itemsToShow)-1,max:l.value-1,min:0}))}}let K=0;{let ne=0,ye=0-Z.value.before;const ve=Math.abs(O.value+ht.value);for(;ne<=ve;){const Le=(ye%a.length+a.length)%a.length;ne+=((M=q.value[Le])===null||M===void 0?void 0:M[w.value])+h.gap,ye++}K=ye-1}let Y=0;{let ne=K,ye=0;for(ne<0?ye=q.value.slice(0,ne).reduce((ve,Le)=>ve+Le[w.value]+h.gap,0)-Math.abs(O.value+ht.value):ye=q.value.slice(0,ne).reduce((ve,Le)=>ve+Le[w.value]+h.gap,0)-Math.abs(O.value);ye<R.value[w.value];){const ve=(ne%a.length+a.length)%a.length;ye+=((z=q.value[ve])===null||z===void 0?void 0:z[w.value])+h.gap,ne++}Y=ne-1}return{min:Math.floor(K),max:Math.ceil(Y)}}),V=r.computed(()=>{if(h.slideEffect==="fade")return;const M=D.value?"Y":"X",z=D.value?Ce.y:Ce.x;let K=O.value+z;if(!h.wrapAround&&h.preventExcessiveDragging){let Y=0;B.value?Y=q.value.reduce((ve,Le)=>ve+Le[w.value],0):Y=(l.value-Number(h.itemsToShow))*v.value;const ne=_.value?0:-1*Y,ye=_.value?Y:0;K=Nt({val:K,min:ne,max:ye})}return`translate${M}(${K}px)`}),U=r.computed(()=>({"--vc-transition-duration":Ae.value?ss(h.transition,"ms"):void 0,"--vc-slide-gap":ss(h.gap),"--vc-carousel-height":ss(h.height),"--vc-cloned-offset":ss(ht.value)})),ee={slideTo:Ke,next:st,prev:tn},re=r.reactive({activeSlide:p,config:h,currentSlide:m,isSliding:Ae,isVertical:D,maxSlide:b,minSlide:x,nav:ee,normalizedDir:S,slideRegistry:o,slideSize:u,slides:a,slidesCount:l,viewport:d,visibleRange:N});r.provide(ln,re);const G=r.reactive({config:h,currentSlide:m,maxSlide:b,middleSlide:y,minSlide:x,slideSize:u,slidesCount:l});return i({data:G,nav:ee,next:st,prev:tn,restartCarousel:nn,slideTo:Ke,updateBreakpointsConfig:T,updateSlideSize:P,updateSlidesData:L}),()=>{var M;const z=e.default||e.slides,K=(z==null?void 0:z(G))||[],{before:Y,after:ne}=Z.value,ye=$a({slides:a,position:"before",toShow:Y}),ve=$a({slides:a,position:"after",toShow:ne}),Le=[...ye,...K,...ve];if(!h.enabled||!Le.length)return r.h("section",{ref:c,class:["carousel","is-disabled"]},Le);const Fi=((M=e.addons)===null||M===void 0?void 0:M.call(e,G))||[],$i=r.h("ol",{class:"carousel__track",style:{transform:V.value},onMousedownCapture:h.mouseDrag?he:null,onTouchstartPassiveCapture:h.touchDrag?he:null},Le),Ii=r.h("div",{class:"carousel__viewport",ref:d},$i);return r.h("section",{ref:c,class:["carousel",`is-${S.value}`,`is-effect-${h.slideEffect}`,{"is-vertical":D.value,"is-sliding":Ae.value,"is-dragging":ze.value,"is-hover":Qe.value}],dir:S.value,style:U.value,"aria-label":h.i18n.ariaGallery,tabindex:"0",onFocus:A,onBlur:ue,onMouseenter:ft,onMouseleave:it},[Ii,Fi,r.h(by)])}}});var po;(function(n){n.arrowDown="arrowDown",n.arrowLeft="arrowLeft",n.arrowRight="arrowRight",n.arrowUp="arrowUp"})(po||(po={}));const za=n=>`icon${n.charAt(0).toUpperCase()+n.slice(1)}`,_y={arrowDown:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",arrowLeft:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z",arrowRight:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",arrowUp:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"};function ky(n){return n in po}const Wa=n=>n&&ky(n),Ha=r.defineComponent({props:{name:{type:String,required:!0,validator:Wa},title:{type:String,default:n=>n.name?Pe.i18n[za(n.name)]:""}},setup(n){const e=r.inject(ln,null);return()=>{const t=n.name;if(!t||!Wa(t))return;const i=_y[t],s=r.h("path",{d:i}),o=(e==null?void 0:e.config.i18n[za(t)])||n.title,a=r.h("title",o);return r.h("svg",{class:"carousel__icon",viewBox:"0 0 24 24",role:"img","aria-label":o},[a,s])}}}),Ua=r.defineComponent({name:"CarouselNavigation",inheritAttrs:!1,setup(n,{slots:e,attrs:t}){const i=r.inject(ln);if(!i)return()=>"";const{next:s,prev:o}=e,a=()=>({btt:"arrowDown",ltr:"arrowLeft",rtl:"arrowRight",ttb:"arrowUp"})[i.normalizedDir],l=()=>({btt:"arrowUp",ltr:"arrowRight",rtl:"arrowLeft",ttb:"arrowDown"})[i.normalizedDir],c=r.computed(()=>!i.config.wrapAround&&i.currentSlide<=i.minSlide),d=r.computed(()=>!i.config.wrapAround&&i.currentSlide>=i.maxSlide);return()=>{const{i18n:u}=i.config,f=r.h("button",Object.assign(Object.assign({type:"button",disabled:c.value,"aria-label":u.ariaPreviousSlide,title:u.ariaPreviousSlide,onClick:i.nav.prev},t),{class:["carousel__prev",{"carousel__prev--disabled":c.value},t.class]}),(o==null?void 0:o())||r.h(Ha,{name:a()})),h=r.h("button",Object.assign(Object.assign({type:"button",disabled:d.value,"aria-label":u.ariaNextSlide,title:u.ariaNextSlide,onClick:i.nav.next},t),{class:["carousel__next",{"carousel__next--disabled":d.value},t.class]}),(s==null?void 0:s())||r.h(Ha,{name:l()}));return[f,h]}}});r.defineComponent({name:"CarouselPagination",props:{disableOnClick:{type:Boolean},paginateByItemsToShow:{type:Boolean}},setup(n){const e=r.inject(ln);if(!e)return()=>"";const t=r.computed(()=>e.config.itemsToShow),i=r.computed(()=>ho({align:e.config.snapAlign,itemsToShow:t.value})),s=r.computed(()=>n.paginateByItemsToShow&&t.value>1),o=r.computed(()=>Math.ceil((e.activeSlide-i.value)/t.value)),a=r.computed(()=>Math.ceil(e.slidesCount/t.value)),l=c=>Ra(s.value?{val:o.value,max:a.value-1,min:0}:{val:e.activeSlide,max:e.maxSlide,min:e.minSlide})===c;return()=>{var c,d;const u=[];for(let f=s.value?0:e.minSlide;f<=(s.value?a.value-1:e.maxSlide);f++){const h=La(e.config.i18n[s.value?"ariaNavigateToPage":"ariaNavigateToSlide"],{slideNumber:f+1}),m=l(f),p=r.h("button",{type:"button",class:{"carousel__pagination-button":!0,"carousel__pagination-button--active":m},"aria-label":h,"aria-pressed":m,"aria-controls":(d=(c=e.slides[f])===null||c===void 0?void 0:c.exposed)===null||d===void 0?void 0:d.id,title:h,disabled:n.disableOnClick,onClick:()=>e.nav.slideTo(s.value?Math.floor(f*+e.config.itemsToShow+i.value):f)}),g=r.h("li",{class:"carousel__pagination-item",key:f},p);u.push(g)}return r.h("ol",{class:"carousel__pagination"},u)}}});const qa=r.defineComponent({name:"CarouselSlide",props:{id:{type:String,default:n=>n.isClone?void 0:r.useId()},index:{type:Number,default:void 0},isClone:{type:Boolean,default:!1},position:{type:String,default:void 0}},setup(n,{attrs:e,slots:t,expose:i}){const s=r.inject(ln);if(r.provide(ln,void 0),!s)return()=>"";const o=r.ref(n.index),a=p=>{o.value=p},l=r.getCurrentInstance(),c=()=>{const p=l.vnode.el;return p?p.getBoundingClientRect():{width:0,height:0}};i({id:n.id,setIndex:a,getBoundingRect:c});const d=r.computed(()=>o.value===s.activeSlide),u=r.computed(()=>o.value===s.activeSlide-1),f=r.computed(()=>o.value===s.activeSlide+1),h=r.computed(()=>o.value>=s.visibleRange.min&&o.value<=s.visibleRange.max),m=r.computed(()=>{if(s.config.itemsToShow==="auto")return;const p=s.config.itemsToShow,g=s.config.gap>0&&p>1?`calc(${100/p}% - ${s.config.gap*(p-1)/p}px)`:`${100/p}%`;return s.isVertical?{height:g}:{width:g}});return s.slideRegistry.registerSlide(l,n.index),r.onUnmounted(()=>{s.slideRegistry.unregisterSlide(l)}),n.isClone&&(r.onMounted(()=>{Ia(l.vnode)}),r.onUpdated(()=>{Ia(l.vnode)})),()=>{var p,g;return s.config.enabled?r.h("li",{style:[e.style,Object.assign({},m.value)],class:{carousel__slide:!0,"carousel__slide--clone":n.isClone,"carousel__slide--visible":h.value,"carousel__slide--active":d.value,"carousel__slide--prev":u.value,"carousel__slide--next":f.value,"carousel__slide--sliding":s.isSliding},onFocusin:()=>{s.viewport&&(s.viewport.scrollLeft=0),s.nav.slideTo(o.value)},id:n.isClone?void 0:n.id,"aria-hidden":n.isClone||void 0},(g=t.default)===null||g===void 0?void 0:g.call(t,{currentIndex:o.value,isActive:d.value,isClone:n.isClone,isPrev:u.value,isNext:f.value,isSliding:s.isSliding,isVisible:h.value})):(p=t.default)===null||p===void 0?void 0:p.call(t)}}}),Sy={class:"p-4 mb-4 flex flex-wrap gap-2 border border-gray-300 shadow-md rounded-lg"},wy={key:0,class:"error-message"},Ey={class:"text-red-500 font-bold"},Cy={key:0},vy={key:1,class:"mb-4 mt-4"},Ya=Be({__name:"EntityListingCarousel",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(n,{expose:e}){const t=ts(),i=Ze();r.provide("entityObject",t);const s=n,o=r.ref([]);return r.watch(()=>t.state.data,c=>{c&&(o.value=c.result)},{immediate:!0}),e({props:s,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),r.watch(()=>i.globalConfigs.appId,async c=>{if(c){const d=await t.getEntity(s.entityName);t.setEntity(d.success?d.response:{result:[]})}},{immediate:!0}),(c,d)=>c.$slots["list-item-display-carousel"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.renderSlot(c.$slots,"header",{},void 0,!0),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:0})):r.createCommentVNode("",!0),n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:1})):r.createCommentVNode("",!0),o.value.length>1?(r.openBlock(),r.createBlock(r.unref(ja),{key:2,"items-to-show":5,"wrap-around":!0,autoplay:2e3,pauseAutoplayOnHover:!0,transition:500},{addons:r.withCtx(()=>[r.createVNode(r.unref(Ua))]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(u,f)=>(r.openBlock(),r.createBlock(r.unref(qa),{key:f},{default:r.withCtx(()=>[r.createElementVNode("div",Sy,[r.renderSlot(c.$slots,"list-item-display-carousel",{item:u},void 0,!0)])]),_:2},1024))),128))]),_:3})):r.createCommentVNode("",!0),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.renderSlot(c.$slots,"header",{},void 0,!0),n.entityName?(r.openBlock(),r.createElementBlock("div",vy,[n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:0})):r.createCommentVNode("",!0),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:1})):r.createCommentVNode("",!0),o.value.length?(r.openBlock(),r.createBlock(r.unref(ja),{key:2,"items-to-show":3,"wrap-around":!1,mouseDrag:!0,pauseAutoplayOnHover:!0,breakpoints:{1024:{itemsToShow:3},950:{itemsToShow:2},768:{itemsToShow:1},340:{itemsToShow:1}}},{addons:r.withCtx(()=>[r.createVNode(r.unref(Ua))]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(u,f)=>(r.openBlock(),r.createBlock(r.unref(qa),{key:f},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listItemDisplay&&n.listItemDisplay!==""?n.listItemDisplay:ay),r.mergeProps({ref_for:!0},{item:u,...s}),null,16))]),_:2},1024))),128))]),_:1})):r.createCommentVNode("",!0),n.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listPagination||is),{key:3})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",wy,[r.createElementVNode("p",Ey,[d[0]||(d[0]=r.createTextVNode(" Error: Missing required props - ")),n.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Cy,"Entity Name"))])])),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64))}},[["__scopeId","data-v-96c5cd60"]]),Dy={install(n,e){n.component("CSEntityGrid",na),n.component("csentitygrid",na),n.component("CSEntityList",Ta),n.component("csentitylist",Ta),n.component("CSEntityBarChart",Ea),n.component("csentitybarchart",Ea),n.component("CSEntityLineChart",Ca),n.component("csentitylinechart",Ca),n.component("CSEntityPieChart",va),n.component("csentitypiechart",va),n.component("CSEntityPolarChart",Da),n.component("csentitypolarchart",Da),n.component("CSEntityRadarChart",Oa),n.component("csentityradarchart",Oa),n.component("CSEntity360View",Na),n.component("csentity360view",Na),n.component("CSEntityListing",Pa),n.component("csentitylisting",Pa),n.component("CSEntityListingTile",Ba),n.component("csentitylistingtile",Ba),n.component("CSEntityListingCarousel",Ya),n.component("csentitylistingcarousel",Ya),n.component("CSEntityExplorer",ta),n.component("csentityexplorer",ta)}},Ka=6048e5,Oy=864e5,Xa=Symbol.for("constructDateFrom");function Ht(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&Xa in n?n[Xa](e):n instanceof Date?new n.constructor(e):new Date(e)}function ct(n,e){return Ht(e||n,n)}let Ny={};function os(){return Ny}function ni(n,e){var l,c,d,u;const t=os(),i=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((u=(d=t.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=ct(n,e==null?void 0:e.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function rs(n,e){return ni(n,{...e,weekStartsOn:1})}function Ga(n,e){const t=ct(n,e==null?void 0:e.in),i=t.getFullYear(),s=Ht(t,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=rs(s),a=Ht(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=rs(a);return t.getTime()>=o.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function Qa(n){const e=ct(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function Ty(n,...e){const t=Ht.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Ja(n,e){const t=ct(n,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function Py(n,e,t){const[i,s]=Ty(t==null?void 0:t.in,n,e),o=Ja(i),a=Ja(s),l=+o-Qa(o),c=+a-Qa(a);return Math.round((l-c)/Oy)}function By(n,e){const t=Ga(n,e),i=Ht(n,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),rs(i)}function My(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Vy(n){return!(!My(n)&&typeof n!="number"||isNaN(+ct(n)))}function Ay(n,e){const t=ct(n,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Fy={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$y=(n,e,t)=>{let i;const s=Fy[n];return typeof s=="string"?i=s:e===1?i=s.one:i=s.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function go(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const Iy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ly={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ry={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},jy={date:go({formats:Iy,defaultWidth:"full"}),time:go({formats:Ly,defaultWidth:"full"}),dateTime:go({formats:Ry,defaultWidth:"full"})},zy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wy=(n,e,t,i)=>zy[n];function ii(n){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=t!=null&&t.width?String(t.width):a;s=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=t!=null&&t.width?String(t.width):n.defaultWidth;s=n.values[l]||n.values[a]}const o=n.argumentCallback?n.argumentCallback(e):e;return s[o]}}const Hy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Uy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},qy={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Yy={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ky={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Xy={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Gy={ordinalNumber:(n,e)=>{const t=Number(n),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:ii({values:Hy,defaultWidth:"wide"}),quarter:ii({values:Uy,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ii({values:qy,defaultWidth:"wide"}),day:ii({values:Yy,defaultWidth:"wide"}),dayPeriod:ii({values:Ky,defaultWidth:"wide",formattingValues:Xy,defaultFormattingWidth:"wide"})};function si(n){return(e,t={})=>{const i=t.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(l)?Jy(l,f=>f.test(a)):Qy(l,f=>f.test(a));let d;d=n.valueCallback?n.valueCallback(c):c,d=t.valueCallback?t.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function Qy(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function Jy(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function Zy(n){return(e,t={})=>{const i=e.match(n.matchPattern);if(!i)return null;const s=i[0],o=e.match(n.parsePattern);if(!o)return null;let a=n.valueCallback?n.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const eb=/^(\d+)(th|st|nd|rd)?/i,tb=/\d+/i,nb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ib={any:[/^b/i,/^(a|c)/i]},sb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ob={any:[/1/i,/2/i,/3/i,/4/i]},rb={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ab={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lb={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},cb={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},db={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ub={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fb={ordinalNumber:Zy({matchPattern:eb,parsePattern:tb,valueCallback:n=>parseInt(n,10)}),era:si({matchPatterns:nb,defaultMatchWidth:"wide",parsePatterns:ib,defaultParseWidth:"any"}),quarter:si({matchPatterns:sb,defaultMatchWidth:"wide",parsePatterns:ob,defaultParseWidth:"any",valueCallback:n=>n+1}),month:si({matchPatterns:rb,defaultMatchWidth:"wide",parsePatterns:ab,defaultParseWidth:"any"}),day:si({matchPatterns:lb,defaultMatchWidth:"wide",parsePatterns:cb,defaultParseWidth:"any"}),dayPeriod:si({matchPatterns:db,defaultMatchWidth:"any",parsePatterns:ub,defaultParseWidth:"any"})},hb={code:"en-US",formatDistance:$y,formatLong:jy,formatRelative:Wy,localize:Gy,match:fb,options:{weekStartsOn:0,firstWeekContainsDate:1}};function mb(n,e){const t=ct(n,e==null?void 0:e.in);return Py(t,Ay(t))+1}function pb(n,e){const t=ct(n,e==null?void 0:e.in),i=+rs(t)-+By(t);return Math.round(i/Ka)+1}function Za(n,e){var u,f,h,m;const t=ct(n,e==null?void 0:e.in),i=t.getFullYear(),s=os(),o=(e==null?void 0:e.firstWeekContainsDate)??((f=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(h=s.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,a=Ht((e==null?void 0:e.in)||n,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const l=ni(a,e),c=Ht((e==null?void 0:e.in)||n,0);c.setFullYear(i,0,o),c.setHours(0,0,0,0);const d=ni(c,e);return+t>=+l?i+1:+t>=+d?i:i-1}function gb(n,e){var l,c,d,u;const t=os(),i=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((u=(d=t.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=Za(n,e),o=Ht((e==null?void 0:e.in)||n,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),ni(o,e)}function yb(n,e){const t=ct(n,e==null?void 0:e.in),i=+ni(t,e)-+gb(t,e);return Math.round(i/Ka)+1}function pe(n,e){const t=n<0?"-":"",i=Math.abs(n).toString().padStart(e,"0");return t+i}const Ut={y(n,e){const t=n.getFullYear(),i=t>0?t:1-t;return pe(e==="yy"?i%100:i,e.length)},M(n,e){const t=n.getMonth();return e==="M"?String(t+1):pe(t+1,2)},d(n,e){return pe(n.getDate(),e.length)},a(n,e){const t=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,e){return pe(n.getHours()%12||12,e.length)},H(n,e){return pe(n.getHours(),e.length)},m(n,e){return pe(n.getMinutes(),e.length)},s(n,e){return pe(n.getSeconds(),e.length)},S(n,e){const t=e.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,t-3));return pe(s,e.length)}},On={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},el={G:function(n,e,t){const i=n.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(n,e,t){if(e==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return t.ordinalNumber(s,{unit:"year"})}return Ut.y(n,e)},Y:function(n,e,t,i){const s=Za(n,i),o=s>0?s:1-s;if(e==="YY"){const a=o%100;return pe(a,2)}return e==="Yo"?t.ordinalNumber(o,{unit:"year"}):pe(o,e.length)},R:function(n,e){const t=Ga(n);return pe(t,e.length)},u:function(n,e){const t=n.getFullYear();return pe(t,e.length)},Q:function(n,e,t){const i=Math.ceil((n.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return pe(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,e,t){const i=Math.ceil((n.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return pe(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,e,t){const i=n.getMonth();switch(e){case"M":case"MM":return Ut.M(n,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(n,e,t){const i=n.getMonth();switch(e){case"L":return String(i+1);case"LL":return pe(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(n,e,t,i){const s=yb(n,i);return e==="wo"?t.ordinalNumber(s,{unit:"week"}):pe(s,e.length)},I:function(n,e,t){const i=pb(n);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):pe(i,e.length)},d:function(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):Ut.d(n,e)},D:function(n,e,t){const i=mb(n);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):pe(i,e.length)},E:function(n,e,t){const i=n.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(n,e,t,i){const s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return pe(o,2);case"eo":return t.ordinalNumber(o,{unit:"day"});case"eee":return t.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(s,{width:"short",context:"formatting"});case"eeee":default:return t.day(s,{width:"wide",context:"formatting"})}},c:function(n,e,t,i){const s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return pe(o,e.length);case"co":return t.ordinalNumber(o,{unit:"day"});case"ccc":return t.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(s,{width:"narrow",context:"standalone"});case"cccccc":return t.day(s,{width:"short",context:"standalone"});case"cccc":default:return t.day(s,{width:"wide",context:"standalone"})}},i:function(n,e,t){const i=n.getDay(),s=i===0?7:i;switch(e){case"i":return String(s);case"ii":return pe(s,e.length);case"io":return t.ordinalNumber(s,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(n,e,t){const s=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,e,t){const i=n.getHours();let s;switch(i===12?s=On.noon:i===0?s=On.midnight:s=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,e,t){const i=n.getHours();let s;switch(i>=17?s=On.evening:i>=12?s=On.afternoon:i>=4?s=On.morning:s=On.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,e,t){if(e==="ho"){let i=n.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return Ut.h(n,e)},H:function(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):Ut.H(n,e)},K:function(n,e,t){const i=n.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):pe(i,e.length)},k:function(n,e,t){let i=n.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):pe(i,e.length)},m:function(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ut.m(n,e)},s:function(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):Ut.s(n,e)},S:function(n,e){return Ut.S(n,e)},X:function(n,e,t){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return nl(i);case"XXXX":case"XX":return cn(i);case"XXXXX":case"XXX":default:return cn(i,":")}},x:function(n,e,t){const i=n.getTimezoneOffset();switch(e){case"x":return nl(i);case"xxxx":case"xx":return cn(i);case"xxxxx":case"xxx":default:return cn(i,":")}},O:function(n,e,t){const i=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+tl(i,":");case"OOOO":default:return"GMT"+cn(i,":")}},z:function(n,e,t){const i=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+tl(i,":");case"zzzz":default:return"GMT"+cn(i,":")}},t:function(n,e,t){const i=Math.trunc(+n/1e3);return pe(i,e.length)},T:function(n,e,t){return pe(+n,e.length)}};function tl(n,e=""){const t=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),o=i%60;return o===0?t+String(s):t+String(s)+e+pe(o,2)}function nl(n,e){return n%60===0?(n>0?"-":"+")+pe(Math.abs(n)/60,2):cn(n,e)}function cn(n,e=""){const t=n>0?"-":"+",i=Math.abs(n),s=pe(Math.trunc(i/60),2),o=pe(i%60,2);return t+s+e+o}const il=(n,e)=>{switch(n){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},sl=(n,e)=>{switch(n){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},bb={p:sl,P:(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],i=t[1],s=t[2];if(!s)return il(n,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",il(i,e)).replace("{{time}}",sl(s,e))}},xb=/^D+$/,_b=/^Y+$/,kb=["D","DD","YY","YYYY"];function Sb(n){return xb.test(n)}function wb(n){return _b.test(n)}function Eb(n,e,t){const i=Cb(n,e,t);if(console.warn(i),kb.includes(n))throw new RangeError(i)}function Cb(n,e,t){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const vb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Db=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ob=/^'([^]*?)'?$/,Nb=/''/g,Tb=/[a-zA-Z]/;function ol(n,e,t){var u,f,h,m;const i=os(),s=i.locale??hb,o=i.firstWeekContainsDate??((f=(u=i.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,a=i.weekStartsOn??((m=(h=i.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=ct(n,t==null?void 0:t.in);if(!Vy(l))throw new RangeError("Invalid time value");let c=e.match(Db).map(p=>{const g=p[0];if(g==="p"||g==="P"){const y=bb[g];return y(p,s.formatLong)}return p}).join("").match(vb).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:Pb(p)};if(el[g])return{isToken:!0,value:p};if(g.match(Tb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(p=>{if(!p.isToken)return p.value;const g=p.value;(wb(g)||Sb(g))&&Eb(g,e,String(n));const y=el[g[0]];return y(l,g,s.localize,d)}).join("")}function Pb(n){const e=n.match(Ob);return e?e[1].replace(Nb,"'"):n}const Bb=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(n,e){const{value:t,arg:i}=e;if(n&&t){const s=ol(new Date(t),i||"yyyy-MM-dd");n.textContent=s}},updated(n,e){const{value:t,arg:i}=e;if(n&&t){const s=ol(new Date(t),i||"yyyy-MM-dd");n.textContent=s}}}},Symbol.toStringTag,{value:"Module"})),Mb=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(n,e){const{value:t,arg:i}=e;t&&(n.textContent=n.textContent.toUpperCase())},updated(n,e){const{value:t,arg:i}=e;t&&(n.textContent=n.textContent.toUpperCase())}}},Symbol.toStringTag,{value:"Module"}));/*!
157
161
  * @kurkle/color v0.3.4
158
162
  * https://github.com/kurkle/color#readme
159
163
  * (c) 2024 Jukka Kurkela
160
164
  * Released under the MIT License
161
- */function Xn(n){return n+.5|0}const Fe=(n,t,e)=>Math.max(Math.min(n,e),t);function Gn(n){return Fe(Xn(n*2.55),0,255)}function $e(n){return Fe(Xn(n*255),0,255)}function ke(n){return Fe(Xn(n/2.55)/100,0,1)}function Va(n){return Fe(Xn(n*100),0,100)}const qt={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},to=[..."0123456789ABCDEF"],yy=n=>to[n&15],by=n=>to[(n&240)>>4]+to[n&15],Yi=n=>(n&240)>>4===(n&15),_y=n=>Yi(n.r)&&Yi(n.g)&&Yi(n.b)&&Yi(n.a);function xy(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&qt[n[1]]*17,g:255&qt[n[2]]*17,b:255&qt[n[3]]*17,a:t===5?qt[n[4]]*17:255}:(t===7||t===9)&&(e={r:qt[n[1]]<<4|qt[n[2]],g:qt[n[3]]<<4|qt[n[4]],b:qt[n[5]]<<4|qt[n[6]],a:t===9?qt[n[7]]<<4|qt[n[8]]:255})),e}const ky=(n,t)=>n<255?t(n):"";function Sy(n){var t=_y(n)?yy:by;return n?"#"+t(n.r)+t(n.g)+t(n.b)+ky(n.a,t):void 0}const wy=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Aa(n,t,e){const i=t*Math.min(e,1-e),s=(o,r=(o+n/30)%12)=>e-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Ey(n,t,e){const i=(s,o=(s+n/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function Cy(n,t,e){const i=Aa(n,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function vy(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function eo(n){const e=n.r/255,i=n.g/255,s=n.b/255,o=Math.max(e,i,s),r=Math.min(e,i,s),l=(o+r)/2;let c,d,u;return o!==r&&(u=o-r,d=l>.5?u/(2-o-r):u/(o+r),c=vy(e,i,s,u,o),c=c*60+.5),[c|0,d||0,l]}function no(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map($e)}function io(n,t,e){return no(Aa,n,t,e)}function Oy(n,t,e){return no(Cy,n,t,e)}function Dy(n,t,e){return no(Ey,n,t,e)}function Ba(n){return(n%360+360)%360}function Ny(n){const t=wy.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Gn(+t[5]):$e(+t[5]));const s=Ba(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=Oy(s,o,r):t[1]==="hsv"?i=Dy(s,o,r):i=io(s,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function Ty(n,t){var e=eo(n);e[0]=Ba(e[0]+t),e=io(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Py(n){if(!n)return;const t=eo(n),e=t[0],i=Va(t[1]),s=Va(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${ke(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const Fa={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"},$a={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 My(){const n={},t=Object.keys($a),e=Object.keys(Fa);let i,s,o,r,l;for(i=0;i<t.length;i++){for(r=l=t[i],s=0;s<e.length;s++)o=e[s],l=l.replace(o,Fa[o]);o=parseInt($a[r],16),n[l]=[o>>16&255,o>>8&255,o&255]}return n}let Ki;function Vy(n){Ki||(Ki=My(),Ki.transparent=[0,0,0,0]);const t=Ki[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Ay=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function By(n){const t=Ay.exec(n);let e=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];e=t[8]?Gn(r):Fe(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?Gn(i):Fe(i,0,255)),s=255&(t[4]?Gn(s):Fe(s,0,255)),o=255&(t[6]?Gn(o):Fe(o,0,255)),{r:i,g:s,b:o,a:e}}}function Fy(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ke(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const so=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,bn=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function $y(n,t,e){const i=bn(ke(n.r)),s=bn(ke(n.g)),o=bn(ke(n.b));return{r:$e(so(i+e*(bn(ke(t.r))-i))),g:$e(so(s+e*(bn(ke(t.g))-s))),b:$e(so(o+e*(bn(ke(t.b))-o))),a:n.a+e*(t.a-n.a)}}function Xi(n,t,e){if(n){let i=eo(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=io(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Ra(n,t){return n&&Object.assign(t||{},n)}function La(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=$e(n[3]))):(t=Ra(n,{r:0,g:0,b:0,a:1}),t.a=$e(t.a)),t}function Ry(n){return n.charAt(0)==="r"?By(n):Ny(n)}class Qn{constructor(t){if(t instanceof Qn)return t;const e=typeof t;let i;e==="object"?i=La(t):e==="string"&&(i=xy(t)||Vy(t)||Ry(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ra(this._rgb);return t&&(t.a=ke(t.a)),t}set rgb(t){this._rgb=La(t)}rgbString(){return this._valid?Fy(this._rgb):void 0}hexString(){return this._valid?Sy(this._rgb):void 0}hslString(){return this._valid?Py(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let o;const r=e===o?.5:e,l=2*r-1,c=i.a-s.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;o=1-d,i.r=255&d*i.r+o*s.r+.5,i.g=255&d*i.g+o*s.g+.5,i.b=255&d*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=$y(this._rgb,t._rgb,e)),this}clone(){return new Qn(this.rgb)}alpha(t){return this._rgb.a=$e(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Xn(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Xi(this._rgb,2,t),this}darken(t){return Xi(this._rgb,2,-t),this}saturate(t){return Xi(this._rgb,1,t),this}desaturate(t){return Xi(this._rgb,1,-t),this}rotate(t){return Ty(this._rgb,t),this}}/*!
165
+ */function oi(n){return n+.5|0}const qt=(n,e,t)=>Math.max(Math.min(n,t),e);function ri(n){return qt(oi(n*2.55),0,255)}function Yt(n){return qt(oi(n*255),0,255)}function Tt(n){return qt(oi(n/2.55)/100,0,1)}function rl(n){return qt(oi(n*100),0,100)}const tt={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},yo=[..."0123456789ABCDEF"],Vb=n=>yo[n&15],Ab=n=>yo[(n&240)>>4]+yo[n&15],as=n=>(n&240)>>4===(n&15),Fb=n=>as(n.r)&&as(n.g)&&as(n.b)&&as(n.a);function $b(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&tt[n[1]]*17,g:255&tt[n[2]]*17,b:255&tt[n[3]]*17,a:e===5?tt[n[4]]*17:255}:(e===7||e===9)&&(t={r:tt[n[1]]<<4|tt[n[2]],g:tt[n[3]]<<4|tt[n[4]],b:tt[n[5]]<<4|tt[n[6]],a:e===9?tt[n[7]]<<4|tt[n[8]]:255})),t}const Ib=(n,e)=>n<255?e(n):"";function Lb(n){var e=Fb(n)?Vb:Ab;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Ib(n.a,e):void 0}const Rb=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function al(n,e,t){const i=e*Math.min(t,1-t),s=(o,a=(o+n/30)%12)=>t-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function jb(n,e,t){const i=(s,o=(s+n/60)%6)=>t-t*e*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function zb(n,e,t){const i=al(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function Wb(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function bo(n){const t=n.r/255,i=n.g/255,s=n.b/255,o=Math.max(t,i,s),a=Math.min(t,i,s),l=(o+a)/2;let c,d,u;return o!==a&&(u=o-a,d=l>.5?u/(2-o-a):u/(o+a),c=Wb(t,i,s,u,o),c=c*60+.5),[c|0,d||0,l]}function xo(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Yt)}function _o(n,e,t){return xo(al,n,e,t)}function Hb(n,e,t){return xo(zb,n,e,t)}function Ub(n,e,t){return xo(jb,n,e,t)}function ll(n){return(n%360+360)%360}function qb(n){const e=Rb.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?ri(+e[5]):Yt(+e[5]));const s=ll(+e[2]),o=+e[3]/100,a=+e[4]/100;return e[1]==="hwb"?i=Hb(s,o,a):e[1]==="hsv"?i=Ub(s,o,a):i=_o(s,o,a),{r:i[0],g:i[1],b:i[2],a:t}}function Yb(n,e){var t=bo(n);t[0]=ll(t[0]+e),t=_o(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Kb(n){if(!n)return;const e=bo(n),t=e[0],i=rl(e[1]),s=rl(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${Tt(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const cl={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"},dl={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 Xb(){const n={},e=Object.keys(dl),t=Object.keys(cl);let i,s,o,a,l;for(i=0;i<e.length;i++){for(a=l=e[i],s=0;s<t.length;s++)o=t[s],l=l.replace(o,cl[o]);o=parseInt(dl[a],16),n[l]=[o>>16&255,o>>8&255,o&255]}return n}let ls;function Gb(n){ls||(ls=Xb(),ls.transparent=[0,0,0,0]);const e=ls[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Qb=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Jb(n){const e=Qb.exec(n);let t=255,i,s,o;if(e){if(e[7]!==i){const a=+e[7];t=e[8]?ri(a):qt(a*255,0,255)}return i=+e[1],s=+e[3],o=+e[5],i=255&(e[2]?ri(i):qt(i,0,255)),s=255&(e[4]?ri(s):qt(s,0,255)),o=255&(e[6]?ri(o):qt(o,0,255)),{r:i,g:s,b:o,a:t}}}function Zb(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Tt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ko=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Nn=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function e0(n,e,t){const i=Nn(Tt(n.r)),s=Nn(Tt(n.g)),o=Nn(Tt(n.b));return{r:Yt(ko(i+t*(Nn(Tt(e.r))-i))),g:Yt(ko(s+t*(Nn(Tt(e.g))-s))),b:Yt(ko(o+t*(Nn(Tt(e.b))-o))),a:n.a+t*(e.a-n.a)}}function cs(n,e,t){if(n){let i=bo(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=_o(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function ul(n,e){return n&&Object.assign(e||{},n)}function fl(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Yt(n[3]))):(e=ul(n,{r:0,g:0,b:0,a:1}),e.a=Yt(e.a)),e}function t0(n){return n.charAt(0)==="r"?Jb(n):qb(n)}class ai{constructor(e){if(e instanceof ai)return e;const t=typeof e;let i;t==="object"?i=fl(e):t==="string"&&(i=$b(e)||Gb(e)||t0(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=ul(this._rgb);return e&&(e.a=Tt(e.a)),e}set rgb(e){this._rgb=fl(e)}rgbString(){return this._valid?Zb(this._rgb):void 0}hexString(){return this._valid?Lb(this._rgb):void 0}hslString(){return this._valid?Kb(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let o;const a=t===o?.5:t,l=2*a-1,c=i.a-s.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;o=1-d,i.r=255&d*i.r+o*s.r+.5,i.g=255&d*i.g+o*s.g+.5,i.b=255&d*i.b+o*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=e0(this._rgb,e._rgb,t)),this}clone(){return new ai(this.rgb)}alpha(e){return this._rgb.a=Yt(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=oi(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.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 cs(this._rgb,2,e),this}darken(e){return cs(this._rgb,2,-e),this}saturate(e){return cs(this._rgb,1,e),this}desaturate(e){return cs(this._rgb,1,-e),this}rotate(e){return Yb(this._rgb,e),this}}/*!
162
166
  * Chart.js v4.4.7
163
167
  * https://www.chartjs.org
164
168
  * (c) 2024 Chart.js Contributors
165
169
  * Released under the MIT License
166
- */function Se(){}const Ly=(()=>{let n=0;return()=>n++})();function st(n){return n==null}function _t(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function nt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function kt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function zt(n,t){return kt(n)?n:t}function J(n,t){return typeof n>"u"?t:n}const Iy=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Ia=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function ft(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function rt(n,t,e,i){let s,o,r;if(_t(n))for(o=n.length,s=0;s<o;s++)t.call(e,n[s],s);else if(nt(n))for(r=Object.keys(n),o=r.length,s=0;s<o;s++)t.call(e,n[r[s]],r[s])}function Gi(n,t){let e,i,s,o;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Qi(n){if(_t(n))return n.map(Qi);if(nt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=Qi(n[e[s]]);return t}return n}function ja(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function jy(n,t,e,i){if(!ja(n))return;const s=t[n],o=e[n];nt(s)&&nt(o)?Jn(s,o,i):t[n]=Qi(o)}function Jn(n,t,e){const i=_t(t)?t:[t],s=i.length;if(!nt(n))return n;e=e||{};const o=e.merger||jy;let r;for(let l=0;l<s;++l){if(r=i[l],!nt(r))continue;const c=Object.keys(r);for(let d=0,u=c.length;d<u;++d)o(c[d],n,r,e)}return n}function Zn(n,t){return Jn(n,t,{merger:zy})}function zy(n,t,e){if(!ja(n))return;const i=t[n],s=e[n];nt(i)&&nt(s)?Zn(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Qi(s))}const za={"":n=>n,x:n=>n.x,y:n=>n.y};function Wy(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Hy(n){const t=Wy(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Re(n,t){return(za[t]||(za[t]=Hy(t)))(n)}function oo(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ti=n=>typeof n<"u",Le=n=>typeof n=="function",Wa=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Uy(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const mt=Math.PI,pt=2*mt,qy=pt+mt,Ji=Number.POSITIVE_INFINITY,Yy=mt/180,St=mt/2,Qe=mt/4,Ha=mt*2/3,Ie=Math.log10,ce=Math.sign;function ei(n,t,e){return Math.abs(n-t)<e}function Ua(n){const t=Math.round(n);n=ei(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Ie(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Ky(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function _n(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Xy(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function qa(n,t,e){let i,s,o;for(i=0,s=n.length;i<s;i++)o=n[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ne(n){return n*(mt/180)}function ro(n){return n*(180/mt)}function Ya(n){if(!kt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Ka(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*mt&&(o+=pt),{angle:o,distance:s}}function ao(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Gy(n,t){return(n-t+qy)%pt-mt}function Wt(n){return(n%pt+pt)%pt}function ni(n,t,e,i){const s=Wt(n),o=Wt(t),r=Wt(e),l=Wt(o-s),c=Wt(r-s),d=Wt(s-o),u=Wt(s-r);return s===o||s===r||i&&o===r||l>c&&d<u}function Ot(n,t,e){return Math.max(t,Math.min(e,n))}function Qy(n){return Ot(n,-32768,32767)}function we(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function lo(n,t,e){e=e||(r=>n[r]<t);let i=n.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,e(o)?s=o:i=o;return{lo:s,hi:i}}const Ee=(n,t,e,i)=>lo(n,e,i?s=>{const o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),Jy=(n,t,e)=>lo(n,e,i=>n[i][t]>=e);function Zy(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const Xa=["push","pop","shift","splice","unshift"];function tb(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Xa.forEach(e=>{const i="_onData"+oo(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return n._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...o)}),r}})})}function Ga(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Xa.forEach(o=>{delete n[o]}),delete n._chartjs)}function Qa(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Ja=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Za(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Ja.call(window,()=>{i=!1,n.apply(t,e)}))}}function eb(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const co=n=>n==="start"?"left":n==="end"?"right":"center",Pt=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,nb=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function tl(n,t,e){const i=t.length;let s=0,o=i;if(n._sorted){const{iScale:r,_parsed:l}=n,c=r.axis,{min:d,max:u,minDefined:h,maxDefined:f}=r.getUserBounds();h&&(s=Ot(Math.min(Ee(l,c,d).lo,e?i:Ee(t,c,r.getPixelForValue(d)).lo),0,i-1)),f?o=Ot(Math.max(Ee(l,r.axis,u,!0).hi+1,e?0:Ee(t,c,r.getPixelForValue(u),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function el(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),o}const Zi=n=>n===0||n===1,nl=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*pt/e)),il=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*pt/e)+1,ii={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*St)+1,easeOutSine:n=>Math.sin(n*St),easeInOutSine:n=>-.5*(Math.cos(mt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Zi(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Zi(n)?n:nl(n,.075,.3),easeOutElastic:n=>Zi(n)?n:il(n,.075,.3),easeInOutElastic(n){return Zi(n)?n:n<.5?.5*nl(n*2,.1125,.45):.5+.5*il(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-ii.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?ii.easeInBounce(n*2)*.5:ii.easeOutBounce(n*2-1)*.5+.5};function uo(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function sl(n){return uo(n)?n:new Qn(n)}function ho(n){return uo(n)?n:new Qn(n).saturate(.5).darken(.1).hexString()}const ib=["x","y","borderWidth","radius","tension"],sb=["color","borderColor","backgroundColor"];function ob(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:sb},numbers:{type:"number",properties:ib}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function rb(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ol=new Map;function ab(n,t){t=t||{};const e=n+JSON.stringify(t);let i=ol.get(e);return i||(i=new Intl.NumberFormat(n,t),ol.set(e,i)),i}function si(n,t,e){return ab(t,e).format(n)}const rl={values(n){return _t(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,o=n;if(e.length>1){const d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),o=lb(n,e)}const r=Ie(Math.abs(o)),l=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),c={notation:s,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),si(n,i,c)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Ie(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?rl.numeric.call(this,n,t,e):""}};function lb(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var oi={formatters:rl};function cb(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:oi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Je=Object.create(null),fo=Object.create(null);function ri(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const o=e[i];n=n[o]||(n[o]=Object.create(null))}return n}function mo(n,t,e){return typeof t=="string"?Jn(ri(n,t),e):Jn(ri(n,""),t)}class db{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>ho(s.backgroundColor),this.hoverBorderColor=(i,s)=>ho(s.borderColor),this.hoverColor=(i,s)=>ho(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return mo(this,t,e)}get(t){return ri(this,t)}describe(t,e){return mo(fo,t,e)}override(t,e){return mo(Je,t,e)}route(t,e,i,s){const o=ri(this,t),r=ri(this,i),l="_"+e;Object.defineProperties(o,{[l]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const c=this[l],d=r[s];return nt(c)?Object.assign({},d,c):J(c,d)},set(c){this[l]=c}}})}apply(t){t.forEach(e=>e(this))}}var gt=new db({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ob,rb,cb]);function ub(n){return!n||st(n.size)||st(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ts(n,t,e,i,s){let o=t[s];return o||(o=t[s]=n.measureText(s).width,e.push(s)),o>i&&(i=o),i}function hb(n,t,e,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let r=0;const l=e.length;let c,d,u,h,f;for(c=0;c<l;c++)if(h=e[c],h!=null&&!_t(h))r=ts(n,s,o,r,h);else if(_t(h))for(d=0,u=h.length;d<u;d++)f=h[d],f!=null&&!_t(f)&&(r=ts(n,s,o,r,f));n.restore();const m=o.length/2;if(m>e.length){for(c=0;c<m;c++)delete s[o[c]];o.splice(0,m)}return r}function Ze(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function al(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function po(n,t,e,i){ll(n,t,e,i,null)}function ll(n,t,e,i,s){let o,r,l,c,d,u,h,f;const m=t.pointStyle,p=t.rotation,g=t.radius;let y=(p||0)*Yy;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(y),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),m){default:s?n.ellipse(e,i,s/2,g,0,0,pt):n.arc(e,i,g,0,pt),n.closePath();break;case"triangle":u=s?s/2:g,n.moveTo(e+Math.sin(y)*u,i-Math.cos(y)*g),y+=Ha,n.lineTo(e+Math.sin(y)*u,i-Math.cos(y)*g),y+=Ha,n.lineTo(e+Math.sin(y)*u,i-Math.cos(y)*g),n.closePath();break;case"rectRounded":d=g*.516,c=g-d,r=Math.cos(y+Qe)*c,h=Math.cos(y+Qe)*(s?s/2-d:c),l=Math.sin(y+Qe)*c,f=Math.sin(y+Qe)*(s?s/2-d:c),n.arc(e-h,i-l,d,y-mt,y-St),n.arc(e+f,i-r,d,y-St,y),n.arc(e+h,i+l,d,y,y+St),n.arc(e-f,i+r,d,y+St,y+mt),n.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*g,u=s?s/2:c,n.rect(e-u,i-c,2*u,2*c);break}y+=Qe;case"rectRot":h=Math.cos(y)*(s?s/2:g),r=Math.cos(y)*g,l=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),n.moveTo(e-h,i-l),n.lineTo(e+f,i-r),n.lineTo(e+h,i+l),n.lineTo(e-f,i+r),n.closePath();break;case"crossRot":y+=Qe;case"cross":h=Math.cos(y)*(s?s/2:g),r=Math.cos(y)*g,l=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),n.moveTo(e-h,i-l),n.lineTo(e+h,i+l),n.moveTo(e+f,i-r),n.lineTo(e-f,i+r);break;case"star":h=Math.cos(y)*(s?s/2:g),r=Math.cos(y)*g,l=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),n.moveTo(e-h,i-l),n.lineTo(e+h,i+l),n.moveTo(e+f,i-r),n.lineTo(e-f,i+r),y+=Qe,h=Math.cos(y)*(s?s/2:g),r=Math.cos(y)*g,l=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),n.moveTo(e-h,i-l),n.lineTo(e+h,i+l),n.moveTo(e+f,i-r),n.lineTo(e-f,i+r);break;case"line":r=s?s/2:Math.cos(y)*g,l=Math.sin(y)*g,n.moveTo(e-r,i-l),n.lineTo(e+r,i+l);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(y)*(s?s/2:g),i+Math.sin(y)*g);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ce(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function es(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function ns(n){n.restore()}function fb(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;n.lineTo(o,t.y),n.lineTo(o,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function mb(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function pb(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),st(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function gb(n,t,e,i,s){if(s.strikethrough||s.underline){const o=n.measureText(i),r=t-o.actualBoundingBoxLeft,l=t+o.actualBoundingBoxRight,c=e-o.actualBoundingBoxAscent,d=e+o.actualBoundingBoxDescent,u=s.strikethrough?(c+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(r,u),n.lineTo(l,u),n.stroke()}}function yb(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function tn(n,t,e,i,s,o={}){const r=_t(t)?t:[t],l=o.strokeWidth>0&&o.strokeColor!=="";let c,d;for(n.save(),n.font=s.string,pb(n,o),c=0;c<r.length;++c)d=r[c],o.backdrop&&yb(n,o.backdrop),l&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),st(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(d,e,i,o.maxWidth)),n.fillText(d,e,i,o.maxWidth),gb(n,e,i,d,o),i+=Number(s.lineHeight);n.restore()}function ai(n,t){const{x:e,y:i,w:s,h:o,radius:r}=t;n.arc(e+r.topLeft,i+r.topLeft,r.topLeft,1.5*mt,mt,!0),n.lineTo(e,i+o-r.bottomLeft),n.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,mt,St,!0),n.lineTo(e+s-r.bottomRight,i+o),n.arc(e+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,St,0,!0),n.lineTo(e+s,i+r.topRight),n.arc(e+s-r.topRight,i+r.topRight,r.topRight,0,-St,!0),n.lineTo(e+r.topLeft,i)}const bb=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,_b=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function xb(n,t){const e=(""+n).match(bb);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const kb=n=>+n||0;function go(n,t){const e={},i=nt(t),s=i?Object.keys(t):t,o=nt(n)?i?r=>J(n[r],n[t[r]]):r=>n[r]:()=>n;for(const r of s)e[r]=kb(o(r));return e}function cl(n){return go(n,{top:"y",right:"x",bottom:"y",left:"x"})}function en(n){return go(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Mt(n){const t=cl(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function vt(n,t){n=n||{},t=t||gt.font;let e=J(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=J(n.style,t.style);i&&!(""+i).match(_b)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:J(n.family,t.family),lineHeight:xb(J(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:J(n.weight,t.weight),string:""};return s.string=ub(s),s}function li(n,t,e,i){let s,o,r;for(s=0,o=n.length;s<o;++s)if(r=n[s],r!==void 0&&r!==void 0)return r}function Sb(n,t,e){const{min:i,max:s}=n,o=Ia(t,(s-i)/2),r=(l,c)=>e&&l===0?0:l+c;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function je(n,t){return Object.assign(Object.create(n),t)}function yo(n,t=[""],e,i,s=()=>n[0]){const o=e||n;typeof i>"u"&&(i=ml("_fallback",n));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:l=>yo([l,...n],t,o,i)};return new Proxy(r,{deleteProperty(l,c){return delete l[c],delete l._keys,delete n[0][c],!0},get(l,c){return ul(l,c,()=>Tb(c,t,n,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,c){return pl(l).includes(c)},ownKeys(l){return pl(l)},set(l,c,d){const u=l._storage||(l._storage=s());return l[c]=u[c]=d,delete l._keys,!0}})}function xn(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:dl(n,i),setContext:o=>xn(n,o,e,i),override:o=>xn(n.override(o),t,e,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete n[r],!0},get(o,r,l){return ul(o,r,()=>Eb(o,r,l))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(n,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,r)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,r){return Reflect.has(n,r)},ownKeys(){return Reflect.ownKeys(n)},set(o,r,l){return n[r]=l,delete o[r],!0}})}function dl(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:Le(e)?e:()=>e,isIndexable:Le(i)?i:()=>i}}const wb=(n,t)=>n?n+oo(t):t,bo=(n,t)=>nt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ul(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Eb(n,t,e){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=n;let l=i[t];return Le(l)&&r.isScriptable(t)&&(l=Cb(t,l,n,e)),_t(l)&&l.length&&(l=vb(t,l,n,r.isIndexable)),bo(t,l)&&(l=xn(l,s,o&&o[t],r)),l}function Cb(n,t,e,i){const{_proxy:s,_context:o,_subProxy:r,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let c=t(o,r||i);return l.delete(n),bo(n,c)&&(c=_o(s._scopes,s,n,c)),c}function vb(n,t,e,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:l}=e;if(typeof o.index<"u"&&i(n))return t[o.index%t.length];if(nt(t[0])){const c=t,d=s._scopes.filter(u=>u!==c);t=[];for(const u of c){const h=_o(d,s,n,u);t.push(xn(h,o,r&&r[n],l))}}return t}function hl(n,t,e){return Le(n)?n(t,e):n}const Ob=(n,t)=>n===!0?t:typeof n=="string"?Re(t,n):void 0;function Db(n,t,e,i,s){for(const o of t){const r=Ob(e,o);if(r){n.add(r);const l=hl(r._fallback,e,s);if(typeof l<"u"&&l!==e&&l!==i)return l}else if(r===!1&&typeof i<"u"&&e!==i)return null}return!1}function _o(n,t,e,i){const s=t._rootScopes,o=hl(t._fallback,e,i),r=[...n,...s],l=new Set;l.add(i);let c=fl(l,r,e,o||e,i);return c===null||typeof o<"u"&&o!==e&&(c=fl(l,r,o,c,i),c===null)?!1:yo(Array.from(l),[""],s,o,()=>Nb(t,e,i))}function fl(n,t,e,i,s){for(;e;)e=Db(n,t,e,i,s);return e}function Nb(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return _t(s)&&nt(e)?e:s||{}}function Tb(n,t,e,i){let s;for(const o of t)if(s=ml(wb(o,n),e),typeof s<"u")return bo(n,s)?_o(e,i,n,s):s}function ml(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function pl(n){let t=n._keys;return t||(t=n._keys=Pb(n._scopes)),t}function Pb(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function gl(n,t,e,i){const{iScale:s}=n,{key:o="r"}=this._parsing,r=new Array(i);let l,c,d,u;for(l=0,c=i;l<c;++l)d=l+e,u=t[d],r[l]={r:s.parse(Re(u,o),d)};return r}const Mb=Number.EPSILON||1e-14,kn=(n,t)=>t<n.length&&!n[t].skip&&n[t],yl=n=>n==="x"?"y":"x";function Vb(n,t,e,i){const s=n.skip?t:n,o=t,r=e.skip?t:e,l=ao(o,s),c=ao(r,o);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const h=i*d,f=i*u;return{previous:{x:o.x-h*(r.x-s.x),y:o.y-h*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function Ab(n,t,e){const i=n.length;let s,o,r,l,c,d=kn(n,0);for(let u=0;u<i-1;++u)if(c=d,d=kn(n,u+1),!(!c||!d)){if(ei(t[u],0,Mb)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],o=e[u+1]/t[u],l=Math.pow(s,2)+Math.pow(o,2),!(l<=9)&&(r=3/Math.sqrt(l),e[u]=s*r*t[u],e[u+1]=o*r*t[u])}}function Bb(n,t,e="x"){const i=yl(e),s=n.length;let o,r,l,c=kn(n,0);for(let d=0;d<s;++d){if(r=l,l=c,c=kn(n,d+1),!l)continue;const u=l[e],h=l[i];r&&(o=(u-r[e])/3,l[`cp1${e}`]=u-o,l[`cp1${i}`]=h-o*t[d]),c&&(o=(c[e]-u)/3,l[`cp2${e}`]=u+o,l[`cp2${i}`]=h+o*t[d])}}function Fb(n,t="x"){const e=yl(t),i=n.length,s=Array(i).fill(0),o=Array(i);let r,l,c,d=kn(n,0);for(r=0;r<i;++r)if(l=c,c=d,d=kn(n,r+1),!!c){if(d){const u=d[t]-c[t];s[r]=u!==0?(d[e]-c[e])/u:0}o[r]=l?d?ce(s[r-1])!==ce(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Ab(n,s,o),Bb(n,o,t)}function is(n,t,e){return Math.max(Math.min(n,e),t)}function $b(n,t){let e,i,s,o,r,l=Ce(n[0],t);for(e=0,i=n.length;e<i;++e)r=o,o=l,l=e<i-1&&Ce(n[e+1],t),o&&(s=n[e],r&&(s.cp1x=is(s.cp1x,t.left,t.right),s.cp1y=is(s.cp1y,t.top,t.bottom)),l&&(s.cp2x=is(s.cp2x,t.left,t.right),s.cp2y=is(s.cp2y,t.top,t.bottom)))}function Rb(n,t,e,i,s){let o,r,l,c;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")Fb(n,s);else{let d=i?n[n.length-1]:n[0];for(o=0,r=n.length;o<r;++o)l=n[o],c=Vb(d,l,n[Math.min(o+1,r-(i?0:1))%r],t.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}t.capBezierPoints&&$b(n,e)}function xo(){return typeof window<"u"&&typeof document<"u"}function ko(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ss(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const os=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Lb(n,t){return os(n).getPropertyValue(t)}const Ib=["top","right","bottom","left"];function nn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Ib[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const jb=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function zb(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i;let r=!1,l,c;if(jb(s,o,n.target))l=s,c=o;else{const d=t.getBoundingClientRect();l=i.clientX-d.left,c=i.clientY-d.top,r=!0}return{x:l,y:c,box:r}}function sn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=os(e),o=s.boxSizing==="border-box",r=nn(s,"padding"),l=nn(s,"border","width"),{x:c,y:d,box:u}=zb(n,e),h=r.left+(u&&l.left),f=r.top+(u&&l.top);let{width:m,height:p}=t;return o&&(m-=r.width+l.width,p-=r.height+l.height),{x:Math.round((c-h)/m*e.width/i),y:Math.round((d-f)/p*e.height/i)}}function Wb(n,t,e){let i,s;if(t===void 0||e===void 0){const o=n&&ko(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{const r=o.getBoundingClientRect(),l=os(o),c=nn(l,"border","width"),d=nn(l,"padding");t=r.width-d.width-c.width,e=r.height-d.height-c.height,i=ss(l.maxWidth,o,"clientWidth"),s=ss(l.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||Ji,maxHeight:s||Ji}}const rs=n=>Math.round(n*10)/10;function Hb(n,t,e,i){const s=os(n),o=nn(s,"margin"),r=ss(s.maxWidth,n,"clientWidth")||Ji,l=ss(s.maxHeight,n,"clientHeight")||Ji,c=Wb(n,t,e);let{width:d,height:u}=c;if(s.boxSizing==="content-box"){const f=nn(s,"border","width"),m=nn(s,"padding");d-=m.width+f.width,u-=m.height+f.height}return d=Math.max(0,d-o.width),u=Math.max(0,i?d/i:u-o.height),d=rs(Math.min(d,r,c.maxWidth)),u=rs(Math.min(u,l,c.maxHeight)),d&&!u&&(u=rs(d/2)),(t!==void 0||e!==void 0)&&i&&c.height&&u>c.height&&(u=c.height,d=rs(Math.floor(u*i))),{width:d,height:u}}function bl(n,t,e){const i=t||1,s=Math.floor(n.height*i),o=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const r=n.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${n.height}px`,r.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(n.currentDevicePixelRatio=i,r.height=s,r.width=o,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Ub=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};xo()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function _l(n,t){const e=Lb(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function on(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function qb(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Yb(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},r=on(n,s,e),l=on(s,o,e),c=on(o,t,e),d=on(r,l,e),u=on(l,c,e);return on(d,u,e)}const Kb=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Xb=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Sn(n,t,e){return n?Kb(t,e):Xb()}function xl(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function kl(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Sl(n){return n==="angle"?{between:ni,compare:Gy,normalize:Wt}:{between:we,compare:(t,e)=>t-e,normalize:t=>t}}function wl({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function Gb(n,t,e){const{property:i,start:s,end:o}=e,{between:r,normalize:l}=Sl(i),c=t.length;let{start:d,end:u,loop:h}=n,f,m;if(h){for(d+=c,u+=c,f=0,m=c;f<m&&r(l(t[d%c][i]),s,o);++f)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:h,style:n.style}}function El(n,t,e){if(!e)return[n];const{property:i,start:s,end:o}=e,r=t.length,{compare:l,between:c,normalize:d}=Sl(i),{start:u,end:h,loop:f,style:m}=Gb(n,t,e),p=[];let g=!1,y=null,b,_,w;const E=()=>c(s,w,b)&&l(s,w)!==0,k=()=>l(o,b)===0||c(o,w,b),C=()=>g||E(),S=()=>!g||k();for(let x=u,O=u;x<=h;++x)_=t[x%r],!_.skip&&(b=d(_[i]),b!==w&&(g=c(b,s,o),y===null&&C()&&(y=l(b,s)===0?x:O),y!==null&&S()&&(p.push(wl({start:y,end:x,loop:f,count:r,style:m})),y=null),O=x,w=b));return y!==null&&p.push(wl({start:y,end:h,loop:f,count:r,style:m})),p}function Cl(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const o=El(i[s],n.points,t);o.length&&e.push(...o)}return e}function Qb(n,t,e,i){let s=0,o=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&n[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Jb(n,t,e,i){const s=n.length,o=[];let r=t,l=n[t],c;for(c=t+1;c<=e;++c){const d=n[c%s];d.skip||d.stop?l.skip||(i=!1,o.push({start:t%s,end:(c-1)%s,loop:i}),t=r=d.stop?c:null):(r=c,l.skip&&(t=c)),l=d}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function Zb(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const o=!!n._loop,{start:r,end:l}=Qb(e,s,o,i);if(i===!0)return vl(n,[{start:r,end:l,loop:o}],e,t);const c=l<r?l+s:l,d=!!n._fullLoop&&r===0&&l===s-1;return vl(n,Jb(e,r,c,d),e,t)}function vl(n,t,e,i){return!i||!i.setContext||!e?t:t0(n,t,e,i)}function t0(n,t,e,i){const s=n._chart.getContext(),o=Ol(n.options),{_datasetIndex:r,options:{spanGaps:l}}=n,c=e.length,d=[];let u=o,h=t[0].start,f=h;function m(p,g,y,b){const _=l?-1:1;if(p!==g){for(p+=c;e[p%c].skip;)p-=_;for(;e[g%c].skip;)g+=_;p%c!==g%c&&(d.push({start:p%c,end:g%c,loop:y,style:b}),u=b,h=g%c)}}for(const p of t){h=l?h:p.start;let g=e[h%c],y;for(f=h+1;f<=p.end;f++){const b=e[f%c];y=Ol(i.setContext(je(s,{type:"segment",p0:g,p1:b,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:r}))),e0(y,u)&&m(h,f-1,p.loop,u),g=b,u=y}h<f-1&&m(h,f-1,p.loop,u)}return d}function Ol(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function e0(n,t){if(!t)return!1;const e=[],i=function(s,o){return uo(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
170
+ */function Pt(){}const n0=(()=>{let n=0;return()=>n++})();function ce(n){return n==null}function Ee(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function le(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Oe(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Xe(n,e){return Oe(n)?n:e}function oe(n,e){return typeof n>"u"?e:n}const i0=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/e,hl=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function xe(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ge(n,e,t,i){let s,o,a;if(Ee(n))for(o=n.length,s=0;s<o;s++)e.call(t,n[s],s);else if(le(n))for(a=Object.keys(n),o=a.length,s=0;s<o;s++)e.call(t,n[a[s]],a[s])}function ds(n,e){let t,i,s,o;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],o=e[t],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function us(n){if(Ee(n))return n.map(us);if(le(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=us(n[t[s]]);return e}return n}function ml(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function s0(n,e,t,i){if(!ml(n))return;const s=e[n],o=t[n];le(s)&&le(o)?li(s,o,i):e[n]=us(o)}function li(n,e,t){const i=Ee(e)?e:[e],s=i.length;if(!le(n))return n;t=t||{};const o=t.merger||s0;let a;for(let l=0;l<s;++l){if(a=i[l],!le(a))continue;const c=Object.keys(a);for(let d=0,u=c.length;d<u;++d)o(c[d],n,a,t)}return n}function ci(n,e){return li(n,e,{merger:o0})}function o0(n,e,t){if(!ml(n))return;const i=e[n],s=t[n];le(i)&&le(s)?ci(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=us(s))}const pl={"":n=>n,x:n=>n.x,y:n=>n.y};function r0(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function a0(n){const e=r0(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Kt(n,e){return(pl[e]||(pl[e]=a0(e)))(n)}function So(n){return n.charAt(0).toUpperCase()+n.slice(1)}const di=n=>typeof n<"u",Xt=n=>typeof n=="function",gl=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function l0(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const _e=Math.PI,ke=2*_e,c0=ke+_e,fs=Number.POSITIVE_INFINITY,d0=_e/180,Te=_e/2,dn=_e/4,yl=_e*2/3,Gt=Math.log10,yt=Math.sign;function ui(n,e,t){return Math.abs(n-e)<t}function bl(n){const e=Math.round(n);n=ui(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Gt(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function u0(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,o)=>s-o).pop(),e}function Tn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function f0(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function xl(n,e,t){let i,s,o;for(i=0,s=n.length;i<s;i++)o=n[i][t],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function dt(n){return n*(_e/180)}function wo(n){return n*(180/_e)}function _l(n){if(!Oe(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function kl(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let o=Math.atan2(i,t);return o<-.5*_e&&(o+=ke),{angle:o,distance:s}}function Eo(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function h0(n,e){return(n-e+c0)%ke-_e}function Ge(n){return(n%ke+ke)%ke}function fi(n,e,t,i){const s=Ge(n),o=Ge(e),a=Ge(t),l=Ge(o-s),c=Ge(a-s),d=Ge(s-o),u=Ge(s-a);return s===o||s===a||i&&o===a||l>c&&d<u}function Fe(n,e,t){return Math.max(e,Math.min(t,n))}function m0(n){return Fe(n,-32768,32767)}function Bt(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Co(n,e,t){t=t||(a=>n[a]<e);let i=n.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,t(o)?s=o:i=o;return{lo:s,hi:i}}const Mt=(n,e,t,i)=>Co(n,t,i?s=>{const o=n[s][e];return o<t||o===t&&n[s+1][e]===t}:s=>n[s][e]<t),p0=(n,e,t)=>Co(n,t,i=>n[i][e]>=t);function g0(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}const Sl=["push","pop","shift","splice","unshift"];function y0(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Sl.forEach(t=>{const i="_onData"+So(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return n._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...o)}),a}})})}function wl(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Sl.forEach(o=>{delete n[o]}),delete n._chartjs)}function El(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const Cl=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function vl(n,e){let t=[],i=!1;return function(...s){t=s,i||(i=!0,Cl.call(window,()=>{i=!1,n.apply(e,t)}))}}function b0(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const vo=n=>n==="start"?"left":n==="end"?"right":"center",Re=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2,x0=(n,e,t,i)=>n===(i?"left":"right")?t:n==="center"?(e+t)/2:e;function Dl(n,e,t){const i=e.length;let s=0,o=i;if(n._sorted){const{iScale:a,_parsed:l}=n,c=a.axis,{min:d,max:u,minDefined:f,maxDefined:h}=a.getUserBounds();f&&(s=Fe(Math.min(Mt(l,c,d).lo,t?i:Mt(e,c,a.getPixelForValue(d)).lo),0,i-1)),h?o=Fe(Math.max(Mt(l,a.axis,u,!0).hi+1,t?0:Mt(e,c,a.getPixelForValue(u),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function Ol(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),o}const hs=n=>n===0||n===1,Nl=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ke/t)),Tl=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ke/t)+1,hi={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Te)+1,easeOutSine:n=>Math.sin(n*Te),easeInOutSine:n=>-.5*(Math.cos(_e*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>hs(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>hs(n)?n:Nl(n,.075,.3),easeOutElastic:n=>hs(n)?n:Tl(n,.075,.3),easeInOutElastic(n){return hs(n)?n:n<.5?.5*Nl(n*2,.1125,.45):.5+.5*Tl(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-hi.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?hi.easeInBounce(n*2)*.5:hi.easeOutBounce(n*2-1)*.5+.5};function Do(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Pl(n){return Do(n)?n:new ai(n)}function Oo(n){return Do(n)?n:new ai(n).saturate(.5).darken(.1).hexString()}const _0=["x","y","borderWidth","radius","tension"],k0=["color","borderColor","backgroundColor"];function S0(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:k0},numbers:{type:"number",properties:_0}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function w0(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Bl=new Map;function E0(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Bl.get(t);return i||(i=new Intl.NumberFormat(n,e),Bl.set(t,i)),i}function mi(n,e,t){return E0(e,t).format(n)}const Ml={values(n){return Ee(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,o=n;if(t.length>1){const d=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),o=C0(n,t)}const a=Gt(Math.abs(o)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:s,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),mi(n,i,c)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Gt(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?Ml.numeric.call(this,n,e,t):""}};function C0(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var pi={formatters:Ml};function v0(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.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:pi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const un=Object.create(null),No=Object.create(null);function gi(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;i<s;++i){const o=t[i];n=n[o]||(n[o]=Object.create(null))}return n}function To(n,e,t){return typeof e=="string"?li(gi(n,e),t):li(gi(n,""),e)}class D0{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Oo(s.backgroundColor),this.hoverBorderColor=(i,s)=>Oo(s.borderColor),this.hoverColor=(i,s)=>Oo(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return To(this,e,t)}get(e){return gi(this,e)}describe(e,t){return To(No,e,t)}override(e,t){return To(un,e,t)}route(e,t,i,s){const o=gi(this,e),a=gi(this,i),l="_"+t;Object.defineProperties(o,{[l]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){const c=this[l],d=a[s];return le(c)?Object.assign({},d,c):oe(c,d)},set(c){this[l]=c}}})}apply(e){e.forEach(t=>t(this))}}var Se=new D0({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[S0,w0,v0]);function O0(n){return!n||ce(n.size)||ce(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ms(n,e,t,i,s){let o=e[s];return o||(o=e[s]=n.measureText(s).width,t.push(s)),o>i&&(i=o),i}function N0(n,e,t,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},o=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let a=0;const l=t.length;let c,d,u,f,h;for(c=0;c<l;c++)if(f=t[c],f!=null&&!Ee(f))a=ms(n,s,o,a,f);else if(Ee(f))for(d=0,u=f.length;d<u;d++)h=f[d],h!=null&&!Ee(h)&&(a=ms(n,s,o,a,h));n.restore();const m=o.length/2;if(m>t.length){for(c=0;c<m;c++)delete s[o[c]];o.splice(0,m)}return a}function fn(n,e,t){const i=n.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((e-s)*i)/i+s}function Vl(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function Po(n,e,t,i){Al(n,e,t,i,null)}function Al(n,e,t,i,s){let o,a,l,c,d,u,f,h;const m=e.pointStyle,p=e.rotation,g=e.radius;let y=(p||0)*d0;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(y),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),m){default:s?n.ellipse(t,i,s/2,g,0,0,ke):n.arc(t,i,g,0,ke),n.closePath();break;case"triangle":u=s?s/2:g,n.moveTo(t+Math.sin(y)*u,i-Math.cos(y)*g),y+=yl,n.lineTo(t+Math.sin(y)*u,i-Math.cos(y)*g),y+=yl,n.lineTo(t+Math.sin(y)*u,i-Math.cos(y)*g),n.closePath();break;case"rectRounded":d=g*.516,c=g-d,a=Math.cos(y+dn)*c,f=Math.cos(y+dn)*(s?s/2-d:c),l=Math.sin(y+dn)*c,h=Math.sin(y+dn)*(s?s/2-d:c),n.arc(t-f,i-l,d,y-_e,y-Te),n.arc(t+h,i-a,d,y-Te,y),n.arc(t+f,i+l,d,y,y+Te),n.arc(t-h,i+a,d,y+Te,y+_e),n.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*g,u=s?s/2:c,n.rect(t-u,i-c,2*u,2*c);break}y+=dn;case"rectRot":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),n.moveTo(t-f,i-l),n.lineTo(t+h,i-a),n.lineTo(t+f,i+l),n.lineTo(t-h,i+a),n.closePath();break;case"crossRot":y+=dn;case"cross":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),n.moveTo(t-f,i-l),n.lineTo(t+f,i+l),n.moveTo(t+h,i-a),n.lineTo(t-h,i+a);break;case"star":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),n.moveTo(t-f,i-l),n.lineTo(t+f,i+l),n.moveTo(t+h,i-a),n.lineTo(t-h,i+a),y+=dn,f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),n.moveTo(t-f,i-l),n.lineTo(t+f,i+l),n.moveTo(t+h,i-a),n.lineTo(t-h,i+a);break;case"line":a=s?s/2:Math.cos(y)*g,l=Math.sin(y)*g,n.moveTo(t-a,i-l),n.lineTo(t+a,i+l);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(y)*(s?s/2:g),i+Math.sin(y)*g);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function Vt(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function ps(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function gs(n){n.restore()}function T0(n,e,t,i,s){if(!e)return n.lineTo(t.x,t.y);if(s==="middle"){const o=(e.x+t.x)/2;n.lineTo(o,e.y),n.lineTo(o,t.y)}else s==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function P0(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function B0(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),ce(e.rotation)||n.rotate(e.rotation),e.color&&(n.fillStyle=e.color),e.textAlign&&(n.textAlign=e.textAlign),e.textBaseline&&(n.textBaseline=e.textBaseline)}function M0(n,e,t,i,s){if(s.strikethrough||s.underline){const o=n.measureText(i),a=e-o.actualBoundingBoxLeft,l=e+o.actualBoundingBoxRight,c=t-o.actualBoundingBoxAscent,d=t+o.actualBoundingBoxDescent,u=s.strikethrough?(c+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,u),n.lineTo(l,u),n.stroke()}}function V0(n,e){const t=n.fillStyle;n.fillStyle=e.color,n.fillRect(e.left,e.top,e.width,e.height),n.fillStyle=t}function hn(n,e,t,i,s,o={}){const a=Ee(e)?e:[e],l=o.strokeWidth>0&&o.strokeColor!=="";let c,d;for(n.save(),n.font=s.string,B0(n,o),c=0;c<a.length;++c)d=a[c],o.backdrop&&V0(n,o.backdrop),l&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),ce(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(d,t,i,o.maxWidth)),n.fillText(d,t,i,o.maxWidth),M0(n,t,i,d,o),i+=Number(s.lineHeight);n.restore()}function yi(n,e){const{x:t,y:i,w:s,h:o,radius:a}=e;n.arc(t+a.topLeft,i+a.topLeft,a.topLeft,1.5*_e,_e,!0),n.lineTo(t,i+o-a.bottomLeft),n.arc(t+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,_e,Te,!0),n.lineTo(t+s-a.bottomRight,i+o),n.arc(t+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,Te,0,!0),n.lineTo(t+s,i+a.topRight),n.arc(t+s-a.topRight,i+a.topRight,a.topRight,0,-Te,!0),n.lineTo(t+a.topLeft,i)}const A0=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,F0=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function $0(n,e){const t=(""+n).match(A0);if(!t||t[1]==="normal")return e*1.2;switch(n=+t[2],t[3]){case"px":return n;case"%":n/=100;break}return e*n}const I0=n=>+n||0;function Bo(n,e){const t={},i=le(e),s=i?Object.keys(e):e,o=le(n)?i?a=>oe(n[a],n[e[a]]):a=>n[a]:()=>n;for(const a of s)t[a]=I0(o(a));return t}function Fl(n){return Bo(n,{top:"y",right:"x",bottom:"y",left:"x"})}function mn(n){return Bo(n,["topLeft","topRight","bottomLeft","bottomRight"])}function je(n){const e=Fl(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ve(n,e){n=n||{},e=e||Se.font;let t=oe(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=oe(n.style,e.style);i&&!(""+i).match(F0)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:oe(n.family,e.family),lineHeight:$0(oe(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:oe(n.weight,e.weight),string:""};return s.string=O0(s),s}function bi(n,e,t,i){let s,o,a;for(s=0,o=n.length;s<o;++s)if(a=n[s],a!==void 0&&a!==void 0)return a}function L0(n,e,t){const{min:i,max:s}=n,o=hl(e,(s-i)/2),a=(l,c)=>t&&l===0?0:l+c;return{min:a(i,-Math.abs(o)),max:a(s,o)}}function Qt(n,e){return Object.assign(Object.create(n),e)}function Mo(n,e=[""],t,i,s=()=>n[0]){const o=t||n;typeof i>"u"&&(i=jl("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:l=>Mo([l,...n],e,o,i)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete n[0][c],!0},get(l,c){return Il(l,c,()=>Y0(c,e,n,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,c){return zl(l).includes(c)},ownKeys(l){return zl(l)},set(l,c,d){const u=l._storage||(l._storage=s());return l[c]=u[c]=d,delete l._keys,!0}})}function Pn(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:$l(n,i),setContext:o=>Pn(n,o,t,i),override:o=>Pn(n.override(o),e,t,i)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete n[a],!0},get(o,a,l){return Il(o,a,()=>j0(o,a,l))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(o,a,l){return n[a]=l,delete o[a],!0}})}function $l(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Xt(t)?t:()=>t,isIndexable:Xt(i)?i:()=>i}}const R0=(n,e)=>n?n+So(e):e,Vo=(n,e)=>le(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Il(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function j0(n,e,t){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;let l=i[e];return Xt(l)&&a.isScriptable(e)&&(l=z0(e,l,n,t)),Ee(l)&&l.length&&(l=W0(e,l,n,a.isIndexable)),Vo(e,l)&&(l=Pn(l,s,o&&o[e],a)),l}function z0(n,e,t,i){const{_proxy:s,_context:o,_subProxy:a,_stack:l}=t;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let c=e(o,a||i);return l.delete(n),Vo(n,c)&&(c=Ao(s._scopes,s,n,c)),c}function W0(n,e,t,i){const{_proxy:s,_context:o,_subProxy:a,_descriptors:l}=t;if(typeof o.index<"u"&&i(n))return e[o.index%e.length];if(le(e[0])){const c=e,d=s._scopes.filter(u=>u!==c);e=[];for(const u of c){const f=Ao(d,s,n,u);e.push(Pn(f,o,a&&a[n],l))}}return e}function Ll(n,e,t){return Xt(n)?n(e,t):n}const H0=(n,e)=>n===!0?e:typeof n=="string"?Kt(e,n):void 0;function U0(n,e,t,i,s){for(const o of e){const a=H0(t,o);if(a){n.add(a);const l=Ll(a._fallback,t,s);if(typeof l<"u"&&l!==t&&l!==i)return l}else if(a===!1&&typeof i<"u"&&t!==i)return null}return!1}function Ao(n,e,t,i){const s=e._rootScopes,o=Ll(e._fallback,t,i),a=[...n,...s],l=new Set;l.add(i);let c=Rl(l,a,t,o||t,i);return c===null||typeof o<"u"&&o!==t&&(c=Rl(l,a,o,c,i),c===null)?!1:Mo(Array.from(l),[""],s,o,()=>q0(e,t,i))}function Rl(n,e,t,i,s){for(;t;)t=U0(n,e,t,i,s);return t}function q0(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return Ee(s)&&le(t)?t:s||{}}function Y0(n,e,t,i){let s;for(const o of e)if(s=jl(R0(o,n),t),typeof s<"u")return Vo(n,s)?Ao(t,i,n,s):s}function jl(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function zl(n){let e=n._keys;return e||(e=n._keys=K0(n._scopes)),e}function K0(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function Wl(n,e,t,i){const{iScale:s}=n,{key:o="r"}=this._parsing,a=new Array(i);let l,c,d,u;for(l=0,c=i;l<c;++l)d=l+t,u=e[d],a[l]={r:s.parse(Kt(u,o),d)};return a}const X0=Number.EPSILON||1e-14,Bn=(n,e)=>e<n.length&&!n[e].skip&&n[e],Hl=n=>n==="x"?"y":"x";function G0(n,e,t,i){const s=n.skip?e:n,o=e,a=t.skip?e:t,l=Eo(o,s),c=Eo(a,o);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=i*d,h=i*u;return{previous:{x:o.x-f*(a.x-s.x),y:o.y-f*(a.y-s.y)},next:{x:o.x+h*(a.x-s.x),y:o.y+h*(a.y-s.y)}}}function Q0(n,e,t){const i=n.length;let s,o,a,l,c,d=Bn(n,0);for(let u=0;u<i-1;++u)if(c=d,d=Bn(n,u+1),!(!c||!d)){if(ui(e[u],0,X0)){t[u]=t[u+1]=0;continue}s=t[u]/e[u],o=t[u+1]/e[u],l=Math.pow(s,2)+Math.pow(o,2),!(l<=9)&&(a=3/Math.sqrt(l),t[u]=s*a*e[u],t[u+1]=o*a*e[u])}}function J0(n,e,t="x"){const i=Hl(t),s=n.length;let o,a,l,c=Bn(n,0);for(let d=0;d<s;++d){if(a=l,l=c,c=Bn(n,d+1),!l)continue;const u=l[t],f=l[i];a&&(o=(u-a[t])/3,l[`cp1${t}`]=u-o,l[`cp1${i}`]=f-o*e[d]),c&&(o=(c[t]-u)/3,l[`cp2${t}`]=u+o,l[`cp2${i}`]=f+o*e[d])}}function Z0(n,e="x"){const t=Hl(e),i=n.length,s=Array(i).fill(0),o=Array(i);let a,l,c,d=Bn(n,0);for(a=0;a<i;++a)if(l=c,c=d,d=Bn(n,a+1),!!c){if(d){const u=d[e]-c[e];s[a]=u!==0?(d[t]-c[t])/u:0}o[a]=l?d?yt(s[a-1])!==yt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}Q0(n,s,o),J0(n,o,e)}function ys(n,e,t){return Math.max(Math.min(n,t),e)}function ex(n,e){let t,i,s,o,a,l=Vt(n[0],e);for(t=0,i=n.length;t<i;++t)a=o,o=l,l=t<i-1&&Vt(n[t+1],e),o&&(s=n[t],a&&(s.cp1x=ys(s.cp1x,e.left,e.right),s.cp1y=ys(s.cp1y,e.top,e.bottom)),l&&(s.cp2x=ys(s.cp2x,e.left,e.right),s.cp2y=ys(s.cp2y,e.top,e.bottom)))}function tx(n,e,t,i,s){let o,a,l,c;if(e.spanGaps&&(n=n.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")Z0(n,s);else{let d=i?n[n.length-1]:n[0];for(o=0,a=n.length;o<a;++o)l=n[o],c=G0(d,l,n[Math.min(o+1,a-(i?0:1))%a],e.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}e.capBezierPoints&&ex(n,t)}function Fo(){return typeof window<"u"&&typeof document<"u"}function $o(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function bs(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}const xs=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function nx(n,e){return xs(n).getPropertyValue(e)}const ix=["top","right","bottom","left"];function pn(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const o=ix[s];i[o]=parseFloat(n[e+"-"+o+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const sx=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function ox(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:o}=i;let a=!1,l,c;if(sx(s,o,n.target))l=s,c=o;else{const d=e.getBoundingClientRect();l=i.clientX-d.left,c=i.clientY-d.top,a=!0}return{x:l,y:c,box:a}}function gn(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=xs(t),o=s.boxSizing==="border-box",a=pn(s,"padding"),l=pn(s,"border","width"),{x:c,y:d,box:u}=ox(n,t),f=a.left+(u&&l.left),h=a.top+(u&&l.top);let{width:m,height:p}=e;return o&&(m-=a.width+l.width,p-=a.height+l.height),{x:Math.round((c-f)/m*t.width/i),y:Math.round((d-h)/p*t.height/i)}}function rx(n,e,t){let i,s;if(e===void 0||t===void 0){const o=n&&$o(n);if(!o)e=n.clientWidth,t=n.clientHeight;else{const a=o.getBoundingClientRect(),l=xs(o),c=pn(l,"border","width"),d=pn(l,"padding");e=a.width-d.width-c.width,t=a.height-d.height-c.height,i=bs(l.maxWidth,o,"clientWidth"),s=bs(l.maxHeight,o,"clientHeight")}}return{width:e,height:t,maxWidth:i||fs,maxHeight:s||fs}}const _s=n=>Math.round(n*10)/10;function ax(n,e,t,i){const s=xs(n),o=pn(s,"margin"),a=bs(s.maxWidth,n,"clientWidth")||fs,l=bs(s.maxHeight,n,"clientHeight")||fs,c=rx(n,e,t);let{width:d,height:u}=c;if(s.boxSizing==="content-box"){const h=pn(s,"border","width"),m=pn(s,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-o.width),u=Math.max(0,i?d/i:u-o.height),d=_s(Math.min(d,a,c.maxWidth)),u=_s(Math.min(u,l,c.maxHeight)),d&&!u&&(u=_s(d/2)),(e!==void 0||t!==void 0)&&i&&c.height&&u>c.height&&(u=c.height,d=_s(Math.floor(u*i))),{width:d,height:u}}function Ul(n,e,t){const i=e||1,s=Math.floor(n.height*i),o=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const a=n.canvas;return a.style&&(t||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==s||a.width!==o?(n.currentDevicePixelRatio=i,a.height=s,a.width=o,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const lx=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Fo()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function ql(n,e){const t=nx(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function yn(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function cx(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function dx(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},o={x:e.cp1x,y:e.cp1y},a=yn(n,s,t),l=yn(s,o,t),c=yn(o,e,t),d=yn(a,l,t),u=yn(l,c,t);return yn(d,u,t)}const ux=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},fx=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function Mn(n,e,t){return n?ux(e,t):fx()}function Yl(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Kl(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Xl(n){return n==="angle"?{between:fi,compare:h0,normalize:Ge}:{between:Bt,compare:(e,t)=>e-t,normalize:e=>e}}function Gl({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function hx(n,e,t){const{property:i,start:s,end:o}=t,{between:a,normalize:l}=Xl(i),c=e.length;let{start:d,end:u,loop:f}=n,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&a(l(e[d%c][i]),s,o);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:n.style}}function Ql(n,e,t){if(!t)return[n];const{property:i,start:s,end:o}=t,a=e.length,{compare:l,between:c,normalize:d}=Xl(i),{start:u,end:f,loop:h,style:m}=hx(n,e,t),p=[];let g=!1,y=null,b,x,E;const C=()=>c(s,E,b)&&l(s,E)!==0,k=()=>l(o,b)===0||c(o,E,b),v=()=>g||C(),S=()=>!g||k();for(let _=u,D=u;_<=f;++_)x=e[_%a],!x.skip&&(b=d(x[i]),b!==E&&(g=c(b,s,o),y===null&&v()&&(y=l(b,s)===0?_:D),y!==null&&S()&&(p.push(Gl({start:y,end:_,loop:h,count:a,style:m})),y=null),D=_,E=b));return y!==null&&p.push(Gl({start:y,end:f,loop:h,count:a,style:m})),p}function Jl(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const o=Ql(i[s],n.points,e);o.length&&t.push(...o)}return t}function mx(n,e,t,i){let s=0,o=e-1;if(t&&!i)for(;s<e&&!n[s].skip;)s++;for(;s<e&&n[s].skip;)s++;for(s%=e,t&&(o+=s);o>s&&n[o%e].skip;)o--;return o%=e,{start:s,end:o}}function px(n,e,t,i){const s=n.length,o=[];let a=e,l=n[e],c;for(c=e+1;c<=t;++c){const d=n[c%s];d.skip||d.stop?l.skip||(i=!1,o.push({start:e%s,end:(c-1)%s,loop:i}),e=a=d.stop?c:null):(a=c,l.skip&&(e=c)),l=d}return a!==null&&o.push({start:e%s,end:a%s,loop:i}),o}function gx(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const o=!!n._loop,{start:a,end:l}=mx(t,s,o,i);if(i===!0)return Zl(n,[{start:a,end:l,loop:o}],t,e);const c=l<a?l+s:l,d=!!n._fullLoop&&a===0&&l===s-1;return Zl(n,px(t,a,c,d),t,e)}function Zl(n,e,t,i){return!i||!i.setContext||!t?e:yx(n,e,t,i)}function yx(n,e,t,i){const s=n._chart.getContext(),o=ec(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,c=t.length,d=[];let u=o,f=e[0].start,h=f;function m(p,g,y,b){const x=l?-1:1;if(p!==g){for(p+=c;t[p%c].skip;)p-=x;for(;t[g%c].skip;)g+=x;p%c!==g%c&&(d.push({start:p%c,end:g%c,loop:y,style:b}),u=b,f=g%c)}}for(const p of e){f=l?f:p.start;let g=t[f%c],y;for(h=f+1;h<=p.end;h++){const b=t[h%c];y=ec(i.setContext(Qt(s,{type:"segment",p0:g,p1:b,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:a}))),bx(y,u)&&m(f,h-1,p.loop,u),g=b,u=y}f<h-1&&m(f,h-1,p.loop,u)}return d}function ec(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function bx(n,e){if(!e)return!1;const t=[],i=function(s,o){return Do(o)?(t.includes(o)||t.push(o),t.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(e,i)}/*!
167
171
  * Chart.js v4.4.7
168
172
  * https://www.chartjs.org
169
173
  * (c) 2024 Chart.js Contributors
170
174
  * Released under the MIT License
171
- */class n0{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const o=e.listeners[s],r=e.duration;o.forEach(l=>l({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Ja.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,l=!1,c;for(;r>=0;--r)c=o[r],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(t),l=!0):(o[r]=o[o.length-1],o.pop());l&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var de=new n0;const Dl="transparent",i0={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=sl(n||Dl),s=i.valid&&sl(t||Dl);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Nl{constructor(t,e,i,s){const o=e[i];s=li([t.to,s,o,t.from]);const r=li([t.from,o,s]);this._active=!0,this._fn=t.fn||i0[t.type||typeof r],this._easing=ii[t.easing]||ii.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=li([t.to,e,s,t.from]),this._from=li([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,l=this._to;let c;if(this._active=o!==l&&(r||e<i),!this._active){this._target[s]=l,this._notify(!0);return}if(e<0){this._target[s]=o;return}c=e/i%2,c=r&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,l,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class So{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!nt(t))return;const e=Object.keys(gt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!nt(o))return;const r={};for(const l of e)r[l]=o[l];(_t(o.properties)&&o.properties||[s]).forEach(l=>{(l===s||!i.has(l))&&i.set(l,r)})})}_animateOptions(t,e){const i=e.options,s=o0(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&s0(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),l=Date.now();let c;for(c=r.length-1;c>=0;--c){const d=r[c];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[d];let h=o[d];const f=i.get(d);if(h)if(f&&h.active()){h.update(f,u,l);continue}else h.cancel();if(!f||!f.duration){t[d]=u;continue}o[d]=h=new Nl(f,t,d,u),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return de.add(this._chart,i),!0}}function s0(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=n[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function o0(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Tl(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function r0(n,t,e){if(e===!1)return!1;const i=Tl(n,e),s=Tl(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function a0(n){let t,e,i,s;return nt(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function Pl(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function Ml(n,t,e,i={}){const s=n.keys,o=i.mode==="single";let r,l,c,d;if(t===null)return;let u=!1;for(r=0,l=s.length;r<l;++r){if(c=+s[r],c===e){if(u=!0,i.all)continue;break}d=n.values[c],kt(d)&&(o||t===0||ce(t)===ce(d))&&(t+=d)}return!u&&!i.all?0:t}function l0(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(n),l=new Array(r.length);let c,d,u;for(c=0,d=r.length;c<d;++c)u=r[c],l[c]={[s]:u,[o]:n[u]};return l}function wo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function c0(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function d0(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function u0(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Vl(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Al(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:l}=i,c=o.axis,d=r.axis,u=c0(o,r,i),h=t.length;let f;for(let m=0;m<h;++m){const p=t[m],{[c]:g,[d]:y}=p,b=p._stacks||(p._stacks={});f=b[d]=u0(s,u,g),f[l]=y,f._top=Vl(f,r,!0,i.type),f._bottom=Vl(f,r,!1,i.type);const _=f._visualValues||(f._visualValues={});_[l]=y}}function Eo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function h0(n,t){return je(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function f0(n,t,e){return je(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ci(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const Co=n=>n==="reset"||n==="none",Bl=(n,t)=>t?n:Object.assign({},n),m0=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Pl(e,!0),values:null};class Yt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=wo(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ci(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(h,f,m,p)=>h==="x"?f:h==="r"?p:m,o=e.xAxisID=J(i.xAxisID,Eo(t,"x")),r=e.yAxisID=J(i.yAxisID,Eo(t,"y")),l=e.rAxisID=J(i.rAxisID,Eo(t,"r")),c=e.indexAxis,d=e.iAxisID=s(c,o,r,l),u=e.vAxisID=s(c,r,o,l);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(d),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ga(this._data,this),t._stacked&&ci(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(nt(e)){const s=this._cachedMeta;this._data=l0(e,s)}else if(i!==e){if(i){Ga(i,this);const s=this._cachedMeta;ci(s),s._parsed=[]}e&&Object.isExtensible(e)&&tb(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=wo(e.vScale,e),e.stack!==i.stack&&(s=!0,ci(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&(Al(this,e._parsed),e._stacked=wo(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,l=o.axis;let c=t===0&&e===s.length?!0:i._sorted,d=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{_t(s[t])?f=this.parseArrayData(i,s,t,e):nt(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const m=()=>h[l]===null||d&&h[l]<d[l];for(u=0;u<e;++u)i._parsed[u+t]=h=f[u],c&&(m()&&(c=!1),d=h);i._sorted=c}r&&Al(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:r}=t,l=o.axis,c=r.axis,d=o.getLabels(),u=o===r,h=new Array(s);let f,m,p;for(f=0,m=s;f<m;++f)p=f+i,h[f]={[l]:u||o.parse(d[p],p),[c]:r.parse(e[p],p)};return h}parseArrayData(t,e,i,s){const{xScale:o,yScale:r}=t,l=new Array(s);let c,d,u,h;for(c=0,d=s;c<d;++c)u=c+i,h=e[u],l[c]={x:o.parse(h[0],u),y:r.parse(h[1],u)};return l}parseObjectData(t,e,i,s){const{xScale:o,yScale:r}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+i,m=e[f],d[u]={x:o.parse(Re(m,l),f),y:r.parse(Re(m,c),f)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,o=this._cachedMeta,r=e[t.axis],l={keys:Pl(s,!0),values:e._stacks[t.axis]._visualValues};return Ml(l,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const o=i[e.axis];let r=o===null?NaN:o;const l=s&&i._stacks[e.axis];s&&l&&(s.values=l,r=Ml(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,l=this._getOtherScale(t),c=m0(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=d0(l);let f,m;function p(){m=s[f];const g=m[l.axis];return!kt(m[t.axis])||u>g||h<g}for(f=0;f<r&&!(!p()&&(this.updateRangeFromParsed(d,t,m,c),o));++f);if(o){for(f=r-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(d,t,m,c);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],kt(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=a0(J(this.options.clip,r0(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],o=e.chartArea,r=[],l=this._drawStart||0,c=this._drawCount||s.length-l,d=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,o,l,c),u=l;u<l+c;++u){const h=s[u];h.hidden||(h.active&&d?r.push(h):h.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=f0(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=h0(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,l=o[r],c=this.enableOptionSharing&&ti(i);if(l)return Bl(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=d.getOptionScopes(this.getDataset(),u),m=Object.keys(gt.elements[t]),p=()=>this.getContext(i,s,e),g=d.resolveNamedOptions(f,m,p,h);return g.$shared&&(g.$shared=c,o[r]=Object.freeze(Bl(g,c))),g}_resolveAnimations(t,e,i){const s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,l=o[r];if(l)return l;let c;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),h);c=u.createResolver(f,this.getContext(t,i,e))}const d=new So(s,c&&c.animations);return c&&c._cacheable&&(o[r]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Co(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,s){Co(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Co(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const s=i.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,i=!0){const s=this._cachedMeta,o=s.data,r=t+e;let l;const c=d=>{for(d.length+=e,l=d.length-1;l>=r;l--)d[l]=d[l-e]};for(c(o),l=t;l<r;++l)o[l]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&ci(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}L(Yt,"defaults",{}),L(Yt,"datasetElementType",null),L(Yt,"dataElementType",null);function p0(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=e.length;s<o;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Qa(i.sort((s,o)=>s-o))}return n._cache.$bar}function g0(n){const t=n.iScale,e=p0(t,n.type);let i=t._length,s,o,r,l;const c=()=>{r===32767||r===-32768||(ti(l)&&(i=Math.min(i,Math.abs(r-l)||i)),l=r)};for(s=0,o=e.length;s<o;++s)r=t.getPixelForValue(e[s]),c();for(l=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),c();return i}function y0(n,t,e,i){const s=e.barThickness;let o,r;return st(s)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=s*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[n]-o/2}}function b0(n,t,e,i){const s=t.pixels,o=s[n];let r=n>0?s[n-1]:null,l=n<s.length-1?s[n+1]:null;const c=e.categoryPercentage;r===null&&(r=o-(l===null?t.end-t.start:l-o)),l===null&&(l=o+o-r);const d=o-(o-Math.min(r,l))/2*c;return{chunk:Math.abs(l-r)/2*c/i,ratio:e.barPercentage,start:d}}function _0(n,t,e,i){const s=e.parse(n[0],i),o=e.parse(n[1],i),r=Math.min(s,o),l=Math.max(s,o);let c=r,d=l;Math.abs(r)>Math.abs(l)&&(c=l,d=r),t[e.axis]=d,t._custom={barStart:c,barEnd:d,start:s,end:o,min:r,max:l}}function Fl(n,t,e,i){return _t(n)?_0(n,t,e,i):t[e.axis]=e.parse(n,i),t}function $l(n,t,e,i){const s=n.iScale,o=n.vScale,r=s.getLabels(),l=s===o,c=[];let d,u,h,f;for(d=e,u=e+i;d<u;++d)f=t[d],h={},h[s.axis]=l||s.parse(r[d],d),c.push(Fl(f,h,o,d));return c}function vo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function x0(n,t,e){return n!==0?ce(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function k0(n){let t,e,i,s,o;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:i,reverse:t,top:s,bottom:o}}function S0(n,t,e,i){let s=t.borderSkipped;const o={};if(!s){n.borderSkipped=o;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:l,reverse:c,top:d,bottom:u}=k0(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=d:(e._bottom||0)===i?s=u:(o[Rl(u,r,l,c)]=!0,s=d)),o[Rl(s,r,l,c)]=!0,n.borderSkipped=o}function Rl(n,t,e,i){return i?(n=w0(n,t,e),n=Ll(n,e,t)):n=Ll(n,t,e),n}function w0(n,t,e){return n===t?e:n===e?t:n}function Ll(n,t,e){return n==="start"?t:n==="end"?e:n}function E0(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class di extends Yt{parsePrimitiveData(t,e,i,s){return $l(t,e,i,s)}parseArrayData(t,e,i,s){return $l(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:o,vScale:r}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=o.axis==="x"?l:c,u=r.axis==="x"?l:c,h=[];let f,m,p,g;for(f=i,m=i+s;f<m;++f)g=e[f],p={},p[o.axis]=o.parse(Re(g,d),f),h.push(Fl(Re(g,u),p,r,f));return h}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const o=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,o=this.getParsed(t),r=o._custom,l=vo(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const o=s==="reset",{index:r,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s);for(let m=e;m<e+i;m++){const p=this.getParsed(m),g=o||st(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,u),b=(p._stacks||{})[l.axis],_={horizontal:d,base:g.base,enableBorderRadius:!b||vo(p._custom)||r===b._top||r===b._bottom,x:d?g.head:y.center,y:d?y.center:g.head,height:d?y.size:Math.abs(g.size),width:d?Math.abs(g.size):y.size};f&&(_.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const w=_.options||t[m].options;S0(_,w,b,r),E0(_,w,u.ratio),this.updateElement(t[m],m,_,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=i.options.stacked,r=[],l=this._cachedMeta.controller.getParsed(e),c=l&&l[i.axis],d=u=>{const h=u._parsed.find(m=>m[i.axis]===c),f=h&&h[u.vScale.axis];if(st(f)||isNaN(f))return!0};for(const u of s)if(!(e!==void 0&&d(u))&&((o===!1||r.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&r.push(u.stack),u.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let o,r;for(o=0,r=e.data.length;o<r;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const l=t.barThickness;return{min:l||g0(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:r}}=this,l=o||0,c=this.getParsed(t),d=c._custom,u=vo(d);let h=c[e.axis],f=0,m=i?this.applyStack(e,c,i):h,p,g;m!==h&&(f=m-h,m=h),u&&(h=d.barStart,m=d.barEnd-d.barStart,h!==0&&ce(h)!==ce(d.barEnd)&&(f=0),f+=h);const y=!st(o)&&!u?o:f;let b=e.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+m):p=b,g=p-b,Math.abs(g)<r){g=x0(g,e,l)*r,h===l&&(b-=g/2);const _=e.getPixelForDecimal(0),w=e.getPixelForDecimal(1),E=Math.min(_,w),k=Math.max(_,w);b=Math.max(Math.min(b,k),E),p=b+g,i&&!u&&(c._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(b))}if(b===e.getPixelForValue(l)){const _=ce(g)*e.getLineWidthForValue(l)/2;b+=_,g-=_}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,r=J(s.maxBarThickness,1/0);let l,c;if(e.grouped){const d=o?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?b0(t,e,s,d):y0(t,e,s,d),h=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);l=u.start+u.chunk*h+u.chunk/2,c=Math.min(r,u.chunk*u.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),c=Math.min(r,e.min*e.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}L(di,"id","bar"),L(di,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),L(di,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ui extends Yt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const o=super.parsePrimitiveData(t,e,i,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+i).radius;return o}parseArrayData(t,e,i,s){const o=super.parseArrayData(t,e,i,s);for(let r=0;r<o.length;r++){const l=e[i+r];o[r]._custom=J(l[2],this.resolveDataElementOptions(r+i).radius)}return o}parseObjectData(t,e,i,s){const o=super.parseObjectData(t,e,i,s);for(let r=0;r<o.length;r++){const l=e[i+r];o[r]._custom=J(l&&l.r&&+l.r,this.resolveDataElementOptions(r+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),l=s.getLabelForValue(r.x),c=o.getLabelForValue(r.y),d=r._custom;return{label:i[t]||"",value:"("+l+", "+c+(d?", "+d:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:r,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,s),u=r.axis,h=l.axis;for(let f=e;f<e+i;f++){const m=t[f],p=!o&&this.getParsed(f),g={},y=g[u]=o?r.getPixelForDecimal(.5):r.getPixelForValue(p[u]),b=g[h]=o?l.getBasePixel():l.getPixelForValue(p[h]);g.skip=isNaN(y)||isNaN(b),d&&(g.options=c||this.resolveDataElementOptions(f,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,f,g,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=J(i&&i._custom,o),s}}L(ui,"id","bubble"),L(ui,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),L(ui,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function C0(n,t,e){let i=1,s=1,o=0,r=0;if(t<pt){const l=n,c=l+t,d=Math.cos(l),u=Math.sin(l),h=Math.cos(c),f=Math.sin(c),m=(w,E,k)=>ni(w,l,c,!0)?1:Math.max(E,E*e,k,k*e),p=(w,E,k)=>ni(w,l,c,!0)?-1:Math.min(E,E*e,k,k*e),g=m(0,d,h),y=m(St,u,f),b=p(mt,d,h),_=p(mt+St,u,f);i=(g-b)/2,s=(y-_)/2,o=-(g+b)/2,r=-(y+_)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class ze extends Yt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=c=>+i[c];if(nt(i[t])){const{key:c="value"}=this._parsing;o=d=>+Re(i[d],c)}let r,l;for(r=t,l=t+e;r<l;++r)s._parsed[r]=o(r)}}_getRotation(){return ne(this.options.rotation-90)}_getCircumference(){return ne(this.options.circumference)}_getRotationExtents(){let t=pt,e=-pt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-r)/2,0),c=Math.min(Iy(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:p,offsetY:g}=C0(h,u,c),y=(i.width-r)/f,b=(i.height-r)/m,_=Math.max(Math.min(y,b)/2,0),w=Ia(this.options.radius,_),E=Math.max(w*c,0),k=(w-E)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=g*w,s.total=this.calculateTotal(),this.outerRadius=w-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*d,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/pt)}updateElements(t,e,i,s){const o=s==="reset",r=this.chart,l=r.chartArea,d=r.options.animation,u=(l.left+l.right)/2,h=(l.top+l.bottom)/2,f=o&&d.animateScale,m=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:g,includeOptions:y}=this._getSharedOptions(e,s);let b=this._getRotation(),_;for(_=0;_<e;++_)b+=this._circumference(_,o);for(_=e;_<e+i;++_){const w=this._circumference(_,o),E=t[_],k={x:u+this.offsetX,y:h+this.offsetY,startAngle:b,endAngle:b+w,circumference:w,outerRadius:p,innerRadius:m};y&&(k.options=g||this.resolveDataElementOptions(_,E.active?"active":s)),b+=w,this.updateElement(E,_,k,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?pt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=si(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,o,r,l,c;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){r=i.getDatasetMeta(s),t=r.data,l=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)c=l.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(e=Math.max(e,c.borderWidth||0,c.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(J(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}L(ze,"id","doughnut"),L(ze,"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"}),L(ze,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),L(ze,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const c=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class hi extends Yt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:l,count:c}=tl(e,s,r);this._drawStart=l,this._drawCount=c,el(e)&&(l=0,c=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:d},t),this.updateElements(s,l,c,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,s),f=r.axis,m=l.axis,{spanGaps:p,segment:g}=this.options,y=_n(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",_=e+i,w=t.length;let E=e>0&&this.getParsed(e-1);for(let k=0;k<w;++k){const C=t[k],S=b?C:{};if(k<e||k>=_){S.skip=!0;continue}const x=this.getParsed(k),O=st(x[m]),M=S[f]=r.getPixelForValue(x[f],k),v=S[m]=o||O?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,x,c):x[m],k);S.skip=isNaN(M)||isNaN(v)||O,S.stop=k>0&&Math.abs(x[f]-E[f])>y,g&&(S.parsed=x,S.raw=d.data[k]),h&&(S.options=u||this.resolveDataElementOptions(k,C.active?"active":s)),b||this.updateElement(C,k,S,s),E=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}L(hi,"id","line"),L(hi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),L(hi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class wn extends Yt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=si(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return gl.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),l=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,i,s){const o=s==="reset",r=this.chart,c=r.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,h=d.yCenter,f=d.getIndexAngle(0)-.5*mt;let m=f,p;const g=360/this.countVisibleElements();for(p=0;p<e;++p)m+=this._computeAngle(p,s,g);for(p=e;p<e+i;p++){const y=t[p];let b=m,_=m+this._computeAngle(p,s,g),w=r.getDataVisibility(p)?d.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=_,o&&(c.animateScale&&(w=0),c.animateRotate&&(b=_=f));const E={x:u,y:h,innerRadius:0,outerRadius:w,startAngle:b,endAngle:_,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,E,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?ne(this.resolveDataElementOptions(t,e).angle||i):0}}L(wn,"id","polarArea"),L(wn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),L(wn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const c=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class as extends ze{}L(as,"id","pie"),L(as,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class fi extends Yt{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return gl.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(i.points=s,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const l={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(i,void 0,l,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const o=this._cachedMeta.rScale,r=s==="reset";for(let l=e;l<e+i;l++){const c=t[l],d=this.resolveDataElementOptions(l,c.active?"active":s),u=o.getPointPositionForValue(l,this.getParsed(l).r),h=r?o.xCenter:u.x,f=r?o.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:d};this.updateElement(c,l,m,s)}}}L(fi,"id","radar"),L(fi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),L(fi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class mi extends Yt{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),l=s.getLabelForValue(r.x),c=o.getLabelForValue(r.y);return{label:i[t]||"",value:"("+l+", "+c+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:r}=tl(e,i,s);if(this._drawStart=o,this._drawCount=r,el(e)&&(o=0,r=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:c}=e;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=i;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!s,options:d},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const o=s==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=r.axis,p=l.axis,{spanGaps:g,segment:y}=this.options,b=_n(g)?g:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none";let w=e>0&&this.getParsed(e-1);for(let E=e;E<e+i;++E){const k=t[E],C=this.getParsed(E),S=_?k:{},x=st(C[p]),O=S[m]=r.getPixelForValue(C[m],E),M=S[p]=o||x?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,C,c):C[p],E);S.skip=isNaN(O)||isNaN(M)||x,S.stop=E>0&&Math.abs(C[m]-w[m])>b,y&&(S.parsed=C,S.raw=d.data[E]),f&&(S.options=h||this.resolveDataElementOptions(E,k.active?"active":s)),_||this.updateElement(k,E,S,s),w=C}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let c=e.length-1;c>=0;--c)l=Math.max(l,e[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,r)/2}}L(mi,"id","scatter"),L(mi,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),L(mi,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Il=Object.freeze({__proto__:null,BarController:di,BubbleController:ui,DoughnutController:ze,LineController:hi,PieController:as,PolarAreaController:wn,RadarController:fi,ScatterController:mi});function rn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Oo{constructor(t){L(this,"options");this.options=t||{}}static override(t){Object.assign(Oo.prototype,t)}init(){}formats(){return rn()}parse(){return rn()}format(){return rn()}add(){return rn()}diff(){return rn()}startOf(){return rn()}endOf(){return rn()}}var jl={_date:Oo};function v0(n,t,e,i){const{controller:s,data:o,_sorted:r}=n,l=s._cachedMeta.iScale;if(l&&t===l.axis&&t!=="r"&&r&&o.length){const c=l._reversePixels?Jy:Ee;if(i){if(s._sharedOptions){const d=o[0],u=typeof d.getRange=="function"&&d.getRange(t);if(u){const h=c(o,t,e-u),f=c(o,t,e+u);return{lo:h.lo,hi:f.hi}}}}else return c(o,t,e)}return{lo:0,hi:o.length-1}}function pi(n,t,e,i,s){const o=n.getSortedVisibleDatasetMetas(),r=e[t];for(let l=0,c=o.length;l<c;++l){const{index:d,data:u}=o[l],{lo:h,hi:f}=v0(o[l],t,r,s);for(let m=h;m<=f;++m){const p=u[m];p.skip||i(p,d,m)}}}function O0(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,r=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Do(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||pi(n,e,t,function(l,c,d){!s&&!Ce(l,n.chartArea,0)||l.inRange(t.x,t.y,i)&&o.push({element:l,datasetIndex:c,index:d})},!0),o}function D0(n,t,e,i){let s=[];function o(r,l,c){const{startAngle:d,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:h}=Ka(r,{x:t.x,y:t.y});ni(h,d,u)&&s.push({element:r,datasetIndex:l,index:c})}return pi(n,e,t,o),s}function N0(n,t,e,i,s,o){let r=[];const l=O0(e);let c=Number.POSITIVE_INFINITY;function d(u,h,f){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const p=u.getCenterPoint(s);if(!(!!o||n.isPointInArea(p))&&!m)return;const y=l(t,p);y<c?(r=[{element:u,datasetIndex:h,index:f}],c=y):y===c&&r.push({element:u,datasetIndex:h,index:f})}return pi(n,e,t,d),r}function No(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?D0(n,t,e,s):N0(n,t,e,i,s,o)}function zl(n,t,e,i,s){const o=[],r=e==="x"?"inXRange":"inYRange";let l=!1;return pi(n,e,t,(c,d,u)=>{c[r]&&c[r](t[e],s)&&(o.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(t.x,t.y,s))}),i&&!l?[]:o}var Wl={evaluateInteractionItems:pi,modes:{index(n,t,e,i){const s=sn(t,n),o=e.axis||"x",r=e.includeInvisible||!1,l=e.intersect?Do(n,s,o,i,r):No(n,s,o,!1,i,r),c=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,h=d.data[u];h&&!h.skip&&c.push({element:h,datasetIndex:d.index,index:u})}),c):[]},dataset(n,t,e,i){const s=sn(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;let l=e.intersect?Do(n,s,o,i,r):No(n,s,o,!1,i,r);if(l.length>0){const c=l[0].datasetIndex,d=n.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(n,t,e,i){const s=sn(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return Do(n,s,o,i,r)},nearest(n,t,e,i){const s=sn(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return No(n,s,o,e.intersect,i,r)},x(n,t,e,i){const s=sn(t,n);return zl(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=sn(t,n);return zl(n,s,"y",e.intersect,i)}}};const Hl=["left","top","right","bottom"];function gi(n,t){return n.filter(e=>e.pos===t)}function Ul(n,t){return n.filter(e=>Hl.indexOf(e.pos)===-1&&e.box.axis===t)}function yi(n,t){return n.sort((e,i)=>{const s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function T0(n){const t=[];let e,i,s,o,r,l;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:o,options:{stack:r,stackWeight:l=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:l});return t}function P0(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!Hl.includes(s))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function M0(n,t){const e=P0(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,r,l;for(o=0,r=n.length;o<r;++o){l=n[o];const{fullSize:c}=l.box,d=e[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*i:c&&t.availableWidth,l.height=s):(l.width=i,l.height=u?u*s:c&&t.availableHeight)}return e}function V0(n){const t=T0(n),e=yi(t.filter(d=>d.box.fullSize),!0),i=yi(gi(t,"left"),!0),s=yi(gi(t,"right")),o=yi(gi(t,"top"),!0),r=yi(gi(t,"bottom")),l=Ul(t,"x"),c=Ul(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(c).concat(r).concat(l),chartArea:gi(t,"chartArea"),vertical:i.concat(s).concat(c),horizontal:o.concat(r).concat(l)}}function ql(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Yl(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function A0(n,t,e,i){const{pos:s,box:o}=e,r=n.maxPadding;if(!nt(s)){e.size&&(n[s]-=e.size);const h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?o.height:o.width),e.size=h.size/h.count,n[s]+=e.size}o.getPadding&&Yl(r,o.getPadding());const l=Math.max(0,t.outerWidth-ql(r,n,"left","right")),c=Math.max(0,t.outerHeight-ql(r,n,"top","bottom")),d=l!==n.w,u=c!==n.h;return n.w=l,n.h=c,e.horizontal?{same:d,other:u}:{same:u,other:d}}function B0(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function F0(n,t){const e=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return i(n?["left","right"]:["top","bottom"])}function bi(n,t,e,i){const s=[];let o,r,l,c,d,u;for(o=0,r=n.length,d=0;o<r;++o){l=n[o],c=l.box,c.update(l.width||t.w,l.height||t.h,F0(l.horizontal,t));const{same:h,other:f}=A0(t,e,l,i);d|=h&&s.length,u=u||f,c.fullSize||s.push(l)}return d&&bi(s,t,e,i)||u}function ls(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Kl(n,t,e,i){const s=e.padding;let{x:o,y:r}=t;for(const l of n){const c=l.box,d=i[l.stack]||{count:1,placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const h=t.w*u,f=d.size||c.height;ti(d.start)&&(r=d.start),c.fullSize?ls(c,s.left,r,e.outerWidth-s.right-s.left,f):ls(c,t.left+d.placed,r,h,f),d.start=r,d.placed+=h,r=c.bottom}else{const h=t.h*u,f=d.size||c.width;ti(d.start)&&(o=d.start),c.fullSize?ls(c,o,s.top,f,e.outerHeight-s.bottom-s.top):ls(c,o,t.top+d.placed,f,h),d.start=o,d.placed+=h,o=c.right}}t.x=o,t.y=r}var Tt={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=Mt(n.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),l=V0(n.boxes),c=l.vertical,d=l.horizontal;rt(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=c.reduce((g,y)=>y.box.options&&y.box.options.display===!1?g:g+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),f=Object.assign({},s);Yl(f,Mt(i));const m=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),p=M0(c.concat(d),h);bi(l.fullSize,m,h,p),bi(c,m,h,p),bi(d,m,h,p)&&bi(c,m,h,p),B0(m),Kl(l.leftAndTop,m,h,p),m.x+=m.w,m.y+=m.h,Kl(l.rightAndBottom,m,h,p),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},rt(l.chartArea,g=>{const y=g.box;Object.assign(y,n.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class To{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Xl extends To{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const cs="$chartjs",$0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Gl=n=>n===null||n==="";function R0(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[cs]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Gl(s)){const o=_l(n,"width");o!==void 0&&(n.width=o)}if(Gl(i))if(n.style.height==="")n.height=n.width/(t||2);else{const o=_l(n,"height");o!==void 0&&(n.height=o)}return n}const Ql=Ub?{passive:!0}:!1;function L0(n,t,e){n&&n.addEventListener(t,e,Ql)}function I0(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Ql)}function j0(n,t){const e=$0[n.type]||n.type,{x:i,y:s}=sn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function ds(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function z0(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(const l of o)r=r||ds(l.addedNodes,i),r=r&&!ds(l.removedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function W0(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(const l of o)r=r||ds(l.removedNodes,i),r=r&&!ds(l.addedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const _i=new Map;let Jl=0;function Zl(){const n=window.devicePixelRatio;n!==Jl&&(Jl=n,_i.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function H0(n,t){_i.size||window.addEventListener("resize",Zl),_i.set(n,t)}function U0(n){_i.delete(n),_i.size||window.removeEventListener("resize",Zl)}function q0(n,t,e){const i=n.canvas,s=i&&ko(i);if(!s)return;const o=Za((l,c)=>{const d=s.clientWidth;e(l,c),d<s.clientWidth&&e()},window),r=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||o(d,u)});return r.observe(s),H0(n,o),r}function Po(n,t,e){e&&e.disconnect(),t==="resize"&&U0(n)}function Y0(n,t,e){const i=n.canvas,s=Za(o=>{n.ctx!==null&&e(j0(o,n))},n);return L0(i,t,s),s}class tc extends To{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(R0(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[cs])return!1;const i=e[cs].initial;["height","width"].forEach(o=>{const r=i[o];st(r)?e.removeAttribute(o):e.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[cs],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:z0,detach:W0,resize:q0}[e]||Y0;s[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Po,detach:Po,resize:Po}[e]||I0)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Hb(t,e,i,s)}isAttached(t){const e=t&&ko(t);return!!(e&&e.isConnected)}}function ec(n){return!xo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Xl:tc}class Kt{constructor(){L(this,"x");L(this,"y");L(this,"active",!1);L(this,"options");L(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return _n(this.x)&&_n(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}L(Kt,"defaults",{}),L(Kt,"defaultRoutes");function K0(n,t){const e=n.options.ticks,i=X0(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Q0(t):[],r=o.length,l=o[0],c=o[r-1],d=[];if(r>s)return J0(t,d,o,r/s),d;const u=G0(o,t,s);if(r>0){let h,f;const m=r>1?Math.round((c-l)/(r-1)):null;for(us(t,d,u,st(m)?0:l-m,l),h=0,f=r-1;h<f;h++)us(t,d,u,o[h],o[h+1]);return us(t,d,u,c,st(m)?t.length:c+m),d}return us(t,d,u),d}function X0(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function G0(n,t,e){const i=Z0(n),s=t.length/e;if(!i)return Math.max(s,1);const o=Ky(i);for(let r=0,l=o.length-1;r<l;r++){const c=o[r];if(c>s)return c}return Math.max(s,1)}function Q0(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function J0(n,t,e,i){let s=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<n.length;r++)r===o&&(t.push(n[r]),s++,o=e[s*i])}function us(n,t,e,i,s){const o=J(i,0),r=Math.min(J(s,n.length),n.length);let l=0,c,d,u;for(e=Math.ceil(e),s&&(c=s-i,e=c/Math.floor(c/e)),u=o;u<0;)l++,u=Math.round(o+l*e);for(d=Math.max(o,0);d<r;d++)d===u&&(t.push(n[d]),l++,u=Math.round(o+l*e))}function Z0(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const t_=n=>n==="left"?"right":n==="right"?"left":n,nc=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,ic=(n,t)=>Math.min(t||n,n);function sc(n,t){const e=[],i=n.length/t,s=n.length;let o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function e_(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,r=n._endPixel,l=1e-6;let c=n.getPixelForTick(s),d;if(!(e&&(i===1?d=Math.max(c-o,r-c):t===0?d=(n.getPixelForTick(1)-c)/2:d=(c-n.getPixelForTick(s-1))/2,c+=s<t?d:-d,c<o-l||c>r+l)))return c}function n_(n,t){rt(n,e=>{const i=e.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function xi(n){return n.drawTicks?n.tickLength:0}function oc(n,t){if(!n.display)return 0;const e=vt(n.font,t),i=Mt(n.padding);return(_t(n.text)?n.text.length:1)*e.lineHeight+i.height}function i_(n,t){return je(n,{scale:t,type:"scale"})}function s_(n,t,e){return je(n,{tick:e,index:t,type:"tick"})}function o_(n,t,e){let i=co(n);return(e&&t!=="right"||!e&&t==="right")&&(i=t_(i)),i}function r_(n,t,e,i){const{top:s,left:o,bottom:r,right:l,chart:c}=n,{chartArea:d,scales:u}=c;let h=0,f,m,p;const g=r-s,y=l-o;if(n.isHorizontal()){if(m=Pt(i,o,l),nt(e)){const b=Object.keys(e)[0],_=e[b];p=u[b].getPixelForValue(_)+g-t}else e==="center"?p=(d.bottom+d.top)/2+g-t:p=nc(n,e,t);f=l-o}else{if(nt(e)){const b=Object.keys(e)[0],_=e[b];m=u[b].getPixelForValue(_)-y+t}else e==="center"?m=(d.left+d.right)/2-y+t:m=nc(n,e,t);p=Pt(i,r,s),h=e==="left"?-St:St}return{titleX:m,titleY:p,maxWidth:f,rotation:h}}class We extends Kt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=zt(t,Number.POSITIVE_INFINITY),e=zt(e,Number.NEGATIVE_INFINITY),i=zt(i,Number.POSITIVE_INFINITY),s=zt(s,Number.NEGATIVE_INFINITY),{min:zt(t,i),max:zt(e,s),minDefined:kt(t),maxDefined:kt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:i};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)r=l[c].controller.getMinMax(this,t),s||(e=Math.min(e,r.min)),o||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=s&&e>i?e:i,{min:zt(e,zt(i,e)),max:zt(i,zt(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ft(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,l=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Sb(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?sc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=K0(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ft(this.options.afterUpdate,[this])}beforeSetDimensions(){ft(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(){ft(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ft(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ft(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=ft(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){ft(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ft(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=ic(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let r=s,l,c,d;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Ot(this.chart.width-h,0,this.maxWidth);l=t.offset?this.maxWidth/i:m/(i-1),h+6>l&&(l=m/(i-(t.offset?.5:1)),c=this.maxHeight-xi(t.grid)-e.padding-oc(t.title,this.chart.options.font),d=Math.sqrt(h*h+f*f),r=ro(Math.min(Math.asin(Ot((u.highest.height+6)/l,-1,1)),Math.asin(Ot(c/d,-1,1))-Math.asin(Ot(f/d,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ft(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),l=this.isHorizontal();if(r){const c=oc(s,e.options.font);if(l?(t.width=this.maxWidth,t.height=xi(o)+c):(t.height=this.maxHeight,t.width=xi(o)+c),i.display&&this.ticks.length){const{first:d,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,p=ne(this.labelRotation),g=Math.cos(p),y=Math.sin(p);if(l){const b=i.mirror?0:y*h.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+b+m)}else{const b=i.mirror?0:g*h.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+b+m)}this._calculatePadding(d,u,y,g)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:o,padding:r},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;c?d?(f=s*t.width,m=i*e.height):(f=i*t.height,m=s*e.width):o==="start"?m=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,m=e.width/2),this.paddingLeft=Math.max((f-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+r)*this.width/(this.width-h),0)}else{let u=e.height/2,h=t.height/2;o==="start"?(u=0,h=t.height):o==="end"&&(u=e.height,h=0),this.paddingTop=u+r,this.paddingBottom=h+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(){ft(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)st(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=sc(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:o}=this,r=[],l=[],c=Math.floor(e/ic(e,i));let d=0,u=0,h,f,m,p,g,y,b,_,w,E,k;for(h=0;h<e;h+=c){if(p=t[h].label,g=this._resolveTickFontOptions(h),s.font=y=g.string,b=o[y]=o[y]||{data:{},gc:[]},_=g.lineHeight,w=E=0,!st(p)&&!_t(p))w=ts(s,b.data,b.gc,w,p),E=_;else if(_t(p))for(f=0,m=p.length;f<m;++f)k=p[f],!st(k)&&!_t(k)&&(w=ts(s,b.data,b.gc,w,k),E+=_);r.push(w),l.push(E),d=Math.max(w,d),u=Math.max(E,u)}n_(o,e);const C=r.indexOf(d),S=l.indexOf(u),x=O=>({width:r[O]||0,height:l[O]||0});return{first:x(0),last:x(e-1),widest:x(C),highest:x(S),widths:r,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Qy(this._alignToPixels?Ze(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=s_(this.getContext(),t,i))}return this.$context||(this.$context=i_(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ne(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,l=o?o.widest.width+r:0,c=o?o.highest.height+r:0;return this.isHorizontal()?c*i>l*s?l/i:c/s:c*s<l*i?c/i:l/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:l}=s,c=o.offset,d=this.isHorizontal(),h=this.ticks.length+(c?1:0),f=xi(o),m=[],p=l.setContext(this.getContext()),g=p.display?p.width:0,y=g/2,b=function(F){return Ze(i,F,g)};let _,w,E,k,C,S,x,O,M,v,T,$;if(r==="top")_=b(this.bottom),S=this.bottom-f,O=_-y,v=b(t.top)+y,$=t.bottom;else if(r==="bottom")_=b(this.top),v=t.top,$=b(t.bottom)-y,S=_+y,O=this.top+f;else if(r==="left")_=b(this.right),C=this.right-f,x=_-y,M=b(t.left)+y,T=t.right;else if(r==="right")_=b(this.left),M=t.left,T=b(t.right)-y,C=_+y,x=this.left+f;else if(e==="x"){if(r==="center")_=b((t.top+t.bottom)/2+.5);else if(nt(r)){const F=Object.keys(r)[0],I=r[F];_=b(this.chart.scales[F].getPixelForValue(I))}v=t.top,$=t.bottom,S=_+y,O=S+f}else if(e==="y"){if(r==="center")_=b((t.left+t.right)/2);else if(nt(r)){const F=Object.keys(r)[0],I=r[F];_=b(this.chart.scales[F].getPixelForValue(I))}C=_-y,x=C-f,M=t.left,T=t.right}const U=J(s.ticks.maxTicksLimit,h),H=Math.max(1,Math.ceil(h/U));for(w=0;w<h;w+=H){const F=this.getContext(w),I=o.setContext(F),B=l.setContext(F),P=I.lineWidth,R=I.color,W=B.dash||[],Z=B.dashOffset,Q=I.tickWidth,Y=I.tickColor,X=I.tickBorderDash||[],it=I.tickBorderDashOffset;E=e_(this,w,c),E!==void 0&&(k=Ze(i,E,P),d?C=x=M=T=k:S=O=v=$=k,m.push({tx1:C,ty1:S,tx2:x,ty2:O,x1:M,y1:v,x2:T,y2:$,width:P,color:R,borderDash:W,borderDashOffset:Z,tickWidth:Q,tickColor:Y,tickBorderDash:X,tickBorderDashOffset:it}))}return this._ticksLength=h,this._borderValue=_,m}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:h}=o,f=xi(i.grid),m=f+u,p=h?-u:m,g=-ne(this.labelRotation),y=[];let b,_,w,E,k,C,S,x,O,M,v,T,$="middle";if(s==="top")C=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const H=this._getYAxisLabelAlignment(f);S=H.textAlign,k=H.x}else if(s==="right"){const H=this._getYAxisLabelAlignment(f);S=H.textAlign,k=H.x}else if(e==="x"){if(s==="center")C=(t.top+t.bottom)/2+m;else if(nt(s)){const H=Object.keys(s)[0],F=s[H];C=this.chart.scales[H].getPixelForValue(F)+m}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")k=(t.left+t.right)/2-m;else if(nt(s)){const H=Object.keys(s)[0],F=s[H];k=this.chart.scales[H].getPixelForValue(F)}S=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(c==="start"?$="top":c==="end"&&($="bottom"));const U=this._getLabelSizes();for(b=0,_=l.length;b<_;++b){w=l[b],E=w.label;const H=o.setContext(this.getContext(b));x=this.getPixelForTick(b)+o.labelOffset,O=this._resolveTickFontOptions(b),M=O.lineHeight,v=_t(E)?E.length:1;const F=v/2,I=H.color,B=H.textStrokeColor,P=H.textStrokeWidth;let R=S;r?(k=x,S==="inner"&&(b===_-1?R=this.options.reverse?"left":"right":b===0?R=this.options.reverse?"right":"left":R="center"),s==="top"?d==="near"||g!==0?T=-v*M+M/2:d==="center"?T=-U.highest.height/2-F*M+M:T=-U.highest.height+M/2:d==="near"||g!==0?T=M/2:d==="center"?T=U.highest.height/2-F*M:T=U.highest.height-v*M,h&&(T*=-1),g!==0&&!H.showLabelBackdrop&&(k+=M/2*Math.sin(g))):(C=x,T=(1-v)*M/2);let W;if(H.showLabelBackdrop){const Z=Mt(H.backdropPadding),Q=U.heights[b],Y=U.widths[b];let X=T-Z.top,it=0-Z.left;switch($){case"middle":X-=Q/2;break;case"bottom":X-=Q;break}switch(S){case"center":it-=Y/2;break;case"right":it-=Y;break;case"inner":b===_-1?it-=Y:b>0&&(it-=Y/2);break}W={left:it,top:X,width:Y+Z.width,height:Q+Z.height,color:H.backdropColor}}y.push({label:E,font:O,textOffset:T,options:{rotation:g,color:I,strokeColor:B,strokeWidth:P,textAlign:R,textBaseline:$,translation:[k,C],backdrop:W}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ne(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),l=t+o,c=r.widest.width;let d,u;return e==="left"?s?(u=this.right+o,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u=this.left)):e==="right"?s?(u=this.left+o,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,i==="near"?d="left":i==="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 t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const l=(c,d,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){const c=s[o];e.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),e.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const l=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,h,f;this.isHorizontal()?(d=Ze(t,this.left,r)-r/2,u=Ze(t,this.right,l)+l/2,h=f=c):(h=Ze(t,this.top,r)-r/2,f=Ze(t,this.bottom,l)+l/2,d=u=c),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(d,h),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&es(i,s);const o=this.getLabelItems(t);for(const r of o){const l=r.options,c=r.font,d=r.label,u=r.textOffset;tn(i,d,0,u,c,l)}s&&ns(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=vt(i.font),r=Mt(i.padding),l=i.align;let c=o.lineHeight/2;e==="bottom"||e==="center"||nt(e)?(c+=r.bottom,_t(i.text)&&(c+=o.lineHeight*(i.text.length-1))):c+=r.top;const{titleX:d,titleY:u,maxWidth:h,rotation:f}=r_(this,c,e,l);tn(t,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:f,textAlign:o_(l,e,s),textBaseline:"middle",translation:[d,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=J(t.grid&&t.grid.z,-1),s=J(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==We.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=e.length;o<r;++o){const l=e[o];l[i]===this.id&&(!t||l.type===t)&&s.push(l)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return vt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class hs{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;c_(e)&&(i=this.register(e));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,a_(t,r,i),this.override&&gt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in gt[s]&&(delete gt[s][i],this.override&&delete Je[i])}}function a_(n,t,e){const i=Jn(Object.create(null),[e?gt.get(e):{},gt.get(t),n.defaults]);gt.set(t,i),n.defaultRoutes&&l_(t,n.defaultRoutes),n.descriptors&&gt.describe(t,n.descriptors)}function l_(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),r=t[e].split("."),l=r.pop(),c=r.join(".");gt.route(o,s,c,l)})}function c_(n){return"id"in n&&"defaults"in n}class d_{constructor(){this.controllers=new hs(Yt,"datasets",!0),this.elements=new hs(Kt,"elements"),this.plugins=new hs(Object,"plugins"),this.scales=new hs(We,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):rt(s,r=>{const l=i||this._getRegistryForType(r);this._exec(t,l,r)})})}_exec(t,e,i){const s=oo(t);ft(i["before"+s],[],i),e[t](i),ft(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var ie=new d_;class u_{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,i,s){s=s||{};for(const o of t){const r=o.plugin,l=r[i],c=[e,s,o.options];if(ft(l,c,r)===!1&&s.cancelable)return!1}return!0}invalidate(){st(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=J(i.options&&i.options.plugins,{}),o=h_(i);return s===!1&&!e?[]:m_(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(l=>!r.some(c=>l.plugin.id===c.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function h_(n){const t={},e=[],i=Object.keys(ie.plugins.items);for(let o=0;o<i.length;o++)e.push(ie.getPlugin(i[o]));const s=n.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function f_(n,t){return!t&&n===!1?null:n===!0?{}:n}function m_(n,{plugins:t,localIds:e},i,s){const o=[],r=n.getContext();for(const l of t){const c=l.id,d=f_(i[c],s);d!==null&&o.push({plugin:l,options:p_(n.config,{plugin:l,local:e[c]},d,r)})}return o}function p_(n,{plugin:t,local:e},i,s){const o=n.pluginScopeKeys(t),r=n.getOptionScopes(i,o);return e&&t.defaults&&r.push(t.defaults),n.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Mo(n,t){const e=gt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function g_(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function y_(n,t){return n===t?"_index_":"_value_"}function rc(n){if(n==="x"||n==="y"||n==="r")return n}function b_(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Vo(n,...t){if(rc(n))return n;for(const e of t){const i=e.axis||b_(e.position)||n.length>1&&rc(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function ac(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function __(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return ac(n,"x",e[0])||ac(n,"y",e[0])}return{}}function x_(n,t){const e=Je[n.type]||{scales:{}},i=t.scales||{},s=Mo(n.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const l=i[r];if(!nt(l))return console.error(`Invalid scale configuration for scale: ${r}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const c=Vo(r,l,__(r,n),gt.scales[l.type]),d=y_(c,s),u=e.scales||{};o[r]=Zn(Object.create(null),[{axis:c},l,u[c],u[d]])}),n.data.datasets.forEach(r=>{const l=r.type||n.type,c=r.indexAxis||Mo(l,t),u=(Je[l]||{}).scales||{};Object.keys(u).forEach(h=>{const f=g_(h,c),m=r[f+"AxisID"]||f;o[m]=o[m]||Object.create(null),Zn(o[m],[{axis:f},i[m],u[h]])})}),Object.keys(o).forEach(r=>{const l=o[r];Zn(l,[gt.scales[l.type],gt.scale])}),o}function lc(n){const t=n.options||(n.options={});t.plugins=J(t.plugins,{}),t.scales=x_(n,t)}function cc(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function k_(n){return n=n||{},n.data=cc(n.data),lc(n),n}const dc=new Map,uc=new Set;function fs(n,t){let e=dc.get(n);return e||(e=t(),dc.set(n,e),uc.add(e)),e}const ki=(n,t,e)=>{const i=Re(t,e);i!==void 0&&n.add(i)};class S_{constructor(t){this._config=k_(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=cc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),lc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return fs(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return fs(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return fs(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return fs(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),l=r.get(e);if(l)return l;const c=new Set;e.forEach(u=>{t&&(c.add(t),u.forEach(h=>ki(c,t,h))),u.forEach(h=>ki(c,s,h)),u.forEach(h=>ki(c,Je[o]||{},h)),u.forEach(h=>ki(c,gt,h)),u.forEach(h=>ki(c,fo,h))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),uc.has(e)&&r.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,Je[e]||{},gt.datasets[e]||{},{type:e},gt,fo]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:l}=hc(this._resolverCache,t,s);let c=r;if(E_(r,e)){o.$shared=!1,i=Le(i)?i():i;const d=this.createResolver(t,i,l);c=xn(r,i,d)}for(const d of e)o[d]=c[d];return o}createResolver(t,e,i=[""],s){const{resolver:o}=hc(this._resolverCache,t,i);return nt(e)?xn(o,e,void 0,s):o}}function hc(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let o=i.get(s);return o||(o={resolver:yo(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},i.set(s,o)),o}const w_=n=>nt(n)&&Object.getOwnPropertyNames(n).some(t=>Le(n[t]));function E_(n,t){const{isScriptable:e,isIndexable:i}=dl(n);for(const s of t){const o=e(s),r=i(s),l=(r||o)&&n[s];if(o&&(Le(l)||w_(l))||r&&_t(l))return!0}return!1}var C_="4.4.7";const v_=["top","bottom","left","right","chartArea"];function fc(n,t){return n==="top"||n==="bottom"||v_.indexOf(n)===-1&&t==="x"}function mc(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function pc(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),ft(e&&e.onComplete,[n],t)}function O_(n){const t=n.chart,e=t.options.animation;ft(e&&e.onProgress,[n],t)}function gc(n){return xo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ms={},yc=n=>{const t=gc(n);return Object.values(ms).filter(e=>e.canvas===t).pop()};function D_(n,t,e){const i=Object.keys(n);for(const s of i){const o=+s;if(o>=t){const r=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=r)}}}function N_(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function ps(n,t,e){return n.options.clip?n[e]:t[e]}function T_(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:ps(e,t,"left"),right:ps(e,t,"right"),top:ps(i,t,"top"),bottom:ps(i,t,"bottom")}:t}class ue{static register(...t){ie.add(...t),bc()}static unregister(...t){ie.remove(...t),bc()}constructor(t,e){const i=this.config=new S_(e),s=gc(t),o=yc(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||ec(s)),this.platform.updateConfig(i);const l=this.platform.acquireContext(s,r.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Ly(),this.ctx=l,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 u_,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=eb(h=>this.update(h),r.resizeDelay||0),this._dataChanges=[],ms[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}de.listen(this,"complete",pc),de.listen(this,"progress",O_),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return st(t)?e&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ie}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():bl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return al(this.canvas,this.ctx),this}stop(){return de.stop(this),this}resize(t,e){de.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,bl(this,l,!0)&&(this.notifyPlugins("resize",{size:r}),ft(i.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};rt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((r,l)=>(r[l]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const l=e[r],c=Vo(r,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),rt(o,r=>{const l=r.options,c=l.id,d=Vo(c,l),u=J(l.type,r.dtype);(l.position===void 0||fc(l.position,d)!==fc(r.dposition))&&(l.position=r.dposition),s[c]=!0;let h=null;if(c in i&&i[c].type===u)h=i[c];else{const f=ie.getScale(u);h=new f({id:c,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(l,t)}),rt(s,(r,l)=>{r||delete i[l]}),rt(i,r=>{Tt.configure(this,r,r.options),Tt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(mc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const o=e[i];let r=this.getDatasetMeta(i);const l=o.type||this.config.type;if(r.type&&r.type!==l&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=l,r.indexAxis=o.indexAxis||Mo(l,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const c=ie.getController(l),{datasetElementType:d,dataElementType:u}=gt.datasets[l];Object.assign(c,{dataElementType:ie.getElement(u),datasetElementType:d&&ie.getElement(d)}),r.controller=new c(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){rt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:h}=this.getDatasetMeta(d),f=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(f),r=Math.max(+h.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||rt(o,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(mc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){rt(this.scales,t=>{Tt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Wa(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of e){const r=i==="_removeElements"?-o:o;D_(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,l)=>l+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<e;o++)if(!Wa(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Tt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],rt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Le(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(de.has(this)?this.attached&&!de.running(this)&&de.start(this):(this.draw(),pc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,o;for(s=0,o=e.length;s<o;++s){const r=e[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,o=T_(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&es(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&ns(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Ce(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=Wl.modes[e];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=je(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);ti(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(l=>l.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),de.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),al(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ms[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},s=(o,r,l)=>{o.offsetX=r,o.offsetY=l,this._eventHandler(o)};rt(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(c,d)=>{e.addEventListener(this,c,d),t[c]=d},s=(c,d)=>{t[c]&&(e.removeEventListener(this,c,d),delete t[c])},o=(c,d)=>{this.canvas&&this.resize(c,d)};let r;const l=()=>{s("attach",l),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",l)},e.isAttached(this.canvas)?l():r()}unbindEvents(){rt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},rt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let o,r,l,c;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){r=t[l];const d=r&&this.getDatasetMeta(r.datasetIndex).controller;d&&d[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{const l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[r],index:r}});!Gi(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,o=(c,d)=>c.filter(u=>!d.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),r=o(e,t),l=i?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:o}=this,r=e,l=this._getActiveElements(t,s,i,r),c=Uy(t),d=N_(t,this._lastEvent,i,c);i&&(this._lastEvent=null,ft(o.onHover,[t,l,this],this),c&&ft(o.onClick,[t,l,this],this));const u=!Gi(l,s);return(u||e)&&(this._active=l,this._updateHoverStyles(l,s,e)),this._lastEvent=d,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}L(ue,"defaults",gt),L(ue,"instances",ms),L(ue,"overrides",Je),L(ue,"registry",ie),L(ue,"version",C_),L(ue,"getChart",yc);function bc(){return rt(ue.instances,n=>n._plugins.invalidate())}function P_(n,t,e){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:l,innerRadius:c}=t;let d=s/l;n.beginPath(),n.arc(o,r,l,i-d,e+d),c>s?(d=s/c,n.arc(o,r,c,e+d,i-d,!0)):n.arc(o,r,s,e+St,i-St),n.closePath(),n.clip()}function M_(n){return go(n,["outerStart","outerEnd","innerStart","innerEnd"])}function V_(n,t,e,i){const s=M_(n.options.borderRadius),o=(e-t)/2,r=Math.min(o,i*t/2),l=c=>{const d=(e-Math.min(o,c))*i/2;return Ot(c,0,Math.min(o,d))};return{outerStart:l(s.outerStart),outerEnd:l(s.outerEnd),innerStart:Ot(s.innerStart,0,r),innerEnd:Ot(s.innerEnd,0,r)}}function En(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function gs(n,t,e,i,s,o){const{x:r,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=t,h=Math.max(t.outerRadius+i+e-d,0),f=u>0?u+i+e+d:0;let m=0;const p=s-c;if(i){const H=u>0?u-i:0,F=h>0?h-i:0,I=(H+F)/2,B=I!==0?p*I/(I+i):p;m=(p-B)/2}const g=Math.max(.001,p*h-e/mt)/h,y=(p-g)/2,b=c+y+m,_=s-y-m,{outerStart:w,outerEnd:E,innerStart:k,innerEnd:C}=V_(t,f,h,_-b),S=h-w,x=h-E,O=b+w/S,M=_-E/x,v=f+k,T=f+C,$=b+k/v,U=_-C/T;if(n.beginPath(),o){const H=(O+M)/2;if(n.arc(r,l,h,O,H),n.arc(r,l,h,H,M),E>0){const P=En(x,M,r,l);n.arc(P.x,P.y,E,M,_+St)}const F=En(T,_,r,l);if(n.lineTo(F.x,F.y),C>0){const P=En(T,U,r,l);n.arc(P.x,P.y,C,_+St,U+Math.PI)}const I=(_-C/f+(b+k/f))/2;if(n.arc(r,l,f,_-C/f,I,!0),n.arc(r,l,f,I,b+k/f,!0),k>0){const P=En(v,$,r,l);n.arc(P.x,P.y,k,$+Math.PI,b-St)}const B=En(S,b,r,l);if(n.lineTo(B.x,B.y),w>0){const P=En(S,O,r,l);n.arc(P.x,P.y,w,b-St,O)}}else{n.moveTo(r,l);const H=Math.cos(O)*h+r,F=Math.sin(O)*h+l;n.lineTo(H,F);const I=Math.cos(M)*h+r,B=Math.sin(M)*h+l;n.lineTo(I,B)}n.closePath()}function A_(n,t,e,i,s){const{fullCircles:o,startAngle:r,circumference:l}=t;let c=t.endAngle;if(o){gs(n,t,e,i,c,s);for(let d=0;d<o;++d)n.fill();isNaN(l)||(c=r+(l%pt||pt))}return gs(n,t,e,i,c,s),n.fill(),c}function B_(n,t,e,i,s){const{fullCircles:o,startAngle:r,circumference:l,options:c}=t,{borderWidth:d,borderJoinStyle:u,borderDash:h,borderDashOffset:f}=c,m=c.borderAlign==="inner";if(!d)return;n.setLineDash(h||[]),n.lineDashOffset=f,m?(n.lineWidth=d*2,n.lineJoin=u||"round"):(n.lineWidth=d,n.lineJoin=u||"bevel");let p=t.endAngle;if(o){gs(n,t,e,i,p,s);for(let g=0;g<o;++g)n.stroke();isNaN(l)||(p=r+(l%pt||pt))}m&&P_(n,t,p),o||(gs(n,t,e,i,p,s),n.stroke())}class Cn extends Kt{constructor(e){super();L(this,"circumference");L(this,"endAngle");L(this,"fullCircles");L(this,"innerRadius");L(this,"outerRadius");L(this,"pixelMargin");L(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const o=this.getProps(["x","y"],s),{angle:r,distance:l}=Ka(o,{x:e,y:i}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,p=J(f,d-c),g=ni(r,c,d)&&c!==d,y=p>=pt||g,b=we(l,u+m,h+m);return y&&b}getCenterPoint(e){const{x:i,y:s,startAngle:o,endAngle:r,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:d,spacing:u}=this.options,h=(o+r)/2,f=(l+c+u+d)/2;return{x:i+Math.cos(h)*f,y:s+Math.sin(h)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,o=(i.offset||0)/4,r=(i.spacing||0)/2,l=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>pt?Math.floor(s/pt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const c=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(c)*o,Math.sin(c)*o);const d=1-Math.sin(Math.min(mt,s||0)),u=o*d;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,A_(e,this,u,r,l),B_(e,this,u,r,l),e.restore()}}L(Cn,"id","arc"),L(Cn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),L(Cn,"defaultRoutes",{backgroundColor:"backgroundColor"}),L(Cn,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function _c(n,t,e=t){n.lineCap=J(e.borderCapStyle,t.borderCapStyle),n.setLineDash(J(e.borderDash,t.borderDash)),n.lineDashOffset=J(e.borderDashOffset,t.borderDashOffset),n.lineJoin=J(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=J(e.borderWidth,t.borderWidth),n.strokeStyle=J(e.borderColor,t.borderColor)}function F_(n,t,e){n.lineTo(e.x,e.y)}function $_(n){return n.stepped?fb:n.tension||n.cubicInterpolationMode==="monotone"?mb:F_}function xc(n,t,e={}){const i=n.length,{start:s=0,end:o=i-1}=e,{start:r,end:l}=t,c=Math.max(s,r),d=Math.min(o,l),u=s<r&&o<r||s>l&&o>l;return{count:i,start:c,loop:t.loop,ilen:d<c&&!u?i+d-c:d-c}}function R_(n,t,e,i){const{points:s,options:o}=t,{count:r,start:l,loop:c,ilen:d}=xc(s,e,i),u=$_(o);let{move:h=!0,reverse:f}=i||{},m,p,g;for(m=0;m<=d;++m)p=s[(l+(f?d-m:m))%r],!p.skip&&(h?(n.moveTo(p.x,p.y),h=!1):u(n,g,p,f,o.stepped),g=p);return c&&(p=s[(l+(f?d:0))%r],u(n,g,p,f,o.stepped)),!!c}function L_(n,t,e,i){const s=t.points,{count:o,start:r,ilen:l}=xc(s,e,i),{move:c=!0,reverse:d}=i||{};let u=0,h=0,f,m,p,g,y,b;const _=E=>(r+(d?l-E:E))%o,w=()=>{g!==y&&(n.lineTo(u,y),n.lineTo(u,g),n.lineTo(u,b))};for(c&&(m=s[_(0)],n.moveTo(m.x,m.y)),f=0;f<=l;++f){if(m=s[_(f)],m.skip)continue;const E=m.x,k=m.y,C=E|0;C===p?(k<g?g=k:k>y&&(y=k),u=(h*u+E)/++h):(w(),n.lineTo(E,k),p=C,h=0,g=y=k),b=k}w()}function Ao(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?L_:R_}function I_(n){return n.stepped?qb:n.tension||n.cubicInterpolationMode==="monotone"?Yb:on}function j_(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),_c(n,t.options),n.stroke(s)}function z_(n,t,e,i){const{segments:s,options:o}=t,r=Ao(t);for(const l of s)_c(n,o,l.style),n.beginPath(),r(n,t,l,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const W_=typeof Path2D=="function";function H_(n,t,e,i){W_&&!t.options.segment?j_(n,t,e,i):z_(n,t,e,i)}class ve extends Kt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Rb(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Zb(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],o=this.points,r=Cl(this,{property:e,start:s,end:s});if(!r.length)return;const l=[],c=I_(i);let d,u;for(d=0,u=r.length;d<u;++d){const{start:h,end:f}=r[d],m=o[h],p=o[f];if(m===p){l.push(m);continue}const g=Math.abs((s-m[e])/(p[e]-m[e])),y=c(m,p,g,i.stepped);y[e]=t[e],l.push(y)}return l.length===1?l[0]:l}pathSegment(t,e,i){return Ao(this)(t,this,e,i)}path(t,e,i){const s=this.segments,o=Ao(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const l of s)r&=o(t,this,l,{start:e,end:e+i-1});return!!r}draw(t,e,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),H_(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}L(ve,"id","line"),L(ve,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),L(ve,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),L(ve,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function kc(n,t,e,i){const s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}class Si extends Kt{constructor(e){super();L(this,"parsed");L(this,"skip");L(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const o=this.options,{x:r,y:l}=this.getProps(["x","y"],s);return Math.pow(e-r,2)+Math.pow(i-l,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,i){return kc(this,e,"x",i)}inYRange(e,i){return kc(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Ce(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,po(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}L(Si,"id","point"),L(Si,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),L(Si,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Sc(n,t){const{x:e,y:i,base:s,width:o,height:r}=n.getProps(["x","y","base","width","height"],t);let l,c,d,u,h;return n.horizontal?(h=r/2,l=Math.min(e,s),c=Math.max(e,s),d=i-h,u=i+h):(h=o/2,l=e-h,c=e+h,d=Math.min(i,s),u=Math.max(i,s)),{left:l,top:d,right:c,bottom:u}}function He(n,t,e,i){return n?0:Ot(t,e,i)}function U_(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,o=cl(i);return{t:He(s.top,o.top,0,e),r:He(s.right,o.right,0,t),b:He(s.bottom,o.bottom,0,e),l:He(s.left,o.left,0,t)}}function q_(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=en(s),r=Math.min(t,e),l=n.borderSkipped,c=i||nt(s);return{topLeft:He(!c||l.top||l.left,o.topLeft,0,r),topRight:He(!c||l.top||l.right,o.topRight,0,r),bottomLeft:He(!c||l.bottom||l.left,o.bottomLeft,0,r),bottomRight:He(!c||l.bottom||l.right,o.bottomRight,0,r)}}function Y_(n){const t=Sc(n),e=t.right-t.left,i=t.bottom-t.top,s=U_(n,e/2,i/2),o=q_(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Bo(n,t,e,i){const s=t===null,o=e===null,l=n&&!(s&&o)&&Sc(n,i);return l&&(s||we(t,l.left,l.right))&&(o||we(e,l.top,l.bottom))}function K_(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function X_(n,t){n.rect(t.x,t.y,t.w,t.h)}function Fo(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,o=(n.x+n.w!==e.x+e.w?t:0)-i,r=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+o,h:n.h+r,radius:n.radius}}class wi extends Kt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:r}=Y_(this),l=K_(r.radius)?ai:X_;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),l(t,Fo(r,e,o)),t.clip(),l(t,Fo(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,Fo(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Bo(this,t,e,i)}inXRange(t,e){return Bo(this,t,null,e)}inYRange(t,e){return Bo(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}L(wi,"id","bar"),L(wi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),L(wi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var wc=Object.freeze({__proto__:null,ArcElement:Cn,BarElement:wi,LineElement:ve,PointElement:Si});const $o=["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)"],Ec=$o.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Cc(n){return $o[n%$o.length]}function vc(n){return Ec[n%Ec.length]}function G_(n,t){return n.borderColor=Cc(t),n.backgroundColor=vc(t),++t}function Q_(n,t){return n.backgroundColor=n.data.map(()=>Cc(t++)),t}function J_(n,t){return n.backgroundColor=n.data.map(()=>vc(t++)),t}function Z_(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof ze?t=Q_(e,t):s instanceof wn?t=J_(e,t):s&&(t=G_(e,t))}}function Oc(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function tx(n){return n&&(n.borderColor||n.backgroundColor)}function ex(){return gt.borderColor!=="rgba(0,0,0,0.1)"||gt.backgroundColor!=="rgba(0,0,0,0.1)"}var Dc={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:o}=s,r=Oc(i)||tx(s)||o&&Oc(o)||ex();if(!e.forceOverride&&r)return;const l=Z_(n);i.forEach(l)}};function nx(n,t,e,i,s){const o=s.samples||i;if(o>=e)return n.slice(t,t+e);const r=[],l=(e-2)/(o-2);let c=0;const d=t+e-1;let u=t,h,f,m,p,g;for(r[c++]=n[u],h=0;h<o-2;h++){let y=0,b=0,_;const w=Math.floor((h+1)*l)+1+t,E=Math.min(Math.floor((h+2)*l)+1,e)+t,k=E-w;for(_=w;_<E;_++)y+=n[_].x,b+=n[_].y;y/=k,b/=k;const C=Math.floor(h*l)+1+t,S=Math.min(Math.floor((h+1)*l)+1,e)+t,{x,y:O}=n[u];for(m=p=-1,_=C;_<S;_++)p=.5*Math.abs((x-y)*(n[_].y-O)-(x-n[_].x)*(b-O)),p>m&&(m=p,f=n[_],g=_);r[c++]=f,u=g}return r[c++]=n[d],r}function ix(n,t,e,i){let s=0,o=0,r,l,c,d,u,h,f,m,p,g;const y=[],b=t+e-1,_=n[t].x,E=n[b].x-_;for(r=t;r<t+e;++r){l=n[r],c=(l.x-_)/E*i,d=l.y;const k=c|0;if(k===u)d<p?(p=d,h=r):d>g&&(g=d,f=r),s=(o*s+l.x)/++o;else{const C=r-1;if(!st(h)&&!st(f)){const S=Math.min(h,f),x=Math.max(h,f);S!==m&&S!==C&&y.push({...n[S],x:s}),x!==m&&x!==C&&y.push({...n[x],x:s})}r>0&&C!==m&&y.push(n[C]),y.push(l),u=k,o=0,p=g=d,h=f=m=r}}return y}function Nc(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Tc(n){n.data.datasets.forEach(t=>{Nc(t)})}function sx(n,t){const e=t.length;let i=0,s;const{iScale:o}=n,{min:r,max:l,minDefined:c,maxDefined:d}=o.getUserBounds();return c&&(i=Ot(Ee(t,o.axis,r).lo,0,e-1)),d?s=Ot(Ee(t,o.axis,l).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var Pc={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Tc(n);return}const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:l}=s,c=n.getDatasetMeta(o),d=r||s.data;if(li([l,n.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=n.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:h,count:f}=sx(c,d);const m=e.threshold||4*i;if(f<=m){Nc(s);return}st(r)&&(s._data=d,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(e.algorithm){case"lttb":p=nx(d,h,f,i,e);break;case"min-max":p=ix(d,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){Tc(n)}};function ox(n,t,e){const i=n.segments,s=n.points,o=t.points,r=[];for(const l of i){let{start:c,end:d}=l;d=Lo(c,d,s);const u=Ro(e,s[c],s[d],l.loop);if(!t.segments){r.push({source:l,target:u,start:s[c],end:s[d]});continue}const h=Cl(t,u);for(const f of h){const m=Ro(e,o[f.start],o[f.end],f.loop),p=El(l,s,m);for(const g of p)r.push({source:g,target:f,start:{[e]:Mc(u,m,"start",Math.max)},end:{[e]:Mc(u,m,"end",Math.min)}})}}return r}function Ro(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=Wt(s),o=Wt(o)),{property:n,start:s,end:o}}function rx(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:l})=>{l=Lo(r,l,s);const c=s[r],d=s[l];i!==null?(o.push({x:c.x,y:i}),o.push({x:d.x,y:i})):e!==null&&(o.push({x:e,y:c.y}),o.push({x:e,y:d.y}))}),o}function Lo(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Mc(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Vc(n,t){let e=[],i=!1;return _t(n)?(i=!0,e=n):e=rx(n,t),e.length?new ve({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ac(n){return n&&n.fill!==!1}function ax(n,t,e){let s=n[t].fill;const o=[t];let r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!kt(s))return s;if(r=n[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function lx(n,t,e){const i=hx(n);if(nt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return kt(s)&&Math.floor(s)===s?cx(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function cx(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function dx(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:nt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function ux(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:nt(n)?i=n.value:i=t.getBaseValue(),i}function hx(n){const t=n.options,e=t.fill;let i=J(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function fx(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,r=i.points,l=mx(t,e);l.push(Vc({x:null,y:t.bottom},i));for(let c=0;c<o.length;c++){const d=o[c];for(let u=d.start;u<=d.end;u++)px(s,r[u],l)}return new ve({points:s,options:{}})}function mx(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function px(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:r,last:l,point:c}=gx(o,t,"x");if(!(!c||r&&l)){if(r)i.unshift(c);else if(n.push(c),!l)break}}n.push(...i)}function gx(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],o=n.segments,r=n.points;let l=!1,c=!1;for(let d=0;d<o.length;d++){const u=o[d],h=r[u.start][e],f=r[u.end][e];if(we(s,h,f)){l=s===h,c=s===f;break}}return{first:l,last:c,point:i}}class Bc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:o,radius:r}=this;return e=e||{start:0,end:pt},t.arc(s,o,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function yx(n){const{chart:t,fill:e,line:i}=n;if(kt(e))return bx(t,e);if(e==="stack")return fx(n);if(e==="shape")return!0;const s=_x(n);return s instanceof Bc?s:Vc(s,i)}function bx(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function _x(n){return(n.scale||{}).getPointPositionForValue?kx(n):xx(n)}function xx(n){const{scale:t={},fill:e}=n,i=dx(e,t);if(kt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function kx(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,r=ux(e,t,o),l=[];if(i.grid.circular){const c=t.getPointPositionForValue(0,o);return new Bc({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(r)})}for(let c=0;c<s;++c)l.push(t.getPointPositionForValue(c,r));return l}function Io(n,t,e){const i=yx(t),{line:s,scale:o,axis:r}=t,l=s.options,c=l.fill,d=l.backgroundColor,{above:u=d,below:h=d}=c||{};i&&s.points.length&&(es(n,e),Sx(n,{line:s,target:i,above:u,below:h,area:e,scale:o,axis:r}),ns(n))}function Sx(n,t){const{line:e,target:i,above:s,below:o,area:r,scale:l}=t,c=e._loop?"angle":t.axis;n.save(),c==="x"&&o!==s&&(Fc(n,i,r.top),$c(n,{line:e,target:i,color:s,scale:l,property:c}),n.restore(),n.save(),Fc(n,i,r.bottom)),$c(n,{line:e,target:i,color:o,scale:l,property:c}),n.restore()}function Fc(n,t,e){const{segments:i,points:s}=t;let o=!0,r=!1;n.beginPath();for(const l of i){const{start:c,end:d}=l,u=s[c],h=s[Lo(c,d,s)];o?(n.moveTo(u.x,u.y),o=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),r=!!t.pathSegment(n,l,{move:r}),r?n.closePath():n.lineTo(h.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function $c(n,t){const{line:e,target:i,property:s,color:o,scale:r}=t,l=ox(e,i,s);for(const{source:c,target:d,start:u,end:h}of l){const{style:{backgroundColor:f=o}={}}=c,m=i!==!0;n.save(),n.fillStyle=f,wx(n,r,m&&Ro(s,u,h)),n.beginPath();const p=!!e.pathSegment(n,c);let g;if(m){p?n.closePath():Rc(n,i,h,s);const y=!!i.pathSegment(n,d,{move:p,reverse:!0});g=p&&y,g||Rc(n,i,u,s)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function wx(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:o,start:r,end:l}=e||{};o==="x"&&(n.beginPath(),n.rect(r,i,l-r,s-i),n.clip())}function Rc(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Lc={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let o,r,l,c;for(r=0;r<i;++r)o=n.getDatasetMeta(r),l=o.dataset,c=null,l&&l.options&&l instanceof ve&&(c={visible:n.isDatasetVisible(r),index:r,fill:lx(l,r,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:l}),o.$filler=c,s.push(c);for(r=0;r<i;++r)c=s[r],!(!c||c.fill===!1)&&(c.fill=ax(s,r,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let r=s.length-1;r>=0;--r){const l=s[r].$filler;l&&(l.line.updateControlPoints(o,l.axis),i&&l.fill&&Io(n.ctx,l,o))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Ac(o)&&Io(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Ac(i)||e.drawTime!=="beforeDatasetDraw"||Io(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ic=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Ex=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class jc extends Kt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=ft(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=vt(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Ic(i,o);let d,u;e.font=s.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(r,o,l,c)+10):(u=this.maxHeight,d=this._fitCols(r,s,l,c)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:o,maxWidth:r,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=s+l;let h=t;o.textAlign="left",o.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((p,g)=>{const y=i+e/2+o.measureText(p.text).width;(g===0||d[d.length-1]+y+2*l>r)&&(h+=u,d[d.length-(g>0?0:1)]=0,m+=u,f++),c[g]={left:0,top:m,row:f,width:y,height:s},d[d.length-1]+=y+l}),h}_fitCols(t,e,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=r-t;let h=l,f=0,m=0,p=0,g=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:_,itemHeight:w}=Cx(i,e,o,y,s);b>0&&m+w+2*l>u&&(h+=f+l,d.push({width:f,height:m}),p+=f+l,g++,f=m=0),c[b]={left:p,top:m,col:g,width:_,height:w},f=Math.max(f,_),m+=w+l}),h+=f,d.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Sn(o,this.left,this.width);if(this.isHorizontal()){let l=0,c=Pt(i,this.left+s,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,c=Pt(i,this.left+s,this.right-this.lineWidths[l])),d.top+=this.top+t+s,d.left=r.leftForLtr(r.x(c),d.width),c+=d.width+s}else{let l=0,c=Pt(i,this.top+t+s,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,c=Pt(i,this.top+t+s,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+s,d.left=r.leftForLtr(r.x(d.left),d.width),c+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;es(t,this),this._draw(),ns(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,l=gt.color,c=Sn(t.rtl,this.left,this.width),d=vt(r.font),{padding:u}=r,h=d.size,f=h/2;let m;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:p,boxHeight:g,itemHeight:y}=Ic(r,h),b=function(C,S,x){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const O=J(x.lineWidth,1);if(s.fillStyle=J(x.fillStyle,l),s.lineCap=J(x.lineCap,"butt"),s.lineDashOffset=J(x.lineDashOffset,0),s.lineJoin=J(x.lineJoin,"miter"),s.lineWidth=O,s.strokeStyle=J(x.strokeStyle,l),s.setLineDash(J(x.lineDash,[])),r.usePointStyle){const M={radius:g*Math.SQRT2/2,pointStyle:x.pointStyle,rotation:x.rotation,borderWidth:O},v=c.xPlus(C,p/2),T=S+f;ll(s,M,v,T,r.pointStyleWidth&&p)}else{const M=S+Math.max((h-g)/2,0),v=c.leftForLtr(C,p),T=en(x.borderRadius);s.beginPath(),Object.values(T).some($=>$!==0)?ai(s,{x:v,y:M,w:p,h:g,radius:T}):s.rect(v,M,p,g),s.fill(),O!==0&&s.stroke()}s.restore()},_=function(C,S,x){tn(s,x.text,C,S+y/2,d,{strikethrough:x.hidden,textAlign:c.textAlign(x.textAlign)})},w=this.isHorizontal(),E=this._computeTitleHeight();w?m={x:Pt(o,this.left+u,this.right-i[0]),y:this.top+u+E,line:0}:m={x:this.left+u,y:Pt(o,this.top+E+u,this.bottom-e[0].height),line:0},xl(this.ctx,t.textDirection);const k=y+u;this.legendItems.forEach((C,S)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const x=s.measureText(C.text).width,O=c.textAlign(C.textAlign||(C.textAlign=r.textAlign)),M=p+f+x;let v=m.x,T=m.y;c.setWidth(this.width),w?S>0&&v+M+u>this.right&&(T=m.y+=k,m.line++,v=m.x=Pt(o,this.left+u,this.right-i[m.line])):S>0&&T+k>this.bottom&&(v=m.x=v+e[m.line].width+u,m.line++,T=m.y=Pt(o,this.top+E+u,this.bottom-e[m.line].height));const $=c.x(v);if(b($,T,C),v=nb(O,v+p+f,w?v+M:this.right,t.rtl),_(c.x(v),T,C),w)m.x+=M+u;else if(typeof C.text!="string"){const U=d.lineHeight;m.y+=zc(C,U)+u}else m.y+=k}),kl(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=vt(e.font),s=Mt(e.padding);if(!e.display)return;const o=Sn(t.rtl,this.left,this.width),r=this.ctx,l=e.position,c=i.size/2,d=s.top+c;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+d,h=Pt(t.align,h,this.right-f);else{const p=this.columnSizes.reduce((g,y)=>Math.max(g,y.height),0);u=d+Pt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=Pt(l,h,h+f);r.textAlign=o.textAlign(co(l)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,tn(r,e.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,e=vt(t.font),i=Mt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(we(t,this.left,this.right)&&we(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],we(t,s.left,s.left+s.width)&&we(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Dx(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Ex(s,i);s&&!o&&ft(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&ft(e.onHover,[t,i,this],this)}else i&&ft(e.onClick,[t,i,this],this)}}function Cx(n,t,e,i,s){const o=vx(i,n,t,e),r=Ox(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function vx(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+i.measureText(s).width}function Ox(n,t,e){let i=n;return typeof t.text!="string"&&(i=zc(t,e)),i}function zc(n,t){const e=n.text?n.text.length:0;return t*e}function Dx(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Wc={id:"legend",_element:jc,start(n,t,e){const i=n.legend=new jc({ctx:n.ctx,options:e,chart:n});Tt.configure(n,i,e),Tt.addBox(n,i)},stop(n){Tt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;Tt.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(e?0:void 0),u=Mt(d.borderWidth);return{text:t[c.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:s||d.textAlign,borderRadius:r&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class jo extends Kt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=_t(i.text)?i.text.length:1;this._padding=Mt(i.padding);const o=s*vt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:r}=this,l=r.align;let c=0,d,u,h;return this.isHorizontal()?(u=Pt(l,i,o),h=e+t,d=o-i):(r.position==="left"?(u=i+t,h=Pt(l,s,e),c=mt*-.5):(u=o-t,h=Pt(l,e,s),c=mt*.5),d=s-e),{titleX:u,titleY:h,maxWidth:d,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=vt(e.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(o);tn(t,e.text,0,0,i,{color:e.color,maxWidth:c,rotation:d,textAlign:co(e.align),textBaseline:"middle",translation:[r,l]})}}function Nx(n,t){const e=new jo({ctx:n.ctx,options:t,chart:n});Tt.configure(n,e,t),Tt.addBox(n,e),n.titleBlock=e}var Hc={id:"title",_element:jo,start(n,t,e){Nx(n,e)},stop(n){const t=n.titleBlock;Tt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;Tt.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ys=new WeakMap;var Uc={id:"subtitle",start(n,t,e){const i=new jo({ctx:n.ctx,options:e,chart:n});Tt.configure(n,i,e),Tt.addBox(n,i),ys.set(n,i)},stop(n){Tt.removeBox(n,ys.get(n)),ys.delete(n)},beforeUpdate(n,t,e){const i=ys.get(n);Tt.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ei={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,o=0;for(t=0,e=n.length;t<e;++t){const l=n[t].element;if(l&&l.hasValue()){const c=l.tooltipPosition();i.add(c.x),s+=c.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((l,c)=>l+c)/i.size,y:s/o}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,l;for(o=0,r=n.length;o<r;++o){const c=n[o].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=ao(t,d);u<s&&(s=u,l=c)}}if(l){const c=l.tooltipPosition();e=c.x,i=c.y}return{x:e,y:i}}};function he(n,t){return t&&(_t(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Oe(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
175
+ */class xx{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const o=t.listeners[s],a=t.duration;o.forEach(l=>l({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(i-t.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Cl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,l=!1,c;for(;a>=0;--a)c=o[a],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(e),l=!0):(o[a]=o[o.length-1],o.pop());l&&(s.draw(),this._notify(s,i,e,"progress")),o.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=o.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var bt=new xx;const tc="transparent",_x={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Pl(n||tc),s=i.valid&&Pl(e||tc);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class nc{constructor(e,t,i,s){const o=t[i];s=bi([e.to,s,o,e.from]);const a=bi([e.from,o,s]);this._active=!0,this._fn=e.fn||_x[e.type||typeof a],this._easing=hi[e.easing]||hi.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=bi([e.to,t,s,e.from]),this._from=bi([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,o=this._from,a=this._loop,l=this._to;let c;if(this._active=o!==l&&(a||t<i),!this._active){this._target[s]=l,this._notify(!0);return}if(t<0){this._target[s]=o;return}c=t/i%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,l,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}class Io{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!le(e))return;const t=Object.keys(Se.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const o=e[s];if(!le(o))return;const a={};for(const l of t)a[l]=o[l];(Ee(o.properties)&&o.properties||[s]).forEach(l=>{(l===s||!i.has(l))&&i.set(l,a)})})}_animateOptions(e,t){const i=t.options,s=Sx(e,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&kx(e.options.$animations,i).then(()=>{e.options=i},()=>{}),o}_createAnimations(e,t){const i=this._properties,s=[],o=e.$animations||(e.$animations={}),a=Object.keys(t),l=Date.now();let c;for(c=a.length-1;c>=0;--c){const d=a[c];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(e,t));continue}const u=t[d];let f=o[d];const h=i.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){e[d]=u;continue}o[d]=f=new nc(h,e,d,u),s.push(f)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return bt.add(this._chart,i),!0}}function kx(n,e){const t=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const o=n[i[s]];o&&o.active()&&t.push(o.wait())}return Promise.all(t)}function Sx(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function ic(n,e){const t=n&&n.options||{},i=t.reverse,s=t.min===void 0?e:0,o=t.max===void 0?e:0;return{start:i?o:s,end:i?s:o}}function wx(n,e,t){if(t===!1)return!1;const i=ic(n,t),s=ic(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Ex(n){let e,t,i,s;return le(n)?(e=n.top,t=n.right,i=n.bottom,s=n.left):e=t=i=s=n,{top:e,right:t,bottom:i,left:s,disabled:n===!1}}function sc(n,e){const t=[],i=n._getSortedDatasetMetas(e);let s,o;for(s=0,o=i.length;s<o;++s)t.push(i[s].index);return t}function oc(n,e,t,i={}){const s=n.keys,o=i.mode==="single";let a,l,c,d;if(e===null)return;let u=!1;for(a=0,l=s.length;a<l;++a){if(c=+s[a],c===t){if(u=!0,i.all)continue;break}d=n.values[c],Oe(d)&&(o||e===0||yt(e)===yt(d))&&(e+=d)}return!u&&!i.all?0:e}function Cx(n,e){const{iScale:t,vScale:i}=e,s=t.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",a=Object.keys(n),l=new Array(a.length);let c,d,u;for(c=0,d=a.length;c<d;++c)u=a[c],l[c]={[s]:u,[o]:n[u]};return l}function Lo(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function vx(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function Dx(n){const{min:e,max:t,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY}}function Ox(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function rc(n,e,t,i){for(const s of e.getMatchingVisibleMetas(i).reverse()){const o=n[s.index];if(t&&o>0||!t&&o<0)return s.index}return null}function ac(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:o,vScale:a,index:l}=i,c=o.axis,d=a.axis,u=vx(o,a,i),f=e.length;let h;for(let m=0;m<f;++m){const p=e[m],{[c]:g,[d]:y}=p,b=p._stacks||(p._stacks={});h=b[d]=Ox(s,u,g),h[l]=y,h._top=rc(h,a,!0,i.type),h._bottom=rc(h,a,!1,i.type);const x=h._visualValues||(h._visualValues={});x[l]=y}}function Ro(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function Nx(n,e){return Qt(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Tx(n,e,t){return Qt(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function xi(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const o=s._stacks;if(!o||o[i]===void 0||o[i][t]===void 0)return;delete o[i][t],o[i]._visualValues!==void 0&&o[i]._visualValues[t]!==void 0&&delete o[i]._visualValues[t]}}}const jo=n=>n==="reset"||n==="none",lc=(n,e)=>e?n:Object.assign({},n),Px=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:sc(t,!0),values:null};class nt{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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=Lo(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&&xi(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,o=t.xAxisID=oe(i.xAxisID,Ro(e,"x")),a=t.yAxisID=oe(i.yAxisID,Ro(e,"y")),l=t.rAxisID=oe(i.rAxisID,Ro(e,"r")),c=t.indexAxis,d=t.iAxisID=s(c,o,a,l),u=t.vAxisID=s(c,a,o,l);t.xScale=this.getScaleForId(o),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(l),t.iScale=this.getScaleForId(d),t.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 t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&wl(this._data,this),e._stacked&&xi(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(le(t)){const s=this._cachedMeta;this._data=Cx(t,s)}else if(i!==t){if(i){wl(i,this);const s=this._cachedMeta;xi(s),s._parsed=[]}t&&Object.isExtensible(t)&&y0(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=t._stacked;t._stacked=Lo(t.vScale,t),t.stack!==i.stack&&(s=!0,xi(t),t.stack=i.stack),this._resyncElements(e),(s||o!==t._stacked)&&(ac(this,t._parsed),t._stacked=Lo(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:a}=i,l=o.axis;let c=e===0&&t===s.length?!0:i._sorted,d=e>0&&i._parsed[e-1],u,f,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Ee(s[e])?h=this.parseArrayData(i,s,e,t):le(s[e])?h=this.parseObjectData(i,s,e,t):h=this.parsePrimitiveData(i,s,e,t);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<t;++u)i._parsed[u+e]=f=h[u],c&&(m()&&(c=!1),d=f);i._sorted=c}a&&ac(this,h)}parsePrimitiveData(e,t,i,s){const{iScale:o,vScale:a}=e,l=o.axis,c=a.axis,d=o.getLabels(),u=o===a,f=new Array(s);let h,m,p;for(h=0,m=s;h<m;++h)p=h+i,f[h]={[l]:u||o.parse(d[p],p),[c]:a.parse(t[p],p)};return f}parseArrayData(e,t,i,s){const{xScale:o,yScale:a}=e,l=new Array(s);let c,d,u,f;for(c=0,d=s;c<d;++c)u=c+i,f=t[u],l[c]={x:o.parse(f[0],u),y:a.parse(f[1],u)};return l}parseObjectData(e,t,i,s){const{xScale:o,yScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(s);let u,f,h,m;for(u=0,f=s;u<f;++u)h=u+i,m=t[h],d[u]={x:o.parse(Kt(m,l),h),y:a.parse(Kt(m,c),h)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const s=this.chart,o=this._cachedMeta,a=t[e.axis],l={keys:sc(s,!0),values:t._stacks[e.axis]._visualValues};return oc(l,a,o.index,{mode:i})}updateRangeFromParsed(e,t,i,s){const o=i[t.axis];let a=o===null?NaN:o;const l=s&&i._stacks[t.axis];s&&l&&(s.values=l,a=oc(s,o,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&e===i.iScale,a=s.length,l=this._getOtherScale(e),c=Px(t,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Dx(l);let h,m;function p(){m=s[h];const g=m[l.axis];return!Oe(m[e.axis])||u>g||f<g}for(h=0;h<a&&!(!p()&&(this.updateRangeFromParsed(d,e,m,c),o));++h);if(o){for(h=a-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(d,e,m,c);break}}return d}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=t.length;s<o;++s)a=t[s][e.axis],Oe(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,s=t.vScale,o=this.getParsed(e);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=Ex(oe(this.options.clip,wx(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,s=i.data||[],o=t.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||s.length-l,d=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(e,o,l,c),u=l;u<l+c;++u){const f=s[u];f.hidden||(f.active&&d?a.push(f):f.draw(e,o))}for(u=0;u<a.length;++u)a[u].draw(e,o)}getStyle(e,t){const i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const s=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const a=this._cachedMeta.data[e];o=a.$context||(a.$context=Tx(this.getContext(),e,a)),o.parsed=this.getParsed(e),o.raw=s.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=Nx(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!t,o.mode=i,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const s=t==="active",o=this._cachedDataOpts,a=e+"-"+t,l=o[a],c=this.enableOptionSharing&&di(i);if(l)return lc(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),f=s?[`${e}Hover`,"hover",e,""]:[e,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(Se.elements[e]),p=()=>this.getContext(i,s,t),g=d.resolveNamedOptions(h,m,p,f);return g.$shared&&(g.$shared=c,o[a]=Object.freeze(lc(g,c))),g}_resolveAnimations(e,t,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${t}`,l=o[a];if(l)return l;let c;if(s.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,t),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(e,i,t))}const d=new Io(s,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||jo(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(t,o)||o!==s;return this.updateSharedOptions(o,t,i),{sharedOptions:o,includeOptions:a}}updateElement(e,t,i,s){jo(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!jo(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const o=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"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 t=this._data,i=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const s=i.length,o=t.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,e):o<s&&this._removeElements(o,s-o)}_insertElements(e,t,i=!0){const s=this._cachedMeta,o=s.data,a=e+t;let l;const c=d=>{for(d.length+=t,l=d.length-1;l>=a;l--)d[l]=d[l-t]};for(c(o),l=e;l<a;++l)o[l]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(e,t),i&&this.updateElements(o,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,t);i._stacked&&xi(i,s)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,s]=e;this[t](i,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}j(nt,"defaults",{}),j(nt,"datasetElementType",null),j(nt,"dataElementType",null);function Bx(n,e){if(!n._cache.$bar){const t=n.getMatchingVisibleMetas(e);let i=[];for(let s=0,o=t.length;s<o;s++)i=i.concat(t[s].controller.getAllParsedValues(n));n._cache.$bar=El(i.sort((s,o)=>s-o))}return n._cache.$bar}function Mx(n){const e=n.iScale,t=Bx(e,n.type);let i=e._length,s,o,a,l;const c=()=>{a===32767||a===-32768||(di(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(s=0,o=t.length;s<o;++s)a=e.getPixelForValue(t[s]),c();for(l=void 0,s=0,o=e.ticks.length;s<o;++s)a=e.getPixelForTick(s),c();return i}function Vx(n,e,t,i){const s=t.barThickness;let o,a;return ce(s)?(o=e.min*t.categoryPercentage,a=t.barPercentage):(o=s*i,a=1),{chunk:o/i,ratio:a,start:e.pixels[n]-o/2}}function Ax(n,e,t,i){const s=e.pixels,o=s[n];let a=n>0?s[n-1]:null,l=n<s.length-1?s[n+1]:null;const c=t.categoryPercentage;a===null&&(a=o-(l===null?e.end-e.start:l-o)),l===null&&(l=o+o-a);const d=o-(o-Math.min(a,l))/2*c;return{chunk:Math.abs(l-a)/2*c/i,ratio:t.barPercentage,start:d}}function Fx(n,e,t,i){const s=t.parse(n[0],i),o=t.parse(n[1],i),a=Math.min(s,o),l=Math.max(s,o);let c=a,d=l;Math.abs(a)>Math.abs(l)&&(c=l,d=a),e[t.axis]=d,e._custom={barStart:c,barEnd:d,start:s,end:o,min:a,max:l}}function cc(n,e,t,i){return Ee(n)?Fx(n,e,t,i):e[t.axis]=t.parse(n,i),e}function dc(n,e,t,i){const s=n.iScale,o=n.vScale,a=s.getLabels(),l=s===o,c=[];let d,u,f,h;for(d=t,u=t+i;d<u;++d)h=e[d],f={},f[s.axis]=l||s.parse(a[d],d),c.push(cc(h,f,o,d));return c}function zo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function $x(n,e,t){return n!==0?yt(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Ix(n){let e,t,i,s,o;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.base<n.y,t="bottom",i="top"),e?(s="end",o="start"):(s="start",o="end"),{start:t,end:i,reverse:e,top:s,bottom:o}}function Lx(n,e,t,i){let s=e.borderSkipped;const o={};if(!s){n.borderSkipped=o;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:c,top:d,bottom:u}=Ix(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=d:(t._bottom||0)===i?s=u:(o[uc(u,a,l,c)]=!0,s=d)),o[uc(s,a,l,c)]=!0,n.borderSkipped=o}function uc(n,e,t,i){return i?(n=Rx(n,e,t),n=fc(n,t,e)):n=fc(n,e,t),n}function Rx(n,e,t){return n===e?t:n===t?e:n}function fc(n,e,t){return n==="start"?e:n==="end"?t:n}function jx(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class _i extends nt{parsePrimitiveData(e,t,i,s){return dc(e,t,i,s)}parseArrayData(e,t,i,s){return dc(e,t,i,s)}parseObjectData(e,t,i,s){const{iScale:o,vScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=o.axis==="x"?l:c,u=a.axis==="x"?l:c,f=[];let h,m,p,g;for(h=i,m=i+s;h<m;++h)g=t[h],p={},p[o.axis]=o.parse(Kt(g,d),h),f.push(cc(Kt(g,u),p,a,h));return f}updateRangeFromParsed(e,t,i,s){super.updateRangeFromParsed(e,t,i,s);const o=i._custom;o&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:s}=t,o=this.getParsed(e),a=o._custom,l=zo(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(t,s);for(let m=t;m<t+i;m++){const p=this.getParsed(m),g=o||ce(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,u),b=(p._stacks||{})[l.axis],x={horizontal:d,base:g.base,enableBorderRadius:!b||zo(p._custom)||a===b._top||a===b._bottom,x:d?g.head:y.center,y:d?y.center:g.head,height:d?y.size:Math.abs(g.size),width:d?Math.abs(g.size):y.size};h&&(x.options=f||this.resolveDataElementOptions(m,e[m].active?"active":s));const E=x.options||e[m].options;Lx(x,E,b,a),jx(x,E,u.ratio),this.updateElement(e[m],m,x,s)}}_getStacks(e,t){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(t),c=l&&l[i.axis],d=u=>{const f=u._parsed.find(m=>m[i.axis]===c),h=f&&f[u.vScale.axis];if(ce(h)||isNaN(h))return!0};for(const u of s)if(!(t!==void 0&&d(u))&&((o===!1||a.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),o=t!==void 0?s.indexOf(t):-1;return o===-1?s.length-1:o}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let o,a;for(o=0,a=t.data.length;o<a;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const l=e.barThickness;return{min:l||Mx(t),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,l=o||0,c=this.getParsed(e),d=c._custom,u=zo(d);let f=c[t.axis],h=0,m=i?this.applyStack(t,c,i):f,p,g;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&yt(f)!==yt(d.barEnd)&&(h=0),h+=f);const y=!ce(o)&&!u?o:h;let b=t.getPixelForValue(y);if(this.chart.getDataVisibility(e)?p=t.getPixelForValue(h+m):p=b,g=p-b,Math.abs(g)<a){g=$x(g,t,l)*a,f===l&&(b-=g/2);const x=t.getPixelForDecimal(0),E=t.getPixelForDecimal(1),C=Math.min(x,E),k=Math.max(x,E);b=Math.max(Math.min(b,k),C),p=b+g,i&&!u&&(c._stacks[t.axis]._visualValues[s]=t.getValueForPixel(p)-t.getValueForPixel(b))}if(b===t.getPixelForValue(l)){const x=yt(g)*t.getLineWidthForValue(l)/2;b+=x,g-=x}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,o=s.skipNull,a=oe(s.maxBarThickness,1/0);let l,c;if(t.grouped){const d=o?this._getStackCount(e):t.stackCount,u=s.barThickness==="flex"?Ax(e,t,s,d):Vx(e,t,s,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);l=u.start+u.chunk*f+u.chunk/2,c=Math.min(a,u.chunk*u.ratio)}else l=i.getPixelForValue(this.getParsed(e)[i.axis],e),c=Math.min(a,t.min*t.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[t.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}j(_i,"id","bar"),j(_i,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),j(_i,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ki extends nt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,i,s){const o=super.parsePrimitiveData(e,t,i,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+i).radius;return o}parseArrayData(e,t,i,s){const o=super.parseArrayData(e,t,i,s);for(let a=0;a<o.length;a++){const l=t[i+a];o[a]._custom=oe(l[2],this.resolveDataElementOptions(a+i).radius)}return o}parseObjectData(e,t,i,s){const o=super.parseObjectData(e,t,i,s);for(let a=0;a<o.length;a++){const l=t[i+a];o[a]._custom=oe(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=t,a=this.getParsed(e),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y),d=a._custom;return{label:i[e]||"",value:"("+l+", "+c+(d?", "+d:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const o=s==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,s),u=a.axis,f=l.axis;for(let h=t;h<t+i;h++){const m=e[h],p=!o&&this.getParsed(h),g={},y=g[u]=o?a.getPixelForDecimal(.5):a.getPixelForValue(p[u]),b=g[f]=o?l.getBasePixel():l.getPixelForValue(p[f]);g.skip=isNaN(y)||isNaN(b),d&&(g.options=c||this.resolveDataElementOptions(h,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,h,g,s)}}resolveDataElementOptions(e,t){const i=this.getParsed(e);let s=super.resolveDataElementOptions(e,t);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return t!=="active"&&(s.radius=0),s.radius+=oe(i&&i._custom,o),s}}j(ki,"id","bubble"),j(ki,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),j(ki,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function zx(n,e,t){let i=1,s=1,o=0,a=0;if(e<ke){const l=n,c=l+e,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(E,C,k)=>fi(E,l,c,!0)?1:Math.max(C,C*t,k,k*t),p=(E,C,k)=>fi(E,l,c,!0)?-1:Math.min(C,C*t,k,k*t),g=m(0,d,f),y=m(Te,u,h),b=p(_e,d,f),x=p(_e+Te,u,h);i=(g-b)/2,s=(y-x)/2,o=-(g+b)/2,a=-(y+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class Jt extends nt{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=c=>+i[c];if(le(i[e])){const{key:c="value"}=this._parsing;o=d=>+Kt(i[d],c)}let a,l;for(a=e,l=e+t;a<l;++a)s._parsed[a]=o(a)}}_getRotation(){return dt(this.options.rotation-90)}_getCircumference(){return dt(this.options.circumference)}_getRotationExtents(){let e=ke,t=-ke;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),a=s._getCircumference();e=Math.min(e,o),t=Math.max(t,o+a)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:i}=t,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-a)/2,0),c=Math.min(i0(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=zx(f,u,c),y=(i.width-a)/h,b=(i.height-a)/m,x=Math.max(Math.min(y,b)/2,0),E=hl(this.options.radius,x),C=Math.max(E*c,0),k=(E-C)/this._getVisibleDatasetWeightTotal();this.offsetX=p*E,this.offsetY=g*E,s.total=this.calculateTotal(),this.outerRadius=E-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*d,0),this.updateElements(o,0,o.length,e)}_circumference(e,t){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*o/ke)}updateElements(e,t,i,s){const o=s==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,h=o&&d.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:y}=this._getSharedOptions(t,s);let b=this._getRotation(),x;for(x=0;x<t;++x)b+=this._circumference(x,o);for(x=t;x<t+i;++x){const E=this._circumference(x,o),C=e[x],k={x:u+this.offsetX,y:f+this.offsetY,startAngle:b,endAngle:b+E,circumference:E,outerRadius:p,innerRadius:m};y&&(k.options=g||this.resolveDataElementOptions(x,C.active?"active":s)),b+=E,this.updateElement(C,x,k,s)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let i=0,s;for(s=0;s<t.length;s++){const o=e._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!t[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?ke*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=mi(t._parsed[e],i.options.locale);return{label:s[e]||"",value:o}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,o,a,l,c;if(!e){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),e=a.data,l=a.controller;break}}if(!e)return 0;for(s=0,o=e.length;s<o;++s)c=l.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(t=Math.max(t,c.borderWidth||0,c.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,s=e.length;i<s;++i){const o=this.resolveDataElementOptions(i);t=Math.max(t,o.offset||0,o.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(t+=this._getRingWeight(i));return t}_getRingWeight(e){return Math.max(oe(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}j(Jt,"id","doughnut"),j(Jt,"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"}),j(Jt,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),j(Jt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return t.labels.map((o,a)=>{const c=e.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,t,i){i.chart.toggleDataVisibility(t.index),i.chart.update()}}}});class Si extends nt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=t,a=this.chart._animationsDisabled;let{start:l,count:c}=Dl(t,s,a);this._drawStart=l,this._drawCount=c,Ol(t)&&(l=0,c=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},e),this.updateElements(s,l,c,e)}updateElements(e,t,i,s){const o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(t,s),h=a.axis,m=l.axis,{spanGaps:p,segment:g}=this.options,y=Tn(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",x=t+i,E=e.length;let C=t>0&&this.getParsed(t-1);for(let k=0;k<E;++k){const v=e[k],S=b?v:{};if(k<t||k>=x){S.skip=!0;continue}const _=this.getParsed(k),D=ce(_[m]),B=S[h]=a.getPixelForValue(_[h],k),w=S[m]=o||D?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,_,c):_[m],k);S.skip=isNaN(B)||isNaN(w)||D,S.stop=k>0&&Math.abs(_[h]-C[h])>y,g&&(S.parsed=_,S.raw=d.data[k]),f&&(S.options=u||this.resolveDataElementOptions(k,v.active?"active":s)),b||this.updateElement(v,k,S,s),C=_}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,a)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}j(Si,"id","line"),j(Si,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),j(Si,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Vn extends nt{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=mi(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:o}}parseObjectData(e,t,i,s){return Wl.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<t.min&&(t.min=o),o>t.max&&(t.max=o))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),o=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),l=(o-a)/e.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(e,t,i,s){const o=s==="reset",a=this.chart,c=a.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,f=d.yCenter,h=d.getIndexAngle(0)-.5*_e;let m=h,p;const g=360/this.countVisibleElements();for(p=0;p<t;++p)m+=this._computeAngle(p,s,g);for(p=t;p<t+i;p++){const y=e[p];let b=m,x=m+this._computeAngle(p,s,g),E=a.getDataVisibility(p)?d.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=x,o&&(c.animateScale&&(E=0),c.animateRotate&&(b=x=h));const C={x:u,y:f,innerRadius:0,outerRadius:E,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,C,s)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?dt(this.resolveDataElementOptions(e,t).angle||i):0}}j(Vn,"id","polarArea"),j(Vn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),j(Vn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return t.labels.map((o,a)=>{const c=e.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,t,i){i.chart.toggleDataVisibility(t.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ks extends Jt{}j(ks,"id","pie"),j(ks,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class wi extends nt{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return Wl.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],o=t.iScale.getLabels();if(i.points=s,e!=="resize"){const a=this.resolveDatasetElementOptions(e);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(i,void 0,l,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let l=t;l<t+i;l++){const c=e[l],d=this.resolveDataElementOptions(l,c.active?"active":s),u=o.getPointPositionForValue(l,this.getParsed(l).r),f=a?o.xCenter:u.x,h=a?o.yCenter:u.y,m={x:f,y:h,angle:u.angle,skip:isNaN(f)||isNaN(h),options:d};this.updateElement(c,l,m,s)}}}j(wi,"id","radar"),j(wi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),j(wi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Ei extends nt{getLabelAndValue(e){const t=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=t,a=this.getParsed(e),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y);return{label:i[e]||"",value:"("+l+", "+c+")"}}update(e){const t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled;let{start:o,count:a}=Dl(t,i,s);if(this._drawStart=o,this._drawCount=a,Ol(t)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:c}=t;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=i;const d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!s,options:d},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(i,o,a,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,t,i,s){const o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(t,s),f=this.getSharedOptions(u),h=this.includeOptions(s,f),m=a.axis,p=l.axis,{spanGaps:g,segment:y}=this.options,b=Tn(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let E=t>0&&this.getParsed(t-1);for(let C=t;C<t+i;++C){const k=e[C],v=this.getParsed(C),S=x?k:{},_=ce(v[p]),D=S[m]=a.getPixelForValue(v[m],C),B=S[p]=o||_?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,v,c):v[p],C);S.skip=isNaN(D)||isNaN(B)||_,S.stop=C>0&&Math.abs(v[m]-E[m])>b,y&&(S.parsed=v,S.raw=d.data[C]),h&&(S.options=f||this.resolveDataElementOptions(C,k.active?"active":s)),x||this.updateElement(k,C,S,s),E=v}this.updateSharedOptions(f,s,u)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let l=0;for(let c=t.length-1;c>=0;--c)l=Math.max(l,t[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const o=t[0].size(this.resolveDataElementOptions(0)),a=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,o,a)/2}}j(Ei,"id","scatter"),j(Ei,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),j(Ei,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var hc=Object.freeze({__proto__:null,BarController:_i,BubbleController:ki,DoughnutController:Jt,LineController:Si,PieController:ks,PolarAreaController:Vn,RadarController:wi,ScatterController:Ei});function bn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Wo{constructor(e){j(this,"options");this.options=e||{}}static override(e){Object.assign(Wo.prototype,e)}init(){}formats(){return bn()}parse(){return bn()}format(){return bn()}add(){return bn()}diff(){return bn()}startOf(){return bn()}endOf(){return bn()}}var mc={_date:Wo};function Wx(n,e,t,i){const{controller:s,data:o,_sorted:a}=n,l=s._cachedMeta.iScale;if(l&&e===l.axis&&e!=="r"&&a&&o.length){const c=l._reversePixels?p0:Mt;if(i){if(s._sharedOptions){const d=o[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){const f=c(o,e,t-u),h=c(o,e,t+u);return{lo:f.lo,hi:h.hi}}}}else return c(o,e,t)}return{lo:0,hi:o.length-1}}function Ci(n,e,t,i,s){const o=n.getSortedVisibleDatasetMetas(),a=t[e];for(let l=0,c=o.length;l<c;++l){const{index:d,data:u}=o[l],{lo:f,hi:h}=Wx(o[l],e,a,s);for(let m=f;m<=h;++m){const p=u[m];p.skip||i(p,d,m)}}}function Hx(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,s){const o=e?Math.abs(i.x-s.x):0,a=t?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Ho(n,e,t,i,s){const o=[];return!s&&!n.isPointInArea(e)||Ci(n,t,e,function(l,c,d){!s&&!Vt(l,n.chartArea,0)||l.inRange(e.x,e.y,i)&&o.push({element:l,datasetIndex:c,index:d})},!0),o}function Ux(n,e,t,i){let s=[];function o(a,l,c){const{startAngle:d,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:f}=kl(a,{x:e.x,y:e.y});fi(f,d,u)&&s.push({element:a,datasetIndex:l,index:c})}return Ci(n,t,e,o),s}function qx(n,e,t,i,s,o){let a=[];const l=Hx(t);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(e.x,e.y,s);if(i&&!m)return;const p=u.getCenterPoint(s);if(!(!!o||n.isPointInArea(p))&&!m)return;const y=l(e,p);y<c?(a=[{element:u,datasetIndex:f,index:h}],c=y):y===c&&a.push({element:u,datasetIndex:f,index:h})}return Ci(n,t,e,d),a}function Uo(n,e,t,i,s,o){return!o&&!n.isPointInArea(e)?[]:t==="r"&&!i?Ux(n,e,t,s):qx(n,e,t,i,s,o)}function pc(n,e,t,i,s){const o=[],a=t==="x"?"inXRange":"inYRange";let l=!1;return Ci(n,t,e,(c,d,u)=>{c[a]&&c[a](e[t],s)&&(o.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(e.x,e.y,s))}),i&&!l?[]:o}var gc={evaluateInteractionItems:Ci,modes:{index(n,e,t,i){const s=gn(e,n),o=t.axis||"x",a=t.includeInvisible||!1,l=t.intersect?Ho(n,s,o,i,a):Uo(n,s,o,!1,i,a),c=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(n,e,t,i){const s=gn(e,n),o=t.axis||"xy",a=t.includeInvisible||!1;let l=t.intersect?Ho(n,s,o,i,a):Uo(n,s,o,!1,i,a);if(l.length>0){const c=l[0].datasetIndex,d=n.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(n,e,t,i){const s=gn(e,n),o=t.axis||"xy",a=t.includeInvisible||!1;return Ho(n,s,o,i,a)},nearest(n,e,t,i){const s=gn(e,n),o=t.axis||"xy",a=t.includeInvisible||!1;return Uo(n,s,o,t.intersect,i,a)},x(n,e,t,i){const s=gn(e,n);return pc(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=gn(e,n);return pc(n,s,"y",t.intersect,i)}}};const yc=["left","top","right","bottom"];function vi(n,e){return n.filter(t=>t.pos===e)}function bc(n,e){return n.filter(t=>yc.indexOf(t.pos)===-1&&t.box.axis===e)}function Di(n,e){return n.sort((t,i)=>{const s=e?i:t,o=e?t:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Yx(n){const e=[];let t,i,s,o,a,l;for(t=0,i=(n||[]).length;t<i;++t)s=n[t],{position:o,options:{stack:a,stackWeight:l=1}}=s,e.push({index:t,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:l});return e}function Kx(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:o}=t;if(!i||!yc.includes(s))continue;const a=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return e}function Xx(n,e){const t=Kx(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=e;let o,a,l;for(o=0,a=n.length;o<a;++o){l=n[o];const{fullSize:c}=l.box,d=t[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*i:c&&e.availableWidth,l.height=s):(l.width=i,l.height=u?u*s:c&&e.availableHeight)}return t}function Gx(n){const e=Yx(n),t=Di(e.filter(d=>d.box.fullSize),!0),i=Di(vi(e,"left"),!0),s=Di(vi(e,"right")),o=Di(vi(e,"top"),!0),a=Di(vi(e,"bottom")),l=bc(e,"x"),c=bc(e,"y");return{fullSize:t,leftAndTop:i.concat(o),rightAndBottom:s.concat(c).concat(a).concat(l),chartArea:vi(e,"chartArea"),vertical:i.concat(s).concat(c),horizontal:o.concat(a).concat(l)}}function xc(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function _c(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function Qx(n,e,t,i){const{pos:s,box:o}=t,a=n.maxPadding;if(!le(s)){t.size&&(n[s]-=t.size);const f=i[t.stack]||{size:0,count:1};f.size=Math.max(f.size,t.horizontal?o.height:o.width),t.size=f.size/f.count,n[s]+=t.size}o.getPadding&&_c(a,o.getPadding());const l=Math.max(0,e.outerWidth-xc(a,n,"left","right")),c=Math.max(0,e.outerHeight-xc(a,n,"top","bottom")),d=l!==n.w,u=c!==n.h;return n.w=l,n.h=c,t.horizontal?{same:d,other:u}:{same:u,other:d}}function Jx(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function Zx(n,e){const t=e.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(e[a],t[a])}),o}return i(n?["left","right"]:["top","bottom"])}function Oi(n,e,t,i){const s=[];let o,a,l,c,d,u;for(o=0,a=n.length,d=0;o<a;++o){l=n[o],c=l.box,c.update(l.width||e.w,l.height||e.h,Zx(l.horizontal,e));const{same:f,other:h}=Qx(e,t,l,i);d|=f&&s.length,u=u||h,c.fullSize||s.push(l)}return d&&Oi(s,e,t,i)||u}function Ss(n,e,t,i,s){n.top=t,n.left=e,n.right=e+i,n.bottom=t+s,n.width=i,n.height=s}function kc(n,e,t,i){const s=t.padding;let{x:o,y:a}=e;for(const l of n){const c=l.box,d=i[l.stack]||{count:1,placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=e.w*u,h=d.size||c.height;di(d.start)&&(a=d.start),c.fullSize?Ss(c,s.left,a,t.outerWidth-s.right-s.left,h):Ss(c,e.left+d.placed,a,f,h),d.start=a,d.placed+=f,a=c.bottom}else{const f=e.h*u,h=d.size||c.width;di(d.start)&&(o=d.start),c.fullSize?Ss(c,o,s.top,h,t.outerHeight-s.bottom-s.top):Ss(c,o,e.top+d.placed,h,f),d.start=o,d.placed+=f,o=c.right}}e.x=o,e.y=a}var Ie={addBox(n,e){n.boxes||(n.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(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){const t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,i){if(!n)return;const s=je(n.options.layout.padding),o=Math.max(e-s.width,0),a=Math.max(t-s.height,0),l=Gx(n.boxes),c=l.vertical,d=l.horizontal;ge(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=c.reduce((g,y)=>y.box.options&&y.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},s);_c(h,je(i));const m=Object.assign({maxPadding:h,w:o,h:a,x:s.left,y:s.top},s),p=Xx(c.concat(d),f);Oi(l.fullSize,m,f,p),Oi(c,m,f,p),Oi(d,m,f,p)&&Oi(c,m,f,p),Jx(m),kc(l.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,kc(l.rightAndBottom,m,f,p),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},ge(l.chartArea,g=>{const y=g.box;Object.assign(y,n.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class qo{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Sc extends qo{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ws="$chartjs",e_={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},wc=n=>n===null||n==="";function t_(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ws]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",wc(s)){const o=ql(n,"width");o!==void 0&&(n.width=o)}if(wc(i))if(n.style.height==="")n.height=n.width/(e||2);else{const o=ql(n,"height");o!==void 0&&(n.height=o)}return n}const Ec=lx?{passive:!0}:!1;function n_(n,e,t){n&&n.addEventListener(e,t,Ec)}function i_(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Ec)}function s_(n,e){const t=e_[n.type]||n.type,{x:i,y:s}=gn(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Es(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function o_(n,e,t){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||Es(l.addedNodes,i),a=a&&!Es(l.removedNodes,i);a&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function r_(n,e,t){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||Es(l.removedNodes,i),a=a&&!Es(l.addedNodes,i);a&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ni=new Map;let Cc=0;function vc(){const n=window.devicePixelRatio;n!==Cc&&(Cc=n,Ni.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function a_(n,e){Ni.size||window.addEventListener("resize",vc),Ni.set(n,e)}function l_(n){Ni.delete(n),Ni.size||window.removeEventListener("resize",vc)}function c_(n,e,t){const i=n.canvas,s=i&&$o(i);if(!s)return;const o=vl((l,c)=>{const d=s.clientWidth;t(l,c),d<s.clientWidth&&t()},window),a=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||o(d,u)});return a.observe(s),a_(n,o),a}function Yo(n,e,t){t&&t.disconnect(),e==="resize"&&l_(n)}function d_(n,e,t){const i=n.canvas,s=vl(o=>{n.ctx!==null&&t(s_(o,n))},n);return n_(i,e,s),s}class Dc extends qo{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(t_(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[ws])return!1;const i=t[ws].initial;["height","width"].forEach(o=>{const a=i[o];ce(a)?t.removeAttribute(o):t.setAttribute(o,a)});const s=i.style||{};return Object.keys(s).forEach(o=>{t.style[o]=s[o]}),t.width=t.width,delete t[ws],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),a={attach:o_,detach:r_,resize:c_}[t]||d_;s[t]=a(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:Yo,detach:Yo,resize:Yo}[t]||i_)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return ax(e,t,i,s)}isAttached(e){const t=e&&$o(e);return!!(t&&t.isConnected)}}function Oc(n){return!Fo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Sc:Dc}let xt=(Rs=class{constructor(){j(this,"x");j(this,"y");j(this,"active",!1);j(this,"options");j(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Tn(this.x)&&Tn(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const s={};return e.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}},j(Rs,"defaults",{}),j(Rs,"defaultRoutes"),Rs);function u_(n,e){const t=n.options.ticks,i=f_(n),s=Math.min(t.maxTicksLimit||i,i),o=t.major.enabled?m_(e):[],a=o.length,l=o[0],c=o[a-1],d=[];if(a>s)return p_(e,d,o,a/s),d;const u=h_(o,e,s);if(a>0){let f,h;const m=a>1?Math.round((c-l)/(a-1)):null;for(Cs(e,d,u,ce(m)?0:l-m,l),f=0,h=a-1;f<h;f++)Cs(e,d,u,o[f],o[f+1]);return Cs(e,d,u,c,ce(m)?e.length:c+m),d}return Cs(e,d,u),d}function f_(n){const e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),s=n._maxLength/t;return Math.floor(Math.min(i,s))}function h_(n,e,t){const i=g_(n),s=e.length/t;if(!i)return Math.max(s,1);const o=u0(i);for(let a=0,l=o.length-1;a<l;a++){const c=o[a];if(c>s)return c}return Math.max(s,1)}function m_(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function p_(n,e,t,i){let s=0,o=t[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===o&&(e.push(n[a]),s++,o=t[s*i])}function Cs(n,e,t,i,s){const o=oe(i,0),a=Math.min(oe(s,n.length),n.length);let l=0,c,d,u;for(t=Math.ceil(t),s&&(c=s-i,t=c/Math.floor(c/t)),u=o;u<0;)l++,u=Math.round(o+l*t);for(d=Math.max(o,0);d<a;d++)d===u&&(e.push(n[d]),l++,u=Math.round(o+l*t))}function g_(n){const e=n.length;let t,i;if(e<2)return!1;for(i=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==i)return!1;return i}const y_=n=>n==="left"?"right":n==="right"?"left":n,Nc=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Tc=(n,e)=>Math.min(e||n,n);function Pc(n,e){const t=[],i=n.length/e,s=n.length;let o=0;for(;o<s;o+=i)t.push(n[Math.floor(o)]);return t}function b_(n,e,t){const i=n.ticks.length,s=Math.min(e,i-1),o=n._startPixel,a=n._endPixel,l=1e-6;let c=n.getPixelForTick(s),d;if(!(t&&(i===1?d=Math.max(c-o,a-c):e===0?d=(n.getPixelForTick(1)-c)/2:d=(c-n.getPixelForTick(s-1))/2,c+=s<e?d:-d,c<o-l||c>a+l)))return c}function x_(n,e){ge(n,t=>{const i=t.gc,s=i.length/2;let o;if(s>e){for(o=0;o<s;++o)delete t.data[i[o]];i.splice(0,s)}})}function Ti(n){return n.drawTicks?n.tickLength:0}function Bc(n,e){if(!n.display)return 0;const t=Ve(n.font,e),i=je(n.padding);return(Ee(n.text)?n.text.length:1)*t.lineHeight+i.height}function __(n,e){return Qt(n,{scale:e,type:"scale"})}function k_(n,e,t){return Qt(n,{tick:t,index:e,type:"tick"})}function S_(n,e,t){let i=vo(n);return(t&&e!=="right"||!t&&e==="right")&&(i=y_(i)),i}function w_(n,e,t,i){const{top:s,left:o,bottom:a,right:l,chart:c}=n,{chartArea:d,scales:u}=c;let f=0,h,m,p;const g=a-s,y=l-o;if(n.isHorizontal()){if(m=Re(i,o,l),le(t)){const b=Object.keys(t)[0],x=t[b];p=u[b].getPixelForValue(x)+g-e}else t==="center"?p=(d.bottom+d.top)/2+g-e:p=Nc(n,t,e);h=l-o}else{if(le(t)){const b=Object.keys(t)[0],x=t[b];m=u[b].getPixelForValue(x)-y+e}else t==="center"?m=(d.left+d.right)/2-y+e:m=Nc(n,t,e);p=Re(i,a,s),f=t==="left"?-Te:Te}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class Zt extends xt{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,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:s}=this;return e=Xe(e,Number.POSITIVE_INFINITY),t=Xe(t,Number.NEGATIVE_INFINITY),i=Xe(i,Number.POSITIVE_INFINITY),s=Xe(s,Number.NEGATIVE_INFINITY),{min:Xe(e,i),max:Xe(t,s),minDefined:Oe(e),maxDefined:Oe(t)}}getMinMax(e){let{min:t,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:t,max:i};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)a=l[c].controller.getMinMax(this,e),s||(t=Math.min(t,a.min)),o||(i=Math.max(i,a.max));return t=o&&t>i?i:t,i=s&&t>i?t:i,{min:Xe(t,Xe(i,t)),max:Xe(i,Xe(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const 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(){xe(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=L0(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?Pc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=u_(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,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){xe(this.options.afterUpdate,[this])}beforeSetDimensions(){xe(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(){xe(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),xe(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){xe(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i],o.label=xe(t.callback,[o.value,i,e],this)}afterTickToLabelConversion(){xe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){xe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=Tc(this.ticks.length,e.ticks.maxTicksLimit),s=t.minRotation||0,o=t.maxRotation;let a=s,l,c,d;if(!this._isVisible()||!t.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=Fe(this.chart.width-f,0,this.maxWidth);l=e.offset?this.maxWidth/i:m/(i-1),f+6>l&&(l=m/(i-(e.offset?.5:1)),c=this.maxHeight-Ti(e.grid)-t.padding-Bc(e.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),a=wo(Math.min(Math.asin(Fe((u.highest.height+6)/l,-1,1)),Math.asin(Fe(c/d,-1,1))-Math.asin(Fe(h/d,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){xe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xe(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const c=Bc(s,t.options.font);if(l?(e.width=this.maxWidth,e.height=Ti(o)+c):(e.height=this.maxHeight,e.width=Ti(o)+c),i.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=i.padding*2,p=dt(this.labelRotation),g=Math.cos(p),y=Math.sin(p);if(l){const b=i.mirror?0:y*f.width+g*h.height;e.height=Math.min(this.maxHeight,e.height+b+m)}else{const b=i.mirror?0:g*f.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+b+m)}this._calculatePadding(d,u,y,g)}}this._handleMargins(),l?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:o,padding:a},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,m=0;c?d?(h=s*e.width,m=i*t.height):(h=i*e.height,m=s*t.width):o==="start"?m=t.width:o==="end"?h=e.width:o!=="inner"&&(h=e.width/2,m=t.width/2),this.paddingLeft=Math.max((h-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+a)*this.width/(this.width-f),0)}else{let u=t.height/2,f=e.height/2;o==="start"?(u=0,f=e.height):o==="end"&&(u=t.height,f=0),this.paddingTop=u+a,this.paddingBottom=f+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){xe(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t<i;t++)ce(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=Pc(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,i){const{ctx:s,_longestTextCache:o}=this,a=[],l=[],c=Math.floor(t/Tc(t,i));let d=0,u=0,f,h,m,p,g,y,b,x,E,C,k;for(f=0;f<t;f+=c){if(p=e[f].label,g=this._resolveTickFontOptions(f),s.font=y=g.string,b=o[y]=o[y]||{data:{},gc:[]},x=g.lineHeight,E=C=0,!ce(p)&&!Ee(p))E=ms(s,b.data,b.gc,E,p),C=x;else if(Ee(p))for(h=0,m=p.length;h<m;++h)k=p[h],!ce(k)&&!Ee(k)&&(E=ms(s,b.data,b.gc,E,k),C+=x);a.push(E),l.push(C),d=Math.max(E,d),u=Math.max(C,u)}x_(o,t);const v=a.indexOf(d),S=l.indexOf(u),_=D=>({width:a[D]||0,height:l[D]||0});return{first:_(0),last:_(t-1),widest:_(v),highest:_(S),widths:a,heights:l}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return m0(this._alignToPixels?fn(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const i=t[e];return i.$context||(i.$context=k_(this.getContext(),e,i))}return this.$context||(this.$context=__(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=dt(this.labelRotation),i=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),o=this._getLabelSizes(),a=e.autoSkipPadding||0,l=o?o.widest.width+a:0,c=o?o.highest.height+a:0;return this.isHorizontal()?c*i>l*s?l/i:c/s:c*s<l*i?c/i:l/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:l}=s,c=o.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=Ti(o),m=[],p=l.setContext(this.getContext()),g=p.display?p.width:0,y=g/2,b=function($){return fn(i,$,g)};let x,E,C,k,v,S,_,D,B,w,T,I;if(a==="top")x=b(this.bottom),S=this.bottom-h,D=x-y,w=b(e.top)+y,I=e.bottom;else if(a==="bottom")x=b(this.top),w=e.top,I=b(e.bottom)-y,S=x+y,D=this.top+h;else if(a==="left")x=b(this.right),v=this.right-h,_=x-y,B=b(e.left)+y,T=e.right;else if(a==="right")x=b(this.left),B=e.left,T=b(e.right)-y,v=x+y,_=this.left+h;else if(t==="x"){if(a==="center")x=b((e.top+e.bottom)/2+.5);else if(le(a)){const $=Object.keys(a)[0],R=a[$];x=b(this.chart.scales[$].getPixelForValue(R))}w=e.top,I=e.bottom,S=x+y,D=S+h}else if(t==="y"){if(a==="center")x=b((e.left+e.right)/2);else if(le(a)){const $=Object.keys(a)[0],R=a[$];x=b(this.chart.scales[$].getPixelForValue(R))}v=x-y,_=v-h,B=e.left,T=e.right}const X=oe(s.ticks.maxTicksLimit,f),q=Math.max(1,Math.ceil(f/X));for(E=0;E<f;E+=q){const $=this.getContext(E),R=o.setContext($),F=l.setContext($),P=R.lineWidth,L=R.color,H=F.dash||[],te=F.dashOffset,ie=R.tickWidth,Q=R.tickColor,J=R.tickBorderDash||[],se=R.tickBorderDashOffset;C=b_(this,E,c),C!==void 0&&(k=fn(i,C,P),d?v=_=B=T=k:S=D=w=I=k,m.push({tx1:v,ty1:S,tx2:_,ty2:D,x1:B,y1:w,x2:T,y2:I,width:P,color:L,borderDash:H,borderDashOffset:te,tickWidth:ie,tickColor:Q,tickBorderDash:J,tickBorderDashOffset:se}))}return this._ticksLength=f,this._borderValue=x,m}_computeLabelItems(e){const t=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=o,h=Ti(i.grid),m=h+u,p=f?-u:m,g=-dt(this.labelRotation),y=[];let b,x,E,C,k,v,S,_,D,B,w,T,I="middle";if(s==="top")v=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")v=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const q=this._getYAxisLabelAlignment(h);S=q.textAlign,k=q.x}else if(s==="right"){const q=this._getYAxisLabelAlignment(h);S=q.textAlign,k=q.x}else if(t==="x"){if(s==="center")v=(e.top+e.bottom)/2+m;else if(le(s)){const q=Object.keys(s)[0],$=s[q];v=this.chart.scales[q].getPixelForValue($)+m}S=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")k=(e.left+e.right)/2-m;else if(le(s)){const q=Object.keys(s)[0],$=s[q];k=this.chart.scales[q].getPixelForValue($)}S=this._getYAxisLabelAlignment(h).textAlign}t==="y"&&(c==="start"?I="top":c==="end"&&(I="bottom"));const X=this._getLabelSizes();for(b=0,x=l.length;b<x;++b){E=l[b],C=E.label;const q=o.setContext(this.getContext(b));_=this.getPixelForTick(b)+o.labelOffset,D=this._resolveTickFontOptions(b),B=D.lineHeight,w=Ee(C)?C.length:1;const $=w/2,R=q.color,F=q.textStrokeColor,P=q.textStrokeWidth;let L=S;a?(k=_,S==="inner"&&(b===x-1?L=this.options.reverse?"left":"right":b===0?L=this.options.reverse?"right":"left":L="center"),s==="top"?d==="near"||g!==0?T=-w*B+B/2:d==="center"?T=-X.highest.height/2-$*B+B:T=-X.highest.height+B/2:d==="near"||g!==0?T=B/2:d==="center"?T=X.highest.height/2-$*B:T=X.highest.height-w*B,f&&(T*=-1),g!==0&&!q.showLabelBackdrop&&(k+=B/2*Math.sin(g))):(v=_,T=(1-w)*B/2);let H;if(q.showLabelBackdrop){const te=je(q.backdropPadding),ie=X.heights[b],Q=X.widths[b];let J=T-te.top,se=0-te.left;switch(I){case"middle":J-=ie/2;break;case"bottom":J-=ie;break}switch(S){case"center":se-=Q/2;break;case"right":se-=Q;break;case"inner":b===x-1?se-=Q:b>0&&(se-=Q/2);break}H={left:se,top:J,width:Q+te.width,height:ie+te.height,color:q.backdropColor}}y.push({label:C,font:D,textOffset:T,options:{rotation:g,color:R,strokeColor:F,strokeWidth:P,textAlign:L,textBaseline:I,translation:[k,v],backdrop:H}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-dt(this.labelRotation))return e==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),l=e+o,c=a.widest.width;let d,u;return t==="left"?s?(u=this.right+o,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u=this.left)):t==="right"?s?(u=this.left+o,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,i==="near"?d="left":i==="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,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:s,width:o,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,o,a),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const s=this.ticks.findIndex(o=>o.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,a;const l=(c,d,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(t.display)for(o=0,a=s.length;o<a;++o){const c=s[o];t.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),t.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const l=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=fn(e,this.left,a)-a/2,u=fn(e,this.right,l)+l/2,f=h=c):(f=fn(e,this.top,a)-a/2,h=fn(e,this.bottom,l)+l/2,d=u=c),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(d,f),t.lineTo(u,h),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&ps(i,s);const o=this.getLabelItems(e);for(const a of o){const l=a.options,c=a.font,d=a.label,u=a.textOffset;hn(i,d,0,u,c,l)}s&&gs(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const o=Ve(i.font),a=je(i.padding),l=i.align;let c=o.lineHeight/2;t==="bottom"||t==="center"||le(t)?(c+=a.bottom,Ee(i.text)&&(c+=o.lineHeight*(i.text.length-1))):c+=a.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=w_(this,c,t,l);hn(e,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:h,textAlign:S_(l,t,s),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=oe(e.grid&&e.grid.z,-1),s=oe(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Zt.prototype.draw?[{z:t,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:t,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,a;for(o=0,a=t.length;o<a;++o){const l=t[o];l[i]===this.id&&(!e||l.type===e)&&s.push(l)}return s}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return Ve(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class vs{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;v_(t)&&(i=this.register(t));const s=this.items,o=e.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in s||(s[o]=e,E_(e,a,i),this.override&&Se.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,s=this.scope;i in t&&delete t[i],s&&i in Se[s]&&(delete Se[s][i],this.override&&delete un[i])}}function E_(n,e,t){const i=li(Object.create(null),[t?Se.get(t):{},Se.get(e),n.defaults]);Se.set(e,i),n.defaultRoutes&&C_(e,n.defaultRoutes),n.descriptors&&Se.describe(e,n.descriptors)}function C_(n,e){Object.keys(e).forEach(t=>{const i=t.split("."),s=i.pop(),o=[n].concat(i).join("."),a=e[t].split("."),l=a.pop(),c=a.join(".");Se.route(o,s,c,l)})}function v_(n){return"id"in n&&"defaults"in n}class D_{constructor(){this.controllers=new vs(nt,"datasets",!0),this.elements=new vs(xt,"elements"),this.plugins=new vs(Object,"plugins"),this.scales=new vs(Zt,"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,t,i){[...t].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(e,o,s):ge(s,a=>{const l=i||this._getRegistryForType(a);this._exec(e,l,a)})})}_exec(e,t,i){const s=So(e);xe(i["before"+s],[],i),t[e](i),xe(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const s=t.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return s}}var ut=new D_;class O_{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=s?this._descriptors(e).filter(s):this._descriptors(e),a=this._notify(o,e,t,i);return t==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),a}_notify(e,t,i,s){s=s||{};for(const o of e){const a=o.plugin,l=a[i],c=[t,s,o.options];if(xe(l,c,a)===!1&&s.cancelable)return!1}return!0}invalidate(){ce(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=oe(i.options&&i.options.plugins,{}),o=N_(i);return s===!1&&!t?[]:P_(e,o,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(l=>!a.some(c=>l.plugin.id===c.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function N_(n){const e={},t=[],i=Object.keys(ut.plugins.items);for(let o=0;o<i.length;o++)t.push(ut.getPlugin(i[o]));const s=n.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];t.indexOf(a)===-1&&(t.push(a),e[a.id]=!0)}return{plugins:t,localIds:e}}function T_(n,e){return!e&&n===!1?null:n===!0?{}:n}function P_(n,{plugins:e,localIds:t},i,s){const o=[],a=n.getContext();for(const l of e){const c=l.id,d=T_(i[c],s);d!==null&&o.push({plugin:l,options:B_(n.config,{plugin:l,local:t[c]},d,a)})}return o}function B_(n,{plugin:e,local:t},i,s){const o=n.pluginScopeKeys(e),a=n.getOptionScopes(i,o);return t&&e.defaults&&a.push(e.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ko(n,e){const t=Se.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function M_(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function V_(n,e){return n===e?"_index_":"_value_"}function Mc(n){if(n==="x"||n==="y"||n==="r")return n}function A_(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Xo(n,...e){if(Mc(n))return n;for(const t of e){const i=t.axis||A_(t.position)||n.length>1&&Mc(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Vc(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function F_(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return Vc(n,"x",t[0])||Vc(n,"y",t[0])}return{}}function $_(n,e){const t=un[n.type]||{scales:{}},i=e.scales||{},s=Ko(n.type,e),o=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!le(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Xo(a,l,F_(a,n),Se.scales[l.type]),d=V_(c,s),u=t.scales||{};o[a]=ci(Object.create(null),[{axis:c},l,u[c],u[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,c=a.indexAxis||Ko(l,e),u=(un[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=M_(f,c),m=a[h+"AxisID"]||h;o[m]=o[m]||Object.create(null),ci(o[m],[{axis:h},i[m],u[f]])})}),Object.keys(o).forEach(a=>{const l=o[a];ci(l,[Se.scales[l.type],Se.scale])}),o}function Ac(n){const e=n.options||(n.options={});e.plugins=oe(e.plugins,{}),e.scales=$_(n,e)}function Fc(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function I_(n){return n=n||{},n.data=Fc(n.data),Ac(n),n}const $c=new Map,Ic=new Set;function Ds(n,e){let t=$c.get(n);return t||(t=e(),$c.set(n,t),Ic.add(t)),t}const Pi=(n,e,t)=>{const i=Kt(e,t);i!==void 0&&n.add(i)};class L_{constructor(e){this._config=I_(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=Fc(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(),Ac(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Ds(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Ds(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Ds(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Ds(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:o}=this,a=this._cachedScopes(e,i),l=a.get(t);if(l)return l;const c=new Set;t.forEach(u=>{e&&(c.add(e),u.forEach(f=>Pi(c,e,f))),u.forEach(f=>Pi(c,s,f)),u.forEach(f=>Pi(c,un[o]||{},f)),u.forEach(f=>Pi(c,Se,f)),u.forEach(f=>Pi(c,No,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Ic.has(t)&&a.set(t,d),d}chartOptionScopes(){const{options:e,type:t}=this;return[e,un[t]||{},Se.datasets[t]||{},{type:t},Se,No]}resolveNamedOptions(e,t,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:l}=Lc(this._resolverCache,e,s);let c=a;if(j_(a,t)){o.$shared=!1,i=Xt(i)?i():i;const d=this.createResolver(e,i,l);c=Pn(a,i,d)}for(const d of t)o[d]=c[d];return o}createResolver(e,t,i=[""],s){const{resolver:o}=Lc(this._resolverCache,e,i);return le(t)?Pn(o,t,void 0,s):o}}function Lc(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let o=i.get(s);return o||(o={resolver:Mo(e,t),subPrefixes:t.filter(l=>!l.toLowerCase().includes("hover"))},i.set(s,o)),o}const R_=n=>le(n)&&Object.getOwnPropertyNames(n).some(e=>Xt(n[e]));function j_(n,e){const{isScriptable:t,isIndexable:i}=$l(n);for(const s of e){const o=t(s),a=i(s),l=(a||o)&&n[s];if(o&&(Xt(l)||R_(l))||a&&Ee(l))return!0}return!1}var z_="4.4.7";const W_=["top","bottom","left","right","chartArea"];function Rc(n,e){return n==="top"||n==="bottom"||W_.indexOf(n)===-1&&e==="x"}function jc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function zc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),xe(t&&t.onComplete,[n],e)}function H_(n){const e=n.chart,t=e.options.animation;xe(t&&t.onProgress,[n],e)}function Wc(n){return Fo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Os={},Hc=n=>{const e=Wc(n);return Object.values(Os).filter(t=>t.canvas===e).pop()};function U_(n,e,t){const i=Object.keys(n);for(const s of i){const o=+s;if(o>=e){const a=n[s];delete n[s],(t>0||o>e)&&(n[o+t]=a)}}}function q_(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Ns(n,e,t){return n.options.clip?n[t]:e[t]}function Y_(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Ns(t,e,"left"),right:Ns(t,e,"right"),top:Ns(i,e,"top"),bottom:Ns(i,e,"bottom")}:e}class _t{static register(...e){ut.add(...e),Uc()}static unregister(...e){ut.remove(...e),Uc()}constructor(e,t){const i=this.config=new L_(t),s=Wc(e),o=Hc(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Oc(s)),this.platform.updateConfig(i);const l=this.platform.acquireContext(s,a.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=n0(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new O_,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=b0(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],Os[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}bt.listen(this,"complete",zc),bt.listen(this,"progress",H_),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:o}=this;return ce(e)?t&&o?o:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return ut}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ul(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Vl(this.canvas,this.ctx),this}stop(){return bt.stop(this),this}resize(e,t){bt.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,e,t,o),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Ul(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),xe(i.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};ge(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let o=[];t&&(o=o.concat(Object.keys(t).map(a=>{const l=t[a],c=Xo(a,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),ge(o,a=>{const l=a.options,c=l.id,d=Xo(c,l),u=oe(l.type,a.dtype);(l.position===void 0||Rc(l.position,d)!==Rc(a.dposition))&&(l.position=a.dposition),s[c]=!0;let f=null;if(c in i&&i[c].type===u)f=i[c];else{const h=ut.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(l,e)}),ge(s,(a,l)=>{a||delete i[l]}),ge(i,a=>{Ie.configure(this,a,a.options),Ie.addBox(this,a)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,o)=>s.index-o.index),i>t){for(let s=t;s<i;++s)this._destroyDatasetMeta(s);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(jc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i<s;i++){const o=t[i];let a=this.getDatasetMeta(i);const l=o.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=l,a.indexAxis=o.indexAxis||Ko(l,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const c=ut.getController(l),{datasetElementType:d,dataElementType:u}=Se.datasets[l];Object.assign(c,{dataElementType:ut.getElement(u),datasetElementType:d&&ut.getElement(d)}),a.controller=new c(this,i),e.push(a.controller)}}return this._updateMetasets(),e}_resetElements(){ge(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),h=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(h),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||ge(o,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(jc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){ge(this.scales,e=>{Ie.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!gl(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of t){const a=i==="_removeElements"?-o:o;U_(e,s,a)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=o=>new Set(e.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),s=i(0);for(let o=1;o<t;o++)if(!gl(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ie.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],ge(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,Xt(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),s={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(t),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(bt.has(this)?this.attached&&!bt.running(this)&&bt.start(this):(this.draw(),zc({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let s,o;for(s=0,o=t.length;s<o;++s){const a=t[s];(!e||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,o=Y_(e,this.chartArea),a={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&ps(t,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),e.controller.draw(),s&&gs(t),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(e){return Vt(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const o=gc.modes[t];return typeof o=="function"?o(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(o=>o&&o._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Qt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",o=this.getDatasetMeta(e),a=o.controller._resolveAnimations(void 0,s);di(t)?(o.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),a.update(o,{visible:i}),this.update(l=>l.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),bt.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Vl(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Os[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,t=this.platform,i=(o,a)=>{t.addEventListener(this,o,a),e[o]=a},s=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};ge(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(c,d)=>{t.addEventListener(this,c,d),e[c]=d},s=(c,d)=>{e[c]&&(t.removeEventListener(this,c,d),delete e[c])},o=(c,d)=>{this.canvas&&this.resize(c,d)};let a;const l=()=>{s("attach",l),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",l)},t.isAttached(this.canvas)?l():a()}unbindEvents(){ge(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ge(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let o,a,l,c;for(t==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),l=0,c=e.length;l<c;++l){a=e[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:o,index:a})=>{const l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!ds(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const s=this.options.hover,o=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),a=o(t,e),l=i?e:o(e,t);a.length&&this.updateHoverStyle(a,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=a=>(a.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:o}=this,a=t,l=this._getActiveElements(e,s,i,a),c=l0(e),d=q_(e,this._lastEvent,i,c);i&&(this._lastEvent=null,xe(o.onHover,[e,l,this],this),c&&xe(o.onClick,[e,l,this],this));const u=!ds(l,s);return(u||t)&&(this._active=l,this._updateHoverStyles(l,s,t)),this._lastEvent=d,u}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,s)}}j(_t,"defaults",Se),j(_t,"instances",Os),j(_t,"overrides",un),j(_t,"registry",ut),j(_t,"version",z_),j(_t,"getChart",Hc);function Uc(){return ge(_t.instances,n=>n._plugins.invalidate())}function K_(n,e,t){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:l,innerRadius:c}=e;let d=s/l;n.beginPath(),n.arc(o,a,l,i-d,t+d),c>s?(d=s/c,n.arc(o,a,c,t+d,i-d,!0)):n.arc(o,a,s,t+Te,i-Te),n.closePath(),n.clip()}function X_(n){return Bo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function G_(n,e,t,i){const s=X_(n.options.borderRadius),o=(t-e)/2,a=Math.min(o,i*e/2),l=c=>{const d=(t-Math.min(o,c))*i/2;return Fe(c,0,Math.min(o,d))};return{outerStart:l(s.outerStart),outerEnd:l(s.outerEnd),innerStart:Fe(s.innerStart,0,a),innerEnd:Fe(s.innerEnd,0,a)}}function An(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function Ts(n,e,t,i,s,o){const{x:a,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=e,f=Math.max(e.outerRadius+i+t-d,0),h=u>0?u+i+t+d:0;let m=0;const p=s-c;if(i){const q=u>0?u-i:0,$=f>0?f-i:0,R=(q+$)/2,F=R!==0?p*R/(R+i):p;m=(p-F)/2}const g=Math.max(.001,p*f-t/_e)/f,y=(p-g)/2,b=c+y+m,x=s-y-m,{outerStart:E,outerEnd:C,innerStart:k,innerEnd:v}=G_(e,h,f,x-b),S=f-E,_=f-C,D=b+E/S,B=x-C/_,w=h+k,T=h+v,I=b+k/w,X=x-v/T;if(n.beginPath(),o){const q=(D+B)/2;if(n.arc(a,l,f,D,q),n.arc(a,l,f,q,B),C>0){const P=An(_,B,a,l);n.arc(P.x,P.y,C,B,x+Te)}const $=An(T,x,a,l);if(n.lineTo($.x,$.y),v>0){const P=An(T,X,a,l);n.arc(P.x,P.y,v,x+Te,X+Math.PI)}const R=(x-v/h+(b+k/h))/2;if(n.arc(a,l,h,x-v/h,R,!0),n.arc(a,l,h,R,b+k/h,!0),k>0){const P=An(w,I,a,l);n.arc(P.x,P.y,k,I+Math.PI,b-Te)}const F=An(S,b,a,l);if(n.lineTo(F.x,F.y),E>0){const P=An(S,D,a,l);n.arc(P.x,P.y,E,b-Te,D)}}else{n.moveTo(a,l);const q=Math.cos(D)*f+a,$=Math.sin(D)*f+l;n.lineTo(q,$);const R=Math.cos(B)*f+a,F=Math.sin(B)*f+l;n.lineTo(R,F)}n.closePath()}function Q_(n,e,t,i,s){const{fullCircles:o,startAngle:a,circumference:l}=e;let c=e.endAngle;if(o){Ts(n,e,t,i,c,s);for(let d=0;d<o;++d)n.fill();isNaN(l)||(c=a+(l%ke||ke))}return Ts(n,e,t,i,c,s),n.fill(),c}function J_(n,e,t,i,s){const{fullCircles:o,startAngle:a,circumference:l,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h}=c,m=c.borderAlign==="inner";if(!d)return;n.setLineDash(f||[]),n.lineDashOffset=h,m?(n.lineWidth=d*2,n.lineJoin=u||"round"):(n.lineWidth=d,n.lineJoin=u||"bevel");let p=e.endAngle;if(o){Ts(n,e,t,i,p,s);for(let g=0;g<o;++g)n.stroke();isNaN(l)||(p=a+(l%ke||ke))}m&&K_(n,e,p),o||(Ts(n,e,t,i,p,s),n.stroke())}class Fn extends xt{constructor(t){super();j(this,"circumference");j(this,"endAngle");j(this,"fullCircles");j(this,"innerRadius");j(this,"outerRadius");j(this,"pixelMargin");j(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,t&&Object.assign(this,t)}inRange(t,i,s){const o=this.getProps(["x","y"],s),{angle:a,distance:l}=kl(o,{x:t,y:i}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,p=oe(h,d-c),g=fi(a,c,d)&&c!==d,y=p>=ke||g,b=Bt(l,u+m,f+m);return y&&b}getCenterPoint(t){const{x:i,y:s,startAngle:o,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:d,spacing:u}=this.options,f=(o+a)/2,h=(l+c+u+d)/2;return{x:i+Math.cos(f)*h,y:s+Math.sin(f)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:i,circumference:s}=this,o=(i.offset||0)/4,a=(i.spacing||0)/2,l=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>ke?Math.floor(s/ke):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*o,Math.sin(c)*o);const d=1-Math.sin(Math.min(_e,s||0)),u=o*d;t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor,Q_(t,this,u,a,l),J_(t,this,u,a,l),t.restore()}}j(Fn,"id","arc"),j(Fn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),j(Fn,"defaultRoutes",{backgroundColor:"backgroundColor"}),j(Fn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"});function qc(n,e,t=e){n.lineCap=oe(t.borderCapStyle,e.borderCapStyle),n.setLineDash(oe(t.borderDash,e.borderDash)),n.lineDashOffset=oe(t.borderDashOffset,e.borderDashOffset),n.lineJoin=oe(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=oe(t.borderWidth,e.borderWidth),n.strokeStyle=oe(t.borderColor,e.borderColor)}function Z_(n,e,t){n.lineTo(t.x,t.y)}function ek(n){return n.stepped?T0:n.tension||n.cubicInterpolationMode==="monotone"?P0:Z_}function Yc(n,e,t={}){const i=n.length,{start:s=0,end:o=i-1}=t,{start:a,end:l}=e,c=Math.max(s,a),d=Math.min(o,l),u=s<a&&o<a||s>l&&o>l;return{count:i,start:c,loop:e.loop,ilen:d<c&&!u?i+d-c:d-c}}function tk(n,e,t,i){const{points:s,options:o}=e,{count:a,start:l,loop:c,ilen:d}=Yc(s,t,i),u=ek(o);let{move:f=!0,reverse:h}=i||{},m,p,g;for(m=0;m<=d;++m)p=s[(l+(h?d-m:m))%a],!p.skip&&(f?(n.moveTo(p.x,p.y),f=!1):u(n,g,p,h,o.stepped),g=p);return c&&(p=s[(l+(h?d:0))%a],u(n,g,p,h,o.stepped)),!!c}function nk(n,e,t,i){const s=e.points,{count:o,start:a,ilen:l}=Yc(s,t,i),{move:c=!0,reverse:d}=i||{};let u=0,f=0,h,m,p,g,y,b;const x=C=>(a+(d?l-C:C))%o,E=()=>{g!==y&&(n.lineTo(u,y),n.lineTo(u,g),n.lineTo(u,b))};for(c&&(m=s[x(0)],n.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=s[x(h)],m.skip)continue;const C=m.x,k=m.y,v=C|0;v===p?(k<g?g=k:k>y&&(y=k),u=(f*u+C)/++f):(E(),n.lineTo(C,k),p=v,f=0,g=y=k),b=k}E()}function Go(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?nk:tk}function ik(n){return n.stepped?cx:n.tension||n.cubicInterpolationMode==="monotone"?dx:yn}function sk(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),qc(n,e.options),n.stroke(s)}function ok(n,e,t,i){const{segments:s,options:o}=e,a=Go(e);for(const l of s)qc(n,o,l.style),n.beginPath(),a(n,e,l,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const rk=typeof Path2D=="function";function ak(n,e,t,i){rk&&!e.options.segment?sk(n,e,t,i):ok(n,e,t,i)}class At extends xt{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,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;tx(this._points,i,e,s,t),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=gx(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],o=this.points,a=Jl(this,{property:t,start:s,end:s});if(!a.length)return;const l=[],c=ik(i);let d,u;for(d=0,u=a.length;d<u;++d){const{start:f,end:h}=a[d],m=o[f],p=o[h];if(m===p){l.push(m);continue}const g=Math.abs((s-m[t])/(p[t]-m[t])),y=c(m,p,g,i.stepped);y[t]=e[t],l.push(y)}return l.length===1?l[0]:l}pathSegment(e,t,i){return Go(this)(e,this,t,i)}path(e,t,i){const s=this.segments,o=Go(this);let a=this._loop;t=t||0,i=i||this.points.length-t;for(const l of s)a&=o(e,this,l,{start:t,end:t+i-1});return!!a}draw(e,t,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),ak(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}j(At,"id","line"),j(At,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),j(At,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),j(At,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Kc(n,e,t,i){const s=n.options,{[t]:o}=n.getProps([t],i);return Math.abs(e-o)<s.radius+s.hitRadius}class Bi extends xt{constructor(t){super();j(this,"parsed");j(this,"skip");j(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,i,s){const o=this.options,{x:a,y:l}=this.getProps(["x","y"],s);return Math.pow(t-a,2)+Math.pow(i-l,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(t,i){return Kc(this,t,"x",i)}inYRange(t,i){return Kc(this,t,"y",i)}getCenterPoint(t){const{x:i,y:s}=this.getProps(["x","y"],t);return{x:i,y:s}}size(t){t=t||this.options||{};let i=t.radius||0;i=Math.max(i,i&&t.hoverRadius||0);const s=i&&t.borderWidth||0;return(i+s)*2}draw(t,i){const s=this.options;this.skip||s.radius<.1||!Vt(this,i,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,Po(t,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}j(Bi,"id","point"),j(Bi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),j(Bi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Xc(n,e){const{x:t,y:i,base:s,width:o,height:a}=n.getProps(["x","y","base","width","height"],e);let l,c,d,u,f;return n.horizontal?(f=a/2,l=Math.min(t,s),c=Math.max(t,s),d=i-f,u=i+f):(f=o/2,l=t-f,c=t+f,d=Math.min(i,s),u=Math.max(i,s)),{left:l,top:d,right:c,bottom:u}}function en(n,e,t,i){return n?0:Fe(e,t,i)}function lk(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,o=Fl(i);return{t:en(s.top,o.top,0,t),r:en(s.right,o.right,0,e),b:en(s.bottom,o.bottom,0,t),l:en(s.left,o.left,0,e)}}function ck(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=mn(s),a=Math.min(e,t),l=n.borderSkipped,c=i||le(s);return{topLeft:en(!c||l.top||l.left,o.topLeft,0,a),topRight:en(!c||l.top||l.right,o.topRight,0,a),bottomLeft:en(!c||l.bottom||l.left,o.bottomLeft,0,a),bottomRight:en(!c||l.bottom||l.right,o.bottomRight,0,a)}}function dk(n){const e=Xc(n),t=e.right-e.left,i=e.bottom-e.top,s=lk(n,t/2,i/2),o=ck(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:t-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Qo(n,e,t,i){const s=e===null,o=t===null,l=n&&!(s&&o)&&Xc(n,i);return l&&(s||Bt(e,l.left,l.right))&&(o||Bt(t,l.top,l.bottom))}function uk(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function fk(n,e){n.rect(e.x,e.y,e.w,e.h)}function Jo(n,e,t={}){const i=n.x!==t.x?-e:0,s=n.y!==t.y?-e:0,o=(n.x+n.w!==t.x+t.w?e:0)-i,a=(n.y+n.h!==t.y+t.h?e:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+o,h:n.h+a,radius:n.radius}}class Mi extends xt{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:t,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:a}=dk(this),l=uk(a.radius)?yi:fk;e.save(),(a.w!==o.w||a.h!==o.h)&&(e.beginPath(),l(e,Jo(a,t,o)),e.clip(),l(e,Jo(o,-t,a)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),l(e,Jo(o,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return Qo(this,e,t,i)}inXRange(e,t){return Qo(this,e,null,t)}inYRange(e,t){return Qo(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(t+s)/2:t,y:o?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}j(Mi,"id","bar"),j(Mi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),j(Mi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Gc=Object.freeze({__proto__:null,ArcElement:Fn,BarElement:Mi,LineElement:At,PointElement:Bi});const Zo=["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)"],Qc=Zo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Jc(n){return Zo[n%Zo.length]}function Zc(n){return Qc[n%Qc.length]}function hk(n,e){return n.borderColor=Jc(e),n.backgroundColor=Zc(e),++e}function mk(n,e){return n.backgroundColor=n.data.map(()=>Jc(e++)),e}function pk(n,e){return n.backgroundColor=n.data.map(()=>Zc(e++)),e}function gk(n){let e=0;return(t,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof Jt?e=mk(t,e):s instanceof Vn?e=pk(t,e):s&&(e=hk(t,e))}}function ed(n){let e;for(e in n)if(n[e].borderColor||n[e].backgroundColor)return!0;return!1}function yk(n){return n&&(n.borderColor||n.backgroundColor)}function bk(){return Se.borderColor!=="rgba(0,0,0,0.1)"||Se.backgroundColor!=="rgba(0,0,0,0.1)"}var td={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,e,t){if(!t.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:o}=s,a=ed(i)||yk(s)||o&&ed(o)||bk();if(!t.forceOverride&&a)return;const l=gk(n);i.forEach(l)}};function xk(n,e,t,i,s){const o=s.samples||i;if(o>=t)return n.slice(e,e+t);const a=[],l=(t-2)/(o-2);let c=0;const d=e+t-1;let u=e,f,h,m,p,g;for(a[c++]=n[u],f=0;f<o-2;f++){let y=0,b=0,x;const E=Math.floor((f+1)*l)+1+e,C=Math.min(Math.floor((f+2)*l)+1,t)+e,k=C-E;for(x=E;x<C;x++)y+=n[x].x,b+=n[x].y;y/=k,b/=k;const v=Math.floor(f*l)+1+e,S=Math.min(Math.floor((f+1)*l)+1,t)+e,{x:_,y:D}=n[u];for(m=p=-1,x=v;x<S;x++)p=.5*Math.abs((_-y)*(n[x].y-D)-(_-n[x].x)*(b-D)),p>m&&(m=p,h=n[x],g=x);a[c++]=h,u=g}return a[c++]=n[d],a}function _k(n,e,t,i){let s=0,o=0,a,l,c,d,u,f,h,m,p,g;const y=[],b=e+t-1,x=n[e].x,C=n[b].x-x;for(a=e;a<e+t;++a){l=n[a],c=(l.x-x)/C*i,d=l.y;const k=c|0;if(k===u)d<p?(p=d,f=a):d>g&&(g=d,h=a),s=(o*s+l.x)/++o;else{const v=a-1;if(!ce(f)&&!ce(h)){const S=Math.min(f,h),_=Math.max(f,h);S!==m&&S!==v&&y.push({...n[S],x:s}),_!==m&&_!==v&&y.push({...n[_],x:s})}a>0&&v!==m&&y.push(n[v]),y.push(l),u=k,o=0,p=g=d,f=h=m=a}}return y}function nd(n){if(n._decimated){const e=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function id(n){n.data.datasets.forEach(e=>{nd(e)})}function kk(n,e){const t=e.length;let i=0,s;const{iScale:o}=n,{min:a,max:l,minDefined:c,maxDefined:d}=o.getUserBounds();return c&&(i=Fe(Mt(e,o.axis,a).lo,0,t-1)),d?s=Fe(Mt(e,o.axis,l).hi+1,i,t)-i:s=t-i,{start:i,count:s}}var sd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,e,t)=>{if(!t.enabled){id(n);return}const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:l}=s,c=n.getDatasetMeta(o),d=a||s.data;if(bi([l,n.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=n.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:f,count:h}=kk(c,d);const m=t.threshold||4*i;if(h<=m){nd(s);return}ce(a)&&(s._data=d,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(t.algorithm){case"lttb":p=xk(d,f,h,i,t);break;case"min-max":p=_k(d,f,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}s._decimated=p})},destroy(n){id(n)}};function Sk(n,e,t){const i=n.segments,s=n.points,o=e.points,a=[];for(const l of i){let{start:c,end:d}=l;d=tr(c,d,s);const u=er(t,s[c],s[d],l.loop);if(!e.segments){a.push({source:l,target:u,start:s[c],end:s[d]});continue}const f=Jl(e,u);for(const h of f){const m=er(t,o[h.start],o[h.end],h.loop),p=Ql(l,s,m);for(const g of p)a.push({source:g,target:h,start:{[t]:od(u,m,"start",Math.max)},end:{[t]:od(u,m,"end",Math.min)}})}}return a}function er(n,e,t,i){if(i)return;let s=e[n],o=t[n];return n==="angle"&&(s=Ge(s),o=Ge(o)),{property:n,start:s,end:o}}function wk(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,o=[];return e.segments.forEach(({start:a,end:l})=>{l=tr(a,l,s);const c=s[a],d=s[l];i!==null?(o.push({x:c.x,y:i}),o.push({x:d.x,y:i})):t!==null&&(o.push({x:t,y:c.y}),o.push({x:t,y:d.y}))}),o}function tr(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function od(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function rd(n,e){let t=[],i=!1;return Ee(n)?(i=!0,t=n):t=wk(n,e),t.length?new At({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function ad(n){return n&&n.fill!==!1}function Ek(n,e,t){let s=n[e].fill;const o=[e];let a;if(!t)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!Oe(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function Ck(n,e,t){const i=Nk(n);if(le(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Oe(s)&&Math.floor(s)===s?vk(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vk(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function Dk(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:le(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function Ok(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:le(n)?i=n.value:i=e.getBaseValue(),i}function Nk(n){const e=n.options,t=e.fill;let i=oe(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Tk(n){const{scale:e,index:t,line:i}=n,s=[],o=i.segments,a=i.points,l=Pk(e,t);l.push(rd({x:null,y:e.bottom},i));for(let c=0;c<o.length;c++){const d=o[c];for(let u=d.start;u<=d.end;u++)Bk(s,a[u],l)}return new At({points:s,options:{}})}function Pk(n,e){const t=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===e)break;o.hidden||t.unshift(o.dataset)}return t}function Bk(n,e,t){const i=[];for(let s=0;s<t.length;s++){const o=t[s],{first:a,last:l,point:c}=Mk(o,e,"x");if(!(!c||a&&l)){if(a)i.unshift(c);else if(n.push(c),!l)break}}n.push(...i)}function Mk(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const s=i[t],o=n.segments,a=n.points;let l=!1,c=!1;for(let d=0;d<o.length;d++){const u=o[d],f=a[u.start][t],h=a[u.end][t];if(Bt(s,f,h)){l=s===f,c=s===h;break}}return{first:l,last:c,point:i}}class ld{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:s,y:o,radius:a}=this;return t=t||{start:0,end:ke},e.arc(s,o,a,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:s}=this,o=e.angle;return{x:t+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function Vk(n){const{chart:e,fill:t,line:i}=n;if(Oe(t))return Ak(e,t);if(t==="stack")return Tk(n);if(t==="shape")return!0;const s=Fk(n);return s instanceof ld?s:rd(s,i)}function Ak(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function Fk(n){return(n.scale||{}).getPointPositionForValue?Ik(n):$k(n)}function $k(n){const{scale:e={},fill:t}=n,i=Dk(t,e);if(Oe(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Ik(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,o=i.reverse?e.max:e.min,a=Ok(t,e,o),l=[];if(i.grid.circular){const c=e.getPointPositionForValue(0,o);return new ld({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(a)})}for(let c=0;c<s;++c)l.push(e.getPointPositionForValue(c,a));return l}function nr(n,e,t){const i=Vk(e),{line:s,scale:o,axis:a}=e,l=s.options,c=l.fill,d=l.backgroundColor,{above:u=d,below:f=d}=c||{};i&&s.points.length&&(ps(n,t),Lk(n,{line:s,target:i,above:u,below:f,area:t,scale:o,axis:a}),gs(n))}function Lk(n,e){const{line:t,target:i,above:s,below:o,area:a,scale:l}=e,c=t._loop?"angle":e.axis;n.save(),c==="x"&&o!==s&&(cd(n,i,a.top),dd(n,{line:t,target:i,color:s,scale:l,property:c}),n.restore(),n.save(),cd(n,i,a.bottom)),dd(n,{line:t,target:i,color:o,scale:l,property:c}),n.restore()}function cd(n,e,t){const{segments:i,points:s}=e;let o=!0,a=!1;n.beginPath();for(const l of i){const{start:c,end:d}=l,u=s[c],f=s[tr(c,d,s)];o?(n.moveTo(u.x,u.y),o=!1):(n.lineTo(u.x,t),n.lineTo(u.x,u.y)),a=!!e.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(f.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function dd(n,e){const{line:t,target:i,property:s,color:o,scale:a}=e,l=Sk(t,i,s);for(const{source:c,target:d,start:u,end:f}of l){const{style:{backgroundColor:h=o}={}}=c,m=i!==!0;n.save(),n.fillStyle=h,Rk(n,a,m&&er(s,u,f)),n.beginPath();const p=!!t.pathSegment(n,c);let g;if(m){p?n.closePath():ud(n,i,f,s);const y=!!i.pathSegment(n,d,{move:p,reverse:!0});g=p&&y,g||ud(n,i,u,s)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function Rk(n,e,t){const{top:i,bottom:s}=e.chart.chartArea,{property:o,start:a,end:l}=t||{};o==="x"&&(n.beginPath(),n.rect(a,i,l-a,s-i),n.clip())}function ud(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var fd={id:"filler",afterDatasetsUpdate(n,e,t){const i=(n.data.datasets||[]).length,s=[];let o,a,l,c;for(a=0;a<i;++a)o=n.getDatasetMeta(a),l=o.dataset,c=null,l&&l.options&&l instanceof At&&(c={visible:n.isDatasetVisible(a),index:a,fill:Ck(l,a,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:l}),o.$filler=c,s.push(c);for(a=0;a<i;++a)c=s[a],!(!c||c.fill===!1)&&(c.fill=Ek(s,a,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let a=s.length-1;a>=0;--a){const l=s[a].$filler;l&&(l.line.updateControlPoints(o,l.axis),i&&l.fill&&nr(n.ctx,l,o))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;ad(o)&&nr(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!ad(i)||t.drawTime!=="beforeDatasetDraw"||nr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const hd=(n,e)=>{let{boxHeight:t=e,boxWidth:i=e}=n;return n.usePointStyle&&(t=Math.min(t,e),i=n.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:t,itemHeight:Math.max(e,t)}},jk=(n,e)=>n!==null&&e!==null&&n.datasetIndex===e.datasetIndex&&n.index===e.index;class md extends xt{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,t,i){this.maxWidth=e,this.maxHeight=t,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=xe(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(i=>e.filter(i,this.chart.data))),e.sort&&(t=t.sort((i,s)=>e.sort(i,s,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}const i=e.labels,s=Ve(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=hd(i,o);let d,u;t.font=s.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(a,o,l,c)+10):(u=this.maxHeight,d=this._fitCols(a,s,l,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,t,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=s+l;let f=e;o.textAlign="left",o.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,g)=>{const y=i+t/2+o.measureText(p.text).width;(g===0||d[d.length-1]+y+2*l>a)&&(f+=u,d[d.length-(g>0?0:1)]=0,m+=u,h++),c[g]={left:0,top:m,row:h,width:y,height:s},d[d.length-1]+=y+l}),f}_fitCols(e,t,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=a-e;let f=l,h=0,m=0,p=0,g=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:x,itemHeight:E}=zk(i,t,o,y,s);b>0&&m+E+2*l>u&&(f+=h+l,d.push({width:h,height:m}),p+=h+l,g++,h=m=0),c[b]={left:p,top:m,col:g,width:x,height:E},h=Math.max(h,x),m+=E+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:i,labels:{padding:s},rtl:o}}=this,a=Mn(o,this.left,this.width);if(this.isHorizontal()){let l=0,c=Re(i,this.left+s,this.right-this.lineWidths[l]);for(const d of t)l!==d.row&&(l=d.row,c=Re(i,this.left+s,this.right-this.lineWidths[l])),d.top+=this.top+e+s,d.left=a.leftForLtr(a.x(c),d.width),c+=d.width+s}else{let l=0,c=Re(i,this.top+e+s,this.bottom-this.columnSizes[l].height);for(const d of t)d.col!==l&&(l=d.col,c=Re(i,this.top+e+s,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+s,d.left=a.leftForLtr(a.x(d.left),d.width),c+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;ps(e,this),this._draw(),gs(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:i,ctx:s}=this,{align:o,labels:a}=e,l=Se.color,c=Mn(e.rtl,this.left,this.width),d=Ve(a.font),{padding:u}=a,f=d.size,h=f/2;let m;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:p,boxHeight:g,itemHeight:y}=hd(a,f),b=function(v,S,_){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const D=oe(_.lineWidth,1);if(s.fillStyle=oe(_.fillStyle,l),s.lineCap=oe(_.lineCap,"butt"),s.lineDashOffset=oe(_.lineDashOffset,0),s.lineJoin=oe(_.lineJoin,"miter"),s.lineWidth=D,s.strokeStyle=oe(_.strokeStyle,l),s.setLineDash(oe(_.lineDash,[])),a.usePointStyle){const B={radius:g*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:D},w=c.xPlus(v,p/2),T=S+h;Al(s,B,w,T,a.pointStyleWidth&&p)}else{const B=S+Math.max((f-g)/2,0),w=c.leftForLtr(v,p),T=mn(_.borderRadius);s.beginPath(),Object.values(T).some(I=>I!==0)?yi(s,{x:w,y:B,w:p,h:g,radius:T}):s.rect(w,B,p,g),s.fill(),D!==0&&s.stroke()}s.restore()},x=function(v,S,_){hn(s,_.text,v,S+y/2,d,{strikethrough:_.hidden,textAlign:c.textAlign(_.textAlign)})},E=this.isHorizontal(),C=this._computeTitleHeight();E?m={x:Re(o,this.left+u,this.right-i[0]),y:this.top+u+C,line:0}:m={x:this.left+u,y:Re(o,this.top+C+u,this.bottom-t[0].height),line:0},Yl(this.ctx,e.textDirection);const k=y+u;this.legendItems.forEach((v,S)=>{s.strokeStyle=v.fontColor,s.fillStyle=v.fontColor;const _=s.measureText(v.text).width,D=c.textAlign(v.textAlign||(v.textAlign=a.textAlign)),B=p+h+_;let w=m.x,T=m.y;c.setWidth(this.width),E?S>0&&w+B+u>this.right&&(T=m.y+=k,m.line++,w=m.x=Re(o,this.left+u,this.right-i[m.line])):S>0&&T+k>this.bottom&&(w=m.x=w+t[m.line].width+u,m.line++,T=m.y=Re(o,this.top+C+u,this.bottom-t[m.line].height));const I=c.x(w);if(b(I,T,v),w=x0(D,w+p+h,E?w+B:this.right,e.rtl),x(c.x(w),T,v),E)m.x+=B+u;else if(typeof v.text!="string"){const X=d.lineHeight;m.y+=pd(v,X)+u}else m.y+=k}),Kl(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,i=Ve(t.font),s=je(t.padding);if(!t.display)return;const o=Mn(e.rtl,this.left,this.width),a=this.ctx,l=t.position,c=i.size/2,d=s.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=Re(e.align,f,this.right-h);else{const p=this.columnSizes.reduce((g,y)=>Math.max(g,y.height),0);u=d+Re(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const m=Re(l,f,f+h);a.textAlign=o.textAlign(vo(l)),a.textBaseline="middle",a.strokeStyle=t.color,a.fillStyle=t.color,a.font=i.string,hn(a,t.text,m,u,i)}_computeTitleHeight(){const e=this.options.title,t=Ve(e.font),i=je(e.padding);return e.display?t.lineHeight+i.height:0}_getLegendItemAt(e,t){let i,s,o;if(Bt(e,this.left,this.right)&&Bt(t,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Bt(e,s.left,s.left+s.width)&&Bt(t,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(e){const t=this.options;if(!Uk(e.type,t))return;const i=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const s=this._hoveredItem,o=jk(s,i);s&&!o&&xe(t.onLeave,[e,s,this],this),this._hoveredItem=i,i&&!o&&xe(t.onHover,[e,i,this],this)}else i&&xe(t.onClick,[e,i,this],this)}}function zk(n,e,t,i,s){const o=Wk(i,n,e,t),a=Hk(s,i,e.lineHeight);return{itemWidth:o,itemHeight:a}}function Wk(n,e,t,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),e+t.size/2+i.measureText(s).width}function Hk(n,e,t){let i=n;return typeof e.text!="string"&&(i=pd(e,t)),i}function pd(n,e){const t=n.text?n.text.length:0;return e*t}function Uk(n,e){return!!((n==="mousemove"||n==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(n==="click"||n==="mouseup"))}var gd={id:"legend",_element:md,start(n,e,t){const i=n.legend=new md({ctx:n.ctx,options:t,chart:n});Ie.configure(n,i,t),Ie.addBox(n,i)},stop(n){Ie.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,e,t){const i=n.legend;Ie.configure(n,i,t),i.options=t},afterUpdate(n){const e=n.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(n,e){e.replay||n.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,e,t){const i=e.datasetIndex,s=t.chart;s.isDatasetVisible(i)?(s.hide(i),e.hidden=!0):(s.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const e=n.data.datasets,{labels:{usePointStyle:t,pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(t?0:void 0),u=je(d.borderWidth);return{text:e[c.index].label,fillStyle:d.backgroundColor,fontColor:o,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:i||d.pointStyle,rotation:d.rotation,textAlign:s||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ir extends xt{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,t){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;const s=Ee(i.text)?i.text.length:1;this._padding=je(i.padding);const o=s*Ve(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:t,left:i,bottom:s,right:o,options:a}=this,l=a.align;let c=0,d,u,f;return this.isHorizontal()?(u=Re(l,i,o),f=t+e,d=o-i):(a.position==="left"?(u=i+e,f=Re(l,s,t),c=_e*-.5):(u=o-e,f=Re(l,t,s),c=_e*.5),d=s-t),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const i=Ve(t.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(o);hn(e,t.text,0,0,i,{color:t.color,maxWidth:c,rotation:d,textAlign:vo(t.align),textBaseline:"middle",translation:[a,l]})}}function qk(n,e){const t=new ir({ctx:n.ctx,options:e,chart:n});Ie.configure(n,t,e),Ie.addBox(n,t),n.titleBlock=t}var yd={id:"title",_element:ir,start(n,e,t){qk(n,t)},stop(n){const e=n.titleBlock;Ie.removeBox(n,e),delete n.titleBlock},beforeUpdate(n,e,t){const i=n.titleBlock;Ie.configure(n,i,t),i.options=t},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 Ps=new WeakMap;var bd={id:"subtitle",start(n,e,t){const i=new ir({ctx:n.ctx,options:t,chart:n});Ie.configure(n,i,t),Ie.addBox(n,i),Ps.set(n,i)},stop(n){Ie.removeBox(n,Ps.get(n)),Ps.delete(n)},beforeUpdate(n,e,t){const i=Ps.get(n);Ie.configure(n,i,t),i.options=t},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 Vi={average(n){if(!n.length)return!1;let e,t,i=new Set,s=0,o=0;for(e=0,t=n.length;e<t;++e){const l=n[e].element;if(l&&l.hasValue()){const c=l.tooltipPosition();i.add(c.x),s+=c.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((l,c)=>l+c)/i.size,y:s/o}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,s=Number.POSITIVE_INFINITY,o,a,l;for(o=0,a=n.length;o<a;++o){const c=n[o].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Eo(e,d);u<s&&(s=u,l=c)}}if(l){const c=l.tooltipPosition();t=c.x,i=c.y}return{x:t,y:i}}};function kt(n,e){return e&&(Ee(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function Ft(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
172
176
  `)>-1?n.split(`
173
- `):n}function Tx(n,t){const{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:r,value:l}=o.getLabelAndValue(s);return{chart:n,label:r,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:l,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function qc(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:r,boxHeight:l}=t,c=vt(t.bodyFont),d=vt(t.titleFont),u=vt(t.footerFont),h=o.length,f=s.length,m=i.length,p=Mt(t.padding);let g=p.height,y=0,b=i.reduce((E,k)=>E+k.before.length+k.lines.length+k.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,h&&(g+=h*d.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),b){const E=t.displayColors?Math.max(l,c.lineHeight):c.lineHeight;g+=m*E+(b-m)*c.lineHeight+(b-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let _=0;const w=function(E){y=Math.max(y,e.measureText(E).width+_)};return e.save(),e.font=d.string,rt(n.title,w),e.font=c.string,rt(n.beforeBody.concat(n.afterBody),w),_=t.displayColors?r+2+t.boxPadding:0,rt(i,E=>{rt(E.before,w),rt(E.lines,w),rt(E.after,w)}),_=0,e.font=u.string,rt(n.footer,w),e.restore(),y+=p.width,{width:y,height:g}}function Px(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Mx(n,t,e,i){const{x:s,width:o}=i,r=e.caretSize+e.caretPadding;if(n==="left"&&s+o+r>t.width||n==="right"&&s-o-r<0)return!0}function Vx(n,t,e,i){const{x:s,width:o}=e,{width:r,chartArea:{left:l,right:c}}=n;let d="center";return i==="center"?d=s<=(l+c)/2?"left":"right":s<=o/2?d="left":s>=r-o/2&&(d="right"),Mx(d,n,t,e)&&(d="center"),d}function Yc(n,t,e){const i=e.yAlign||t.yAlign||Px(n,e);return{xAlign:e.xAlign||t.xAlign||Vx(n,t,e,i),yAlign:i}}function Ax(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Bx(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Kc(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=n,{xAlign:l,yAlign:c}=e,d=s+o,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=en(r);let p=Ax(t,l);const g=Bx(t,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,f)+s:l==="right"&&(p+=Math.max(h,m)+s),{x:Ot(p,0,i.width-t.width),y:Ot(g,0,i.height-t.height)}}function bs(n,t,e){const i=Mt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Xc(n){return he([],Oe(n))}function Fx(n,t,e){return je(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Gc(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Qc={beforeTitle:Se,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Se,beforeBody:Se,beforeLabel:Se,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return st(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Se,afterBody:Se,beforeFooter:Se,footer:Se,afterFooter:Se};function Rt(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Qc[t].call(e,i):s}class zo extends Kt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new So(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Fx(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=Rt(i,"beforeTitle",this,t),o=Rt(i,"title",this,t),r=Rt(i,"afterTitle",this,t);let l=[];return l=he(l,Oe(s)),l=he(l,Oe(o)),l=he(l,Oe(r)),l}getBeforeBody(t,e){return Xc(Rt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return rt(t,o=>{const r={before:[],lines:[],after:[]},l=Gc(i,o);he(r.before,Oe(Rt(l,"beforeLabel",this,o))),he(r.lines,Rt(l,"label",this,o)),he(r.after,Oe(Rt(l,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return Xc(Rt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Rt(i,"beforeFooter",this,t),o=Rt(i,"footer",this,t),r=Rt(i,"afterFooter",this,t);let l=[];return l=he(l,Oe(s)),l=he(l,Oe(o)),l=he(l,Oe(r)),l}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],r=[];let l=[],c,d;for(c=0,d=e.length;c<d;++c)l.push(Tx(this.chart,e[c]));return t.filter&&(l=l.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(l=l.sort((u,h)=>t.itemSort(u,h,i))),rt(l,u=>{const h=Gc(t.callbacks,u);s.push(Rt(h,"labelColor",this,u)),o.push(Rt(h,"labelPointStyle",this,u)),r.push(Rt(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const l=Ei[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const c=this._size=qc(this,i),d=Object.assign({},l,c),u=Yc(this.chart,i,d),h=Kc(i,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const o=this.getCaretPosition(t,i,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:l}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:h}=en(l),{x:f,y:m}=t,{width:p,height:g}=e;let y,b,_,w,E,k;return o==="center"?(E=m+g/2,s==="left"?(y=f,b=y-r,w=E+r,k=E-r):(y=f+p,b=y+r,w=E-r,k=E+r),_=y):(s==="left"?b=f+Math.max(c,u)+r:s==="right"?b=f+p-Math.max(d,h)-r:b=this.caretX,o==="top"?(w=m,E=w-r,y=b-r,_=b+r):(w=m+g,E=w+r,y=b+r,_=b-r),k=w),{x1:y,x2:b,x3:_,y1:w,y2:E,y3:k}}drawTitle(t,e,i){const s=this.title,o=s.length;let r,l,c;if(o){const d=Sn(i.rtl,this.x,this.width);for(t.x=bs(this,i.titleAlign,i),e.textAlign=d.textAlign(i.titleAlign),e.textBaseline="middle",r=vt(i.titleFont),l=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,c=0;c<o;++c)e.fillText(s[c],d.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+l,c+1===o&&(t.y+=i.titleMarginBottom-l)}}_drawColorBox(t,e,i,s,o){const r=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:c,boxWidth:d}=o,u=vt(o.bodyFont),h=bs(this,"left",o),f=s.x(h),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=e.y+m;if(o.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=s.leftForLtr(f,d)+d/2,b=p+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,po(t,g,y,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,po(t,g,y,b)}else{t.lineWidth=nt(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const g=s.leftForLtr(f,d),y=s.leftForLtr(s.xPlus(f,1),d-2),b=en(r.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ai(t,{x:g,y:p,w:d,h:c,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ai(t,{x:y,y:p+1,w:d-2,h:c-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,d,c),t.strokeRect(g,p,d,c),t.fillStyle=r.backgroundColor,t.fillRect(y,p+1,d-2,c-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=i,h=vt(i.bodyFont);let f=h.lineHeight,m=0;const p=Sn(i.rtl,this.x,this.width),g=function(x){e.fillText(x,p.x(t.x+m),t.y+f/2),t.y+=f+o},y=p.textAlign(r);let b,_,w,E,k,C,S;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=bs(this,y,i),e.fillStyle=i.bodyColor,rt(this.beforeBody,g),m=l&&y!=="right"?r==="center"?d/2+u:d+2+u:0,E=0,C=s.length;E<C;++E){for(b=s[E],_=this.labelTextColors[E],e.fillStyle=_,rt(b.before,g),w=b.lines,l&&w.length&&(this._drawColorBox(e,t,E,p,i),f=Math.max(h.lineHeight,c)),k=0,S=w.length;k<S;++k)g(w[k]),f=h.lineHeight;rt(b.after,g)}m=0,f=h.lineHeight,rt(this.afterBody,g),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let r,l;if(o){const c=Sn(i.rtl,this.x,this.width);for(t.x=bs(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=c.textAlign(i.footerAlign),e.textBaseline="middle",r=vt(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:r}=this,{x:l,y:c}=t,{width:d,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=en(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(l+h,c),r==="top"&&this.drawCaret(t,e,i,s),e.lineTo(l+d-f,c),e.quadraticCurveTo(l+d,c,l+d,c+f),r==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(l+d,c+u-p),e.quadraticCurveTo(l+d,c+u,l+d-p,c+u),r==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(l+m,c+u),e.quadraticCurveTo(l,c+u,l,c+u-m),r==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(l,c+h),e.quadraticCurveTo(l,c,l+h,c),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=Ei[t.position].call(this,this._active,this._eventPosition);if(!r)return;const l=this._size=qc(this,t),c=Object.assign({},r,this._size),d=Yc(e,t,c),u=Kc(t,c,d,e);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=Mt(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),xl(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),kl(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),o=!Gi(i,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),l=this._positionChanged(r,t),c=e||!Gi(r,o)||l;return c&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),c}_getActiveElements(t,e,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:s,options:o}=this,r=Ei[o.position].call(this,t,e);return r!==!1&&(i!==r.x||s!==r.y)}}L(zo,"positioners",Ei);var Jc={id:"tooltip",_element:zo,positioners:Ei,afterInit(n,t,e){e&&(n.tooltip=new zo({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Qc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Zc=Object.freeze({__proto__:null,Colors:Dc,Decimation:Pc,Filler:Lc,Legend:Wc,SubTitle:Uc,Title:Hc,Tooltip:Jc});const $x=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Rx(n,t,e,i){const s=n.indexOf(t);if(s===-1)return $x(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const Lx=(n,t)=>n===null?null:Ot(Math.round(n),0,t);function td(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class _s extends We{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:o}of e)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(st(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Rx(i,t,J(e,t),this._addedLabels),Lx(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){return td.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}L(_s,"id","category"),L(_s,"defaults",{ticks:{callback:td}});function Ix(n,t){const e=[],{bounds:s,step:o,min:r,max:l,precision:c,count:d,maxTicks:u,maxDigits:h,includeBounds:f}=n,m=o||1,p=u-1,{min:g,max:y}=t,b=!st(r),_=!st(l),w=!st(d),E=(y-g)/(h+1);let k=Ua((y-g)/p/m)*m,C,S,x,O;if(k<1e-14&&!b&&!_)return[{value:g},{value:y}];O=Math.ceil(y/k)-Math.floor(g/k),O>p&&(k=Ua(O*k/p/m)*m),st(c)||(C=Math.pow(10,c),k=Math.ceil(k*C)/C),s==="ticks"?(S=Math.floor(g/k)*k,x=Math.ceil(y/k)*k):(S=g,x=y),b&&_&&o&&Xy((l-r)/o,k/1e3)?(O=Math.round(Math.min((l-r)/k,u)),k=(l-r)/O,S=r,x=l):w?(S=b?r:S,x=_?l:x,O=d-1,k=(x-S)/O):(O=(x-S)/k,ei(O,Math.round(O),k/1e3)?O=Math.round(O):O=Math.ceil(O));const M=Math.max(Ya(k),Ya(S));C=Math.pow(10,st(c)?M:c),S=Math.round(S*C)/C,x=Math.round(x*C)/C;let v=0;for(b&&(f&&S!==r?(e.push({value:r}),S<r&&v++,ei(Math.round((S+v*k)*C)/C,r,ed(r,E,n))&&v++):S<r&&v++);v<O;++v){const T=Math.round((S+v*k)*C)/C;if(_&&T>l)break;e.push({value:T})}return _&&f&&x!==l?e.length&&ei(e[e.length-1].value,l,ed(l,E,n))?e[e.length-1].value=l:e.push({value:l}):(!_||x===l)&&e.push({value:x}),e}function ed(n,t,{horizontal:e,minRotation:i}){const s=ne(i),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+n).length;return Math.min(t/o,r)}class xs extends We{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=c=>s=e?s:c,l=c=>o=i?o:c;if(t){const c=ce(s),d=ce(o);c<0&&d<0?l(0):c>0&&d>0&&r(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);l(o+c),t||r(s-c)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=Ix(s,o);return t.bounds==="ticks"&&qa(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return si(t,this.chart.options.locale,this.options.ticks.format)}}class ks extends xs{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=kt(t)?t:0,this.max=kt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=ne(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}L(ks,"id","linear"),L(ks,"defaults",{ticks:{callback:oi.formatters.numeric}});const Ci=n=>Math.floor(Ie(n)),an=(n,t)=>Math.pow(10,Ci(n)+t);function nd(n){return n/Math.pow(10,Ci(n))===1}function id(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function jx(n,t){const e=t-n;let i=Ci(e);for(;id(n,t,i)>10;)i++;for(;id(n,t,i)<10;)i--;return Math.min(i,Ci(n))}function zx(n,{min:t,max:e}){t=zt(n.min,t);const i=[],s=Ci(t);let o=jx(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),c=s>o?Math.pow(10,s):0,d=Math.round((t-c)*r)/r,u=Math.floor((t-c)/l/10)*l*10;let h=Math.floor((d-u)/Math.pow(10,o)),f=zt(n.min,Math.round((c+u+h*Math.pow(10,o))*r)/r);for(;f<e;)i.push({value:f,major:nd(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,r=o>=0?1:r),f=Math.round((c+u+h*Math.pow(10,o))*r)/r;const m=zt(n.max,f);return i.push({value:m,major:nd(m),significand:h}),i}class Ss extends We{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=xs.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return kt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=kt(t)?Math.max(0,t):null,this.max=kt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!kt(this._userMin)&&(this.min=t===an(this.min,0)?an(this.min,-1):an(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=l=>i=t?i:l,r=l=>s=e?s:l;i===s&&(i<=0?(o(1),r(10)):(o(an(i,-1)),r(an(s,1)))),i<=0&&o(an(s,-1)),s<=0&&r(an(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=zx(e,this);return t.bounds==="ticks"&&qa(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":si(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ie(t),this._valueRange=Ie(this.max)-Ie(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ie(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}L(Ss,"id","logarithmic"),L(Ss,"defaults",{ticks:{callback:oi.formatters.logarithmic,major:{enabled:!0}}});function Wo(n){const t=n.ticks;if(t.display&&n.display){const e=Mt(t.backdropPadding);return J(t.font&&t.font.size,gt.font.size)+e.height}return 0}function Wx(n,t,e){return e=_t(e)?e:[e],{w:hb(n,t.string,e),h:e.length*t.lineHeight}}function sd(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function Hx(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],o=n._pointLabels.length,r=n.options.pointLabels,l=r.centerPointLabels?mt/o:0;for(let c=0;c<o;c++){const d=r.setContext(n.getPointLabelContext(c));s[c]=d.padding;const u=n.getPointPosition(c,n.drawingArea+s[c],l),h=vt(d.font),f=Wx(n.ctx,h,n._pointLabels[c]);i[c]=f;const m=Wt(n.getIndexAngle(c)+l),p=Math.round(ro(m)),g=sd(p,u.x,f.w,0,180),y=sd(p,u.y,f.h,90,270);Ux(e,t,m,g,y)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Kx(n,i,s)}function Ux(n,t,e,i,s){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let l=0,c=0;i.start<t.l?(l=(t.l-i.start)/o,n.l=Math.min(n.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/o,n.r=Math.max(n.r,t.r+l)),s.start<t.t?(c=(t.t-s.start)/r,n.t=Math.min(n.t,t.t-c)):s.end>t.b&&(c=(s.end-t.b)/r,n.b=Math.max(n.b,t.b+c))}function qx(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:r,size:l}=e,c=n.getPointPosition(t,i+s+r,o),d=Math.round(ro(Wt(c.angle+St))),u=Qx(c.y,l.h,d),h=Xx(d),f=Gx(c.x,l.w,h);return{visible:!0,x:c.x,y:u,textAlign:h,left:f,top:u,right:f+l.w,bottom:u+l.h}}function Yx(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;return!(Ce({x:e,y:i},t)||Ce({x:e,y:o},t)||Ce({x:s,y:i},t)||Ce({x:s,y:o},t))}function Kx(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:r,display:l}=o.pointLabels,c={extra:Wo(o)/2,additionalAngle:r?mt/s:0};let d;for(let u=0;u<s;u++){c.padding=e[u],c.size=t[u];const h=qx(n,u,c);i.push(h),l==="auto"&&(h.visible=Yx(h,d),h.visible&&(d=h))}return i}function Xx(n){return n===0||n===180?"center":n<180?"left":"right"}function Gx(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Qx(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Jx(n,t,e){const{left:i,top:s,right:o,bottom:r}=e,{backdropColor:l}=t;if(!st(l)){const c=en(t.borderRadius),d=Mt(t.backdropPadding);n.fillStyle=l;const u=i-d.left,h=s-d.top,f=o-i+d.width,m=r-s+d.height;Object.values(c).some(p=>p!==0)?(n.beginPath(),ai(n,{x:u,y:h,w:f,h:m,radius:c}),n.fill()):n.fillRect(u,h,f,m)}}function Zx(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const o=n._pointLabelItems[s];if(!o.visible)continue;const r=i.setContext(n.getPointLabelContext(s));Jx(e,r,o);const l=vt(r.font),{x:c,y:d,textAlign:u}=o;tn(e,n._pointLabels[s],c,d+l.lineHeight/2,l,{color:r.color,textAlign:u,textBaseline:"middle"})}}function od(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,pt);else{let o=n.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=n.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function tk(n,t,e,i,s){const o=n.ctx,r=t.circular,{color:l,lineWidth:c}=t;!r&&!i||!l||!c||e<0||(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),od(n,e,r,i),o.closePath(),o.stroke(),o.restore())}function ek(n,t,e){return je(n,{label:e,index:t,type:"pointLabel"})}class vn extends xs{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Mt(Wo(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=kt(t)&&!isNaN(t)?t:0,this.max=kt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Wo(this.options))}generateTickLabels(t){xs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=ft(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Hx(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=pt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Wt(t*e+ne(i))}getDistanceFromCenterForValue(t){if(st(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(st(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return ek(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-St+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),od(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,r=this._pointLabels.length;let l,c,d;if(e.pointLabels.display&&Zx(this,r),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=s.setContext(f),p=o.setContext(f);tk(this,m,c,r,p)}}),i.display){for(t.save(),l=r-1;l>=0;l--){const u=i.setContext(this.getPointLabelContext(l)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),d=this.getPointPosition(l,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&this.min>=0&&!e.reverse)return;const d=i.setContext(this.getContext(c)),u=vt(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){t.font=u.string,r=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const h=Mt(d.backdropPadding);t.fillRect(-r/2-h.left,-o-u.size/2-h.top,r+h.width,u.size+h.height)}tn(t,l.label,0,-o,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}L(vn,"id","radialLinear"),L(vn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:oi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),L(vn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),L(vn,"descriptors",{angleLines:{_fallback:"grid"}});const ws={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Lt=Object.keys(ws);function rd(n,t){return n-t}function ad(n,t){if(st(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),kt(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(_n(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function ld(n,t,e,i){const s=Lt.length;for(let o=Lt.indexOf(n);o<s-1;++o){const r=ws[Lt[o]],l=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(l*r.size))<=i)return Lt[o]}return Lt[s-1]}function nk(n,t,e,i,s){for(let o=Lt.length-1;o>=Lt.indexOf(e);o--){const r=Lt[o];if(ws[r].common&&n._adapter.diff(s,i,r)>=t-1)return r}return Lt[e?Lt.indexOf(e):0]}function ik(n){for(let t=Lt.indexOf(n)+1,e=Lt.length;t<e;++t)if(ws[Lt[t]].common)return Lt[t]}function cd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=lo(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function sk(n,t,e,i){const s=n._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let l,c;for(l=o;l<=r;l=+s.add(l,1,i))c=e[l],c>=0&&(t[c].major=!0);return t}function dd(n,t,e){const i=[],s={},o=t.length;let r,l;for(r=0;r<o;++r)l=t[r],s[l]=r,i.push({value:l,major:!1});return o===0||!e?i:sk(n,i,s,e)}class On extends We{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new jl._date(t.adapters.date);s.init(e),Zn(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:ad(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:r,maxDefined:l}=this.getUserBounds();function c(d){!r&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!l&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!r||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=kt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=kt(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,l=Zy(s,o,r);return this._unit=e.unit||(i.autoSkip?ld(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):nk(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:ik(this._unit),this.initOffsets(s),t.reverse&&l.reverse(),dd(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=Ot(e,0,r),i=Ot(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||ld(o.minUnit,e,i,this._getLabelCapacity(e)),l=J(s.ticks.stepSize,1),c=r==="week"?o.isoWeekday:!1,d=_n(c)||c===!0,u={};let h=e,f,m;if(d&&(h=+t.startOf(h,"isoWeek",c)),h=+t.startOf(h,d?"day":r),t.diff(i,e,r)>1e5*l)throw new Error(e+" and "+i+" are too far apart with stepSize of "+l+" "+r);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,l,r),m++)cd(u,f,p);return(f===i||s.bounds==="ticks"||m===1)&&cd(u,f,p),Object.keys(u).sort(rd).map(g=>+g)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,s){const o=this.options,r=o.ticks.callback;if(r)return ft(r,[t,e,i],this);const l=o.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],h=d&&l[d],f=i[e],m=d&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=ne(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:i*o+l*r,h:i*r+l*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,dd(this,[t],this._majorUnit),s),r=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(ad(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Qa(t.sort(rd))}}L(On,"id","time"),L(On,"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 Es(n,t,e){let i=0,s=n.length-1,o,r,l,c;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Ee(n,"pos",t)),{pos:o,time:l}=n[i],{pos:r,time:c}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Ee(n,"time",t)),{time:o,pos:l}=n[i],{time:r,pos:c}=n[s]);const d=r-o;return d?l+(c-l)*(t-o)/d:l}class Cs extends On{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Es(e,this.min),this._tableRange=Es(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let r,l,c,d,u;for(r=0,l=t.length;r<l;++r)d=t[r],d>=e&&d<=i&&s.push(d);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,l=s.length;r<l;++r)u=s[r+1],c=s[r-1],d=s[r],Math.round((u+c)/2)!==d&&o.push({time:d,pos:r/(l-1)});return o}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Es(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Es(this._table,i*this._tableRange+this._minPos,!0)}}L(Cs,"id","timeseries"),L(Cs,"defaults",On.defaults);var ud=Object.freeze({__proto__:null,CategoryScale:_s,LinearScale:ks,LogarithmicScale:Ss,RadialLinearScale:vn,TimeScale:On,TimeSeriesScale:Cs});const hd=[Il,wc,Zc,ud];ue.register(...hd);const ok=Object.freeze(Object.defineProperty({__proto__:null,Animation:Nl,Animations:So,ArcElement:Cn,BarController:di,BarElement:wi,BasePlatform:To,BasicPlatform:Xl,BubbleController:ui,CategoryScale:_s,Chart:ue,Colors:Dc,DatasetController:Yt,Decimation:Pc,DomPlatform:tc,DoughnutController:ze,Element:Kt,Filler:Lc,Interaction:Wl,Legend:Wc,LineController:hi,LineElement:ve,LinearScale:ks,LogarithmicScale:Ss,PieController:as,PointElement:Si,PolarAreaController:wn,RadarController:fi,RadialLinearScale:vn,Scale:We,ScatterController:mi,SubTitle:Uc,Ticks:oi,TimeScale:On,TimeSeriesScale:Cs,Title:Hc,Tooltip:Jc,_adapters:jl,_detectPlatform:ec,animator:de,controllers:Il,default:ue,defaults:gt,elements:wc,layouts:Tt,plugins:Zc,registerables:hd,registry:ie,scales:ud},Symbol.toStringTag,{value:"Module"}));Nt.default=dg,Nt.useEntitiesStore=sh,Nt.useGlobalConfigsStore=me,Object.defineProperties(Nt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
177
+ `):n}function Yk(n,e){const{element:t,datasetIndex:i,index:s}=e,o=n.getDatasetMeta(i).controller,{label:a,value:l}=o.getLabelAndValue(s);return{chart:n,label:a,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:l,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function xd(n,e){const t=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:a,boxHeight:l}=e,c=Ve(e.bodyFont),d=Ve(e.titleFont),u=Ve(e.footerFont),f=o.length,h=s.length,m=i.length,p=je(e.padding);let g=p.height,y=0,b=i.reduce((C,k)=>C+k.before.length+k.lines.length+k.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),b){const C=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;g+=m*C+(b-m)*c.lineHeight+(b-1)*e.bodySpacing}h&&(g+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let x=0;const E=function(C){y=Math.max(y,t.measureText(C).width+x)};return t.save(),t.font=d.string,ge(n.title,E),t.font=c.string,ge(n.beforeBody.concat(n.afterBody),E),x=e.displayColors?a+2+e.boxPadding:0,ge(i,C=>{ge(C.before,E),ge(C.lines,E),ge(C.after,E)}),x=0,t.font=u.string,ge(n.footer,E),t.restore(),y+=p.width,{width:y,height:g}}function Kk(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function Xk(n,e,t,i){const{x:s,width:o}=i,a=t.caretSize+t.caretPadding;if(n==="left"&&s+o+a>e.width||n==="right"&&s-o-a<0)return!0}function Gk(n,e,t,i){const{x:s,width:o}=t,{width:a,chartArea:{left:l,right:c}}=n;let d="center";return i==="center"?d=s<=(l+c)/2?"left":"right":s<=o/2?d="left":s>=a-o/2&&(d="right"),Xk(d,n,e,t)&&(d="center"),d}function _d(n,e,t){const i=t.yAlign||e.yAlign||Kk(n,t);return{xAlign:t.xAlign||e.xAlign||Gk(n,e,t,i),yAlign:i}}function Qk(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function Jk(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function kd(n,e,t,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=n,{xAlign:l,yAlign:c}=t,d=s+o,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=mn(a);let p=Qk(e,l);const g=Jk(e,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,h)+s:l==="right"&&(p+=Math.max(f,m)+s),{x:Fe(p,0,i.width-e.width),y:Fe(g,0,i.height-e.height)}}function Bs(n,e,t){const i=je(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Sd(n){return kt([],Ft(n))}function Zk(n,e,t){return Qt(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function wd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Ed={beforeTitle:Pt,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:Pt,beforeBody:Pt,beforeLabel:Pt,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return ce(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Pt,afterBody:Pt,beforeFooter:Pt,footer:Pt,afterFooter:Pt};function Ue(n,e,t,i){const s=n[e].call(t,i);return typeof s>"u"?Ed[e].call(t,i):s}class sr extends xt{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 t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,o=new Io(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Zk(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=Ue(i,"beforeTitle",this,e),o=Ue(i,"title",this,e),a=Ue(i,"afterTitle",this,e);let l=[];return l=kt(l,Ft(s)),l=kt(l,Ft(o)),l=kt(l,Ft(a)),l}getBeforeBody(e,t){return Sd(Ue(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,s=[];return ge(e,o=>{const a={before:[],lines:[],after:[]},l=wd(i,o);kt(a.before,Ft(Ue(l,"beforeLabel",this,o))),kt(a.lines,Ue(l,"label",this,o)),kt(a.after,Ft(Ue(l,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(e,t){return Sd(Ue(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,s=Ue(i,"beforeFooter",this,e),o=Ue(i,"footer",this,e),a=Ue(i,"afterFooter",this,e);let l=[];return l=kt(l,Ft(s)),l=kt(l,Ft(o)),l=kt(l,Ft(a)),l}_createItems(e){const t=this._active,i=this.chart.data,s=[],o=[],a=[];let l=[],c,d;for(c=0,d=t.length;c<d;++c)l.push(Yk(this.chart,t[c]));return e.filter&&(l=l.filter((u,f,h)=>e.filter(u,f,h,i))),e.itemSort&&(l=l.sort((u,f)=>e.itemSort(u,f,i))),ge(l,u=>{const f=wd(e.callbacks,u);s.push(Ue(f,"labelColor",this,u)),o.push(Ue(f,"labelPointStyle",this,u)),a.push(Ue(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const l=Vi[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const c=this._size=xd(this,i),d=Object.assign({},l,c),u=_d(this.chart,i,d),f=kd(i,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const o=this.getCaretPosition(e,i,s);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=mn(l),{x:h,y:m}=e,{width:p,height:g}=t;let y,b,x,E,C,k;return o==="center"?(C=m+g/2,s==="left"?(y=h,b=y-a,E=C+a,k=C-a):(y=h+p,b=y+a,E=C-a,k=C+a),x=y):(s==="left"?b=h+Math.max(c,u)+a:s==="right"?b=h+p-Math.max(d,f)-a:b=this.caretX,o==="top"?(E=m,C=E-a,y=b-a,x=b+a):(E=m+g,C=E+a,y=b+a,x=b-a),k=E),{x1:y,x2:b,x3:x,y1:E,y2:C,y3:k}}drawTitle(e,t,i){const s=this.title,o=s.length;let a,l,c;if(o){const d=Mn(i.rtl,this.x,this.width);for(e.x=Bs(this,i.titleAlign,i),t.textAlign=d.textAlign(i.titleAlign),t.textBaseline="middle",a=Ve(i.titleFont),l=i.titleSpacing,t.fillStyle=i.titleColor,t.font=a.string,c=0;c<o;++c)t.fillText(s[c],d.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+l,c+1===o&&(e.y+=i.titleMarginBottom-l)}}_drawColorBox(e,t,i,s,o){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:c,boxWidth:d}=o,u=Ve(o.bodyFont),f=Bs(this,"left",o),h=s.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=t.y+m;if(o.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=s.leftForLtr(h,d)+d/2,b=p+c/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,Po(e,g,y,b),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,Po(e,g,y,b)}else{e.lineWidth=le(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const g=s.leftForLtr(h,d),y=s.leftForLtr(s.xPlus(h,1),d-2),b=mn(a.borderRadius);Object.values(b).some(x=>x!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,yi(e,{x:g,y:p,w:d,h:c,radius:b}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),yi(e,{x:y,y:p+1,w:d-2,h:c-2,radius:b}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(g,p,d,c),e.strokeRect(g,p,d,c),e.fillStyle=a.backgroundColor,e.fillRect(y,p+1,d-2,c-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=i,f=Ve(i.bodyFont);let h=f.lineHeight,m=0;const p=Mn(i.rtl,this.x,this.width),g=function(_){t.fillText(_,p.x(e.x+m),e.y+h/2),e.y+=h+o},y=p.textAlign(a);let b,x,E,C,k,v,S;for(t.textAlign=a,t.textBaseline="middle",t.font=f.string,e.x=Bs(this,y,i),t.fillStyle=i.bodyColor,ge(this.beforeBody,g),m=l&&y!=="right"?a==="center"?d/2+u:d+2+u:0,C=0,v=s.length;C<v;++C){for(b=s[C],x=this.labelTextColors[C],t.fillStyle=x,ge(b.before,g),E=b.lines,l&&E.length&&(this._drawColorBox(t,e,C,p,i),h=Math.max(f.lineHeight,c)),k=0,S=E.length;k<S;++k)g(E[k]),h=f.lineHeight;ge(b.after,g)}m=0,h=f.lineHeight,ge(this.afterBody,g),e.y-=o}drawFooter(e,t,i){const s=this.footer,o=s.length;let a,l;if(o){const c=Mn(i.rtl,this.x,this.width);for(e.x=Bs(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=c.textAlign(i.footerAlign),t.textBaseline="middle",a=Ve(i.footerFont),t.fillStyle=i.footerColor,t.font=a.string,l=0;l<o;++l)t.fillText(s[l],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+i.footerSpacing}}drawBackground(e,t,i,s){const{xAlign:o,yAlign:a}=this,{x:l,y:c}=e,{width:d,height:u}=i,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=mn(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(l+f,c),a==="top"&&this.drawCaret(e,t,i,s),t.lineTo(l+d-h,c),t.quadraticCurveTo(l+d,c,l+d,c+h),a==="center"&&o==="right"&&this.drawCaret(e,t,i,s),t.lineTo(l+d,c+u-p),t.quadraticCurveTo(l+d,c+u,l+d-p,c+u),a==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(l+m,c+u),t.quadraticCurveTo(l,c+u,l,c+u-m),a==="center"&&o==="left"&&this.drawCaret(e,t,i,s),t.lineTo(l,c+f),t.quadraticCurveTo(l,c,l+f,c),t.closePath(),t.fill(),s.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const a=Vi[e.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=xd(this,e),c=Object.assign({},a,this._size),d=_d(t,e,c),u=kd(e,c,d,t);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=je(t.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&l&&(e.save(),e.globalAlpha=i,this.drawBackground(o,e,s,t),Yl(e,t.textDirection),o.y+=a.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),Kl(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),o=!ds(i,s),a=this._positionChanged(s,t);(o||a)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(e,o,t,i),l=this._positionChanged(a,e),c=t||!ds(a,o)||l;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),c}_getActiveElements(e,t,i,s){const o=this.options;if(e.type==="mouseout")return[];if(!s)return t.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(e,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(e,t){const{caretX:i,caretY:s,options:o}=this,a=Vi[o.position].call(this,e,t);return a!==!1&&(i!==a.x||s!==a.y)}}j(sr,"positioners",Vi);var Cd={id:"tooltip",_element:sr,positioners:Vi,afterInit(n,e,t){t&&(n.tooltip=new sr({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,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:(n,e)=>e.bodyFont.size,boxWidth:(n,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:Ed},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},vd=Object.freeze({__proto__:null,Colors:td,Decimation:sd,Filler:fd,Legend:gd,SubTitle:bd,Title:yd,Tooltip:Cd});const eS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function tS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return eS(n,e,t,i);const o=n.lastIndexOf(e);return s!==o?t:s}const nS=(n,e)=>n===null?null:Fe(Math.round(n),0,e);function Dd(n){const e=this.getLabels();return n>=0&&n<e.length?e[n]:n}class Ms extends Zt{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:o}of t)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(ce(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:tS(i,e,oe(t,e),this._addedLabels),nS(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=e===0&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=e;a<=t;a++)s.push({value:a});return s}getLabelForValue(e){return Dd.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 t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}j(Ms,"id","category"),j(Ms,"defaults",{ticks:{callback:Dd}});function iS(n,e){const t=[],{bounds:s,step:o,min:a,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=n,m=o||1,p=u-1,{min:g,max:y}=e,b=!ce(a),x=!ce(l),E=!ce(d),C=(y-g)/(f+1);let k=bl((y-g)/p/m)*m,v,S,_,D;if(k<1e-14&&!b&&!x)return[{value:g},{value:y}];D=Math.ceil(y/k)-Math.floor(g/k),D>p&&(k=bl(D*k/p/m)*m),ce(c)||(v=Math.pow(10,c),k=Math.ceil(k*v)/v),s==="ticks"?(S=Math.floor(g/k)*k,_=Math.ceil(y/k)*k):(S=g,_=y),b&&x&&o&&f0((l-a)/o,k/1e3)?(D=Math.round(Math.min((l-a)/k,u)),k=(l-a)/D,S=a,_=l):E?(S=b?a:S,_=x?l:_,D=d-1,k=(_-S)/D):(D=(_-S)/k,ui(D,Math.round(D),k/1e3)?D=Math.round(D):D=Math.ceil(D));const B=Math.max(_l(k),_l(S));v=Math.pow(10,ce(c)?B:c),S=Math.round(S*v)/v,_=Math.round(_*v)/v;let w=0;for(b&&(h&&S!==a?(t.push({value:a}),S<a&&w++,ui(Math.round((S+w*k)*v)/v,a,Od(a,C,n))&&w++):S<a&&w++);w<D;++w){const T=Math.round((S+w*k)*v)/v;if(x&&T>l)break;t.push({value:T})}return x&&h&&_!==l?t.length&&ui(t[t.length-1].value,l,Od(l,C,n))?t[t.length-1].value=l:t.push({value:l}):(!x||_===l)&&t.push({value:_}),t}function Od(n,e,{horizontal:t,minRotation:i}){const s=dt(i),o=(t?Math.sin(s):Math.cos(s))||.001,a=.75*e*(""+n).length;return Math.min(e/o,a)}class Vs extends Zt{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,t){return ce(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const a=c=>s=t?s:c,l=c=>o=i?o:c;if(e){const c=yt(s),d=yt(o);c<0&&d<0?l(0):c>0&&d>0&&a(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);l(o+c),e||a(s-c)}this.min=s,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},o=this._range||this,a=iS(s,o);return e.bounds==="ticks"&&xl(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return mi(e,this.chart.options.locale,this.options.ticks.format)}}class As extends Vs{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Oe(e)?e:0,this.max=Oe(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=dt(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}j(As,"id","linear"),j(As,"defaults",{ticks:{callback:pi.formatters.numeric}});const Ai=n=>Math.floor(Gt(n)),xn=(n,e)=>Math.pow(10,Ai(n)+e);function Nd(n){return n/Math.pow(10,Ai(n))===1}function Td(n,e,t){const i=Math.pow(10,t),s=Math.floor(n/i);return Math.ceil(e/i)-s}function sS(n,e){const t=e-n;let i=Ai(t);for(;Td(n,e,i)>10;)i++;for(;Td(n,e,i)<10;)i--;return Math.min(i,Ai(n))}function oS(n,{min:e,max:t}){e=Xe(n.min,e);const i=[],s=Ai(e);let o=sS(e,t),a=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),c=s>o?Math.pow(10,s):0,d=Math.round((e-c)*a)/a,u=Math.floor((e-c)/l/10)*l*10;let f=Math.floor((d-u)/Math.pow(10,o)),h=Xe(n.min,Math.round((c+u+f*Math.pow(10,o))*a)/a);for(;h<t;)i.push({value:h,major:Nd(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,a=o>=0?1:a),h=Math.round((c+u+f*Math.pow(10,o))*a)/a;const m=Xe(n.max,h);return i.push({value:m,major:Nd(m),significand:f}),i}class Fs extends Zt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=Vs.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return Oe(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Oe(e)?Math.max(0,e):null,this.max=Oe(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Oe(this._userMin)&&(this.min=e===xn(this.min,0)?xn(this.min,-1):xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const o=l=>i=e?i:l,a=l=>s=t?s:l;i===s&&(i<=0?(o(1),a(10)):(o(xn(i,-1)),a(xn(s,1)))),i<=0&&o(xn(s,-1)),s<=0&&a(xn(i,1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=oS(t,this);return e.bounds==="ticks"&&xl(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":mi(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Gt(e),this._valueRange=Gt(this.max)-Gt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Gt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}j(Fs,"id","logarithmic"),j(Fs,"defaults",{ticks:{callback:pi.formatters.logarithmic,major:{enabled:!0}}});function or(n){const e=n.ticks;if(e.display&&n.display){const t=je(e.backdropPadding);return oe(e.font&&e.font.size,Se.font.size)+t.height}return 0}function rS(n,e,t){return t=Ee(t)?t:[t],{w:N0(n,e.string,t),h:t.length*e.lineHeight}}function Pd(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:n<i||n>s?{start:e-t,end:e}:{start:e,end:e+t}}function aS(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],o=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?_e/o:0;for(let c=0;c<o;c++){const d=a.setContext(n.getPointLabelContext(c));s[c]=d.padding;const u=n.getPointPosition(c,n.drawingArea+s[c],l),f=Ve(d.font),h=rS(n.ctx,f,n._pointLabels[c]);i[c]=h;const m=Ge(n.getIndexAngle(c)+l),p=Math.round(wo(m)),g=Pd(p,u.x,h.w,0,180),y=Pd(p,u.y,h.h,90,270);lS(t,e,m,g,y)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=uS(n,i,s)}function lS(n,e,t,i,s){const o=Math.abs(Math.sin(t)),a=Math.abs(Math.cos(t));let l=0,c=0;i.start<e.l?(l=(e.l-i.start)/o,n.l=Math.min(n.l,e.l-l)):i.end>e.r&&(l=(i.end-e.r)/o,n.r=Math.max(n.r,e.r+l)),s.start<e.t?(c=(e.t-s.start)/a,n.t=Math.min(n.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/a,n.b=Math.max(n.b,e.b+c))}function cS(n,e,t){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:a,size:l}=t,c=n.getPointPosition(e,i+s+a,o),d=Math.round(wo(Ge(c.angle+Te))),u=mS(c.y,l.h,d),f=fS(d),h=hS(c.x,l.w,f);return{visible:!0,x:c.x,y:u,textAlign:f,left:h,top:u,right:h+l.w,bottom:u+l.h}}function dS(n,e){if(!e)return!0;const{left:t,top:i,right:s,bottom:o}=n;return!(Vt({x:t,y:i},e)||Vt({x:t,y:o},e)||Vt({x:s,y:i},e)||Vt({x:s,y:o},e))}function uS(n,e,t){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:a,display:l}=o.pointLabels,c={extra:or(o)/2,additionalAngle:a?_e/s:0};let d;for(let u=0;u<s;u++){c.padding=t[u],c.size=e[u];const f=cS(n,u,c);i.push(f),l==="auto"&&(f.visible=dS(f,d),f.visible&&(d=f))}return i}function fS(n){return n===0||n===180?"center":n<180?"left":"right"}function hS(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function mS(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function pS(n,e,t){const{left:i,top:s,right:o,bottom:a}=t,{backdropColor:l}=e;if(!ce(l)){const c=mn(e.borderRadius),d=je(e.backdropPadding);n.fillStyle=l;const u=i-d.left,f=s-d.top,h=o-i+d.width,m=a-s+d.height;Object.values(c).some(p=>p!==0)?(n.beginPath(),yi(n,{x:u,y:f,w:h,h:m,radius:c}),n.fill()):n.fillRect(u,f,h,m)}}function gS(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const o=n._pointLabelItems[s];if(!o.visible)continue;const a=i.setContext(n.getPointLabelContext(s));pS(t,a,o);const l=Ve(a.font),{x:c,y:d,textAlign:u}=o;hn(t,n._pointLabels[s],c,d+l.lineHeight/2,l,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Bd(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,ke);else{let o=n.getPointPosition(0,e);s.moveTo(o.x,o.y);for(let a=1;a<i;a++)o=n.getPointPosition(a,e),s.lineTo(o.x,o.y)}}function yS(n,e,t,i,s){const o=n.ctx,a=e.circular,{color:l,lineWidth:c}=e;!a&&!i||!l||!c||t<0||(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Bd(n,t,a,i),o.closePath(),o.stroke(),o.restore())}function bS(n,e,t){return Qt(n,{label:t,index:e,type:"pointLabel"})}class $n extends Vs{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=je(or(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=Oe(e)&&!isNaN(e)?e:0,this.max=Oe(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/or(this.options))}generateTickLabels(e){Vs.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const s=xe(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?aS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=ke/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ge(e*t+dt(i))}getDistanceFromCenterForValue(e){if(ce(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(ce(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const i=t[e];return bS(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const s=this.getIndexAngle(e)-Te+i;return{x:Math.cos(s)*t+this.xCenter,y:Math.sin(s)*t+this.yCenter,angle:s}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:i,right:s,bottom:o}=this._pointLabelItems[e];return{left:t,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),Bd(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:i,grid:s,border:o}=t,a=this._pointLabels.length;let l,c,d;if(t.pointLabels.display&&gS(this,a),s.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(f),m=s.setContext(h),p=o.setContext(h);yS(this,m,c,a,p)}}),i.display){for(e.save(),l=a-1;l>=0;l--){const u=i.setContext(this.getPointLabelContext(l)),{color:f,lineWidth:h}=u;!h||!f||(e.lineWidth=h,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),d=this.getPointPosition(l,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,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&this.min>=0&&!t.reverse)return;const d=i.setContext(this.getContext(c)),u=Ve(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,a=e.measureText(l.label).width,e.fillStyle=d.backdropColor;const f=je(d.backdropPadding);e.fillRect(-a/2-f.left,-o-u.size/2-f.top,a+f.width,u.size+f.height)}hn(e,l.label,0,-o,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}j($n,"id","radialLinear"),j($n,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:pi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),j($n,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),j($n,"descriptors",{angleLines:{_fallback:"grid"}});const $s={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}},qe=Object.keys($s);function Md(n,e){return n-e}function Vd(n,e){if(ce(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts;let a=e;return typeof i=="function"&&(a=i(a)),Oe(a)||(a=typeof i=="string"?t.parse(a,i):t.parse(a)),a===null?null:(s&&(a=s==="week"&&(Tn(o)||o===!0)?t.startOf(a,"isoWeek",o):t.startOf(a,s)),+a)}function Ad(n,e,t,i){const s=qe.length;for(let o=qe.indexOf(n);o<s-1;++o){const a=$s[qe[o]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((t-e)/(l*a.size))<=i)return qe[o]}return qe[s-1]}function xS(n,e,t,i,s){for(let o=qe.length-1;o>=qe.indexOf(t);o--){const a=qe[o];if($s[a].common&&n._adapter.diff(s,i,a)>=e-1)return a}return qe[t?qe.indexOf(t):0]}function _S(n){for(let e=qe.indexOf(n)+1,t=qe.length;e<t;++e)if($s[qe[e]].common)return qe[e]}function Fd(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=Co(t,e),o=t[i]>=e?t[i]:t[s];n[o]=!0}}function kS(n,e,t,i){const s=n._adapter,o=+s.startOf(e[0].value,i),a=e[e.length-1].value;let l,c;for(l=o;l<=a;l=+s.add(l,1,i))c=t[l],c>=0&&(e[c].major=!0);return e}function $d(n,e,t){const i=[],s={},o=e.length;let a,l;for(a=0;a<o;++a)l=e[a],s[l]=a,i.push({value:l,major:!1});return o===0||!t?i:kS(n,i,s,t)}class In extends Zt{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,t={}){const i=e.time||(e.time={}),s=this._adapter=new mc._date(e.adapters.date);s.init(t),ci(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Vd(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!l&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=Oe(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),o=Oe(o)&&!isNaN(o)?o:+t.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,l=g0(s,o,a);return this._unit=t.unit||(i.autoSkip?Ad(t.minUnit,this.min,this.max,this._getLabelCapacity(o)):xS(this,l.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:_S(this._unit),this.initOffsets(s),e.reverse&&l.reverse(),$d(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,i=0,s,o;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?i=o:i=(o-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;t=Fe(t,0,a),i=Fe(i,0,a),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||Ad(o.minUnit,t,i,this._getLabelCapacity(t)),l=oe(s.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,d=Tn(c)||c===!0,u={};let f=t,h,m;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":a),e.diff(i,t,a)>1e5*l)throw new Error(t+" and "+i+" are too far apart with stepSize of "+l+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<i;h=+e.add(h,l,a),m++)Fd(u,h,p);return(h===i||s.bounds==="ticks"||m===1)&&Fd(u,h,p),Object.keys(u).sort(Md).map(g=>+g)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const s=this.options.time.displayFormats,o=this._unit,a=t||s[o];return this._adapter.format(e,a)}_tickFormatFunction(e,t,i,s){const o=this.options,a=o.ticks.callback;if(a)return xe(a,[e,t,i],this);const l=o.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=i[t],m=d&&f&&h&&h.major;return this._adapter.format(e,s||(m?f:u))}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t<i;++t)s=e[t],s.label=this._tickFormatFunction(s.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,s=dt(this.isHorizontal()?t.maxRotation:t.minRotation),o=Math.cos(s),a=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:i*o+l*a,h:i*a+l*o}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,s=i[t.unit]||i.millisecond,o=this._tickFormatFunction(e,0,$d(this,[e],this._majorUnit),s),a=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t<i;++t)e=e.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const s=this.getLabels();for(t=0,i=s.length;t<i;++t)e.push(Vd(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return El(e.sort(Md))}}j(In,"id","time"),j(In,"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 Is(n,e,t){let i=0,s=n.length-1,o,a,l,c;t?(e>=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Mt(n,"pos",e)),{pos:o,time:l}=n[i],{pos:a,time:c}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=Mt(n,"time",e)),{time:o,pos:l}=n[i],{time:a,pos:c}=n[s]);const d=a-o;return d?l+(c-l)*(e-o)/d:l}class Ls extends In{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Is(t,this.min),this._tableRange=Is(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],o=[];let a,l,c,d,u;for(a=0,l=e.length;a<l;++a)d=e[a],d>=t&&d<=i&&s.push(d);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(a=0,l=s.length;a<l;++a)u=s[a+1],c=s[a-1],d=s[a],Math.round((u+c)/2)!==d&&o.push({time:d,pos:a/(l-1)});return o}_generate(){const e=this.min,t=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(t)||i.length===1)&&i.push(t),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Is(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Is(this._table,i*this._tableRange+this._minPos,!0)}}j(Ls,"id","timeseries"),j(Ls,"defaults",In.defaults);var Id=Object.freeze({__proto__:null,CategoryScale:Ms,LinearScale:As,LogarithmicScale:Fs,RadialLinearScale:$n,TimeScale:In,TimeSeriesScale:Ls});const Ld=[hc,Gc,vd,Id];_t.register(...Ld);const SS=Object.freeze(Object.defineProperty({__proto__:null,Animation:nc,Animations:Io,ArcElement:Fn,BarController:_i,BarElement:Mi,BasePlatform:qo,BasicPlatform:Sc,BubbleController:ki,CategoryScale:Ms,Chart:_t,Colors:td,DatasetController:nt,Decimation:sd,DomPlatform:Dc,DoughnutController:Jt,Element:xt,Filler:fd,Interaction:gc,Legend:gd,LineController:Si,LineElement:At,LinearScale:As,LogarithmicScale:Fs,PieController:ks,PointElement:Bi,PolarAreaController:Vn,RadarController:wi,RadialLinearScale:$n,Scale:Zt,ScatterController:Ei,SubTitle:bd,Ticks:pi,TimeScale:In,TimeSeriesScale:Ls,Title:yd,Tooltip:Cd,_adapters:mc,_detectPlatform:Oc,animator:bt,controllers:hc,default:_t,defaults:Se,elements:Gc,layouts:Ie,plugins:vd,registerables:Ld,registry:ut,scales:Id},Symbol.toStringTag,{value:"Module"}));$e.default=Dy,$e.useEntitiesStore=ea,$e.useGlobalConfigsStore=Ze,Object.defineProperties($e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});